@thatopen/components 2.4.0-alpha.2 → 2.4.0-alpha.3
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/core/Types/src/async-event.d.ts +4 -0
- package/dist/core/Types/src/event-manager.d.ts +30 -0
- package/dist/core/Types/src/event.d.ts +4 -0
- package/dist/core/Types/src/index.d.ts +1 -0
- package/dist/core/Types/src/interfaces.d.ts +10 -0
- package/dist/index.cjs +15 -15
- package/dist/index.mjs +62 -10
- package/dist/namespace.d.ts +3427 -3379
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";var Bo=Object.defineProperty;var Vo=(c,i,t)=>i in c?Bo(c,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[i]=t;var C=(c,i,t)=>(Vo(c,typeof i!="symbol"?i+"":i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("three"),Dn=require("@thatopen/fragments"),Yo=require("web-ifc");function bn(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return i.default=c,Object.freeze(i)}const b=bn(y),jt=bn(Dn),k=bn(Yo),Ur=0,Go=1,zo=2,Xn=2,Ws=1.25,$n=1,cs=6*4+4+4,xs=65535,ko=Math.pow(2,-24),Xs=Symbol("SKIP_GENERATION");function Ho(c){return c.index?c.index.count:c.attributes.position.count}function ei(c){return Ho(c)/3}function Wo(c,i=ArrayBuffer){return c>65535?new Uint32Array(new i(4*c)):new Uint16Array(new i(2*c))}function Xo(c,i){if(!c.index){const t=c.attributes.position.count,e=i.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,s=Wo(t,e);c.setIndex(new y.BufferAttribute(s,1));for(let n=0;n<t;n++)s[n]=n}}function xr(c){const i=ei(c),t=c.drawRange,e=t.start/3,s=(t.start+t.count)/3,n=Math.max(0,e),r=Math.min(i,s)-n;return[{offset:Math.floor(n),count:Math.floor(r)}]}function Br(c){if(!c.groups||!c.groups.length)return xr(c);const i=[],t=new Set,e=c.drawRange,s=e.start/3,n=(e.start+e.count)/3;for(const o of c.groups){const a=o.start/3,l=(o.start+o.count)/3;t.add(Math.max(s,a)),t.add(Math.min(n,l))}const r=Array.from(t.values()).sort((o,a)=>o-a);for(let o=0;o<r.length-1;o++){const a=r[o],l=r[o+1];i.push({offset:Math.floor(a),count:Math.floor(l-a)})}return i}function $o(c){if(c.groups.length===0)return!1;const i=ei(c),t=Br(c).sort((n,r)=>n.offset-r.offset),e=t[t.length-1];e.count=Math.min(i-e.offset,e.count);let s=0;return t.forEach(({count:n})=>s+=n),i!==s}function Ot(c,i,t){return t.min.x=i[c],t.min.y=i[c+1],t.min.z=i[c+2],t.max.x=i[c+3],t.max.y=i[c+4],t.max.z=i[c+5],t}function Zo(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Zn(c){let i=-1,t=-1/0;for(let e=0;e<3;e++){const s=c[e+3]-c[e];s>t&&(t=s,i=e)}return i}function jn(c,i){i.set(c)}function qn(c,i,t){let e,s;for(let n=0;n<3;n++){const r=n+3;e=c[n],s=i[n],t[n]=e<s?e:s,e=c[r],s=i[r],t[r]=e>s?e:s}}function xi(c,i,t){for(let e=0;e<3;e++){const s=i[c+2*e],n=i[c+2*e+1],r=s-n,o=s+n;r<t[e]&&(t[e]=r),o>t[e+3]&&(t[e+3]=o)}}function ri(c){const i=c[3]-c[0],t=c[4]-c[1],e=c[5]-c[2];return 2*(i*t+t*e+e*i)}function $s(c,i,t,e,s=null){let n=1/0,r=1/0,o=1/0,a=-1/0,l=-1/0,h=-1/0,f=1/0,I=1/0,u=1/0,d=-1/0,E=-1/0,T=-1/0;const p=s!==null;for(let m=i*6,F=(i+t)*6;m<F;m+=6){const R=c[m+0],S=c[m+1],N=R-S,L=R+S;N<n&&(n=N),L>a&&(a=L),p&&R<f&&(f=R),p&&R>d&&(d=R);const D=c[m+2],P=c[m+3],v=D-P,G=D+P;v<r&&(r=v),G>l&&(l=G),p&&D<I&&(I=D),p&&D>E&&(E=D);const O=c[m+4],w=c[m+5],g=O-w,U=O+w;g<o&&(o=g),U>h&&(h=U),p&&O<u&&(u=O),p&&O>T&&(T=O)}e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=l,e[5]=h,p&&(s[0]=f,s[1]=I,s[2]=u,s[3]=d,s[4]=E,s[5]=T)}function jo(c,i,t,e){let s=1/0,n=1/0,r=1/0,o=-1/0,a=-1/0,l=-1/0;for(let h=i*6,f=(i+t)*6;h<f;h+=6){const I=c[h+0];I<s&&(s=I),I>o&&(o=I);const u=c[h+2];u<n&&(n=u),u>a&&(a=u);const d=c[h+4];d<r&&(r=d),d>l&&(l=d)}e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=l}function qo(c,i){Zo(i);const t=c.attributes.position,e=c.index?c.index.array:null,s=ei(c),n=new Float32Array(s*6),r=t.normalized,o=t.array,a=t.offset||0;let l=3;t.isInterleavedBufferAttribute&&(l=t.data.stride);const h=["getX","getY","getZ"];for(let f=0;f<s;f++){const I=f*3,u=f*6;let d=I+0,E=I+1,T=I+2;e&&(d=e[d],E=e[E],T=e[T]),r||(d=d*l+a,E=E*l+a,T=T*l+a);for(let p=0;p<3;p++){let m,F,R;r?(m=t[h[p]](d),F=t[h[p]](E),R=t[h[p]](T)):(m=o[d+p],F=o[E+p],R=o[T+p]);let S=m;F<S&&(S=F),R<S&&(S=R);let N=m;F>N&&(N=F),R>N&&(N=R);const L=(N-S)/2,D=p*2;n[u+D+0]=S+L,n[u+D+1]=L+(Math.abs(S)+L)*ko,S<i[p]&&(i[p]=S),N>i[p+3]&&(i[p+3]=N)}}return n}const ue=32,Qo=(c,i)=>c.candidate-i.candidate,Te=new Array(ue).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Bi=new Float32Array(6);function Ko(c,i,t,e,s,n){let r=-1,o=0;if(n===Ur)r=Zn(i),r!==-1&&(o=(i[r]+i[r+3])/2);else if(n===Go)r=Zn(c),r!==-1&&(o=Jo(t,e,s,r));else if(n===zo){const a=ri(c);let l=Ws*s;const h=e*6,f=(e+s)*6;for(let I=0;I<3;I++){const u=i[I],T=(i[I+3]-u)/ue;if(s<ue/4){const p=[...Te];p.length=s;let m=0;for(let R=h;R<f;R+=6,m++){const S=p[m];S.candidate=t[R+2*I],S.count=0;const{bounds:N,leftCacheBounds:L,rightCacheBounds:D}=S;for(let P=0;P<3;P++)D[P]=1/0,D[P+3]=-1/0,L[P]=1/0,L[P+3]=-1/0,N[P]=1/0,N[P+3]=-1/0;xi(R,t,N)}p.sort(Qo);let F=s;for(let R=0;R<F;R++){const S=p[R];for(;R+1<F&&p[R+1].candidate===S.candidate;)p.splice(R+1,1),F--}for(let R=h;R<f;R+=6){const S=t[R+2*I];for(let N=0;N<F;N++){const L=p[N];S>=L.candidate?xi(R,t,L.rightCacheBounds):(xi(R,t,L.leftCacheBounds),L.count++)}}for(let R=0;R<F;R++){const S=p[R],N=S.count,L=s-S.count,D=S.leftCacheBounds,P=S.rightCacheBounds;let v=0;N!==0&&(v=ri(D)/a);let G=0;L!==0&&(G=ri(P)/a);const O=$n+Ws*(v*N+G*L);O<l&&(r=I,l=O,o=S.candidate)}}else{for(let F=0;F<ue;F++){const R=Te[F];R.count=0,R.candidate=u+T+F*T;const S=R.bounds;for(let N=0;N<3;N++)S[N]=1/0,S[N+3]=-1/0}for(let F=h;F<f;F+=6){let N=~~((t[F+2*I]-u)/T);N>=ue&&(N=ue-1);const L=Te[N];L.count++,xi(F,t,L.bounds)}const p=Te[ue-1];jn(p.bounds,p.rightCacheBounds);for(let F=ue-2;F>=0;F--){const R=Te[F],S=Te[F+1];qn(R.bounds,S.rightCacheBounds,R.rightCacheBounds)}let m=0;for(let F=0;F<ue-1;F++){const R=Te[F],S=R.count,N=R.bounds,D=Te[F+1].rightCacheBounds;S!==0&&(m===0?jn(N,Bi):qn(N,Bi,Bi)),m+=S;let P=0,v=0;m!==0&&(P=ri(Bi)/a);const G=s-m;G!==0&&(v=ri(D)/a);const O=$n+Ws*(P*m+v*G);O<l&&(r=I,l=O,o=R.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${n} used.`);return{axis:r,pos:o}}function Jo(c,i,t,e){let s=0;for(let n=i,r=i+t;n<r;n++)s+=c[n*6+e*2];return s/t}class Vi{constructor(){}}function ta(c,i,t,e,s,n){let r=e,o=e+s-1;const a=n.pos,l=n.axis*2;for(;;){for(;r<=o&&t[r*6+l]<a;)r++;for(;r<=o&&t[o*6+l]>=a;)o--;if(r<o){for(let h=0;h<3;h++){let f=i[r*3+h];i[r*3+h]=i[o*3+h],i[o*3+h]=f}for(let h=0;h<6;h++){let f=t[r*6+h];t[r*6+h]=t[o*6+h],t[o*6+h]=f}r++,o--}else return r}}function ea(c,i,t,e,s,n){let r=e,o=e+s-1;const a=n.pos,l=n.axis*2;for(;;){for(;r<=o&&t[r*6+l]<a;)r++;for(;r<=o&&t[o*6+l]>=a;)o--;if(r<o){let h=c[r];c[r]=c[o],c[o]=h;for(let f=0;f<6;f++){let I=t[r*6+f];t[r*6+f]=t[o*6+f],t[o*6+f]=I}r++,o--}else return r}}function ia(c,i){const t=(c.index?c.index.count:c.attributes.position.count)/3,e=t>2**16,s=e?4:2,n=i?new SharedArrayBuffer(t*s):new ArrayBuffer(t*s),r=e?new Uint32Array(n):new Uint16Array(n);for(let o=0,a=r.length;o<a;o++)r[o]=o;return r}function sa(c,i){const t=c.geometry,e=t.index?t.index.array:null,s=i.maxDepth,n=i.verbose,r=i.maxLeafTris,o=i.strategy,a=i.onProgress,l=ei(t),h=c._indirectBuffer;let f=!1;const I=new Float32Array(6),u=new Float32Array(6),d=qo(t,I),E=i.indirect?ea:ta,T=[],p=i.indirect?xr(t):Br(t);if(p.length===1){const R=p[0],S=new Vi;S.boundingData=I,jo(d,R.offset,R.count,u),F(S,R.offset,R.count,u),T.push(S)}else for(let R of p){const S=new Vi;S.boundingData=new Float32Array(6),$s(d,R.offset,R.count,S.boundingData,u),F(S,R.offset,R.count,u),T.push(S)}return T;function m(R){a&&a(R/l)}function F(R,S,N,L=null,D=0){if(!f&&D>=s&&(f=!0,n&&(console.warn(`MeshBVH: Max depth of ${s} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),N<=r||D>=s)return m(S+N),R.offset=S,R.count=N,R;const P=Ko(R.boundingData,L,d,S,N,o);if(P.axis===-1)return m(S+N),R.offset=S,R.count=N,R;const v=E(h,e,d,S,N,P);if(v===S||v===S+N)m(S+N),R.offset=S,R.count=N;else{R.splitAxis=P.axis;const G=new Vi,O=S,w=v-S;R.left=G,G.boundingData=new Float32Array(6),$s(d,O,w,G.boundingData,u),F(G,O,w,u,D+1);const g=new Vi,U=v,Q=N-w;R.right=g,g.boundingData=new Float32Array(6),$s(d,U,Q,g.boundingData,u),F(g,U,Q,u,D+1)}return R}}function na(c,i){const t=c.geometry;i.indirect&&(c._indirectBuffer=ia(t,i.useSharedArrayBuffer),$o(t)&&!i.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),c._indirectBuffer||Xo(t,i);const e=sa(c,i);let s,n,r;const o=[],a=i.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let f=0;f<e.length;f++){const I=e[f];let u=l(I);const d=new a(cs*u);s=new Float32Array(d),n=new Uint32Array(d),r=new Uint16Array(d),h(0,I),o.push(d)}c._roots=o;return;function l(f){return f.count?1:1+l(f.left)+l(f.right)}function h(f,I){const u=f/4,d=f/2,E=!!I.count,T=I.boundingData;for(let p=0;p<6;p++)s[u+p]=T[p];if(E){const p=I.offset,m=I.count;return n[u+6]=p,r[d+14]=m,r[d+15]=xs,f+cs}else{const p=I.left,m=I.right,F=I.splitAxis;let R;if(R=h(f+cs,p),R/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=R/4,R=h(R,m),n[u+7]=F,R}}}class pe{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(i,t){let e=1/0,s=-1/0;for(let n=0,r=i.length;n<r;n++){const a=i[n][t];e=a<e?a:e,s=a>s?a:s}this.min=e,this.max=s}setFromPoints(i,t){let e=1/0,s=-1/0;for(let n=0,r=t.length;n<r;n++){const o=t[n],a=i.dot(o);e=a<e?a:e,s=a>s?a:s}this.min=e,this.max=s}isSeparated(i){return this.min>i.max||i.min>this.max}}pe.prototype.setFromBox=function(){const c=new y.Vector3;return function(t,e){const s=e.min,n=e.max;let r=1/0,o=-1/0;for(let a=0;a<=1;a++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){c.x=s.x*a+n.x*(1-a),c.y=s.y*l+n.y*(1-l),c.z=s.z*h+n.z*(1-h);const f=t.dot(c);r=Math.min(f,r),o=Math.max(f,o)}this.min=r,this.max=o}}();const ra=function(){const c=new y.Vector3,i=new y.Vector3,t=new y.Vector3;return function(s,n,r){const o=s.start,a=c,l=n.start,h=i;t.subVectors(o,l),c.subVectors(s.end,s.start),i.subVectors(n.end,n.start);const f=t.dot(h),I=h.dot(a),u=h.dot(h),d=t.dot(a),T=a.dot(a)*u-I*I;let p,m;T!==0?p=(f*I-d*u)/T:p=0,m=(f+p*I)/u,r.x=p,r.y=m}}(),vn=function(){const c=new y.Vector2,i=new y.Vector3,t=new y.Vector3;return function(s,n,r,o){ra(s,n,c);let a=c.x,l=c.y;if(a>=0&&a<=1&&l>=0&&l<=1){s.at(a,r),n.at(l,o);return}else if(a>=0&&a<=1){l<0?n.at(0,o):n.at(1,o),s.closestPointToPoint(o,!0,r);return}else if(l>=0&&l<=1){a<0?s.at(0,r):s.at(1,r),n.closestPointToPoint(r,!0,o);return}else{let h;a<0?h=s.start:h=s.end;let f;l<0?f=n.start:f=n.end;const I=i,u=t;if(s.closestPointToPoint(f,!0,i),n.closestPointToPoint(h,!0,t),I.distanceToSquared(f)<=u.distanceToSquared(h)){r.copy(I),o.copy(f);return}else{r.copy(h),o.copy(u);return}}}}(),oa=function(){const c=new y.Vector3,i=new y.Vector3,t=new y.Plane,e=new y.Line3;return function(n,r){const{radius:o,center:a}=n,{a:l,b:h,c:f}=r;if(e.start=l,e.end=h,e.closestPointToPoint(a,!0,c).distanceTo(a)<=o||(e.start=l,e.end=f,e.closestPointToPoint(a,!0,c).distanceTo(a)<=o)||(e.start=h,e.end=f,e.closestPointToPoint(a,!0,c).distanceTo(a)<=o))return!0;const E=r.getPlane(t);if(Math.abs(E.distanceToPoint(a))<=o){const p=E.projectPoint(a,i);if(r.containsPoint(p))return!0}return!1}}(),aa=1e-15;function Zs(c){return Math.abs(c)<aa}class se extends y.Triangle{constructor(...i){super(...i),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new y.Vector3),this.satBounds=new Array(4).fill().map(()=>new pe),this.points=[this.a,this.b,this.c],this.sphere=new y.Sphere,this.plane=new y.Plane,this.needsUpdate=!0}intersectsSphere(i){return oa(i,this)}update(){const i=this.a,t=this.b,e=this.c,s=this.points,n=this.satAxes,r=this.satBounds,o=n[0],a=r[0];this.getNormal(o),a.setFromPoints(o,s);const l=n[1],h=r[1];l.subVectors(i,t),h.setFromPoints(l,s);const f=n[2],I=r[2];f.subVectors(t,e),I.setFromPoints(f,s);const u=n[3],d=r[3];u.subVectors(e,i),d.setFromPoints(u,s),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,i),this.needsUpdate=!1}}se.prototype.closestPointToSegment=function(){const c=new y.Vector3,i=new y.Vector3,t=new y.Line3;return function(s,n=null,r=null){const{start:o,end:a}=s,l=this.points;let h,f=1/0;for(let I=0;I<3;I++){const u=(I+1)%3;t.start.copy(l[I]),t.end.copy(l[u]),vn(t,s,c,i),h=c.distanceToSquared(i),h<f&&(f=h,n&&n.copy(c),r&&r.copy(i))}return this.closestPointToPoint(o,c),h=o.distanceToSquared(c),h<f&&(f=h,n&&n.copy(c),r&&r.copy(o)),this.closestPointToPoint(a,c),h=a.distanceToSquared(c),h<f&&(f=h,n&&n.copy(c),r&&r.copy(a)),Math.sqrt(f)}}();se.prototype.intersectsTriangle=function(){const c=new se,i=new Array(3),t=new Array(3),e=new pe,s=new pe,n=new y.Vector3,r=new y.Vector3,o=new y.Vector3,a=new y.Vector3,l=new y.Vector3,h=new y.Line3,f=new y.Line3,I=new y.Line3,u=new y.Vector3;function d(E,T,p){const m=E.points;let F=0,R=-1;for(let S=0;S<3;S++){const{start:N,end:L}=h;N.copy(m[S]),L.copy(m[(S+1)%3]),h.delta(r);const D=Zs(T.distanceToPoint(N));if(Zs(T.normal.dot(r))&&D){p.copy(h),F=2;break}const P=T.intersectLine(h,u);if(!P&&D&&u.copy(N),(P||D)&&!Zs(u.distanceTo(L))){if(F<=1)(F===1?p.start:p.end).copy(u),D&&(R=F);else if(F>=2){(R===1?p.start:p.end).copy(u),F=2;break}if(F++,F===2&&R===-1)break}}return F}return function(T,p=null,m=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(c.copy(T),c.update(),T=c);const F=this.plane,R=T.plane;if(Math.abs(F.normal.dot(R.normal))>1-1e-10){const S=this.satBounds,N=this.satAxes;t[0]=T.a,t[1]=T.b,t[2]=T.c;for(let P=0;P<4;P++){const v=S[P],G=N[P];if(e.setFromPoints(G,t),v.isSeparated(e))return!1}const L=T.satBounds,D=T.satAxes;i[0]=this.a,i[1]=this.b,i[2]=this.c;for(let P=0;P<4;P++){const v=L[P],G=D[P];if(e.setFromPoints(G,i),v.isSeparated(e))return!1}for(let P=0;P<4;P++){const v=N[P];for(let G=0;G<4;G++){const O=D[G];if(n.crossVectors(v,O),e.setFromPoints(n,i),s.setFromPoints(n,t),e.isSeparated(s))return!1}}return p&&(m||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}else{const S=d(this,R,f);if(S===1&&T.containsPoint(f.end))return p&&(p.start.copy(f.end),p.end.copy(f.end)),!0;if(S!==2)return!1;const N=d(T,F,I);if(N===1&&this.containsPoint(I.end))return p&&(p.start.copy(I.end),p.end.copy(I.end)),!0;if(N!==2)return!1;if(f.delta(o),I.delta(a),o.dot(a)<0){let w=I.start;I.start=I.end,I.end=w}const L=f.start.dot(o),D=f.end.dot(o),P=I.start.dot(o),v=I.end.dot(o),G=D<P,O=L<v;return L!==v&&P!==D&&G===O?!1:(p&&(l.subVectors(f.start,I.start),l.dot(o)>0?p.start.copy(f.start):p.start.copy(I.start),l.subVectors(f.end,I.end),l.dot(o)<0?p.end.copy(f.end):p.end.copy(I.end)),!0)}}}();se.prototype.distanceToPoint=function(){const c=new y.Vector3;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();se.prototype.distanceToTriangle=function(){const c=new y.Vector3,i=new y.Vector3,t=["a","b","c"],e=new y.Line3,s=new y.Line3;return function(r,o=null,a=null){const l=o||a?e:null;if(this.intersectsTriangle(r,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let h=1/0;for(let f=0;f<3;f++){let I;const u=t[f],d=r[u];this.closestPointToPoint(d,c),I=d.distanceToSquared(c),I<h&&(h=I,o&&o.copy(c),a&&a.copy(d));const E=this[u];r.closestPointToPoint(E,c),I=E.distanceToSquared(c),I<h&&(h=I,o&&o.copy(E),a&&a.copy(c))}for(let f=0;f<3;f++){const I=t[f],u=t[(f+1)%3];e.set(this[I],this[u]);for(let d=0;d<3;d++){const E=t[d],T=t[(d+1)%3];s.set(r[E],r[T]),vn(e,s,c,i);const p=c.distanceToSquared(i);p<h&&(h=p,o&&o.copy(c),a&&a.copy(i))}}return Math.sqrt(h)}}();class Ut{constructor(i,t,e){this.isOrientedBox=!0,this.min=new y.Vector3,this.max=new y.Vector3,this.matrix=new y.Matrix4,this.invMatrix=new y.Matrix4,this.points=new Array(8).fill().map(()=>new y.Vector3),this.satAxes=new Array(3).fill().map(()=>new y.Vector3),this.satBounds=new Array(3).fill().map(()=>new pe),this.alignedSatBounds=new Array(3).fill().map(()=>new pe),this.needsUpdate=!1,i&&this.min.copy(i),t&&this.max.copy(t),e&&this.matrix.copy(e)}set(i,t,e){this.min.copy(i),this.max.copy(t),this.matrix.copy(e),this.needsUpdate=!0}copy(i){this.min.copy(i.min),this.max.copy(i.max),this.matrix.copy(i.matrix),this.needsUpdate=!0}}Ut.prototype.update=function(){return function(){const i=this.matrix,t=this.min,e=this.max,s=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let f=0;f<=1;f++){const I=1*l|2*h|4*f,u=s[I];u.x=l?e.x:t.x,u.y=h?e.y:t.y,u.z=f?e.z:t.z,u.applyMatrix4(i)}const n=this.satBounds,r=this.satAxes,o=s[0];for(let l=0;l<3;l++){const h=r[l],f=n[l],I=1<<l,u=s[I];h.subVectors(o,u),f.setFromPoints(h,s)}const a=this.alignedSatBounds;a[0].setFromPointsField(s,"x"),a[1].setFromPointsField(s,"y"),a[2].setFromPointsField(s,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}();Ut.prototype.intersectsBox=function(){const c=new pe;return function(t){this.needsUpdate&&this.update();const e=t.min,s=t.max,n=this.satBounds,r=this.satAxes,o=this.alignedSatBounds;if(c.min=e.x,c.max=s.x,o[0].isSeparated(c)||(c.min=e.y,c.max=s.y,o[1].isSeparated(c))||(c.min=e.z,c.max=s.z,o[2].isSeparated(c)))return!1;for(let a=0;a<3;a++){const l=r[a],h=n[a];if(c.setFromBox(l,t),h.isSeparated(c))return!1}return!0}}();Ut.prototype.intersectsTriangle=function(){const c=new se,i=new Array(3),t=new pe,e=new pe,s=new y.Vector3;return function(r){this.needsUpdate&&this.update(),r.isExtendedTriangle?r.needsUpdate&&r.update():(c.copy(r),c.update(),r=c);const o=this.satBounds,a=this.satAxes;i[0]=r.a,i[1]=r.b,i[2]=r.c;for(let I=0;I<3;I++){const u=o[I],d=a[I];if(t.setFromPoints(d,i),u.isSeparated(t))return!1}const l=r.satBounds,h=r.satAxes,f=this.points;for(let I=0;I<3;I++){const u=l[I],d=h[I];if(t.setFromPoints(d,f),u.isSeparated(t))return!1}for(let I=0;I<3;I++){const u=a[I];for(let d=0;d<4;d++){const E=h[d];if(s.crossVectors(u,E),t.setFromPoints(s,i),e.setFromPoints(s,f),t.isSeparated(e))return!1}}return!0}}();Ut.prototype.closestPointToPoint=function(){return function(i,t){return this.needsUpdate&&this.update(),t.copy(i).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t}}();Ut.prototype.distanceToPoint=function(){const c=new y.Vector3;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();Ut.prototype.distanceToBox=function(){const c=["x","y","z"],i=new Array(12).fill().map(()=>new y.Line3),t=new Array(12).fill().map(()=>new y.Line3),e=new y.Vector3,s=new y.Vector3;return function(r,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(a||l)&&(r.getCenter(s),this.closestPointToPoint(s,e),r.closestPointToPoint(e,s),a&&a.copy(e),l&&l.copy(s)),0;const h=o*o,f=r.min,I=r.max,u=this.points;let d=1/0;for(let T=0;T<8;T++){const p=u[T];s.copy(p).clamp(f,I);const m=p.distanceToSquared(s);if(m<d&&(d=m,a&&a.copy(p),l&&l.copy(s),m<h))return Math.sqrt(m)}let E=0;for(let T=0;T<3;T++)for(let p=0;p<=1;p++)for(let m=0;m<=1;m++){const F=(T+1)%3,R=(T+2)%3,S=p<<F|m<<R,N=1<<T|p<<F|m<<R,L=u[S],D=u[N];i[E].set(L,D);const v=c[T],G=c[F],O=c[R],w=t[E],g=w.start,U=w.end;g[v]=f[v],g[G]=p?f[G]:I[G],g[O]=m?f[O]:I[G],U[v]=I[v],U[G]=p?f[G]:I[G],U[O]=m?f[O]:I[G],E++}for(let T=0;T<=1;T++)for(let p=0;p<=1;p++)for(let m=0;m<=1;m++){s.x=T?I.x:f.x,s.y=p?I.y:f.y,s.z=m?I.z:f.z,this.closestPointToPoint(s,e);const F=s.distanceToSquared(e);if(F<d&&(d=F,a&&a.copy(e),l&&l.copy(s),F<h))return Math.sqrt(F)}for(let T=0;T<12;T++){const p=i[T];for(let m=0;m<12;m++){const F=t[m];vn(p,F,e,s);const R=e.distanceToSquared(s);if(R<d&&(d=R,a&&a.copy(e),l&&l.copy(s),R<h))return Math.sqrt(R)}}return Math.sqrt(d)}}();class Un{constructor(i){this._getNewPrimitive=i,this._primitives=[]}getPrimitive(){const i=this._primitives;return i.length===0?this._getNewPrimitive():i.pop()}releasePrimitive(i){this._primitives.push(i)}}class ca extends Un{constructor(){super(()=>new se)}}const Ht=new ca;function Vt(c,i){return i[c+15]===65535}function Yt(c,i){return i[c+6]}function Wt(c,i){return i[c+14]}function Xt(c){return c+8}function $t(c,i){return i[c+6]}function Vr(c,i){return i[c+7]}class la{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const i=[];let t=null;this.setBuffer=e=>{t&&i.push(t),t=e,this.float32Array=new Float32Array(e),this.uint16Array=new Uint16Array(e),this.uint32Array=new Uint32Array(e)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,i.length!==0&&this.setBuffer(i.pop())}}}const At=new la;let Se,qe;const Ue=[],Yi=new Un(()=>new y.Box3);function ha(c,i,t,e,s,n){Se=Yi.getPrimitive(),qe=Yi.getPrimitive(),Ue.push(Se,qe),At.setBuffer(c._roots[i]);const r=In(0,c.geometry,t,e,s,n);At.clearBuffer(),Yi.releasePrimitive(Se),Yi.releasePrimitive(qe),Ue.pop(),Ue.pop();const o=Ue.length;return o>0&&(qe=Ue[o-1],Se=Ue[o-2]),r}function In(c,i,t,e,s=null,n=0,r=0){const{float32Array:o,uint16Array:a,uint32Array:l}=At;let h=c*2;if(Vt(h,a)){const I=Yt(c,l),u=Wt(h,a);return Ot(c,o,Se),e(I,u,!1,r,n+c,Se)}else{let v=function(O){const{uint16Array:w,uint32Array:g}=At;let U=O*2;for(;!Vt(U,w);)O=Xt(O),U=O*2;return Yt(O,g)},G=function(O){const{uint16Array:w,uint32Array:g}=At;let U=O*2;for(;!Vt(U,w);)O=$t(O,g),U=O*2;return Yt(O,g)+Wt(U,w)};const I=Xt(c),u=$t(c,l);let d=I,E=u,T,p,m,F;if(s&&(m=Se,F=qe,Ot(d,o,m),Ot(E,o,F),T=s(m),p=s(F),p<T)){d=u,E=I;const O=T;T=p,p=O,m=F}m||(m=Se,Ot(d,o,m));const R=Vt(d*2,a),S=t(m,R,T,r+1,n+d);let N;if(S===Xn){const O=v(d),g=G(d)-O;N=e(O,g,!0,r+1,n+d,m)}else N=S&&In(d,i,t,e,s,n,r+1);if(N)return!0;F=qe,Ot(E,o,F);const L=Vt(E*2,a),D=t(F,L,p,r+1,n+E);let P;if(D===Xn){const O=v(E),g=G(E)-O;P=e(O,g,!0,r+1,n+E,F)}else P=D&&In(E,i,t,e,s,n,r+1);return!!P}}const oi=new y.Vector3,js=new y.Vector3;function ua(c,i,t={},e=0,s=1/0){const n=e*e,r=s*s;let o=1/0,a=null;if(c.shapecast({boundsTraverseOrder:h=>(oi.copy(i).clamp(h.min,h.max),oi.distanceToSquared(i)),intersectsBounds:(h,f,I)=>I<o&&I<r,intersectsTriangle:(h,f)=>{h.closestPointToPoint(i,oi);const I=i.distanceToSquared(oi);return I<o&&(js.copy(oi),o=I,a=f),I<n}}),o===1/0)return null;const l=Math.sqrt(o);return t.point?t.point.copy(js):t.point=js.clone(),t.distance=l,t.faceIndex=a,t}const xe=new y.Vector3,Be=new y.Vector3,Ve=new y.Vector3,Gi=new y.Vector2,zi=new y.Vector2,ki=new y.Vector2,Qn=new y.Vector3,Kn=new y.Vector3,Jn=new y.Vector3,Hi=new y.Vector3;function fa(c,i,t,e,s,n){let r;return n===y.BackSide?r=c.intersectTriangle(e,t,i,!0,s):r=c.intersectTriangle(i,t,e,n!==y.DoubleSide,s),r===null?null:{distance:c.origin.distanceTo(s),point:s.clone()}}function Ia(c,i,t,e,s,n,r,o,a){xe.fromBufferAttribute(i,n),Be.fromBufferAttribute(i,r),Ve.fromBufferAttribute(i,o);const l=fa(c,xe,Be,Ve,Hi,a);if(l){e&&(Gi.fromBufferAttribute(e,n),zi.fromBufferAttribute(e,r),ki.fromBufferAttribute(e,o),l.uv=y.Triangle.getInterpolation(Hi,xe,Be,Ve,Gi,zi,ki,new y.Vector2)),s&&(Gi.fromBufferAttribute(s,n),zi.fromBufferAttribute(s,r),ki.fromBufferAttribute(s,o),l.uv1=y.Triangle.getInterpolation(Hi,xe,Be,Ve,Gi,zi,ki,new y.Vector2)),t&&(Qn.fromBufferAttribute(t,n),Kn.fromBufferAttribute(t,r),Jn.fromBufferAttribute(t,o),l.normal=y.Triangle.getInterpolation(Hi,xe,Be,Ve,Qn,Kn,Jn,new y.Vector3),l.normal.dot(c.direction)>0&&l.normal.multiplyScalar(-1));const h={a:n,b:r,c:o,normal:new y.Vector3,materialIndex:0};y.Triangle.getNormal(xe,Be,Ve,h.normal),l.face=h,l.faceIndex=n}return l}function Bs(c,i,t,e,s){const n=e*3;let r=n+0,o=n+1,a=n+2;const l=c.index;c.index&&(r=l.getX(r),o=l.getX(o),a=l.getX(a));const{position:h,normal:f,uv:I,uv1:u}=c.attributes,d=Ia(t,h,f,I,u,r,o,a,i);return d?(d.faceIndex=e,s&&s.push(d),d):null}function _t(c,i,t,e){const s=c.a,n=c.b,r=c.c;let o=i,a=i+1,l=i+2;t&&(o=t.getX(o),a=t.getX(a),l=t.getX(l)),s.x=e.getX(o),s.y=e.getY(o),s.z=e.getZ(o),n.x=e.getX(a),n.y=e.getY(a),n.z=e.getZ(a),r.x=e.getX(l),r.y=e.getY(l),r.z=e.getZ(l)}function da(c,i,t,e,s,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=e,l=e+s;a<l;a++)Bs(r,i,t,a,n)}function Ea(c,i,t,e,s){const{geometry:n,_indirectBuffer:r}=c;let o=1/0,a=null;for(let l=e,h=e+s;l<h;l++){let f;f=Bs(n,i,t,l),f&&f.distance<o&&(a=f,o=f.distance)}return a}function pa(c,i,t,e,s,n,r){const{geometry:o}=t,{index:a}=o,l=o.attributes.position;for(let h=c,f=i+c;h<f;h++){let I;if(I=h,_t(r,I*3,a,l),r.needsUpdate=!0,e(r,I,s,n))return!0}return!1}function Ca(c,i=null){i&&Array.isArray(i)&&(i=new Set(i));const t=c.geometry,e=t.index?t.index.array:null,s=t.attributes.position;let n,r,o,a,l=0;const h=c._roots;for(let I=0,u=h.length;I<u;I++)n=h[I],r=new Uint32Array(n),o=new Uint16Array(n),a=new Float32Array(n),f(0,l),l+=n.byteLength;function f(I,u,d=!1){const E=I*2;if(o[E+15]===xs){const p=r[I+6],m=o[E+14];let F=1/0,R=1/0,S=1/0,N=-1/0,L=-1/0,D=-1/0;for(let P=3*p,v=3*(p+m);P<v;P++){let G=e[P];const O=s.getX(G),w=s.getY(G),g=s.getZ(G);O<F&&(F=O),O>N&&(N=O),w<R&&(R=w),w>L&&(L=w),g<S&&(S=g),g>D&&(D=g)}return a[I+0]!==F||a[I+1]!==R||a[I+2]!==S||a[I+3]!==N||a[I+4]!==L||a[I+5]!==D?(a[I+0]=F,a[I+1]=R,a[I+2]=S,a[I+3]=N,a[I+4]=L,a[I+5]=D,!0):!1}else{const p=I+8,m=r[I+6],F=p+u,R=m+u;let S=d,N=!1,L=!1;i?S||(N=i.has(F),L=i.has(R),S=!N&&!L):(N=!0,L=!0);const D=S||N,P=S||L;let v=!1;D&&(v=f(p,u,S));let G=!1;P&&(G=f(m,u,S));const O=v||G;if(O)for(let w=0;w<3;w++){const g=p+w,U=m+w,Q=a[g],z=a[g+3],et=a[U],X=a[U+3];a[I+w]=Q<et?Q:et,a[I+w+3]=z>X?z:X}return O}}}const tr=new y.Box3;function Oe(c,i,t,e){return Ot(c,i,tr),t.intersectBox(tr,e)}function Ta(c,i,t,e,s,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=e,l=e+s;a<l;a++){let h=o?o[a]:a;Bs(r,i,t,h,n)}}function ma(c,i,t,e,s){const{geometry:n,_indirectBuffer:r}=c;let o=1/0,a=null;for(let l=e,h=e+s;l<h;l++){let f;f=Bs(n,i,t,r?r[l]:l),f&&f.distance<o&&(a=f,o=f.distance)}return a}function Ra(c,i,t,e,s,n,r){const{geometry:o}=t,{index:a}=o,l=o.attributes.position;for(let h=c,f=i+c;h<f;h++){let I;if(I=t.resolveTriangleIndex(h),_t(r,I*3,a,l),r.needsUpdate=!0,e(r,I,s,n))return!0}return!1}const er=new y.Vector3;function ga(c,i,t,e,s){At.setBuffer(c._roots[i]),dn(0,c,t,e,s),At.clearBuffer()}function dn(c,i,t,e,s){const{float32Array:n,uint16Array:r,uint32Array:o}=At,a=c*2;if(Vt(a,r)){const h=Yt(c,o),f=Wt(a,r);da(i,t,e,h,f,s)}else{const h=Xt(c);Oe(h,n,e,er)&&dn(h,i,t,e,s);const f=$t(c,o);Oe(f,n,e,er)&&dn(f,i,t,e,s)}}const ir=new y.Vector3,Aa=["x","y","z"];function Fa(c,i,t,e){At.setBuffer(c._roots[i]);const s=En(0,c,t,e);return At.clearBuffer(),s}function En(c,i,t,e){const{float32Array:s,uint16Array:n,uint32Array:r}=At;let o=c*2;if(Vt(o,n)){const l=Yt(c,r),h=Wt(o,n);return Ea(i,t,e,l,h)}else{const l=Vr(c,r),h=Aa[l],I=e.direction[h]>=0;let u,d;I?(u=Xt(c),d=$t(c,r)):(u=$t(c,r),d=Xt(c));const T=Oe(u,s,e,ir)?En(u,i,t,e):null;if(T){const F=T.point[h];if(I?F<=s[d+l]:F>=s[d+l+3])return T}const m=Oe(d,s,e,ir)?En(d,i,t,e):null;return T&&m?T.distance<=m.distance?T:m:T||m||null}}const Wi=new y.Box3,Ye=new se,Ge=new se,ai=new y.Matrix4,sr=new Ut,Xi=new Ut;function Sa(c,i,t,e){At.setBuffer(c._roots[i]);const s=pn(0,c,t,e);return At.clearBuffer(),s}function pn(c,i,t,e,s=null){const{float32Array:n,uint16Array:r,uint32Array:o}=At;let a=c*2;if(s===null&&(t.boundingBox||t.computeBoundingBox(),sr.set(t.boundingBox.min,t.boundingBox.max,e),s=sr),Vt(a,r)){const h=i.geometry,f=h.index,I=h.attributes.position,u=t.index,d=t.attributes.position,E=Yt(c,o),T=Wt(a,r);if(ai.copy(e).invert(),t.boundsTree)return Ot(c,n,Xi),Xi.matrix.copy(ai),Xi.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>Xi.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(e),m.b.applyMatrix4(e),m.c.applyMatrix4(e),m.needsUpdate=!0;for(let F=E*3,R=(T+E)*3;F<R;F+=3)if(_t(Ge,F,f,I),Ge.needsUpdate=!0,m.intersectsTriangle(Ge))return!0;return!1}});for(let p=E*3,m=(T+E)*3;p<m;p+=3){_t(Ye,p,f,I),Ye.a.applyMatrix4(ai),Ye.b.applyMatrix4(ai),Ye.c.applyMatrix4(ai),Ye.needsUpdate=!0;for(let F=0,R=u.count;F<R;F+=3)if(_t(Ge,F,u,d),Ge.needsUpdate=!0,Ye.intersectsTriangle(Ge))return!0}}else{const h=c+8,f=o[c+6];return Ot(h,n,Wi),!!(s.intersectsBox(Wi)&&pn(h,i,t,e,s)||(Ot(f,n,Wi),s.intersectsBox(Wi)&&pn(f,i,t,e,s)))}}const $i=new y.Matrix4,qs=new Ut,ci=new Ut,Oa=new y.Vector3,Na=new y.Vector3,ya=new y.Vector3,La=new y.Vector3;function Pa(c,i,t,e={},s={},n=0,r=1/0){i.boundingBox||i.computeBoundingBox(),qs.set(i.boundingBox.min,i.boundingBox.max,t),qs.needsUpdate=!0;const o=c.geometry,a=o.attributes.position,l=o.index,h=i.attributes.position,f=i.index,I=Ht.getPrimitive(),u=Ht.getPrimitive();let d=Oa,E=Na,T=null,p=null;s&&(T=ya,p=La);let m=1/0,F=null,R=null;return $i.copy(t).invert(),ci.matrix.copy($i),c.shapecast({boundsTraverseOrder:S=>qs.distanceToBox(S),intersectsBounds:(S,N,L)=>L<m&&L<r?(N&&(ci.min.copy(S.min),ci.max.copy(S.max),ci.needsUpdate=!0),!0):!1,intersectsRange:(S,N)=>{if(i.boundsTree)return i.boundsTree.shapecast({boundsTraverseOrder:D=>ci.distanceToBox(D),intersectsBounds:(D,P,v)=>v<m&&v<r,intersectsRange:(D,P)=>{for(let v=D,G=D+P;v<G;v++){_t(u,3*v,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let O=S,w=S+N;O<w;O++){_t(I,3*O,l,a),I.needsUpdate=!0;const g=I.distanceToTriangle(u,d,T);if(g<m&&(E.copy(d),p&&p.copy(T),m=g,F=O,R=v),g<n)return!0}}}});{const L=ei(i);for(let D=0,P=L;D<P;D++){_t(u,3*D,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let v=S,G=S+N;v<G;v++){_t(I,3*v,l,a),I.needsUpdate=!0;const O=I.distanceToTriangle(u,d,T);if(O<m&&(E.copy(d),p&&p.copy(T),m=O,F=v,R=D),O<n)return!0}}}}}),Ht.releasePrimitive(I),Ht.releasePrimitive(u),m===1/0?null:(e.point?e.point.copy(E):e.point=E.clone(),e.distance=m,e.faceIndex=F,s&&(s.point?s.point.copy(p):s.point=p.clone(),s.point.applyMatrix4($i),E.applyMatrix4($i),s.distance=E.sub(s.point).length(),s.faceIndex=R),e)}function _a(c,i=null){i&&Array.isArray(i)&&(i=new Set(i));const t=c.geometry,e=t.index?t.index.array:null,s=t.attributes.position;let n,r,o,a,l=0;const h=c._roots;for(let I=0,u=h.length;I<u;I++)n=h[I],r=new Uint32Array(n),o=new Uint16Array(n),a=new Float32Array(n),f(0,l),l+=n.byteLength;function f(I,u,d=!1){const E=I*2;if(o[E+15]===xs){const p=r[I+6],m=o[E+14];let F=1/0,R=1/0,S=1/0,N=-1/0,L=-1/0,D=-1/0;for(let P=p,v=p+m;P<v;P++){const G=3*c.resolveTriangleIndex(P);for(let O=0;O<3;O++){let w=G+O;w=e?e[w]:w;const g=s.getX(w),U=s.getY(w),Q=s.getZ(w);g<F&&(F=g),g>N&&(N=g),U<R&&(R=U),U>L&&(L=U),Q<S&&(S=Q),Q>D&&(D=Q)}}return a[I+0]!==F||a[I+1]!==R||a[I+2]!==S||a[I+3]!==N||a[I+4]!==L||a[I+5]!==D?(a[I+0]=F,a[I+1]=R,a[I+2]=S,a[I+3]=N,a[I+4]=L,a[I+5]=D,!0):!1}else{const p=I+8,m=r[I+6],F=p+u,R=m+u;let S=d,N=!1,L=!1;i?S||(N=i.has(F),L=i.has(R),S=!N&&!L):(N=!0,L=!0);const D=S||N,P=S||L;let v=!1;D&&(v=f(p,u,S));let G=!1;P&&(G=f(m,u,S));const O=v||G;if(O)for(let w=0;w<3;w++){const g=p+w,U=m+w,Q=a[g],z=a[g+3],et=a[U],X=a[U+3];a[I+w]=Q<et?Q:et,a[I+w+3]=z>X?z:X}return O}}}const nr=new y.Vector3;function Ma(c,i,t,e,s){At.setBuffer(c._roots[i]),Cn(0,c,t,e,s),At.clearBuffer()}function Cn(c,i,t,e,s){const{float32Array:n,uint16Array:r,uint32Array:o}=At,a=c*2;if(Vt(a,r)){const h=Yt(c,o),f=Wt(a,r);Ta(i,t,e,h,f,s)}else{const h=Xt(c);Oe(h,n,e,nr)&&Cn(h,i,t,e,s);const f=$t(c,o);Oe(f,n,e,nr)&&Cn(f,i,t,e,s)}}const rr=new y.Vector3,wa=["x","y","z"];function Da(c,i,t,e){At.setBuffer(c._roots[i]);const s=Tn(0,c,t,e);return At.clearBuffer(),s}function Tn(c,i,t,e){const{float32Array:s,uint16Array:n,uint32Array:r}=At;let o=c*2;if(Vt(o,n)){const l=Yt(c,r),h=Wt(o,n);return ma(i,t,e,l,h)}else{const l=Vr(c,r),h=wa[l],I=e.direction[h]>=0;let u,d;I?(u=Xt(c),d=$t(c,r)):(u=$t(c,r),d=Xt(c));const T=Oe(u,s,e,rr)?Tn(u,i,t,e):null;if(T){const F=T.point[h];if(I?F<=s[d+l]:F>=s[d+l+3])return T}const m=Oe(d,s,e,rr)?Tn(d,i,t,e):null;return T&&m?T.distance<=m.distance?T:m:T||m||null}}const Zi=new y.Box3,ze=new se,ke=new se,li=new y.Matrix4,or=new Ut,ji=new Ut;function ba(c,i,t,e){At.setBuffer(c._roots[i]);const s=mn(0,c,t,e);return At.clearBuffer(),s}function mn(c,i,t,e,s=null){const{float32Array:n,uint16Array:r,uint32Array:o}=At;let a=c*2;if(s===null&&(t.boundingBox||t.computeBoundingBox(),or.set(t.boundingBox.min,t.boundingBox.max,e),s=or),Vt(a,r)){const h=i.geometry,f=h.index,I=h.attributes.position,u=t.index,d=t.attributes.position,E=Yt(c,o),T=Wt(a,r);if(li.copy(e).invert(),t.boundsTree)return Ot(c,n,ji),ji.matrix.copy(li),ji.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>ji.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(e),m.b.applyMatrix4(e),m.c.applyMatrix4(e),m.needsUpdate=!0;for(let F=E,R=T+E;F<R;F++)if(_t(ke,3*i.resolveTriangleIndex(F),f,I),ke.needsUpdate=!0,m.intersectsTriangle(ke))return!0;return!1}});for(let p=E,m=T+E;p<m;p++){const F=i.resolveTriangleIndex(p);_t(ze,3*F,f,I),ze.a.applyMatrix4(li),ze.b.applyMatrix4(li),ze.c.applyMatrix4(li),ze.needsUpdate=!0;for(let R=0,S=u.count;R<S;R+=3)if(_t(ke,R,u,d),ke.needsUpdate=!0,ze.intersectsTriangle(ke))return!0}}else{const h=c+8,f=o[c+6];return Ot(h,n,Zi),!!(s.intersectsBox(Zi)&&mn(h,i,t,e,s)||(Ot(f,n,Zi),s.intersectsBox(Zi)&&mn(f,i,t,e,s)))}}const qi=new y.Matrix4,Qs=new Ut,hi=new Ut,va=new y.Vector3,Ua=new y.Vector3,xa=new y.Vector3,Ba=new y.Vector3;function Va(c,i,t,e={},s={},n=0,r=1/0){i.boundingBox||i.computeBoundingBox(),Qs.set(i.boundingBox.min,i.boundingBox.max,t),Qs.needsUpdate=!0;const o=c.geometry,a=o.attributes.position,l=o.index,h=i.attributes.position,f=i.index,I=Ht.getPrimitive(),u=Ht.getPrimitive();let d=va,E=Ua,T=null,p=null;s&&(T=xa,p=Ba);let m=1/0,F=null,R=null;return qi.copy(t).invert(),hi.matrix.copy(qi),c.shapecast({boundsTraverseOrder:S=>Qs.distanceToBox(S),intersectsBounds:(S,N,L)=>L<m&&L<r?(N&&(hi.min.copy(S.min),hi.max.copy(S.max),hi.needsUpdate=!0),!0):!1,intersectsRange:(S,N)=>{if(i.boundsTree){const L=i.boundsTree;return L.shapecast({boundsTraverseOrder:D=>hi.distanceToBox(D),intersectsBounds:(D,P,v)=>v<m&&v<r,intersectsRange:(D,P)=>{for(let v=D,G=D+P;v<G;v++){const O=L.resolveTriangleIndex(v);_t(u,3*O,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let w=S,g=S+N;w<g;w++){const U=c.resolveTriangleIndex(w);_t(I,3*U,l,a),I.needsUpdate=!0;const Q=I.distanceToTriangle(u,d,T);if(Q<m&&(E.copy(d),p&&p.copy(T),m=Q,F=w,R=v),Q<n)return!0}}}})}else{const L=ei(i);for(let D=0,P=L;D<P;D++){_t(u,3*D,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let v=S,G=S+N;v<G;v++){const O=c.resolveTriangleIndex(v);_t(I,3*O,l,a),I.needsUpdate=!0;const w=I.distanceToTriangle(u,d,T);if(w<m&&(E.copy(d),p&&p.copy(T),m=w,F=v,R=D),w<n)return!0}}}}}),Ht.releasePrimitive(I),Ht.releasePrimitive(u),m===1/0?null:(e.point?e.point.copy(E):e.point=E.clone(),e.distance=m,e.faceIndex=F,s&&(s.point?s.point.copy(p):s.point=p.clone(),s.point.applyMatrix4(qi),E.applyMatrix4(qi),s.distance=E.sub(s.point).length(),s.faceIndex=R),e)}function Ya(){return typeof SharedArrayBuffer<"u"}const Ai=new At.constructor,us=new At.constructor,ge=new Un(()=>new y.Box3),He=new y.Box3,We=new y.Box3,Ks=new y.Box3,Js=new y.Box3;let tn=!1;function Ga(c,i,t,e){if(tn)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");tn=!0;const s=c._roots,n=i._roots;let r,o=0,a=0;const l=new y.Matrix4().copy(t).invert();for(let h=0,f=s.length;h<f;h++){Ai.setBuffer(s[h]),a=0;const I=ge.getPrimitive();Ot(0,Ai.float32Array,I),I.applyMatrix4(l);for(let u=0,d=n.length;u<d&&(us.setBuffer(n[h]),r=Jt(0,0,t,l,e,o,a,0,0,I),us.clearBuffer(),a+=n[u].length,!r);u++);if(ge.releasePrimitive(I),Ai.clearBuffer(),o+=s[h].length,r)break}return tn=!1,r}function Jt(c,i,t,e,s,n=0,r=0,o=0,a=0,l=null,h=!1){let f,I;h?(f=us,I=Ai):(f=Ai,I=us);const u=f.float32Array,d=f.uint32Array,E=f.uint16Array,T=I.float32Array,p=I.uint32Array,m=I.uint16Array,F=c*2,R=i*2,S=Vt(F,E),N=Vt(R,m);let L=!1;if(N&&S)h?L=s(Yt(i,p),Wt(i*2,m),Yt(c,d),Wt(c*2,E),a,r+i,o,n+c):L=s(Yt(c,d),Wt(c*2,E),Yt(i,p),Wt(i*2,m),o,n+c,a,r+i);else if(N){const D=ge.getPrimitive();Ot(i,T,D),D.applyMatrix4(t);const P=Xt(c),v=$t(c,d);Ot(P,u,He),Ot(v,u,We);const G=D.intersectsBox(He),O=D.intersectsBox(We);L=G&&Jt(i,P,e,t,s,r,n,a,o+1,D,!h)||O&&Jt(i,v,e,t,s,r,n,a,o+1,D,!h),ge.releasePrimitive(D)}else{const D=Xt(i),P=$t(i,p);Ot(D,T,Ks),Ot(P,T,Js);const v=l.intersectsBox(Ks),G=l.intersectsBox(Js);if(v&&G)L=Jt(c,D,t,e,s,n,r,o,a+1,l,h)||Jt(c,P,t,e,s,n,r,o,a+1,l,h);else if(v)if(S)L=Jt(c,D,t,e,s,n,r,o,a+1,l,h);else{const O=ge.getPrimitive();O.copy(Ks).applyMatrix4(t);const w=Xt(c),g=$t(c,d);Ot(w,u,He),Ot(g,u,We);const U=O.intersectsBox(He),Q=O.intersectsBox(We);L=U&&Jt(D,w,e,t,s,r,n,a,o+1,O,!h)||Q&&Jt(D,g,e,t,s,r,n,a,o+1,O,!h),ge.releasePrimitive(O)}else if(G)if(S)L=Jt(c,P,t,e,s,n,r,o,a+1,l,h);else{const O=ge.getPrimitive();O.copy(Js).applyMatrix4(t);const w=Xt(c),g=$t(c,d);Ot(w,u,He),Ot(g,u,We);const U=O.intersectsBox(He),Q=O.intersectsBox(We);L=U&&Jt(P,w,e,t,s,r,n,a,o+1,O,!h)||Q&&Jt(P,g,e,t,s,r,n,a,o+1,O,!h),ge.releasePrimitive(O)}}return L}const Qi=new Ut,ar=new y.Box3;class xn{static serialize(i,t={}){t={cloneBuffers:!0,...t};const e=i.geometry,s=i._roots,n=i._indirectBuffer,r=e.getIndex();let o;return t.cloneBuffers?o={roots:s.map(a=>a.slice()),index:r.array.slice(),indirectBuffer:n?n.slice():null}:o={roots:s,index:r.array,indirectBuffer:n},o}static deserialize(i,t,e={}){e={setIndex:!0,indirect:!!i.indirectBuffer,...e};const{index:s,roots:n,indirectBuffer:r}=i,o=new xn(t,{...e,[Xs]:!0});if(o._roots=n,o._indirectBuffer=r||null,e.setIndex){const a=t.getIndex();if(a===null){const l=new y.BufferAttribute(i.index,1,!1);t.setIndex(l)}else a.array!==s&&(a.array.set(s),a.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(i,t={}){if(i.isBufferGeometry){if(i.index&&i.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Ur,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Xs]:!1},t),t.useSharedArrayBuffer&&!Ya())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=i,this._roots=null,this._indirectBuffer=null,t[Xs]||(na(this,t),!i.boundingBox&&t.setBoundingBox&&(i.boundingBox=this.getBoundingBox(new y.Box3)));const{_indirectBuffer:e}=this;this.resolveTriangleIndex=t.indirect?s=>e[s]:s=>s}refit(i=null){return(this.indirect?_a:Ca)(this,i)}traverse(i,t=0){const e=this._roots[t],s=new Uint32Array(e),n=new Uint16Array(e);r(0);function r(o,a=0){const l=o*2,h=n[l+15]===xs;if(h){const f=s[o+6],I=n[l+14];i(a,h,new Float32Array(e,o*4,6),f,I)}else{const f=o+cs/4,I=s[o+6],u=s[o+7];i(a,h,new Float32Array(e,o*4,6),u)||(r(f,a+1),r(I,a+1))}}}raycast(i,t=y.FrontSide){const e=this._roots,s=this.geometry,n=[],r=t.isMaterial,o=Array.isArray(t),a=s.groups,l=r?t.side:t,h=this.indirect?Ma:ga;for(let f=0,I=e.length;f<I;f++){const u=o?t[a[f].materialIndex].side:l,d=n.length;if(h(this,f,u,i,n),o){const E=a[f].materialIndex;for(let T=d,p=n.length;T<p;T++)n[T].face.materialIndex=E}}return n}raycastFirst(i,t=y.FrontSide){const e=this._roots,s=this.geometry,n=t.isMaterial,r=Array.isArray(t);let o=null;const a=s.groups,l=n?t.side:t,h=this.indirect?Da:Fa;for(let f=0,I=e.length;f<I;f++){const u=r?t[a[f].materialIndex].side:l,d=h(this,f,u,i);d!=null&&(o==null||d.distance<o.distance)&&(o=d,r&&(d.face.materialIndex=a[f].materialIndex))}return o}intersectsGeometry(i,t){let e=!1;const s=this._roots,n=this.indirect?ba:Sa;for(let r=0,o=s.length;r<o&&(e=n(this,r,i,t),!e);r++);return e}shapecast(i){const t=Ht.getPrimitive(),e=this.indirect?Ra:pa;let{boundsTraverseOrder:s,intersectsBounds:n,intersectsRange:r,intersectsTriangle:o}=i;if(r&&o){const f=r;r=(I,u,d,E,T)=>f(I,u,d,E,T)?!0:e(I,u,this,o,d,E,t)}else r||(o?r=(f,I,u,d)=>e(f,I,this,o,u,d,t):r=(f,I,u)=>u);let a=!1,l=0;const h=this._roots;for(let f=0,I=h.length;f<I;f++){const u=h[f];if(a=ha(this,f,n,r,s,l),a)break;l+=u.byteLength}return Ht.releasePrimitive(t),a}bvhcast(i,t,e){let{intersectsRanges:s,intersectsTriangles:n}=e;const r=Ht.getPrimitive(),o=this.geometry.index,a=this.geometry.attributes.position,l=this.indirect?d=>{const E=this.resolveTriangleIndex(d);_t(r,E*3,o,a)}:d=>{_t(r,d*3,o,a)},h=Ht.getPrimitive(),f=i.geometry.index,I=i.geometry.attributes.position,u=i.indirect?d=>{const E=i.resolveTriangleIndex(d);_t(h,E*3,f,I)}:d=>{_t(h,d*3,f,I)};if(n){const d=(E,T,p,m,F,R,S,N)=>{for(let L=p,D=p+m;L<D;L++){u(L),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let P=E,v=E+T;P<v;P++)if(l(P),r.needsUpdate=!0,n(r,h,P,L,F,R,S,N))return!0}return!1};if(s){const E=s;s=function(T,p,m,F,R,S,N,L){return E(T,p,m,F,R,S,N,L)?!0:d(T,p,m,F,R,S,N,L)}}else s=d}return Ga(this,i,t,s)}intersectsBox(i,t){return Qi.set(i.min,i.max,t),Qi.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Qi.intersectsBox(e),intersectsTriangle:e=>Qi.intersectsTriangle(e)})}intersectsSphere(i){return this.shapecast({intersectsBounds:t=>i.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(i)})}closestPointToGeometry(i,t,e={},s={},n=0,r=1/0){return(this.indirect?Va:Pa)(this,i,t,e,s,n,r)}closestPointToPoint(i,t={},e=0,s=1/0){return ua(this,i,t,e,s)}getBoundingBox(i){return i.makeEmpty(),this._roots.forEach(e=>{Ot(0,new Float32Array(e),ar),i.union(ar)}),i}}function cr(c,i,t){return c===null||(c.point.applyMatrix4(i.matrixWorld),c.distance=c.point.distanceTo(t.ray.origin),c.object=i,c.distance<t.near||c.distance>t.far)?null:c}const en=new y.Ray,lr=new y.Matrix4,za=y.Mesh.prototype.raycast;function ka(c,i){if(this.geometry.boundsTree){if(this.material===void 0)return;lr.copy(this.matrixWorld).invert(),en.copy(c.ray).applyMatrix4(lr);const t=this.geometry.boundsTree;if(c.firstHitOnly===!0){const e=cr(t.raycastFirst(en,this.material),this,c);e&&i.push(e)}else{const e=t.raycast(en,this.material);for(let s=0,n=e.length;s<n;s++){const r=cr(e[s],this,c);r&&i.push(r)}}}else za.call(this,c,i)}function Ha(c){return this.boundsTree=new xn(this,c),this.boundsTree}function Wa(){this.boundsTree=null}class q{constructor(){C(this,"trigger",i=>{const t=this.handlers.slice(0);for(const e of t)e(i)});C(this,"handlers",[])}add(i){this.handlers.push(i)}remove(i){this.handlers=this.handlers.filter(t=>t!==i)}reset(){this.handlers.length=0}}class fe{constructor(){C(this,"trigger",async i=>{const t=this.handlers.slice(0);for(const e of t)await e(i)});C(this,"handlers",[])}add(i){this.handlers.push(i)}remove(i){this.handlers=this.handlers.filter(t=>t!==i)}reset(){this.handlers.length=0}}class Vs{constructor(i){C(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);C(this,"isResizeable",()=>"resize"in this&&"getSize"in this);C(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);C(this,"isHideable",()=>"visible"in this);C(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=i}}class mt extends Vs{}class Ys extends Vs{constructor(t){super(t);C(this,"worlds",new Map);C(this,"onWorldChanged",new q);C(this,"currentWorld",null);this.onWorldChanged.add(({world:e,action:s})=>{s==="removed"&&this.worlds.delete(e.uuid)})}}class Yr extends Ys{constructor(){super(...arguments);C(this,"hasCameraControls",()=>"controls"in this)}}class Gr extends Ys{constructor(){super(...arguments);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"onResize",new q);C(this,"onClippingPlanesUpdated",new q);C(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,e,s){e.isLocal=s;const n=this.clippingPlanes.indexOf(e);t&&n===-1?this.clippingPlanes.push(e):!t&&n>-1&&this.clippingPlanes.splice(n,1),this.three.clippingPlanes=this.clippingPlanes.filter(r=>!r.isLocal)}}const Fi=class Fi extends mt{constructor(t){super(t);C(this,"_disposedComponents",new Set);C(this,"enabled",!0);t.add(Fi.uuid,this)}get(){return this._disposedComponents}destroy(t,e=!0,s=!0){t.removeFromParent();const n=t;n.dispose&&n.dispose(),this.disposeGeometryAndMaterials(t,e),s&&n.children&&n.children.length&&this.disposeChildren(n),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,e){const s=t;s.geometry&&this.disposeGeometry(s.geometry),e&&s.material&&Fi.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(t){for(const e of t.children)this.destroy(e)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const e of t.material)e.dispose();else t.material.dispose()}};C(Fi,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let Ce=Fi;class zr extends Ys{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"directionalLights",new Map);C(this,"ambientLights",new Map)}dispose(){const t=this.components.get(Ce);for(const e of this.three.children){const s=e;s.geometry&&t.destroy(s)}this.deleteAllLights(),this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}deleteAllLights(){for(const[,t]of this.directionalLights)t.removeFromParent(),t.target.removeFromParent(),t.dispose();this.directionalLights.clear();for(const[,t]of this.ambientLights)t.removeFromParent(),t.dispose();this.ambientLights.clear()}}class Ie extends Set{constructor(t){super(t);C(this,"onItemAdded",new q);C(this,"onItemDeleted",new q);C(this,"onCleared",new q);C(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}add(...t){for(const e of t)this.has(e)||!this.guard(e)||(super.add(e),this.onItemAdded||(this.onItemAdded=new q),this.onItemAdded.trigger(e));return this}delete(t){const e=super.delete(t);return e&&this.onItemDeleted.trigger(),e}dispose(){this.clear(),this.onItemAdded.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class Qt extends Map{constructor(t){super(t);C(this,"onItemSet",new q);C(this,"onItemUpdated",new q);C(this,"onItemDeleted",new q);C(this,"onCleared",new q);C(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}set(t,e){const s=this.has(t);if(!(this.guard??(()=>!0))(t,e))return this;const o=super.set(t,e);return s?(this.onItemUpdated||(this.onItemUpdated=new q),this.onItemUpdated.trigger({key:t,value:e})):(this.onItemSet||(this.onItemSet=new q),this.onItemSet.trigger({key:t,value:e})),o}delete(t){const e=super.delete(t);return e&&this.onItemDeleted.trigger(t),e}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class Xa extends mt{}const ls=0,$a=1,Za=new y.Vector3,hr=new y.Line3,sn=new y.Plane,ur=new y.Vector3,Ki=new y.Triangle;class ja{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new fr,this.unassigned=new fr,this.vertices=[]}setFromPoints(i){if(i.length>=4){this.makeEmpty();for(let t=0,e=i.length;t<e;t++)this.vertices.push(new qa(i[t]));this.compute()}return this}setFromObject(i){const t=[];return i.updateMatrixWorld(!0),i.traverse(function(e){const s=e.geometry;if(s!==void 0){const n=s.attributes.position;if(n!==void 0)for(let r=0,o=n.count;r<o;r++){const a=new y.Vector3;a.fromBufferAttribute(n,r).applyMatrix4(e.matrixWorld),t.push(a)}}}),this.setFromPoints(t)}containsPoint(i){const t=this.faces;for(let e=0,s=t.length;e<s;e++)if(t[e].distanceToPoint(i)>this.tolerance)return!1;return!0}intersectRay(i,t){const e=this.faces;let s=-1/0,n=1/0;for(let r=0,o=e.length;r<o;r++){const a=e[r],l=a.distanceToPoint(i.origin),h=a.normal.dot(i.direction);if(l>0&&h>=0)return null;const f=h!==0?-l/h:0;if(!(f<=0)&&(h>0?n=Math.min(f,n):s=Math.max(f,s),s>n))return null}return s!==-1/0?i.at(s,t):i.at(n,t),t}intersectsRay(i){return this.intersectRay(i,Za)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(i,t){return i.face=t,t.outside===null?this.assigned.append(i):this.assigned.insertBefore(t.outside,i),t.outside=i,this}removeVertexFromFace(i,t){return i===t.outside&&(i.next!==null&&i.next.face===t?t.outside=i.next:t.outside=null),this.assigned.remove(i),this}removeAllVerticesFromFace(i){if(i.outside!==null){const t=i.outside;let e=i.outside;for(;e.next!==null&&e.next.face===i;)e=e.next;return this.assigned.removeSubList(t,e),t.prev=e.next=null,i.outside=null,t}}deleteFaceVertices(i,t){const e=this.removeAllVerticesFromFace(i);if(e!==void 0)if(t===void 0)this.unassigned.appendChain(e);else{let s=e;do{const n=s.next;t.distanceToPoint(s.point)>this.tolerance?this.addVertexToFace(s,t):this.unassigned.append(s),s=n}while(s!==null)}return this}resolveUnassignedPoints(i){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const e=t.next;let s=this.tolerance,n=null;for(let r=0;r<i.length;r++){const o=i[r];if(o.mark===ls){const a=o.distanceToPoint(t.point);if(a>s&&(s=a,n=o),s>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(t,n),t=e}while(t!==null)}return this}computeExtremes(){const i=new y.Vector3,t=new y.Vector3,e=[],s=[];for(let n=0;n<3;n++)e[n]=s[n]=this.vertices[0];i.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let n=0,r=this.vertices.length;n<r;n++){const o=this.vertices[n],a=o.point;for(let l=0;l<3;l++)a.getComponent(l)<i.getComponent(l)&&(i.setComponent(l,a.getComponent(l)),e[l]=o);for(let l=0;l<3;l++)a.getComponent(l)>t.getComponent(l)&&(t.setComponent(l,a.getComponent(l)),s[l]=o)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(i.x),Math.abs(t.x))+Math.max(Math.abs(i.y),Math.abs(t.y))+Math.max(Math.abs(i.z),Math.abs(t.z))),{min:e,max:s}}computeInitialHull(){const i=this.vertices,t=this.computeExtremes(),e=t.min,s=t.max;let n=0,r=0;for(let I=0;I<3;I++){const u=s[I].point.getComponent(I)-e[I].point.getComponent(I);u>n&&(n=u,r=I)}const o=e[r],a=s[r];let l,h;n=0,hr.set(o.point,a.point);for(let I=0,u=this.vertices.length;I<u;I++){const d=i[I];if(d!==o&&d!==a){hr.closestPointToPoint(d.point,!0,ur);const E=ur.distanceToSquared(d.point);E>n&&(n=E,l=d)}}n=-1,sn.setFromCoplanarPoints(o.point,a.point,l.point);for(let I=0,u=this.vertices.length;I<u;I++){const d=i[I];if(d!==o&&d!==a&&d!==l){const E=Math.abs(sn.distanceToPoint(d.point));E>n&&(n=E,h=d)}}const f=[];if(sn.distanceToPoint(h.point)<0){f.push(ee.create(o,a,l),ee.create(h,a,o),ee.create(h,l,a),ee.create(h,o,l));for(let I=0;I<3;I++){const u=(I+1)%3;f[I+1].getEdge(2).setTwin(f[0].getEdge(u)),f[I+1].getEdge(1).setTwin(f[u+1].getEdge(0))}}else{f.push(ee.create(o,l,a),ee.create(h,o,a),ee.create(h,a,l),ee.create(h,l,o));for(let I=0;I<3;I++){const u=(I+1)%3;f[I+1].getEdge(2).setTwin(f[0].getEdge((3-I)%3)),f[I+1].getEdge(0).setTwin(f[u+1].getEdge(1))}}for(let I=0;I<4;I++)this.faces.push(f[I]);for(let I=0,u=i.length;I<u;I++){const d=i[I];if(d!==o&&d!==a&&d!==l&&d!==h){n=this.tolerance;let E=null;for(let T=0;T<4;T++){const p=this.faces[T].distanceToPoint(d.point);p>n&&(n=p,E=this.faces[T])}E!==null&&this.addVertexToFace(d,E)}}return this}reindexFaces(){const i=[];for(let t=0;t<this.faces.length;t++){const e=this.faces[t];e.mark===ls&&i.push(e)}return this.faces=i,this}nextVertexToAdd(){if(this.assigned.isEmpty()===!1){let i,t=0;const e=this.assigned.first().face;let s=e.outside;do{const n=e.distanceToPoint(s.point);n>t&&(t=n,i=s),s=s.next}while(s!==null&&s.face===e);return i}}computeHorizon(i,t,e,s){this.deleteFaceVertices(e),e.mark=$a;let n;t===null?n=t=e.getEdge(0):n=t.next;do{const r=n.twin,o=r.face;o.mark===ls&&(o.distanceToPoint(i)>this.tolerance?this.computeHorizon(i,r,o,s):s.push(n)),n=n.next}while(n!==t);return this}addAdjoiningFace(i,t){const e=ee.create(i,t.tail(),t.head());return this.faces.push(e),e.getEdge(-1).setTwin(t.twin),e.getEdge(0)}addNewFaces(i,t){this.newFaces=[];let e=null,s=null;for(let n=0;n<t.length;n++){const r=t[n],o=this.addAdjoiningFace(i,r);e===null?e=o:o.next.setTwin(s),this.newFaces.push(o.face),s=o}return e.next.setTwin(s),this}addVertexToHull(i){const t=[];return this.unassigned.clear(),this.removeVertexFromFace(i,i.face),this.computeHorizon(i.point,null,i.face,t),this.addNewFaces(i,t),this.resolveUnassignedPoints(this.newFaces),this}cleanup(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this}compute(){let i;for(this.computeInitialHull();(i=this.nextVertexToAdd())!==void 0;)this.addVertexToHull(i);return this.reindexFaces(),this.cleanup(),this}}class ee{constructor(){this.normal=new y.Vector3,this.midpoint=new y.Vector3,this.area=0,this.constant=0,this.outside=null,this.mark=ls,this.edge=null}static create(i,t,e){const s=new ee,n=new nn(i,s),r=new nn(t,s),o=new nn(e,s);return n.next=o.prev=r,r.next=n.prev=o,o.next=r.prev=n,s.edge=n,s.compute()}getEdge(i){let t=this.edge;for(;i>0;)t=t.next,i--;for(;i<0;)t=t.prev,i++;return t}compute(){const i=this.edge.tail(),t=this.edge.head(),e=this.edge.next.head();return Ki.set(i.point,t.point,e.point),Ki.getNormal(this.normal),Ki.getMidpoint(this.midpoint),this.area=Ki.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(i){return this.normal.dot(i)-this.constant}}class nn{constructor(i,t){this.vertex=i,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const i=this.head(),t=this.tail();return t!==null?t.point.distanceTo(i.point):-1}lengthSquared(){const i=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(i.point):-1}setTwin(i){return this.twin=i,i.twin=this,this}}class qa{constructor(i){this.point=i,this.prev=null,this.next=null,this.face=null}}class fr{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(i,t){return t.prev=i.prev,t.next=i,t.prev===null?this.head=t:t.prev.next=t,i.prev=t,this}insertAfter(i,t){return t.prev=i,t.next=i.next,t.next===null?this.tail=t:t.next.prev=t,i.next=t,this}append(i){return this.head===null?this.head=i:this.tail.next=i,i.prev=this.tail,i.next=null,this.tail=i,this}appendChain(i){for(this.head===null?this.head=i:this.tail.next=i,i.prev=this.tail;i.next!==null;)i=i.next;return this.tail=i,this}remove(i){return i.prev===null?this.head=i.next:i.prev.next=i.next,i.next===null?this.tail=i.prev:i.next.prev=i.prev,this}removeSubList(i,t){return i.prev===null?this.head=t.next:i.prev.next=t.next,t.next===null?this.tail=i.prev:t.next.prev=i.prev,this}isEmpty(){return this.head===null}}const Rn=[2,2,1],gn=[1,0,0];function ce(c,i){return c*3+i}function Qa(c){const i=c.elements;let t=0;for(let e=0;e<9;e++)t+=i[e]*i[e];return Math.sqrt(t)}function Ka(c){const i=c.elements;let t=0;for(let e=0;e<3;e++){const s=i[ce(Rn[e],gn[e])];t+=2*s*s}return Math.sqrt(t)}function Ja(c,i){let t=0,e=1;const s=c.elements;for(let l=0;l<3;l++){const h=Math.abs(s[ce(Rn[l],gn[l])]);h>t&&(t=h,e=l)}let n=1,r=0;const o=gn[e],a=Rn[e];if(Math.abs(s[ce(a,o)])>Number.EPSILON){const l=s[ce(a,a)],h=s[ce(o,o)],f=s[ce(a,o)],I=(l-h)/2/f;let u;I<0?u=-1/(-I+Math.sqrt(1+I*I)):u=1/(I+Math.sqrt(1+I*I)),n=1/Math.sqrt(1+u*u),r=u*n}return i.identity(),i.elements[ce(o,o)]=n,i.elements[ce(a,a)]=n,i.elements[ce(a,o)]=r,i.elements[ce(o,a)]=-r,i}function tc(c,i){let t=0,e=0;const s=10;i.unitary.identity(),i.diagonal.copy(c);const n=i.unitary,r=i.diagonal,o=new b.Matrix3,a=new b.Matrix3,l=Number.EPSILON*Qa(r);for(;e<s&&Ka(r)>l;)Ja(r,o),a.copy(o).transpose(),r.multiply(o),r.premultiply(a),n.multiply(o),++t>2&&(e++,t=0);return i}function kr(c){const i=[];for(let ot=0;ot<c.length-2;ot+=3){const ft=c[ot],ut=c[ot+1],Ct=c[ot+2];i.push(new b.Vector3(ft,ut,Ct))}const t=new ja;t.setFromPoints(i);const e={unitary:new b.Matrix3,diagonal:new b.Matrix3},s=t.faces,n=[],r=[];for(let ot=0,ft=s.length;ot<ft;ot++){const ut=s[ot];let Ct=ut.edge;n.length=0;do n.push(Ct),Ct=Ct.next;while(Ct!==ut.edge);const Gt=n.length-2;for(let wt=1,A=Gt;wt<=A;wt++){const $=n[0].vertex,H=n[wt+0].vertex,M=n[wt+1].vertex;r.push($.point.x,$.point.y,$.point.z),r.push(H.point.x,H.point.y,H.point.z),r.push(M.point.x,M.point.y,M.point.z)}}const o=new b.Vector3,a=new b.Vector3,l=new b.Vector3,h=new b.Vector3,f=new b.Vector3,I=new b.Vector3,u=new b.Vector3,d=new b.Vector3;let E=0,T=0,p=0,m=0,F=0,R=0,S=0;for(let ot=0,ft=r.length;ot<ft;ot+=9){o.fromArray(r,ot),a.fromArray(r,ot+3),l.fromArray(r,ot+6),u.set(0,0,0),u.add(o).add(a).add(l).divideScalar(3),h.subVectors(a,o),f.subVectors(l,o);const ut=I.crossVectors(h,f).length()/2;d.add(I.copy(u).multiplyScalar(ut)),E+=ut,T+=(9*u.x*u.x+o.x*o.x+a.x*a.x+l.x*l.x)*(ut/12),p+=(9*u.x*u.y+o.x*o.y+a.x*a.y+l.x*l.y)*(ut/12),m+=(9*u.x*u.z+o.x*o.z+a.x*a.z+l.x*l.z)*(ut/12),F+=(9*u.y*u.y+o.y*o.y+a.y*a.y+l.y*l.y)*(ut/12),R+=(9*u.y*u.z+o.y*o.z+a.y*a.z+l.y*l.z)*(ut/12),S+=(9*u.z*u.z+o.z*o.z+a.z*a.z+l.z*l.z)*(ut/12)}d.divideScalar(E),T/=E,p/=E,m/=E,F/=E,R/=E,S/=E,T-=d.x*d.x,p-=d.x*d.y,m-=d.x*d.z,F-=d.y*d.y,R-=d.y*d.z,S-=d.z*d.z;const N=new b.Matrix3;N.elements[0]=T,N.elements[1]=p,N.elements[2]=m,N.elements[3]=p,N.elements[4]=F,N.elements[5]=R,N.elements[6]=m,N.elements[7]=R,N.elements[8]=S,tc(N,e);const L=e.unitary,D=new b.Vector3,P=new b.Vector3,v=new b.Vector3;L.extractBasis(D,P,v);let G=-1/0,O=-1/0,w=-1/0,g=1/0,U=1/0,Q=1/0;for(let ot=0,ft=i.length;ot<ft;ot++){const ut=i[ot];G=Math.max(D.dot(ut),G),O=Math.max(P.dot(ut),O),w=Math.max(v.dot(ut),w),g=Math.min(D.dot(ut),g),U=Math.min(P.dot(ut),U),Q=Math.min(v.dot(ut),Q)}D.multiplyScalar(.5*(g+G)),P.multiplyScalar(.5*(U+O)),v.multiplyScalar(.5*(Q+w));const z=new b.Vector3,et=new b.Vector3,X=new b.Matrix3;z.add(D).add(P).add(v),et.x=G-g,et.y=O-U,et.z=w-Q,et.multiplyScalar(.5),X.copy(L);const{x:nt,y:Y,z:B}=et,rt=new b.Matrix4;rt.makeScale(nt*2,Y*2,B*2);const it=new b.Matrix4;it.makeTranslation(-nt,-Y,-B);const tt=new b.Matrix4;tt.makeTranslation(z.x,z.y,z.z);const Ft=new b.Matrix4;Ft.setFromMatrix3(X);const Nt=new b.Matrix4;return Nt.multiply(tt),Nt.multiply(Ft),Nt.multiply(it),Nt.multiply(rt),{center:z,halfSizes:et,rotation:X,transformation:Nt}}function ec(c,i,t){const e=[c[0]-i[0],c[1]-i[1],c[2]-i[2]];return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]>0}class An{static isTransparent(i){return i.transparent&&i.opacity<1}}const Lt=class Lt{static create(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return`${Lt._lut[i&255]+Lt._lut[i>>8&255]+Lt._lut[i>>16&255]+Lt._lut[i>>24&255]}-${Lt._lut[t&255]}${Lt._lut[t>>8&255]}-${Lt._lut[t>>16&15|64]}${Lt._lut[t>>24&255]}-${Lt._lut[e&63|128]}${Lt._lut[e>>8&255]}-${Lt._lut[e>>16&255]}${Lt._lut[e>>24&255]}${Lt._lut[s&255]}${Lt._lut[s>>8&255]}${Lt._lut[s>>16&255]}${Lt._lut[s>>24&255]}`.toLowerCase()}static validate(i){if(!Lt._pattern.test(i))throw new Error(`${i} is not a valid UUID v4.
|
|
1
|
+
"use strict";var Bo=Object.defineProperty;var Vo=(c,i,t)=>i in c?Bo(c,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[i]=t;var C=(c,i,t)=>(Vo(c,typeof i!="symbol"?i+"":i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("three"),Dn=require("@thatopen/fragments"),Yo=require("web-ifc");function bn(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>c[t]})}}return i.default=c,Object.freeze(i)}const b=bn(y),jt=bn(Dn),k=bn(Yo),Ur=0,Go=1,zo=2,Xn=2,Ws=1.25,$n=1,cs=6*4+4+4,xs=65535,ko=Math.pow(2,-24),Xs=Symbol("SKIP_GENERATION");function Ho(c){return c.index?c.index.count:c.attributes.position.count}function ei(c){return Ho(c)/3}function Wo(c,i=ArrayBuffer){return c>65535?new Uint32Array(new i(4*c)):new Uint16Array(new i(2*c))}function Xo(c,i){if(!c.index){const t=c.attributes.position.count,e=i.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,s=Wo(t,e);c.setIndex(new y.BufferAttribute(s,1));for(let n=0;n<t;n++)s[n]=n}}function xr(c){const i=ei(c),t=c.drawRange,e=t.start/3,s=(t.start+t.count)/3,n=Math.max(0,e),r=Math.min(i,s)-n;return[{offset:Math.floor(n),count:Math.floor(r)}]}function Br(c){if(!c.groups||!c.groups.length)return xr(c);const i=[],t=new Set,e=c.drawRange,s=e.start/3,n=(e.start+e.count)/3;for(const o of c.groups){const a=o.start/3,l=(o.start+o.count)/3;t.add(Math.max(s,a)),t.add(Math.min(n,l))}const r=Array.from(t.values()).sort((o,a)=>o-a);for(let o=0;o<r.length-1;o++){const a=r[o],l=r[o+1];i.push({offset:Math.floor(a),count:Math.floor(l-a)})}return i}function $o(c){if(c.groups.length===0)return!1;const i=ei(c),t=Br(c).sort((n,r)=>n.offset-r.offset),e=t[t.length-1];e.count=Math.min(i-e.offset,e.count);let s=0;return t.forEach(({count:n})=>s+=n),i!==s}function Ot(c,i,t){return t.min.x=i[c],t.min.y=i[c+1],t.min.z=i[c+2],t.max.x=i[c+3],t.max.y=i[c+4],t.max.z=i[c+5],t}function Zo(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Zn(c){let i=-1,t=-1/0;for(let e=0;e<3;e++){const s=c[e+3]-c[e];s>t&&(t=s,i=e)}return i}function jn(c,i){i.set(c)}function qn(c,i,t){let e,s;for(let n=0;n<3;n++){const r=n+3;e=c[n],s=i[n],t[n]=e<s?e:s,e=c[r],s=i[r],t[r]=e>s?e:s}}function xi(c,i,t){for(let e=0;e<3;e++){const s=i[c+2*e],n=i[c+2*e+1],r=s-n,o=s+n;r<t[e]&&(t[e]=r),o>t[e+3]&&(t[e+3]=o)}}function ri(c){const i=c[3]-c[0],t=c[4]-c[1],e=c[5]-c[2];return 2*(i*t+t*e+e*i)}function $s(c,i,t,e,s=null){let n=1/0,r=1/0,o=1/0,a=-1/0,l=-1/0,h=-1/0,f=1/0,I=1/0,u=1/0,d=-1/0,E=-1/0,T=-1/0;const p=s!==null;for(let m=i*6,F=(i+t)*6;m<F;m+=6){const R=c[m+0],S=c[m+1],N=R-S,L=R+S;N<n&&(n=N),L>a&&(a=L),p&&R<f&&(f=R),p&&R>d&&(d=R);const D=c[m+2],P=c[m+3],v=D-P,G=D+P;v<r&&(r=v),G>l&&(l=G),p&&D<I&&(I=D),p&&D>E&&(E=D);const O=c[m+4],w=c[m+5],g=O-w,U=O+w;g<o&&(o=g),U>h&&(h=U),p&&O<u&&(u=O),p&&O>T&&(T=O)}e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=l,e[5]=h,p&&(s[0]=f,s[1]=I,s[2]=u,s[3]=d,s[4]=E,s[5]=T)}function jo(c,i,t,e){let s=1/0,n=1/0,r=1/0,o=-1/0,a=-1/0,l=-1/0;for(let h=i*6,f=(i+t)*6;h<f;h+=6){const I=c[h+0];I<s&&(s=I),I>o&&(o=I);const u=c[h+2];u<n&&(n=u),u>a&&(a=u);const d=c[h+4];d<r&&(r=d),d>l&&(l=d)}e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=l}function qo(c,i){Zo(i);const t=c.attributes.position,e=c.index?c.index.array:null,s=ei(c),n=new Float32Array(s*6),r=t.normalized,o=t.array,a=t.offset||0;let l=3;t.isInterleavedBufferAttribute&&(l=t.data.stride);const h=["getX","getY","getZ"];for(let f=0;f<s;f++){const I=f*3,u=f*6;let d=I+0,E=I+1,T=I+2;e&&(d=e[d],E=e[E],T=e[T]),r||(d=d*l+a,E=E*l+a,T=T*l+a);for(let p=0;p<3;p++){let m,F,R;r?(m=t[h[p]](d),F=t[h[p]](E),R=t[h[p]](T)):(m=o[d+p],F=o[E+p],R=o[T+p]);let S=m;F<S&&(S=F),R<S&&(S=R);let N=m;F>N&&(N=F),R>N&&(N=R);const L=(N-S)/2,D=p*2;n[u+D+0]=S+L,n[u+D+1]=L+(Math.abs(S)+L)*ko,S<i[p]&&(i[p]=S),N>i[p+3]&&(i[p+3]=N)}}return n}const ue=32,Qo=(c,i)=>c.candidate-i.candidate,Te=new Array(ue).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Bi=new Float32Array(6);function Ko(c,i,t,e,s,n){let r=-1,o=0;if(n===Ur)r=Zn(i),r!==-1&&(o=(i[r]+i[r+3])/2);else if(n===Go)r=Zn(c),r!==-1&&(o=Jo(t,e,s,r));else if(n===zo){const a=ri(c);let l=Ws*s;const h=e*6,f=(e+s)*6;for(let I=0;I<3;I++){const u=i[I],T=(i[I+3]-u)/ue;if(s<ue/4){const p=[...Te];p.length=s;let m=0;for(let R=h;R<f;R+=6,m++){const S=p[m];S.candidate=t[R+2*I],S.count=0;const{bounds:N,leftCacheBounds:L,rightCacheBounds:D}=S;for(let P=0;P<3;P++)D[P]=1/0,D[P+3]=-1/0,L[P]=1/0,L[P+3]=-1/0,N[P]=1/0,N[P+3]=-1/0;xi(R,t,N)}p.sort(Qo);let F=s;for(let R=0;R<F;R++){const S=p[R];for(;R+1<F&&p[R+1].candidate===S.candidate;)p.splice(R+1,1),F--}for(let R=h;R<f;R+=6){const S=t[R+2*I];for(let N=0;N<F;N++){const L=p[N];S>=L.candidate?xi(R,t,L.rightCacheBounds):(xi(R,t,L.leftCacheBounds),L.count++)}}for(let R=0;R<F;R++){const S=p[R],N=S.count,L=s-S.count,D=S.leftCacheBounds,P=S.rightCacheBounds;let v=0;N!==0&&(v=ri(D)/a);let G=0;L!==0&&(G=ri(P)/a);const O=$n+Ws*(v*N+G*L);O<l&&(r=I,l=O,o=S.candidate)}}else{for(let F=0;F<ue;F++){const R=Te[F];R.count=0,R.candidate=u+T+F*T;const S=R.bounds;for(let N=0;N<3;N++)S[N]=1/0,S[N+3]=-1/0}for(let F=h;F<f;F+=6){let N=~~((t[F+2*I]-u)/T);N>=ue&&(N=ue-1);const L=Te[N];L.count++,xi(F,t,L.bounds)}const p=Te[ue-1];jn(p.bounds,p.rightCacheBounds);for(let F=ue-2;F>=0;F--){const R=Te[F],S=Te[F+1];qn(R.bounds,S.rightCacheBounds,R.rightCacheBounds)}let m=0;for(let F=0;F<ue-1;F++){const R=Te[F],S=R.count,N=R.bounds,D=Te[F+1].rightCacheBounds;S!==0&&(m===0?jn(N,Bi):qn(N,Bi,Bi)),m+=S;let P=0,v=0;m!==0&&(P=ri(Bi)/a);const G=s-m;G!==0&&(v=ri(D)/a);const O=$n+Ws*(P*m+v*G);O<l&&(r=I,l=O,o=R.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${n} used.`);return{axis:r,pos:o}}function Jo(c,i,t,e){let s=0;for(let n=i,r=i+t;n<r;n++)s+=c[n*6+e*2];return s/t}class Vi{constructor(){}}function ta(c,i,t,e,s,n){let r=e,o=e+s-1;const a=n.pos,l=n.axis*2;for(;;){for(;r<=o&&t[r*6+l]<a;)r++;for(;r<=o&&t[o*6+l]>=a;)o--;if(r<o){for(let h=0;h<3;h++){let f=i[r*3+h];i[r*3+h]=i[o*3+h],i[o*3+h]=f}for(let h=0;h<6;h++){let f=t[r*6+h];t[r*6+h]=t[o*6+h],t[o*6+h]=f}r++,o--}else return r}}function ea(c,i,t,e,s,n){let r=e,o=e+s-1;const a=n.pos,l=n.axis*2;for(;;){for(;r<=o&&t[r*6+l]<a;)r++;for(;r<=o&&t[o*6+l]>=a;)o--;if(r<o){let h=c[r];c[r]=c[o],c[o]=h;for(let f=0;f<6;f++){let I=t[r*6+f];t[r*6+f]=t[o*6+f],t[o*6+f]=I}r++,o--}else return r}}function ia(c,i){const t=(c.index?c.index.count:c.attributes.position.count)/3,e=t>2**16,s=e?4:2,n=i?new SharedArrayBuffer(t*s):new ArrayBuffer(t*s),r=e?new Uint32Array(n):new Uint16Array(n);for(let o=0,a=r.length;o<a;o++)r[o]=o;return r}function sa(c,i){const t=c.geometry,e=t.index?t.index.array:null,s=i.maxDepth,n=i.verbose,r=i.maxLeafTris,o=i.strategy,a=i.onProgress,l=ei(t),h=c._indirectBuffer;let f=!1;const I=new Float32Array(6),u=new Float32Array(6),d=qo(t,I),E=i.indirect?ea:ta,T=[],p=i.indirect?xr(t):Br(t);if(p.length===1){const R=p[0],S=new Vi;S.boundingData=I,jo(d,R.offset,R.count,u),F(S,R.offset,R.count,u),T.push(S)}else for(let R of p){const S=new Vi;S.boundingData=new Float32Array(6),$s(d,R.offset,R.count,S.boundingData,u),F(S,R.offset,R.count,u),T.push(S)}return T;function m(R){a&&a(R/l)}function F(R,S,N,L=null,D=0){if(!f&&D>=s&&(f=!0,n&&(console.warn(`MeshBVH: Max depth of ${s} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),N<=r||D>=s)return m(S+N),R.offset=S,R.count=N,R;const P=Ko(R.boundingData,L,d,S,N,o);if(P.axis===-1)return m(S+N),R.offset=S,R.count=N,R;const v=E(h,e,d,S,N,P);if(v===S||v===S+N)m(S+N),R.offset=S,R.count=N;else{R.splitAxis=P.axis;const G=new Vi,O=S,w=v-S;R.left=G,G.boundingData=new Float32Array(6),$s(d,O,w,G.boundingData,u),F(G,O,w,u,D+1);const g=new Vi,U=v,Q=N-w;R.right=g,g.boundingData=new Float32Array(6),$s(d,U,Q,g.boundingData,u),F(g,U,Q,u,D+1)}return R}}function na(c,i){const t=c.geometry;i.indirect&&(c._indirectBuffer=ia(t,i.useSharedArrayBuffer),$o(t)&&!i.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),c._indirectBuffer||Xo(t,i);const e=sa(c,i);let s,n,r;const o=[],a=i.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let f=0;f<e.length;f++){const I=e[f];let u=l(I);const d=new a(cs*u);s=new Float32Array(d),n=new Uint32Array(d),r=new Uint16Array(d),h(0,I),o.push(d)}c._roots=o;return;function l(f){return f.count?1:1+l(f.left)+l(f.right)}function h(f,I){const u=f/4,d=f/2,E=!!I.count,T=I.boundingData;for(let p=0;p<6;p++)s[u+p]=T[p];if(E){const p=I.offset,m=I.count;return n[u+6]=p,r[d+14]=m,r[d+15]=xs,f+cs}else{const p=I.left,m=I.right,F=I.splitAxis;let R;if(R=h(f+cs,p),R/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=R/4,R=h(R,m),n[u+7]=F,R}}}class pe{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(i,t){let e=1/0,s=-1/0;for(let n=0,r=i.length;n<r;n++){const a=i[n][t];e=a<e?a:e,s=a>s?a:s}this.min=e,this.max=s}setFromPoints(i,t){let e=1/0,s=-1/0;for(let n=0,r=t.length;n<r;n++){const o=t[n],a=i.dot(o);e=a<e?a:e,s=a>s?a:s}this.min=e,this.max=s}isSeparated(i){return this.min>i.max||i.min>this.max}}pe.prototype.setFromBox=function(){const c=new y.Vector3;return function(t,e){const s=e.min,n=e.max;let r=1/0,o=-1/0;for(let a=0;a<=1;a++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){c.x=s.x*a+n.x*(1-a),c.y=s.y*l+n.y*(1-l),c.z=s.z*h+n.z*(1-h);const f=t.dot(c);r=Math.min(f,r),o=Math.max(f,o)}this.min=r,this.max=o}}();const ra=function(){const c=new y.Vector3,i=new y.Vector3,t=new y.Vector3;return function(s,n,r){const o=s.start,a=c,l=n.start,h=i;t.subVectors(o,l),c.subVectors(s.end,s.start),i.subVectors(n.end,n.start);const f=t.dot(h),I=h.dot(a),u=h.dot(h),d=t.dot(a),T=a.dot(a)*u-I*I;let p,m;T!==0?p=(f*I-d*u)/T:p=0,m=(f+p*I)/u,r.x=p,r.y=m}}(),vn=function(){const c=new y.Vector2,i=new y.Vector3,t=new y.Vector3;return function(s,n,r,o){ra(s,n,c);let a=c.x,l=c.y;if(a>=0&&a<=1&&l>=0&&l<=1){s.at(a,r),n.at(l,o);return}else if(a>=0&&a<=1){l<0?n.at(0,o):n.at(1,o),s.closestPointToPoint(o,!0,r);return}else if(l>=0&&l<=1){a<0?s.at(0,r):s.at(1,r),n.closestPointToPoint(r,!0,o);return}else{let h;a<0?h=s.start:h=s.end;let f;l<0?f=n.start:f=n.end;const I=i,u=t;if(s.closestPointToPoint(f,!0,i),n.closestPointToPoint(h,!0,t),I.distanceToSquared(f)<=u.distanceToSquared(h)){r.copy(I),o.copy(f);return}else{r.copy(h),o.copy(u);return}}}}(),oa=function(){const c=new y.Vector3,i=new y.Vector3,t=new y.Plane,e=new y.Line3;return function(n,r){const{radius:o,center:a}=n,{a:l,b:h,c:f}=r;if(e.start=l,e.end=h,e.closestPointToPoint(a,!0,c).distanceTo(a)<=o||(e.start=l,e.end=f,e.closestPointToPoint(a,!0,c).distanceTo(a)<=o)||(e.start=h,e.end=f,e.closestPointToPoint(a,!0,c).distanceTo(a)<=o))return!0;const E=r.getPlane(t);if(Math.abs(E.distanceToPoint(a))<=o){const p=E.projectPoint(a,i);if(r.containsPoint(p))return!0}return!1}}(),aa=1e-15;function Zs(c){return Math.abs(c)<aa}class se extends y.Triangle{constructor(...i){super(...i),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new y.Vector3),this.satBounds=new Array(4).fill().map(()=>new pe),this.points=[this.a,this.b,this.c],this.sphere=new y.Sphere,this.plane=new y.Plane,this.needsUpdate=!0}intersectsSphere(i){return oa(i,this)}update(){const i=this.a,t=this.b,e=this.c,s=this.points,n=this.satAxes,r=this.satBounds,o=n[0],a=r[0];this.getNormal(o),a.setFromPoints(o,s);const l=n[1],h=r[1];l.subVectors(i,t),h.setFromPoints(l,s);const f=n[2],I=r[2];f.subVectors(t,e),I.setFromPoints(f,s);const u=n[3],d=r[3];u.subVectors(e,i),d.setFromPoints(u,s),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,i),this.needsUpdate=!1}}se.prototype.closestPointToSegment=function(){const c=new y.Vector3,i=new y.Vector3,t=new y.Line3;return function(s,n=null,r=null){const{start:o,end:a}=s,l=this.points;let h,f=1/0;for(let I=0;I<3;I++){const u=(I+1)%3;t.start.copy(l[I]),t.end.copy(l[u]),vn(t,s,c,i),h=c.distanceToSquared(i),h<f&&(f=h,n&&n.copy(c),r&&r.copy(i))}return this.closestPointToPoint(o,c),h=o.distanceToSquared(c),h<f&&(f=h,n&&n.copy(c),r&&r.copy(o)),this.closestPointToPoint(a,c),h=a.distanceToSquared(c),h<f&&(f=h,n&&n.copy(c),r&&r.copy(a)),Math.sqrt(f)}}();se.prototype.intersectsTriangle=function(){const c=new se,i=new Array(3),t=new Array(3),e=new pe,s=new pe,n=new y.Vector3,r=new y.Vector3,o=new y.Vector3,a=new y.Vector3,l=new y.Vector3,h=new y.Line3,f=new y.Line3,I=new y.Line3,u=new y.Vector3;function d(E,T,p){const m=E.points;let F=0,R=-1;for(let S=0;S<3;S++){const{start:N,end:L}=h;N.copy(m[S]),L.copy(m[(S+1)%3]),h.delta(r);const D=Zs(T.distanceToPoint(N));if(Zs(T.normal.dot(r))&&D){p.copy(h),F=2;break}const P=T.intersectLine(h,u);if(!P&&D&&u.copy(N),(P||D)&&!Zs(u.distanceTo(L))){if(F<=1)(F===1?p.start:p.end).copy(u),D&&(R=F);else if(F>=2){(R===1?p.start:p.end).copy(u),F=2;break}if(F++,F===2&&R===-1)break}}return F}return function(T,p=null,m=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(c.copy(T),c.update(),T=c);const F=this.plane,R=T.plane;if(Math.abs(F.normal.dot(R.normal))>1-1e-10){const S=this.satBounds,N=this.satAxes;t[0]=T.a,t[1]=T.b,t[2]=T.c;for(let P=0;P<4;P++){const v=S[P],G=N[P];if(e.setFromPoints(G,t),v.isSeparated(e))return!1}const L=T.satBounds,D=T.satAxes;i[0]=this.a,i[1]=this.b,i[2]=this.c;for(let P=0;P<4;P++){const v=L[P],G=D[P];if(e.setFromPoints(G,i),v.isSeparated(e))return!1}for(let P=0;P<4;P++){const v=N[P];for(let G=0;G<4;G++){const O=D[G];if(n.crossVectors(v,O),e.setFromPoints(n,i),s.setFromPoints(n,t),e.isSeparated(s))return!1}}return p&&(m||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}else{const S=d(this,R,f);if(S===1&&T.containsPoint(f.end))return p&&(p.start.copy(f.end),p.end.copy(f.end)),!0;if(S!==2)return!1;const N=d(T,F,I);if(N===1&&this.containsPoint(I.end))return p&&(p.start.copy(I.end),p.end.copy(I.end)),!0;if(N!==2)return!1;if(f.delta(o),I.delta(a),o.dot(a)<0){let w=I.start;I.start=I.end,I.end=w}const L=f.start.dot(o),D=f.end.dot(o),P=I.start.dot(o),v=I.end.dot(o),G=D<P,O=L<v;return L!==v&&P!==D&&G===O?!1:(p&&(l.subVectors(f.start,I.start),l.dot(o)>0?p.start.copy(f.start):p.start.copy(I.start),l.subVectors(f.end,I.end),l.dot(o)<0?p.end.copy(f.end):p.end.copy(I.end)),!0)}}}();se.prototype.distanceToPoint=function(){const c=new y.Vector3;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();se.prototype.distanceToTriangle=function(){const c=new y.Vector3,i=new y.Vector3,t=["a","b","c"],e=new y.Line3,s=new y.Line3;return function(r,o=null,a=null){const l=o||a?e:null;if(this.intersectsTriangle(r,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let h=1/0;for(let f=0;f<3;f++){let I;const u=t[f],d=r[u];this.closestPointToPoint(d,c),I=d.distanceToSquared(c),I<h&&(h=I,o&&o.copy(c),a&&a.copy(d));const E=this[u];r.closestPointToPoint(E,c),I=E.distanceToSquared(c),I<h&&(h=I,o&&o.copy(E),a&&a.copy(c))}for(let f=0;f<3;f++){const I=t[f],u=t[(f+1)%3];e.set(this[I],this[u]);for(let d=0;d<3;d++){const E=t[d],T=t[(d+1)%3];s.set(r[E],r[T]),vn(e,s,c,i);const p=c.distanceToSquared(i);p<h&&(h=p,o&&o.copy(c),a&&a.copy(i))}}return Math.sqrt(h)}}();class Ut{constructor(i,t,e){this.isOrientedBox=!0,this.min=new y.Vector3,this.max=new y.Vector3,this.matrix=new y.Matrix4,this.invMatrix=new y.Matrix4,this.points=new Array(8).fill().map(()=>new y.Vector3),this.satAxes=new Array(3).fill().map(()=>new y.Vector3),this.satBounds=new Array(3).fill().map(()=>new pe),this.alignedSatBounds=new Array(3).fill().map(()=>new pe),this.needsUpdate=!1,i&&this.min.copy(i),t&&this.max.copy(t),e&&this.matrix.copy(e)}set(i,t,e){this.min.copy(i),this.max.copy(t),this.matrix.copy(e),this.needsUpdate=!0}copy(i){this.min.copy(i.min),this.max.copy(i.max),this.matrix.copy(i.matrix),this.needsUpdate=!0}}Ut.prototype.update=function(){return function(){const i=this.matrix,t=this.min,e=this.max,s=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let f=0;f<=1;f++){const I=1*l|2*h|4*f,u=s[I];u.x=l?e.x:t.x,u.y=h?e.y:t.y,u.z=f?e.z:t.z,u.applyMatrix4(i)}const n=this.satBounds,r=this.satAxes,o=s[0];for(let l=0;l<3;l++){const h=r[l],f=n[l],I=1<<l,u=s[I];h.subVectors(o,u),f.setFromPoints(h,s)}const a=this.alignedSatBounds;a[0].setFromPointsField(s,"x"),a[1].setFromPointsField(s,"y"),a[2].setFromPointsField(s,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}();Ut.prototype.intersectsBox=function(){const c=new pe;return function(t){this.needsUpdate&&this.update();const e=t.min,s=t.max,n=this.satBounds,r=this.satAxes,o=this.alignedSatBounds;if(c.min=e.x,c.max=s.x,o[0].isSeparated(c)||(c.min=e.y,c.max=s.y,o[1].isSeparated(c))||(c.min=e.z,c.max=s.z,o[2].isSeparated(c)))return!1;for(let a=0;a<3;a++){const l=r[a],h=n[a];if(c.setFromBox(l,t),h.isSeparated(c))return!1}return!0}}();Ut.prototype.intersectsTriangle=function(){const c=new se,i=new Array(3),t=new pe,e=new pe,s=new y.Vector3;return function(r){this.needsUpdate&&this.update(),r.isExtendedTriangle?r.needsUpdate&&r.update():(c.copy(r),c.update(),r=c);const o=this.satBounds,a=this.satAxes;i[0]=r.a,i[1]=r.b,i[2]=r.c;for(let I=0;I<3;I++){const u=o[I],d=a[I];if(t.setFromPoints(d,i),u.isSeparated(t))return!1}const l=r.satBounds,h=r.satAxes,f=this.points;for(let I=0;I<3;I++){const u=l[I],d=h[I];if(t.setFromPoints(d,f),u.isSeparated(t))return!1}for(let I=0;I<3;I++){const u=a[I];for(let d=0;d<4;d++){const E=h[d];if(s.crossVectors(u,E),t.setFromPoints(s,i),e.setFromPoints(s,f),t.isSeparated(e))return!1}}return!0}}();Ut.prototype.closestPointToPoint=function(){return function(i,t){return this.needsUpdate&&this.update(),t.copy(i).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t}}();Ut.prototype.distanceToPoint=function(){const c=new y.Vector3;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();Ut.prototype.distanceToBox=function(){const c=["x","y","z"],i=new Array(12).fill().map(()=>new y.Line3),t=new Array(12).fill().map(()=>new y.Line3),e=new y.Vector3,s=new y.Vector3;return function(r,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(a||l)&&(r.getCenter(s),this.closestPointToPoint(s,e),r.closestPointToPoint(e,s),a&&a.copy(e),l&&l.copy(s)),0;const h=o*o,f=r.min,I=r.max,u=this.points;let d=1/0;for(let T=0;T<8;T++){const p=u[T];s.copy(p).clamp(f,I);const m=p.distanceToSquared(s);if(m<d&&(d=m,a&&a.copy(p),l&&l.copy(s),m<h))return Math.sqrt(m)}let E=0;for(let T=0;T<3;T++)for(let p=0;p<=1;p++)for(let m=0;m<=1;m++){const F=(T+1)%3,R=(T+2)%3,S=p<<F|m<<R,N=1<<T|p<<F|m<<R,L=u[S],D=u[N];i[E].set(L,D);const v=c[T],G=c[F],O=c[R],w=t[E],g=w.start,U=w.end;g[v]=f[v],g[G]=p?f[G]:I[G],g[O]=m?f[O]:I[G],U[v]=I[v],U[G]=p?f[G]:I[G],U[O]=m?f[O]:I[G],E++}for(let T=0;T<=1;T++)for(let p=0;p<=1;p++)for(let m=0;m<=1;m++){s.x=T?I.x:f.x,s.y=p?I.y:f.y,s.z=m?I.z:f.z,this.closestPointToPoint(s,e);const F=s.distanceToSquared(e);if(F<d&&(d=F,a&&a.copy(e),l&&l.copy(s),F<h))return Math.sqrt(F)}for(let T=0;T<12;T++){const p=i[T];for(let m=0;m<12;m++){const F=t[m];vn(p,F,e,s);const R=e.distanceToSquared(s);if(R<d&&(d=R,a&&a.copy(e),l&&l.copy(s),R<h))return Math.sqrt(R)}}return Math.sqrt(d)}}();class Un{constructor(i){this._getNewPrimitive=i,this._primitives=[]}getPrimitive(){const i=this._primitives;return i.length===0?this._getNewPrimitive():i.pop()}releasePrimitive(i){this._primitives.push(i)}}class ca extends Un{constructor(){super(()=>new se)}}const Ht=new ca;function Vt(c,i){return i[c+15]===65535}function Yt(c,i){return i[c+6]}function Wt(c,i){return i[c+14]}function Xt(c){return c+8}function $t(c,i){return i[c+6]}function Vr(c,i){return i[c+7]}class la{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const i=[];let t=null;this.setBuffer=e=>{t&&i.push(t),t=e,this.float32Array=new Float32Array(e),this.uint16Array=new Uint16Array(e),this.uint32Array=new Uint32Array(e)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,i.length!==0&&this.setBuffer(i.pop())}}}const At=new la;let Se,qe;const Ue=[],Yi=new Un(()=>new y.Box3);function ha(c,i,t,e,s,n){Se=Yi.getPrimitive(),qe=Yi.getPrimitive(),Ue.push(Se,qe),At.setBuffer(c._roots[i]);const r=In(0,c.geometry,t,e,s,n);At.clearBuffer(),Yi.releasePrimitive(Se),Yi.releasePrimitive(qe),Ue.pop(),Ue.pop();const o=Ue.length;return o>0&&(qe=Ue[o-1],Se=Ue[o-2]),r}function In(c,i,t,e,s=null,n=0,r=0){const{float32Array:o,uint16Array:a,uint32Array:l}=At;let h=c*2;if(Vt(h,a)){const I=Yt(c,l),u=Wt(h,a);return Ot(c,o,Se),e(I,u,!1,r,n+c,Se)}else{let v=function(O){const{uint16Array:w,uint32Array:g}=At;let U=O*2;for(;!Vt(U,w);)O=Xt(O),U=O*2;return Yt(O,g)},G=function(O){const{uint16Array:w,uint32Array:g}=At;let U=O*2;for(;!Vt(U,w);)O=$t(O,g),U=O*2;return Yt(O,g)+Wt(U,w)};const I=Xt(c),u=$t(c,l);let d=I,E=u,T,p,m,F;if(s&&(m=Se,F=qe,Ot(d,o,m),Ot(E,o,F),T=s(m),p=s(F),p<T)){d=u,E=I;const O=T;T=p,p=O,m=F}m||(m=Se,Ot(d,o,m));const R=Vt(d*2,a),S=t(m,R,T,r+1,n+d);let N;if(S===Xn){const O=v(d),g=G(d)-O;N=e(O,g,!0,r+1,n+d,m)}else N=S&&In(d,i,t,e,s,n,r+1);if(N)return!0;F=qe,Ot(E,o,F);const L=Vt(E*2,a),D=t(F,L,p,r+1,n+E);let P;if(D===Xn){const O=v(E),g=G(E)-O;P=e(O,g,!0,r+1,n+E,F)}else P=D&&In(E,i,t,e,s,n,r+1);return!!P}}const oi=new y.Vector3,js=new y.Vector3;function ua(c,i,t={},e=0,s=1/0){const n=e*e,r=s*s;let o=1/0,a=null;if(c.shapecast({boundsTraverseOrder:h=>(oi.copy(i).clamp(h.min,h.max),oi.distanceToSquared(i)),intersectsBounds:(h,f,I)=>I<o&&I<r,intersectsTriangle:(h,f)=>{h.closestPointToPoint(i,oi);const I=i.distanceToSquared(oi);return I<o&&(js.copy(oi),o=I,a=f),I<n}}),o===1/0)return null;const l=Math.sqrt(o);return t.point?t.point.copy(js):t.point=js.clone(),t.distance=l,t.faceIndex=a,t}const xe=new y.Vector3,Be=new y.Vector3,Ve=new y.Vector3,Gi=new y.Vector2,zi=new y.Vector2,ki=new y.Vector2,Qn=new y.Vector3,Kn=new y.Vector3,Jn=new y.Vector3,Hi=new y.Vector3;function fa(c,i,t,e,s,n){let r;return n===y.BackSide?r=c.intersectTriangle(e,t,i,!0,s):r=c.intersectTriangle(i,t,e,n!==y.DoubleSide,s),r===null?null:{distance:c.origin.distanceTo(s),point:s.clone()}}function Ia(c,i,t,e,s,n,r,o,a){xe.fromBufferAttribute(i,n),Be.fromBufferAttribute(i,r),Ve.fromBufferAttribute(i,o);const l=fa(c,xe,Be,Ve,Hi,a);if(l){e&&(Gi.fromBufferAttribute(e,n),zi.fromBufferAttribute(e,r),ki.fromBufferAttribute(e,o),l.uv=y.Triangle.getInterpolation(Hi,xe,Be,Ve,Gi,zi,ki,new y.Vector2)),s&&(Gi.fromBufferAttribute(s,n),zi.fromBufferAttribute(s,r),ki.fromBufferAttribute(s,o),l.uv1=y.Triangle.getInterpolation(Hi,xe,Be,Ve,Gi,zi,ki,new y.Vector2)),t&&(Qn.fromBufferAttribute(t,n),Kn.fromBufferAttribute(t,r),Jn.fromBufferAttribute(t,o),l.normal=y.Triangle.getInterpolation(Hi,xe,Be,Ve,Qn,Kn,Jn,new y.Vector3),l.normal.dot(c.direction)>0&&l.normal.multiplyScalar(-1));const h={a:n,b:r,c:o,normal:new y.Vector3,materialIndex:0};y.Triangle.getNormal(xe,Be,Ve,h.normal),l.face=h,l.faceIndex=n}return l}function Bs(c,i,t,e,s){const n=e*3;let r=n+0,o=n+1,a=n+2;const l=c.index;c.index&&(r=l.getX(r),o=l.getX(o),a=l.getX(a));const{position:h,normal:f,uv:I,uv1:u}=c.attributes,d=Ia(t,h,f,I,u,r,o,a,i);return d?(d.faceIndex=e,s&&s.push(d),d):null}function _t(c,i,t,e){const s=c.a,n=c.b,r=c.c;let o=i,a=i+1,l=i+2;t&&(o=t.getX(o),a=t.getX(a),l=t.getX(l)),s.x=e.getX(o),s.y=e.getY(o),s.z=e.getZ(o),n.x=e.getX(a),n.y=e.getY(a),n.z=e.getZ(a),r.x=e.getX(l),r.y=e.getY(l),r.z=e.getZ(l)}function da(c,i,t,e,s,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=e,l=e+s;a<l;a++)Bs(r,i,t,a,n)}function Ea(c,i,t,e,s){const{geometry:n,_indirectBuffer:r}=c;let o=1/0,a=null;for(let l=e,h=e+s;l<h;l++){let f;f=Bs(n,i,t,l),f&&f.distance<o&&(a=f,o=f.distance)}return a}function pa(c,i,t,e,s,n,r){const{geometry:o}=t,{index:a}=o,l=o.attributes.position;for(let h=c,f=i+c;h<f;h++){let I;if(I=h,_t(r,I*3,a,l),r.needsUpdate=!0,e(r,I,s,n))return!0}return!1}function Ca(c,i=null){i&&Array.isArray(i)&&(i=new Set(i));const t=c.geometry,e=t.index?t.index.array:null,s=t.attributes.position;let n,r,o,a,l=0;const h=c._roots;for(let I=0,u=h.length;I<u;I++)n=h[I],r=new Uint32Array(n),o=new Uint16Array(n),a=new Float32Array(n),f(0,l),l+=n.byteLength;function f(I,u,d=!1){const E=I*2;if(o[E+15]===xs){const p=r[I+6],m=o[E+14];let F=1/0,R=1/0,S=1/0,N=-1/0,L=-1/0,D=-1/0;for(let P=3*p,v=3*(p+m);P<v;P++){let G=e[P];const O=s.getX(G),w=s.getY(G),g=s.getZ(G);O<F&&(F=O),O>N&&(N=O),w<R&&(R=w),w>L&&(L=w),g<S&&(S=g),g>D&&(D=g)}return a[I+0]!==F||a[I+1]!==R||a[I+2]!==S||a[I+3]!==N||a[I+4]!==L||a[I+5]!==D?(a[I+0]=F,a[I+1]=R,a[I+2]=S,a[I+3]=N,a[I+4]=L,a[I+5]=D,!0):!1}else{const p=I+8,m=r[I+6],F=p+u,R=m+u;let S=d,N=!1,L=!1;i?S||(N=i.has(F),L=i.has(R),S=!N&&!L):(N=!0,L=!0);const D=S||N,P=S||L;let v=!1;D&&(v=f(p,u,S));let G=!1;P&&(G=f(m,u,S));const O=v||G;if(O)for(let w=0;w<3;w++){const g=p+w,U=m+w,Q=a[g],z=a[g+3],et=a[U],X=a[U+3];a[I+w]=Q<et?Q:et,a[I+w+3]=z>X?z:X}return O}}}const tr=new y.Box3;function Oe(c,i,t,e){return Ot(c,i,tr),t.intersectBox(tr,e)}function Ta(c,i,t,e,s,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=e,l=e+s;a<l;a++){let h=o?o[a]:a;Bs(r,i,t,h,n)}}function ma(c,i,t,e,s){const{geometry:n,_indirectBuffer:r}=c;let o=1/0,a=null;for(let l=e,h=e+s;l<h;l++){let f;f=Bs(n,i,t,r?r[l]:l),f&&f.distance<o&&(a=f,o=f.distance)}return a}function Ra(c,i,t,e,s,n,r){const{geometry:o}=t,{index:a}=o,l=o.attributes.position;for(let h=c,f=i+c;h<f;h++){let I;if(I=t.resolveTriangleIndex(h),_t(r,I*3,a,l),r.needsUpdate=!0,e(r,I,s,n))return!0}return!1}const er=new y.Vector3;function ga(c,i,t,e,s){At.setBuffer(c._roots[i]),dn(0,c,t,e,s),At.clearBuffer()}function dn(c,i,t,e,s){const{float32Array:n,uint16Array:r,uint32Array:o}=At,a=c*2;if(Vt(a,r)){const h=Yt(c,o),f=Wt(a,r);da(i,t,e,h,f,s)}else{const h=Xt(c);Oe(h,n,e,er)&&dn(h,i,t,e,s);const f=$t(c,o);Oe(f,n,e,er)&&dn(f,i,t,e,s)}}const ir=new y.Vector3,Aa=["x","y","z"];function Fa(c,i,t,e){At.setBuffer(c._roots[i]);const s=En(0,c,t,e);return At.clearBuffer(),s}function En(c,i,t,e){const{float32Array:s,uint16Array:n,uint32Array:r}=At;let o=c*2;if(Vt(o,n)){const l=Yt(c,r),h=Wt(o,n);return Ea(i,t,e,l,h)}else{const l=Vr(c,r),h=Aa[l],I=e.direction[h]>=0;let u,d;I?(u=Xt(c),d=$t(c,r)):(u=$t(c,r),d=Xt(c));const T=Oe(u,s,e,ir)?En(u,i,t,e):null;if(T){const F=T.point[h];if(I?F<=s[d+l]:F>=s[d+l+3])return T}const m=Oe(d,s,e,ir)?En(d,i,t,e):null;return T&&m?T.distance<=m.distance?T:m:T||m||null}}const Wi=new y.Box3,Ye=new se,Ge=new se,ai=new y.Matrix4,sr=new Ut,Xi=new Ut;function Sa(c,i,t,e){At.setBuffer(c._roots[i]);const s=pn(0,c,t,e);return At.clearBuffer(),s}function pn(c,i,t,e,s=null){const{float32Array:n,uint16Array:r,uint32Array:o}=At;let a=c*2;if(s===null&&(t.boundingBox||t.computeBoundingBox(),sr.set(t.boundingBox.min,t.boundingBox.max,e),s=sr),Vt(a,r)){const h=i.geometry,f=h.index,I=h.attributes.position,u=t.index,d=t.attributes.position,E=Yt(c,o),T=Wt(a,r);if(ai.copy(e).invert(),t.boundsTree)return Ot(c,n,Xi),Xi.matrix.copy(ai),Xi.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>Xi.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(e),m.b.applyMatrix4(e),m.c.applyMatrix4(e),m.needsUpdate=!0;for(let F=E*3,R=(T+E)*3;F<R;F+=3)if(_t(Ge,F,f,I),Ge.needsUpdate=!0,m.intersectsTriangle(Ge))return!0;return!1}});for(let p=E*3,m=(T+E)*3;p<m;p+=3){_t(Ye,p,f,I),Ye.a.applyMatrix4(ai),Ye.b.applyMatrix4(ai),Ye.c.applyMatrix4(ai),Ye.needsUpdate=!0;for(let F=0,R=u.count;F<R;F+=3)if(_t(Ge,F,u,d),Ge.needsUpdate=!0,Ye.intersectsTriangle(Ge))return!0}}else{const h=c+8,f=o[c+6];return Ot(h,n,Wi),!!(s.intersectsBox(Wi)&&pn(h,i,t,e,s)||(Ot(f,n,Wi),s.intersectsBox(Wi)&&pn(f,i,t,e,s)))}}const $i=new y.Matrix4,qs=new Ut,ci=new Ut,Oa=new y.Vector3,Na=new y.Vector3,ya=new y.Vector3,La=new y.Vector3;function Pa(c,i,t,e={},s={},n=0,r=1/0){i.boundingBox||i.computeBoundingBox(),qs.set(i.boundingBox.min,i.boundingBox.max,t),qs.needsUpdate=!0;const o=c.geometry,a=o.attributes.position,l=o.index,h=i.attributes.position,f=i.index,I=Ht.getPrimitive(),u=Ht.getPrimitive();let d=Oa,E=Na,T=null,p=null;s&&(T=ya,p=La);let m=1/0,F=null,R=null;return $i.copy(t).invert(),ci.matrix.copy($i),c.shapecast({boundsTraverseOrder:S=>qs.distanceToBox(S),intersectsBounds:(S,N,L)=>L<m&&L<r?(N&&(ci.min.copy(S.min),ci.max.copy(S.max),ci.needsUpdate=!0),!0):!1,intersectsRange:(S,N)=>{if(i.boundsTree)return i.boundsTree.shapecast({boundsTraverseOrder:D=>ci.distanceToBox(D),intersectsBounds:(D,P,v)=>v<m&&v<r,intersectsRange:(D,P)=>{for(let v=D,G=D+P;v<G;v++){_t(u,3*v,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let O=S,w=S+N;O<w;O++){_t(I,3*O,l,a),I.needsUpdate=!0;const g=I.distanceToTriangle(u,d,T);if(g<m&&(E.copy(d),p&&p.copy(T),m=g,F=O,R=v),g<n)return!0}}}});{const L=ei(i);for(let D=0,P=L;D<P;D++){_t(u,3*D,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let v=S,G=S+N;v<G;v++){_t(I,3*v,l,a),I.needsUpdate=!0;const O=I.distanceToTriangle(u,d,T);if(O<m&&(E.copy(d),p&&p.copy(T),m=O,F=v,R=D),O<n)return!0}}}}}),Ht.releasePrimitive(I),Ht.releasePrimitive(u),m===1/0?null:(e.point?e.point.copy(E):e.point=E.clone(),e.distance=m,e.faceIndex=F,s&&(s.point?s.point.copy(p):s.point=p.clone(),s.point.applyMatrix4($i),E.applyMatrix4($i),s.distance=E.sub(s.point).length(),s.faceIndex=R),e)}function _a(c,i=null){i&&Array.isArray(i)&&(i=new Set(i));const t=c.geometry,e=t.index?t.index.array:null,s=t.attributes.position;let n,r,o,a,l=0;const h=c._roots;for(let I=0,u=h.length;I<u;I++)n=h[I],r=new Uint32Array(n),o=new Uint16Array(n),a=new Float32Array(n),f(0,l),l+=n.byteLength;function f(I,u,d=!1){const E=I*2;if(o[E+15]===xs){const p=r[I+6],m=o[E+14];let F=1/0,R=1/0,S=1/0,N=-1/0,L=-1/0,D=-1/0;for(let P=p,v=p+m;P<v;P++){const G=3*c.resolveTriangleIndex(P);for(let O=0;O<3;O++){let w=G+O;w=e?e[w]:w;const g=s.getX(w),U=s.getY(w),Q=s.getZ(w);g<F&&(F=g),g>N&&(N=g),U<R&&(R=U),U>L&&(L=U),Q<S&&(S=Q),Q>D&&(D=Q)}}return a[I+0]!==F||a[I+1]!==R||a[I+2]!==S||a[I+3]!==N||a[I+4]!==L||a[I+5]!==D?(a[I+0]=F,a[I+1]=R,a[I+2]=S,a[I+3]=N,a[I+4]=L,a[I+5]=D,!0):!1}else{const p=I+8,m=r[I+6],F=p+u,R=m+u;let S=d,N=!1,L=!1;i?S||(N=i.has(F),L=i.has(R),S=!N&&!L):(N=!0,L=!0);const D=S||N,P=S||L;let v=!1;D&&(v=f(p,u,S));let G=!1;P&&(G=f(m,u,S));const O=v||G;if(O)for(let w=0;w<3;w++){const g=p+w,U=m+w,Q=a[g],z=a[g+3],et=a[U],X=a[U+3];a[I+w]=Q<et?Q:et,a[I+w+3]=z>X?z:X}return O}}}const nr=new y.Vector3;function Ma(c,i,t,e,s){At.setBuffer(c._roots[i]),Cn(0,c,t,e,s),At.clearBuffer()}function Cn(c,i,t,e,s){const{float32Array:n,uint16Array:r,uint32Array:o}=At,a=c*2;if(Vt(a,r)){const h=Yt(c,o),f=Wt(a,r);Ta(i,t,e,h,f,s)}else{const h=Xt(c);Oe(h,n,e,nr)&&Cn(h,i,t,e,s);const f=$t(c,o);Oe(f,n,e,nr)&&Cn(f,i,t,e,s)}}const rr=new y.Vector3,wa=["x","y","z"];function Da(c,i,t,e){At.setBuffer(c._roots[i]);const s=Tn(0,c,t,e);return At.clearBuffer(),s}function Tn(c,i,t,e){const{float32Array:s,uint16Array:n,uint32Array:r}=At;let o=c*2;if(Vt(o,n)){const l=Yt(c,r),h=Wt(o,n);return ma(i,t,e,l,h)}else{const l=Vr(c,r),h=wa[l],I=e.direction[h]>=0;let u,d;I?(u=Xt(c),d=$t(c,r)):(u=$t(c,r),d=Xt(c));const T=Oe(u,s,e,rr)?Tn(u,i,t,e):null;if(T){const F=T.point[h];if(I?F<=s[d+l]:F>=s[d+l+3])return T}const m=Oe(d,s,e,rr)?Tn(d,i,t,e):null;return T&&m?T.distance<=m.distance?T:m:T||m||null}}const Zi=new y.Box3,ze=new se,ke=new se,li=new y.Matrix4,or=new Ut,ji=new Ut;function ba(c,i,t,e){At.setBuffer(c._roots[i]);const s=mn(0,c,t,e);return At.clearBuffer(),s}function mn(c,i,t,e,s=null){const{float32Array:n,uint16Array:r,uint32Array:o}=At;let a=c*2;if(s===null&&(t.boundingBox||t.computeBoundingBox(),or.set(t.boundingBox.min,t.boundingBox.max,e),s=or),Vt(a,r)){const h=i.geometry,f=h.index,I=h.attributes.position,u=t.index,d=t.attributes.position,E=Yt(c,o),T=Wt(a,r);if(li.copy(e).invert(),t.boundsTree)return Ot(c,n,ji),ji.matrix.copy(li),ji.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>ji.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(e),m.b.applyMatrix4(e),m.c.applyMatrix4(e),m.needsUpdate=!0;for(let F=E,R=T+E;F<R;F++)if(_t(ke,3*i.resolveTriangleIndex(F),f,I),ke.needsUpdate=!0,m.intersectsTriangle(ke))return!0;return!1}});for(let p=E,m=T+E;p<m;p++){const F=i.resolveTriangleIndex(p);_t(ze,3*F,f,I),ze.a.applyMatrix4(li),ze.b.applyMatrix4(li),ze.c.applyMatrix4(li),ze.needsUpdate=!0;for(let R=0,S=u.count;R<S;R+=3)if(_t(ke,R,u,d),ke.needsUpdate=!0,ze.intersectsTriangle(ke))return!0}}else{const h=c+8,f=o[c+6];return Ot(h,n,Zi),!!(s.intersectsBox(Zi)&&mn(h,i,t,e,s)||(Ot(f,n,Zi),s.intersectsBox(Zi)&&mn(f,i,t,e,s)))}}const qi=new y.Matrix4,Qs=new Ut,hi=new Ut,va=new y.Vector3,Ua=new y.Vector3,xa=new y.Vector3,Ba=new y.Vector3;function Va(c,i,t,e={},s={},n=0,r=1/0){i.boundingBox||i.computeBoundingBox(),Qs.set(i.boundingBox.min,i.boundingBox.max,t),Qs.needsUpdate=!0;const o=c.geometry,a=o.attributes.position,l=o.index,h=i.attributes.position,f=i.index,I=Ht.getPrimitive(),u=Ht.getPrimitive();let d=va,E=Ua,T=null,p=null;s&&(T=xa,p=Ba);let m=1/0,F=null,R=null;return qi.copy(t).invert(),hi.matrix.copy(qi),c.shapecast({boundsTraverseOrder:S=>Qs.distanceToBox(S),intersectsBounds:(S,N,L)=>L<m&&L<r?(N&&(hi.min.copy(S.min),hi.max.copy(S.max),hi.needsUpdate=!0),!0):!1,intersectsRange:(S,N)=>{if(i.boundsTree){const L=i.boundsTree;return L.shapecast({boundsTraverseOrder:D=>hi.distanceToBox(D),intersectsBounds:(D,P,v)=>v<m&&v<r,intersectsRange:(D,P)=>{for(let v=D,G=D+P;v<G;v++){const O=L.resolveTriangleIndex(v);_t(u,3*O,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let w=S,g=S+N;w<g;w++){const U=c.resolveTriangleIndex(w);_t(I,3*U,l,a),I.needsUpdate=!0;const Q=I.distanceToTriangle(u,d,T);if(Q<m&&(E.copy(d),p&&p.copy(T),m=Q,F=w,R=v),Q<n)return!0}}}})}else{const L=ei(i);for(let D=0,P=L;D<P;D++){_t(u,3*D,f,h),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let v=S,G=S+N;v<G;v++){const O=c.resolveTriangleIndex(v);_t(I,3*O,l,a),I.needsUpdate=!0;const w=I.distanceToTriangle(u,d,T);if(w<m&&(E.copy(d),p&&p.copy(T),m=w,F=v,R=D),w<n)return!0}}}}}),Ht.releasePrimitive(I),Ht.releasePrimitive(u),m===1/0?null:(e.point?e.point.copy(E):e.point=E.clone(),e.distance=m,e.faceIndex=F,s&&(s.point?s.point.copy(p):s.point=p.clone(),s.point.applyMatrix4(qi),E.applyMatrix4(qi),s.distance=E.sub(s.point).length(),s.faceIndex=R),e)}function Ya(){return typeof SharedArrayBuffer<"u"}const Ai=new At.constructor,us=new At.constructor,ge=new Un(()=>new y.Box3),He=new y.Box3,We=new y.Box3,Ks=new y.Box3,Js=new y.Box3;let tn=!1;function Ga(c,i,t,e){if(tn)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");tn=!0;const s=c._roots,n=i._roots;let r,o=0,a=0;const l=new y.Matrix4().copy(t).invert();for(let h=0,f=s.length;h<f;h++){Ai.setBuffer(s[h]),a=0;const I=ge.getPrimitive();Ot(0,Ai.float32Array,I),I.applyMatrix4(l);for(let u=0,d=n.length;u<d&&(us.setBuffer(n[h]),r=Jt(0,0,t,l,e,o,a,0,0,I),us.clearBuffer(),a+=n[u].length,!r);u++);if(ge.releasePrimitive(I),Ai.clearBuffer(),o+=s[h].length,r)break}return tn=!1,r}function Jt(c,i,t,e,s,n=0,r=0,o=0,a=0,l=null,h=!1){let f,I;h?(f=us,I=Ai):(f=Ai,I=us);const u=f.float32Array,d=f.uint32Array,E=f.uint16Array,T=I.float32Array,p=I.uint32Array,m=I.uint16Array,F=c*2,R=i*2,S=Vt(F,E),N=Vt(R,m);let L=!1;if(N&&S)h?L=s(Yt(i,p),Wt(i*2,m),Yt(c,d),Wt(c*2,E),a,r+i,o,n+c):L=s(Yt(c,d),Wt(c*2,E),Yt(i,p),Wt(i*2,m),o,n+c,a,r+i);else if(N){const D=ge.getPrimitive();Ot(i,T,D),D.applyMatrix4(t);const P=Xt(c),v=$t(c,d);Ot(P,u,He),Ot(v,u,We);const G=D.intersectsBox(He),O=D.intersectsBox(We);L=G&&Jt(i,P,e,t,s,r,n,a,o+1,D,!h)||O&&Jt(i,v,e,t,s,r,n,a,o+1,D,!h),ge.releasePrimitive(D)}else{const D=Xt(i),P=$t(i,p);Ot(D,T,Ks),Ot(P,T,Js);const v=l.intersectsBox(Ks),G=l.intersectsBox(Js);if(v&&G)L=Jt(c,D,t,e,s,n,r,o,a+1,l,h)||Jt(c,P,t,e,s,n,r,o,a+1,l,h);else if(v)if(S)L=Jt(c,D,t,e,s,n,r,o,a+1,l,h);else{const O=ge.getPrimitive();O.copy(Ks).applyMatrix4(t);const w=Xt(c),g=$t(c,d);Ot(w,u,He),Ot(g,u,We);const U=O.intersectsBox(He),Q=O.intersectsBox(We);L=U&&Jt(D,w,e,t,s,r,n,a,o+1,O,!h)||Q&&Jt(D,g,e,t,s,r,n,a,o+1,O,!h),ge.releasePrimitive(O)}else if(G)if(S)L=Jt(c,P,t,e,s,n,r,o,a+1,l,h);else{const O=ge.getPrimitive();O.copy(Js).applyMatrix4(t);const w=Xt(c),g=$t(c,d);Ot(w,u,He),Ot(g,u,We);const U=O.intersectsBox(He),Q=O.intersectsBox(We);L=U&&Jt(P,w,e,t,s,r,n,a,o+1,O,!h)||Q&&Jt(P,g,e,t,s,r,n,a,o+1,O,!h),ge.releasePrimitive(O)}}return L}const Qi=new Ut,ar=new y.Box3;class xn{static serialize(i,t={}){t={cloneBuffers:!0,...t};const e=i.geometry,s=i._roots,n=i._indirectBuffer,r=e.getIndex();let o;return t.cloneBuffers?o={roots:s.map(a=>a.slice()),index:r.array.slice(),indirectBuffer:n?n.slice():null}:o={roots:s,index:r.array,indirectBuffer:n},o}static deserialize(i,t,e={}){e={setIndex:!0,indirect:!!i.indirectBuffer,...e};const{index:s,roots:n,indirectBuffer:r}=i,o=new xn(t,{...e,[Xs]:!0});if(o._roots=n,o._indirectBuffer=r||null,e.setIndex){const a=t.getIndex();if(a===null){const l=new y.BufferAttribute(i.index,1,!1);t.setIndex(l)}else a.array!==s&&(a.array.set(s),a.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(i,t={}){if(i.isBufferGeometry){if(i.index&&i.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Ur,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Xs]:!1},t),t.useSharedArrayBuffer&&!Ya())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=i,this._roots=null,this._indirectBuffer=null,t[Xs]||(na(this,t),!i.boundingBox&&t.setBoundingBox&&(i.boundingBox=this.getBoundingBox(new y.Box3)));const{_indirectBuffer:e}=this;this.resolveTriangleIndex=t.indirect?s=>e[s]:s=>s}refit(i=null){return(this.indirect?_a:Ca)(this,i)}traverse(i,t=0){const e=this._roots[t],s=new Uint32Array(e),n=new Uint16Array(e);r(0);function r(o,a=0){const l=o*2,h=n[l+15]===xs;if(h){const f=s[o+6],I=n[l+14];i(a,h,new Float32Array(e,o*4,6),f,I)}else{const f=o+cs/4,I=s[o+6],u=s[o+7];i(a,h,new Float32Array(e,o*4,6),u)||(r(f,a+1),r(I,a+1))}}}raycast(i,t=y.FrontSide){const e=this._roots,s=this.geometry,n=[],r=t.isMaterial,o=Array.isArray(t),a=s.groups,l=r?t.side:t,h=this.indirect?Ma:ga;for(let f=0,I=e.length;f<I;f++){const u=o?t[a[f].materialIndex].side:l,d=n.length;if(h(this,f,u,i,n),o){const E=a[f].materialIndex;for(let T=d,p=n.length;T<p;T++)n[T].face.materialIndex=E}}return n}raycastFirst(i,t=y.FrontSide){const e=this._roots,s=this.geometry,n=t.isMaterial,r=Array.isArray(t);let o=null;const a=s.groups,l=n?t.side:t,h=this.indirect?Da:Fa;for(let f=0,I=e.length;f<I;f++){const u=r?t[a[f].materialIndex].side:l,d=h(this,f,u,i);d!=null&&(o==null||d.distance<o.distance)&&(o=d,r&&(d.face.materialIndex=a[f].materialIndex))}return o}intersectsGeometry(i,t){let e=!1;const s=this._roots,n=this.indirect?ba:Sa;for(let r=0,o=s.length;r<o&&(e=n(this,r,i,t),!e);r++);return e}shapecast(i){const t=Ht.getPrimitive(),e=this.indirect?Ra:pa;let{boundsTraverseOrder:s,intersectsBounds:n,intersectsRange:r,intersectsTriangle:o}=i;if(r&&o){const f=r;r=(I,u,d,E,T)=>f(I,u,d,E,T)?!0:e(I,u,this,o,d,E,t)}else r||(o?r=(f,I,u,d)=>e(f,I,this,o,u,d,t):r=(f,I,u)=>u);let a=!1,l=0;const h=this._roots;for(let f=0,I=h.length;f<I;f++){const u=h[f];if(a=ha(this,f,n,r,s,l),a)break;l+=u.byteLength}return Ht.releasePrimitive(t),a}bvhcast(i,t,e){let{intersectsRanges:s,intersectsTriangles:n}=e;const r=Ht.getPrimitive(),o=this.geometry.index,a=this.geometry.attributes.position,l=this.indirect?d=>{const E=this.resolveTriangleIndex(d);_t(r,E*3,o,a)}:d=>{_t(r,d*3,o,a)},h=Ht.getPrimitive(),f=i.geometry.index,I=i.geometry.attributes.position,u=i.indirect?d=>{const E=i.resolveTriangleIndex(d);_t(h,E*3,f,I)}:d=>{_t(h,d*3,f,I)};if(n){const d=(E,T,p,m,F,R,S,N)=>{for(let L=p,D=p+m;L<D;L++){u(L),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let P=E,v=E+T;P<v;P++)if(l(P),r.needsUpdate=!0,n(r,h,P,L,F,R,S,N))return!0}return!1};if(s){const E=s;s=function(T,p,m,F,R,S,N,L){return E(T,p,m,F,R,S,N,L)?!0:d(T,p,m,F,R,S,N,L)}}else s=d}return Ga(this,i,t,s)}intersectsBox(i,t){return Qi.set(i.min,i.max,t),Qi.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Qi.intersectsBox(e),intersectsTriangle:e=>Qi.intersectsTriangle(e)})}intersectsSphere(i){return this.shapecast({intersectsBounds:t=>i.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(i)})}closestPointToGeometry(i,t,e={},s={},n=0,r=1/0){return(this.indirect?Va:Pa)(this,i,t,e,s,n,r)}closestPointToPoint(i,t={},e=0,s=1/0){return ua(this,i,t,e,s)}getBoundingBox(i){return i.makeEmpty(),this._roots.forEach(e=>{Ot(0,new Float32Array(e),ar),i.union(ar)}),i}}function cr(c,i,t){return c===null||(c.point.applyMatrix4(i.matrixWorld),c.distance=c.point.distanceTo(t.ray.origin),c.object=i,c.distance<t.near||c.distance>t.far)?null:c}const en=new y.Ray,lr=new y.Matrix4,za=y.Mesh.prototype.raycast;function ka(c,i){if(this.geometry.boundsTree){if(this.material===void 0)return;lr.copy(this.matrixWorld).invert(),en.copy(c.ray).applyMatrix4(lr);const t=this.geometry.boundsTree;if(c.firstHitOnly===!0){const e=cr(t.raycastFirst(en,this.material),this,c);e&&i.push(e)}else{const e=t.raycast(en,this.material);for(let s=0,n=e.length;s<n;s++){const r=cr(e[s],this,c);r&&i.push(r)}}}else za.call(this,c,i)}function Ha(c){return this.boundsTree=new xn(this,c),this.boundsTree}function Wa(){this.boundsTree=null}class q{constructor(){C(this,"enabled",!0);C(this,"trigger",i=>{if(!this.enabled)return;const t=this.handlers.slice(0);for(const e of t)e(i)});C(this,"handlers",[])}add(i){this.handlers.push(i)}remove(i){this.handlers=this.handlers.filter(t=>t!==i)}reset(){this.handlers.length=0}}class fe{constructor(){C(this,"enabled",!0);C(this,"trigger",async i=>{if(!this.enabled)return;const t=this.handlers.slice(0);for(const e of t)await e(i)});C(this,"handlers",[])}add(i){this.handlers.push(i)}remove(i){this.handlers=this.handlers.filter(t=>t!==i)}reset(){this.handlers.length=0}}class Vs{constructor(i){C(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);C(this,"isResizeable",()=>"resize"in this&&"getSize"in this);C(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);C(this,"isHideable",()=>"visible"in this);C(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=i}}class mt extends Vs{}class Ys extends Vs{constructor(t){super(t);C(this,"worlds",new Map);C(this,"onWorldChanged",new q);C(this,"currentWorld",null);this.onWorldChanged.add(({world:e,action:s})=>{s==="removed"&&this.worlds.delete(e.uuid)})}}class Yr extends Ys{constructor(){super(...arguments);C(this,"hasCameraControls",()=>"controls"in this)}}class Gr extends Ys{constructor(){super(...arguments);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"onResize",new q);C(this,"onClippingPlanesUpdated",new q);C(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,e,s){e.isLocal=s;const n=this.clippingPlanes.indexOf(e);t&&n===-1?this.clippingPlanes.push(e):!t&&n>-1&&this.clippingPlanes.splice(n,1),this.three.clippingPlanes=this.clippingPlanes.filter(r=>!r.isLocal)}}const Fi=class Fi extends mt{constructor(t){super(t);C(this,"_disposedComponents",new Set);C(this,"enabled",!0);t.add(Fi.uuid,this)}get(){return this._disposedComponents}destroy(t,e=!0,s=!0){t.removeFromParent();const n=t;n.dispose&&n.dispose(),this.disposeGeometryAndMaterials(t,e),s&&n.children&&n.children.length&&this.disposeChildren(n),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,e){const s=t;s.geometry&&this.disposeGeometry(s.geometry),e&&s.material&&Fi.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(t){for(const e of t.children)this.destroy(e)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const e of t.material)e.dispose();else t.material.dispose()}};C(Fi,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let Ce=Fi;class zr extends Ys{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"directionalLights",new Map);C(this,"ambientLights",new Map)}dispose(){const t=this.components.get(Ce);for(const e of this.three.children){const s=e;s.geometry&&t.destroy(s)}this.deleteAllLights(),this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}deleteAllLights(){for(const[,t]of this.directionalLights)t.removeFromParent(),t.target.removeFromParent(),t.dispose();this.directionalLights.clear();for(const[,t]of this.ambientLights)t.removeFromParent(),t.dispose();this.ambientLights.clear()}}class Ie extends Set{constructor(t){super(t);C(this,"onItemAdded",new q);C(this,"onItemDeleted",new q);C(this,"onCleared",new q);C(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}add(...t){for(const e of t)this.has(e)||!this.guard(e)||(super.add(e),this.onItemAdded||(this.onItemAdded=new q),this.onItemAdded.trigger(e));return this}delete(t){const e=super.delete(t);return e&&this.onItemDeleted.trigger(),e}dispose(){this.clear(),this.onItemAdded.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class Qt extends Map{constructor(t){super(t);C(this,"onItemSet",new q);C(this,"onItemUpdated",new q);C(this,"onItemDeleted",new q);C(this,"onCleared",new q);C(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}set(t,e){const s=this.has(t);if(!(this.guard??(()=>!0))(t,e))return this;const o=super.set(t,e);return s?(this.onItemUpdated||(this.onItemUpdated=new q),this.onItemUpdated.trigger({key:t,value:e})):(this.onItemSet||(this.onItemSet=new q),this.onItemSet.trigger({key:t,value:e})),o}delete(t){const e=super.delete(t);return e&&this.onItemDeleted.trigger(t),e}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class Xa extends mt{}class $a{constructor(){C(this,"list",new Set)}add(i){for(const t of i)this.list.add(t)}remove(i){for(const t of i)this.list.delete(t)}set(i){for(const t of this.list)t.enabled=i}reset(){for(const i of this.list)i.reset()}}const ls=0,Za=1,ja=new y.Vector3,hr=new y.Line3,sn=new y.Plane,ur=new y.Vector3,Ki=new y.Triangle;class qa{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new fr,this.unassigned=new fr,this.vertices=[]}setFromPoints(i){if(i.length>=4){this.makeEmpty();for(let t=0,e=i.length;t<e;t++)this.vertices.push(new Qa(i[t]));this.compute()}return this}setFromObject(i){const t=[];return i.updateMatrixWorld(!0),i.traverse(function(e){const s=e.geometry;if(s!==void 0){const n=s.attributes.position;if(n!==void 0)for(let r=0,o=n.count;r<o;r++){const a=new y.Vector3;a.fromBufferAttribute(n,r).applyMatrix4(e.matrixWorld),t.push(a)}}}),this.setFromPoints(t)}containsPoint(i){const t=this.faces;for(let e=0,s=t.length;e<s;e++)if(t[e].distanceToPoint(i)>this.tolerance)return!1;return!0}intersectRay(i,t){const e=this.faces;let s=-1/0,n=1/0;for(let r=0,o=e.length;r<o;r++){const a=e[r],l=a.distanceToPoint(i.origin),h=a.normal.dot(i.direction);if(l>0&&h>=0)return null;const f=h!==0?-l/h:0;if(!(f<=0)&&(h>0?n=Math.min(f,n):s=Math.max(f,s),s>n))return null}return s!==-1/0?i.at(s,t):i.at(n,t),t}intersectsRay(i){return this.intersectRay(i,ja)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(i,t){return i.face=t,t.outside===null?this.assigned.append(i):this.assigned.insertBefore(t.outside,i),t.outside=i,this}removeVertexFromFace(i,t){return i===t.outside&&(i.next!==null&&i.next.face===t?t.outside=i.next:t.outside=null),this.assigned.remove(i),this}removeAllVerticesFromFace(i){if(i.outside!==null){const t=i.outside;let e=i.outside;for(;e.next!==null&&e.next.face===i;)e=e.next;return this.assigned.removeSubList(t,e),t.prev=e.next=null,i.outside=null,t}}deleteFaceVertices(i,t){const e=this.removeAllVerticesFromFace(i);if(e!==void 0)if(t===void 0)this.unassigned.appendChain(e);else{let s=e;do{const n=s.next;t.distanceToPoint(s.point)>this.tolerance?this.addVertexToFace(s,t):this.unassigned.append(s),s=n}while(s!==null)}return this}resolveUnassignedPoints(i){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const e=t.next;let s=this.tolerance,n=null;for(let r=0;r<i.length;r++){const o=i[r];if(o.mark===ls){const a=o.distanceToPoint(t.point);if(a>s&&(s=a,n=o),s>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(t,n),t=e}while(t!==null)}return this}computeExtremes(){const i=new y.Vector3,t=new y.Vector3,e=[],s=[];for(let n=0;n<3;n++)e[n]=s[n]=this.vertices[0];i.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let n=0,r=this.vertices.length;n<r;n++){const o=this.vertices[n],a=o.point;for(let l=0;l<3;l++)a.getComponent(l)<i.getComponent(l)&&(i.setComponent(l,a.getComponent(l)),e[l]=o);for(let l=0;l<3;l++)a.getComponent(l)>t.getComponent(l)&&(t.setComponent(l,a.getComponent(l)),s[l]=o)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(i.x),Math.abs(t.x))+Math.max(Math.abs(i.y),Math.abs(t.y))+Math.max(Math.abs(i.z),Math.abs(t.z))),{min:e,max:s}}computeInitialHull(){const i=this.vertices,t=this.computeExtremes(),e=t.min,s=t.max;let n=0,r=0;for(let I=0;I<3;I++){const u=s[I].point.getComponent(I)-e[I].point.getComponent(I);u>n&&(n=u,r=I)}const o=e[r],a=s[r];let l,h;n=0,hr.set(o.point,a.point);for(let I=0,u=this.vertices.length;I<u;I++){const d=i[I];if(d!==o&&d!==a){hr.closestPointToPoint(d.point,!0,ur);const E=ur.distanceToSquared(d.point);E>n&&(n=E,l=d)}}n=-1,sn.setFromCoplanarPoints(o.point,a.point,l.point);for(let I=0,u=this.vertices.length;I<u;I++){const d=i[I];if(d!==o&&d!==a&&d!==l){const E=Math.abs(sn.distanceToPoint(d.point));E>n&&(n=E,h=d)}}const f=[];if(sn.distanceToPoint(h.point)<0){f.push(ee.create(o,a,l),ee.create(h,a,o),ee.create(h,l,a),ee.create(h,o,l));for(let I=0;I<3;I++){const u=(I+1)%3;f[I+1].getEdge(2).setTwin(f[0].getEdge(u)),f[I+1].getEdge(1).setTwin(f[u+1].getEdge(0))}}else{f.push(ee.create(o,l,a),ee.create(h,o,a),ee.create(h,a,l),ee.create(h,l,o));for(let I=0;I<3;I++){const u=(I+1)%3;f[I+1].getEdge(2).setTwin(f[0].getEdge((3-I)%3)),f[I+1].getEdge(0).setTwin(f[u+1].getEdge(1))}}for(let I=0;I<4;I++)this.faces.push(f[I]);for(let I=0,u=i.length;I<u;I++){const d=i[I];if(d!==o&&d!==a&&d!==l&&d!==h){n=this.tolerance;let E=null;for(let T=0;T<4;T++){const p=this.faces[T].distanceToPoint(d.point);p>n&&(n=p,E=this.faces[T])}E!==null&&this.addVertexToFace(d,E)}}return this}reindexFaces(){const i=[];for(let t=0;t<this.faces.length;t++){const e=this.faces[t];e.mark===ls&&i.push(e)}return this.faces=i,this}nextVertexToAdd(){if(this.assigned.isEmpty()===!1){let i,t=0;const e=this.assigned.first().face;let s=e.outside;do{const n=e.distanceToPoint(s.point);n>t&&(t=n,i=s),s=s.next}while(s!==null&&s.face===e);return i}}computeHorizon(i,t,e,s){this.deleteFaceVertices(e),e.mark=Za;let n;t===null?n=t=e.getEdge(0):n=t.next;do{const r=n.twin,o=r.face;o.mark===ls&&(o.distanceToPoint(i)>this.tolerance?this.computeHorizon(i,r,o,s):s.push(n)),n=n.next}while(n!==t);return this}addAdjoiningFace(i,t){const e=ee.create(i,t.tail(),t.head());return this.faces.push(e),e.getEdge(-1).setTwin(t.twin),e.getEdge(0)}addNewFaces(i,t){this.newFaces=[];let e=null,s=null;for(let n=0;n<t.length;n++){const r=t[n],o=this.addAdjoiningFace(i,r);e===null?e=o:o.next.setTwin(s),this.newFaces.push(o.face),s=o}return e.next.setTwin(s),this}addVertexToHull(i){const t=[];return this.unassigned.clear(),this.removeVertexFromFace(i,i.face),this.computeHorizon(i.point,null,i.face,t),this.addNewFaces(i,t),this.resolveUnassignedPoints(this.newFaces),this}cleanup(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this}compute(){let i;for(this.computeInitialHull();(i=this.nextVertexToAdd())!==void 0;)this.addVertexToHull(i);return this.reindexFaces(),this.cleanup(),this}}class ee{constructor(){this.normal=new y.Vector3,this.midpoint=new y.Vector3,this.area=0,this.constant=0,this.outside=null,this.mark=ls,this.edge=null}static create(i,t,e){const s=new ee,n=new nn(i,s),r=new nn(t,s),o=new nn(e,s);return n.next=o.prev=r,r.next=n.prev=o,o.next=r.prev=n,s.edge=n,s.compute()}getEdge(i){let t=this.edge;for(;i>0;)t=t.next,i--;for(;i<0;)t=t.prev,i++;return t}compute(){const i=this.edge.tail(),t=this.edge.head(),e=this.edge.next.head();return Ki.set(i.point,t.point,e.point),Ki.getNormal(this.normal),Ki.getMidpoint(this.midpoint),this.area=Ki.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(i){return this.normal.dot(i)-this.constant}}class nn{constructor(i,t){this.vertex=i,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const i=this.head(),t=this.tail();return t!==null?t.point.distanceTo(i.point):-1}lengthSquared(){const i=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(i.point):-1}setTwin(i){return this.twin=i,i.twin=this,this}}class Qa{constructor(i){this.point=i,this.prev=null,this.next=null,this.face=null}}class fr{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(i,t){return t.prev=i.prev,t.next=i,t.prev===null?this.head=t:t.prev.next=t,i.prev=t,this}insertAfter(i,t){return t.prev=i,t.next=i.next,t.next===null?this.tail=t:t.next.prev=t,i.next=t,this}append(i){return this.head===null?this.head=i:this.tail.next=i,i.prev=this.tail,i.next=null,this.tail=i,this}appendChain(i){for(this.head===null?this.head=i:this.tail.next=i,i.prev=this.tail;i.next!==null;)i=i.next;return this.tail=i,this}remove(i){return i.prev===null?this.head=i.next:i.prev.next=i.next,i.next===null?this.tail=i.prev:i.next.prev=i.prev,this}removeSubList(i,t){return i.prev===null?this.head=t.next:i.prev.next=t.next,t.next===null?this.tail=i.prev:t.next.prev=i.prev,this}isEmpty(){return this.head===null}}const Rn=[2,2,1],gn=[1,0,0];function ce(c,i){return c*3+i}function Ka(c){const i=c.elements;let t=0;for(let e=0;e<9;e++)t+=i[e]*i[e];return Math.sqrt(t)}function Ja(c){const i=c.elements;let t=0;for(let e=0;e<3;e++){const s=i[ce(Rn[e],gn[e])];t+=2*s*s}return Math.sqrt(t)}function tc(c,i){let t=0,e=1;const s=c.elements;for(let l=0;l<3;l++){const h=Math.abs(s[ce(Rn[l],gn[l])]);h>t&&(t=h,e=l)}let n=1,r=0;const o=gn[e],a=Rn[e];if(Math.abs(s[ce(a,o)])>Number.EPSILON){const l=s[ce(a,a)],h=s[ce(o,o)],f=s[ce(a,o)],I=(l-h)/2/f;let u;I<0?u=-1/(-I+Math.sqrt(1+I*I)):u=1/(I+Math.sqrt(1+I*I)),n=1/Math.sqrt(1+u*u),r=u*n}return i.identity(),i.elements[ce(o,o)]=n,i.elements[ce(a,a)]=n,i.elements[ce(a,o)]=r,i.elements[ce(o,a)]=-r,i}function ec(c,i){let t=0,e=0;const s=10;i.unitary.identity(),i.diagonal.copy(c);const n=i.unitary,r=i.diagonal,o=new b.Matrix3,a=new b.Matrix3,l=Number.EPSILON*Ka(r);for(;e<s&&Ja(r)>l;)tc(r,o),a.copy(o).transpose(),r.multiply(o),r.premultiply(a),n.multiply(o),++t>2&&(e++,t=0);return i}function kr(c){const i=[];for(let ot=0;ot<c.length-2;ot+=3){const ft=c[ot],ut=c[ot+1],Ct=c[ot+2];i.push(new b.Vector3(ft,ut,Ct))}const t=new qa;t.setFromPoints(i);const e={unitary:new b.Matrix3,diagonal:new b.Matrix3},s=t.faces,n=[],r=[];for(let ot=0,ft=s.length;ot<ft;ot++){const ut=s[ot];let Ct=ut.edge;n.length=0;do n.push(Ct),Ct=Ct.next;while(Ct!==ut.edge);const Gt=n.length-2;for(let wt=1,A=Gt;wt<=A;wt++){const $=n[0].vertex,H=n[wt+0].vertex,M=n[wt+1].vertex;r.push($.point.x,$.point.y,$.point.z),r.push(H.point.x,H.point.y,H.point.z),r.push(M.point.x,M.point.y,M.point.z)}}const o=new b.Vector3,a=new b.Vector3,l=new b.Vector3,h=new b.Vector3,f=new b.Vector3,I=new b.Vector3,u=new b.Vector3,d=new b.Vector3;let E=0,T=0,p=0,m=0,F=0,R=0,S=0;for(let ot=0,ft=r.length;ot<ft;ot+=9){o.fromArray(r,ot),a.fromArray(r,ot+3),l.fromArray(r,ot+6),u.set(0,0,0),u.add(o).add(a).add(l).divideScalar(3),h.subVectors(a,o),f.subVectors(l,o);const ut=I.crossVectors(h,f).length()/2;d.add(I.copy(u).multiplyScalar(ut)),E+=ut,T+=(9*u.x*u.x+o.x*o.x+a.x*a.x+l.x*l.x)*(ut/12),p+=(9*u.x*u.y+o.x*o.y+a.x*a.y+l.x*l.y)*(ut/12),m+=(9*u.x*u.z+o.x*o.z+a.x*a.z+l.x*l.z)*(ut/12),F+=(9*u.y*u.y+o.y*o.y+a.y*a.y+l.y*l.y)*(ut/12),R+=(9*u.y*u.z+o.y*o.z+a.y*a.z+l.y*l.z)*(ut/12),S+=(9*u.z*u.z+o.z*o.z+a.z*a.z+l.z*l.z)*(ut/12)}d.divideScalar(E),T/=E,p/=E,m/=E,F/=E,R/=E,S/=E,T-=d.x*d.x,p-=d.x*d.y,m-=d.x*d.z,F-=d.y*d.y,R-=d.y*d.z,S-=d.z*d.z;const N=new b.Matrix3;N.elements[0]=T,N.elements[1]=p,N.elements[2]=m,N.elements[3]=p,N.elements[4]=F,N.elements[5]=R,N.elements[6]=m,N.elements[7]=R,N.elements[8]=S,ec(N,e);const L=e.unitary,D=new b.Vector3,P=new b.Vector3,v=new b.Vector3;L.extractBasis(D,P,v);let G=-1/0,O=-1/0,w=-1/0,g=1/0,U=1/0,Q=1/0;for(let ot=0,ft=i.length;ot<ft;ot++){const ut=i[ot];G=Math.max(D.dot(ut),G),O=Math.max(P.dot(ut),O),w=Math.max(v.dot(ut),w),g=Math.min(D.dot(ut),g),U=Math.min(P.dot(ut),U),Q=Math.min(v.dot(ut),Q)}D.multiplyScalar(.5*(g+G)),P.multiplyScalar(.5*(U+O)),v.multiplyScalar(.5*(Q+w));const z=new b.Vector3,et=new b.Vector3,X=new b.Matrix3;z.add(D).add(P).add(v),et.x=G-g,et.y=O-U,et.z=w-Q,et.multiplyScalar(.5),X.copy(L);const{x:nt,y:Y,z:B}=et,rt=new b.Matrix4;rt.makeScale(nt*2,Y*2,B*2);const it=new b.Matrix4;it.makeTranslation(-nt,-Y,-B);const tt=new b.Matrix4;tt.makeTranslation(z.x,z.y,z.z);const Ft=new b.Matrix4;Ft.setFromMatrix3(X);const Nt=new b.Matrix4;return Nt.multiply(tt),Nt.multiply(Ft),Nt.multiply(it),Nt.multiply(rt),{center:z,halfSizes:et,rotation:X,transformation:Nt}}function ic(c,i,t){const e=[c[0]-i[0],c[1]-i[1],c[2]-i[2]];return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]>0}class An{static isTransparent(i){return i.transparent&&i.opacity<1}}const Lt=class Lt{static create(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return`${Lt._lut[i&255]+Lt._lut[i>>8&255]+Lt._lut[i>>16&255]+Lt._lut[i>>24&255]}-${Lt._lut[t&255]}${Lt._lut[t>>8&255]}-${Lt._lut[t>>16&15|64]}${Lt._lut[t>>24&255]}-${Lt._lut[e&63|128]}${Lt._lut[e>>8&255]}-${Lt._lut[e>>16&255]}${Lt._lut[e>>24&255]}${Lt._lut[s&255]}${Lt._lut[s>>8&255]}${Lt._lut[s>>16&255]}${Lt._lut[s>>24&255]}`.toLowerCase()}static validate(i){if(!Lt._pattern.test(i))throw new Error(`${i} is not a valid UUID v4.
|
|
2
2
|
|
|
3
3
|
- If you're the tool creator, you can take one from https://www.uuidgenerator.net/.
|
|
4
4
|
|
|
5
|
-
- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};C(Lt,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),C(Lt,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let Kt=Lt;class ic extends mt{constructor(t,e){super(t);C(this,"onDisposed",new q);C(this,"onVertexFound",new q);C(this,"onVertexLost",new q);C(this,"onEnabled",new q);C(this,"components");C(this,"workingPlane",null);C(this,"_pickedPoint",null);C(this,"_config");C(this,"_enabled",!1);this.components=t,this.config={snapDistance:.25,showOnlyVertex:!1,...e},this.enabled=!1}set enabled(t){this._enabled=t,t||(this._pickedPoint=null),this.onEnabled.trigger(t)}get enabled(){return this._enabled}set config(t){this._config={...this._config,...t}}get config(){return this._config}dispose(){this.onVertexFound.reset(),this.onVertexLost.reset(),this.components=null,this.onDisposed.trigger(),this.onDisposed.reset()}get(t){if(!this.enabled)return this._pickedPoint;const n=this.components.get(ve).get(t).castRay();if(!n)return this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint;const r=this.getClosestVertex(n);return r?(this.workingPlane?Math.abs(this.workingPlane.distanceToPoint(r))<.001:!0)?((this._pickedPoint===null||!this._pickedPoint.equals(r))&&(this._pickedPoint=r.clone(),this.onVertexFound.trigger(this._pickedPoint)),this._pickedPoint):(this._pickedPoint=null,this._pickedPoint):(this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint)}getClosestVertex(t){let e=new b.Vector3,s=!1,n=Number.MAX_SAFE_INTEGER;const r=this.getVertices(t);if(r===null)return null;for(const o of r){if(!o)continue;const a=t.point.distanceTo(o);a>n||a>this._config.snapDistance||(s=!0,e=o,n=t.point.distanceTo(o))}return s?e:this.config.showOnlyVertex?null:t.point}getVertices(t){const e=t.object;if(!t.face||!e)return null;const s=e.geometry,n=new b.Matrix4,{instanceId:r}=t,o=r!==void 0,a=e instanceof b.InstancedMesh;return a&&o&&e.getMatrixAt(r,n),[this.getVertex(t.face.a,s),this.getVertex(t.face.b,s),this.getVertex(t.face.c,s)].map(l=>(l&&(a&&o&&l.applyMatrix4(n),l.applyMatrix4(e.matrixWorld)),l))}getVertex(t,e){if(t===void 0)return null;const s=e.attributes.position;return new b.Vector3(s.getX(t),s.getY(t),s.getZ(t))}}const Rs=class Rs{constructor(){C(this,"onDisposed",new q);C(this,"list",new Map);C(this,"enabled",!1);C(this,"_clock");C(this,"onInit",new q);C(this,"update",()=>{if(!this.enabled)return;const i=this._clock.getDelta();for(const[t,e]of this.list)e.enabled&&e.isUpdateable()&&e.update(i);requestAnimationFrame(this.update)});this._clock=new b.Clock,Rs.setupBVH()}add(i,t){if(this.list.has(i))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");Kt.validate(i),this.list.set(i,t)}get(i){const t=i.uuid;if(!this.list.has(t)){const e=new i(this);return this.list.has(t)||this.add(t,e),e}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update(),this.onInit.trigger()}dispose(){this.enabled=!1;for(const[i,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){b.BufferGeometry.prototype.computeBoundsTree=Ha,b.BufferGeometry.prototype.disposeBoundsTree=Wa,b.Mesh.prototype.raycast=ka}};C(Rs,"release","2.4.0-alpha.1");let Li=Rs;class Hr extends Vs{constructor(){super(...arguments);C(this,"meshes",new Set);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"isDisposing",!1);C(this,"enabled",!0);C(this,"uuid",Kt.create());C(this,"name");C(this,"_scene");C(this,"_camera");C(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(t){this._scene=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(t){this._camera=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(t){this._renderer=t,t&&(t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"}))}update(t){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(t),this.camera.isUpdateable()&&this.camera.update(t),this.renderer&&this.renderer.update(t),this.onAfterUpdate.trigger()))}dispose(t=!0){if(this.enabled=!1,this.isDisposing=!0,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),t){const s=this.components.get(Ce);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const n of this.meshes)s.destroy(n);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.components.get(Pi).list.delete(this.uuid),this.onDisposed.trigger(),this.onDisposed.reset()}}class ye{constructor(i,t,e,s){C(this,"_component");C(this,"name");C(this,"uuid");this._component=i,this.name=e,this.uuid=s??Kt.create(),t.get(Ne).list.set(this.uuid,this)}get controls(){const i={};for(const t in this._config){const e=this._config[t];i[t]=this.copyEntry(e)}return i}copyEntry(i){if(i.type==="Boolean"){const t=i;return{type:t.type,value:t.value}}if(i.type==="Color"){const t=i;return{type:t.type,value:t.value.clone()}}if(i.type==="Text"){const t=i;return{type:t.type,value:t.value}}if(i.type==="Number"){const t=i;return{type:t.type,value:t.value,min:t.min,max:t.max,interpolable:t.interpolable}}if(i.type==="Select"){const t=i;return{type:t.type,value:t.value,multiple:t.multiple,options:new Set(t.options)}}if(i.type==="Vector3"){const t=i;return{type:t.type,value:t.value.clone()}}if(i.type==="TextSet"){const t=i;return{type:t.type,value:new Set(t.value)}}if(i.type==="None"){const t=i;return{type:t.type,value:t.value}}throw new Error("Invalid entry!")}}const gs=class gs extends mt{constructor(t){super(t);C(this,"list",new Qt);C(this,"enabled",!0);t.add(gs.uuid,this)}};C(gs,"uuid","b8c764e0-6b24-4e77-9a32-35fa728ee5b4");let Ne=gs;class sc{constructor(i,t){C(this,"_list");C(this,"_scene");this._list=i,this._scene=t}get color(){return this._list.directionalLight.color.value}set color(i){this._list.directionalLight.color.value=i;for(const[,t]of this._scene.directionalLights)t.color.copy(i)}get intensity(){return this._list.directionalLight.intensity.value}set intensity(i){this._list.directionalLight.intensity.value=i;for(const[,t]of this._scene.directionalLights)t.intensity=i}get position(){return this._list.directionalLight.position.value.clone()}set position(i){this._list.directionalLight.position.value=i;for(const[,t]of this._scene.directionalLights)t.position.copy(i)}}class nc{constructor(i,t){C(this,"_list");C(this,"_scene");this._list=i,this._scene=t}get color(){return this._list.ambientLight.color.value}set color(i){this._list.ambientLight.color.value=i;for(const[,t]of this._scene.ambientLights)t.color.copy(i)}get intensity(){return this._list.ambientLight.intensity.value}set intensity(i){this._list.ambientLight.intensity.value=i;for(const[,t]of this._scene.ambientLights)t.intensity=i}}class Wr extends ye{constructor(){super(...arguments);C(this,"_config",{backgroundColor:{value:new b.Color,type:"Color"},ambientLight:{color:{type:"Color",value:new b.Color},intensity:{type:"Number",interpolable:!0,min:0,max:10,value:2}},directionalLight:{color:{type:"Color",value:new b.Color},intensity:{type:"Number",interpolable:!0,min:0,max:10,value:2},position:{type:"Vector3",value:new b.Vector3}}});C(this,"ambientLight",new nc(this._config,this._component));C(this,"directionalLight",new sc(this._config,this._component))}get backgroundColor(){return this._config.backgroundColor.value}set backgroundColor(t){this._config.backgroundColor.value=t,this._component.three.background=t}}class Xr extends zr{constructor(t){super(t);C(this,"onSetup",new q);C(this,"isSetup",!1);C(this,"three");C(this,"config",new Wr(this,this.components,"Scene"));C(this,"_defaultConfig",{backgroundColor:new b.Color(2107698),directionalLight:{color:new b.Color("white"),intensity:1.5,position:new b.Vector3(5,10,3)},ambientLight:{color:new b.Color("white"),intensity:1}});this.three=new b.Scene,this.three.background=new b.Color(2107698)}setup(t){const e={...this._defaultConfig,...t};this.config.backgroundColor=e.backgroundColor;const s=e.ambientLight;this.config.ambientLight.color=s.color,this.config.ambientLight.intensity=s.intensity;const n=e.directionalLight;this.config.directionalLight.color=n.color,this.config.directionalLight.intensity=n.intensity,this.config.directionalLight.position=n.position,this.deleteAllLights();const{color:r,intensity:o}=this.config.directionalLight,a=new b.DirectionalLight(r,o);a.position.copy(n.position);const{color:l,intensity:h}=this.config.directionalLight,f=new b.AmbientLight(l,h);this.three.add(a,f),this.directionalLights.set(a.uuid,a),this.ambientLights.set(f.uuid,f),this.isSetup=!0,this.onSetup.trigger()}dispose(){super.dispose(),this.components.get(Ne).list.delete(this.config.uuid)}}class rc extends Gr{constructor(t,e,s){super(t);C(this,"enabled",!0);C(this,"container");C(this,"three");C(this,"_canvas");C(this,"_parameters");C(this,"_resizeObserver",null);C(this,"onContainerUpdated",new q);C(this,"_resizing",!1);C(this,"resize",t=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const e=t?t.x:this.container.clientWidth,s=t?t.y:this.container.clientHeight;this.three.setSize(e,s),this.onResize.trigger(new b.Vector2(e,s)),this._resizing=!1});C(this,"resizeEvent",()=>{this.resize()});C(this,"onContextLost",t=>{t.preventDefault(),this.enabled=!1});C(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new b.WebGLRenderer({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0});this.container=e,this._parameters=s,this.three=new b.WebGLRenderer({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const n=this.three.getContext(),{canvas:r}=n;r.addEventListener("webglcontextlost",this.onContextLost,!1),r.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,e=this.currentWorld.camera.three;this.three.render(t,e),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.forceContextLoss(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new b.Vector2(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const e=this.three.domElement.parentElement;if(!e)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),t&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(e),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*!
|
|
5
|
+
- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};C(Lt,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),C(Lt,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let Kt=Lt;class sc extends mt{constructor(t,e){super(t);C(this,"onDisposed",new q);C(this,"onVertexFound",new q);C(this,"onVertexLost",new q);C(this,"onEnabled",new q);C(this,"components");C(this,"workingPlane",null);C(this,"_pickedPoint",null);C(this,"_config");C(this,"_enabled",!1);this.components=t,this.config={snapDistance:.25,showOnlyVertex:!1,...e},this.enabled=!1}set enabled(t){this._enabled=t,t||(this._pickedPoint=null),this.onEnabled.trigger(t)}get enabled(){return this._enabled}set config(t){this._config={...this._config,...t}}get config(){return this._config}dispose(){this.onVertexFound.reset(),this.onVertexLost.reset(),this.components=null,this.onDisposed.trigger(),this.onDisposed.reset()}get(t){if(!this.enabled)return this._pickedPoint;const n=this.components.get(ve).get(t).castRay();if(!n)return this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint;const r=this.getClosestVertex(n);return r?(this.workingPlane?Math.abs(this.workingPlane.distanceToPoint(r))<.001:!0)?((this._pickedPoint===null||!this._pickedPoint.equals(r))&&(this._pickedPoint=r.clone(),this.onVertexFound.trigger(this._pickedPoint)),this._pickedPoint):(this._pickedPoint=null,this._pickedPoint):(this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint)}getClosestVertex(t){let e=new b.Vector3,s=!1,n=Number.MAX_SAFE_INTEGER;const r=this.getVertices(t);if(r===null)return null;for(const o of r){if(!o)continue;const a=t.point.distanceTo(o);a>n||a>this._config.snapDistance||(s=!0,e=o,n=t.point.distanceTo(o))}return s?e:this.config.showOnlyVertex?null:t.point}getVertices(t){const e=t.object;if(!t.face||!e)return null;const s=e.geometry,n=new b.Matrix4,{instanceId:r}=t,o=r!==void 0,a=e instanceof b.InstancedMesh;return a&&o&&e.getMatrixAt(r,n),[this.getVertex(t.face.a,s),this.getVertex(t.face.b,s),this.getVertex(t.face.c,s)].map(l=>(l&&(a&&o&&l.applyMatrix4(n),l.applyMatrix4(e.matrixWorld)),l))}getVertex(t,e){if(t===void 0)return null;const s=e.attributes.position;return new b.Vector3(s.getX(t),s.getY(t),s.getZ(t))}}const Rs=class Rs{constructor(){C(this,"onDisposed",new q);C(this,"list",new Map);C(this,"enabled",!1);C(this,"_clock");C(this,"onInit",new q);C(this,"update",()=>{if(!this.enabled)return;const i=this._clock.getDelta();for(const[t,e]of this.list)e.enabled&&e.isUpdateable()&&e.update(i);requestAnimationFrame(this.update)});this._clock=new b.Clock,Rs.setupBVH()}add(i,t){if(this.list.has(i))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");Kt.validate(i),this.list.set(i,t)}get(i){const t=i.uuid;if(!this.list.has(t)){const e=new i(this);return this.list.has(t)||this.add(t,e),e}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update(),this.onInit.trigger()}dispose(){this.enabled=!1;for(const[i,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){b.BufferGeometry.prototype.computeBoundsTree=Ha,b.BufferGeometry.prototype.disposeBoundsTree=Wa,b.Mesh.prototype.raycast=ka}};C(Rs,"release","2.4.0-alpha.1");let Li=Rs;class Hr extends Vs{constructor(){super(...arguments);C(this,"meshes",new Set);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"isDisposing",!1);C(this,"enabled",!0);C(this,"uuid",Kt.create());C(this,"name");C(this,"_scene");C(this,"_camera");C(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(t){this._scene=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(t){this._camera=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(t){this._renderer=t,t&&(t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"}))}update(t){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(t),this.camera.isUpdateable()&&this.camera.update(t),this.renderer&&this.renderer.update(t),this.onAfterUpdate.trigger()))}dispose(t=!0){if(this.enabled=!1,this.isDisposing=!0,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),t){const s=this.components.get(Ce);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const n of this.meshes)s.destroy(n);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.components.get(Pi).list.delete(this.uuid),this.onDisposed.trigger(),this.onDisposed.reset()}}class ye{constructor(i,t,e,s){C(this,"_component");C(this,"name");C(this,"uuid");this._component=i,this.name=e,this.uuid=s??Kt.create(),t.get(Ne).list.set(this.uuid,this)}get controls(){const i={};for(const t in this._config){const e=this._config[t];i[t]=this.copyEntry(e)}return i}copyEntry(i){if(i.type==="Boolean"){const t=i;return{type:t.type,value:t.value}}if(i.type==="Color"){const t=i;return{type:t.type,value:t.value.clone()}}if(i.type==="Text"){const t=i;return{type:t.type,value:t.value}}if(i.type==="Number"){const t=i;return{type:t.type,value:t.value,min:t.min,max:t.max,interpolable:t.interpolable}}if(i.type==="Select"){const t=i;return{type:t.type,value:t.value,multiple:t.multiple,options:new Set(t.options)}}if(i.type==="Vector3"){const t=i;return{type:t.type,value:t.value.clone()}}if(i.type==="TextSet"){const t=i;return{type:t.type,value:new Set(t.value)}}if(i.type==="None"){const t=i;return{type:t.type,value:t.value}}throw new Error("Invalid entry!")}}const gs=class gs extends mt{constructor(t){super(t);C(this,"list",new Qt);C(this,"enabled",!0);t.add(gs.uuid,this)}};C(gs,"uuid","b8c764e0-6b24-4e77-9a32-35fa728ee5b4");let Ne=gs;class nc{constructor(i,t){C(this,"_list");C(this,"_scene");this._list=i,this._scene=t}get color(){return this._list.directionalLight.color.value}set color(i){this._list.directionalLight.color.value=i;for(const[,t]of this._scene.directionalLights)t.color.copy(i)}get intensity(){return this._list.directionalLight.intensity.value}set intensity(i){this._list.directionalLight.intensity.value=i;for(const[,t]of this._scene.directionalLights)t.intensity=i}get position(){return this._list.directionalLight.position.value.clone()}set position(i){this._list.directionalLight.position.value=i;for(const[,t]of this._scene.directionalLights)t.position.copy(i)}}class rc{constructor(i,t){C(this,"_list");C(this,"_scene");this._list=i,this._scene=t}get color(){return this._list.ambientLight.color.value}set color(i){this._list.ambientLight.color.value=i;for(const[,t]of this._scene.ambientLights)t.color.copy(i)}get intensity(){return this._list.ambientLight.intensity.value}set intensity(i){this._list.ambientLight.intensity.value=i;for(const[,t]of this._scene.ambientLights)t.intensity=i}}class Wr extends ye{constructor(){super(...arguments);C(this,"_config",{backgroundColor:{value:new b.Color,type:"Color"},ambientLight:{color:{type:"Color",value:new b.Color},intensity:{type:"Number",interpolable:!0,min:0,max:10,value:2}},directionalLight:{color:{type:"Color",value:new b.Color},intensity:{type:"Number",interpolable:!0,min:0,max:10,value:2},position:{type:"Vector3",value:new b.Vector3}}});C(this,"ambientLight",new rc(this._config,this._component));C(this,"directionalLight",new nc(this._config,this._component))}get backgroundColor(){return this._config.backgroundColor.value}set backgroundColor(t){this._config.backgroundColor.value=t,this._component.three.background=t}}class Xr extends zr{constructor(t){super(t);C(this,"onSetup",new q);C(this,"isSetup",!1);C(this,"three");C(this,"config",new Wr(this,this.components,"Scene"));C(this,"_defaultConfig",{backgroundColor:new b.Color(2107698),directionalLight:{color:new b.Color("white"),intensity:1.5,position:new b.Vector3(5,10,3)},ambientLight:{color:new b.Color("white"),intensity:1}});this.three=new b.Scene,this.three.background=new b.Color(2107698)}setup(t){const e={...this._defaultConfig,...t};this.config.backgroundColor=e.backgroundColor;const s=e.ambientLight;this.config.ambientLight.color=s.color,this.config.ambientLight.intensity=s.intensity;const n=e.directionalLight;this.config.directionalLight.color=n.color,this.config.directionalLight.intensity=n.intensity,this.config.directionalLight.position=n.position,this.deleteAllLights();const{color:r,intensity:o}=this.config.directionalLight,a=new b.DirectionalLight(r,o);a.position.copy(n.position);const{color:l,intensity:h}=this.config.directionalLight,f=new b.AmbientLight(l,h);this.three.add(a,f),this.directionalLights.set(a.uuid,a),this.ambientLights.set(f.uuid,f),this.isSetup=!0,this.onSetup.trigger()}dispose(){super.dispose(),this.components.get(Ne).list.delete(this.config.uuid)}}class oc extends Gr{constructor(t,e,s){super(t);C(this,"enabled",!0);C(this,"container");C(this,"three");C(this,"_canvas");C(this,"_parameters");C(this,"_resizeObserver",null);C(this,"onContainerUpdated",new q);C(this,"_resizing",!1);C(this,"resize",t=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const e=t?t.x:this.container.clientWidth,s=t?t.y:this.container.clientHeight;this.three.setSize(e,s),this.onResize.trigger(new b.Vector2(e,s)),this._resizing=!1});C(this,"resizeEvent",()=>{this.resize()});C(this,"onContextLost",t=>{t.preventDefault(),this.enabled=!1});C(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new b.WebGLRenderer({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0});this.container=e,this._parameters=s,this.three=new b.WebGLRenderer({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const n=this.three.getContext(),{canvas:r}=n;r.addEventListener("webglcontextlost",this.onContextLost,!1),r.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,e=this.currentWorld.camera.three;this.three.render(t,e),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.forceContextLoss(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new b.Vector2(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const e=this.three.domElement.parentElement;if(!e)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),t&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(e),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*!
|
|
6
6
|
* camera-controls
|
|
7
7
|
* https://github.com/yomotsu/camera-controls
|
|
8
8
|
* (c) 2017 @yomotsu
|
|
9
9
|
* Released under the MIT License.
|
|
10
|
-
*/const lt={LEFT:1,RIGHT:2,MIDDLE:4},W=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Xe={NONE:0,IN:1,OUT:-1};function Pe(c){return c.isPerspectiveCamera}function Re(c){return c.isOrthographicCamera}const $e=Math.PI*2,Ir=Math.PI/2,$r=1e-5,ui=Math.PI/180;function te(c,i,t){return Math.max(i,Math.min(t,c))}function gt(c,i=$r){return Math.abs(c)<i}function Et(c,i,t=$r){return gt(c-i,t)}function dr(c,i){return Math.round(c/i)*i}function fi(c){return isFinite(c)?c:c<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Ii(c){return Math.abs(c)<Number.MAX_VALUE?c:c*(1/0)}function Ji(c,i,t,e,s=1/0,n){e=Math.max(1e-4,e);const r=2/e,o=r*n,a=1/(1+o+.48*o*o+.235*o*o*o);let l=c-i;const h=i,f=s*e;l=te(l,-f,f),i=c-l;const I=(t.value+r*l)*n;t.value=(t.value-r*I)*a;let u=i+(l+I)*a;return h-c>0==u>h&&(u=h,t.value=(u-h)/n),u}function Er(c,i,t,e,s=1/0,n,r){e=Math.max(1e-4,e);const o=2/e,a=o*n,l=1/(1+a+.48*a*a+.235*a*a*a);let h=i.x,f=i.y,I=i.z,u=c.x-h,d=c.y-f,E=c.z-I;const T=h,p=f,m=I,F=s*e,R=F*F,S=u*u+d*d+E*E;if(S>R){const U=Math.sqrt(S);u=u/U*F,d=d/U*F,E=E/U*F}h=c.x-u,f=c.y-d,I=c.z-E;const N=(t.x+o*u)*n,L=(t.y+o*d)*n,D=(t.z+o*E)*n;t.x=(t.x-o*N)*l,t.y=(t.y-o*L)*l,t.z=(t.z-o*D)*l,r.x=h+(u+N)*l,r.y=f+(d+L)*l,r.z=I+(E+D)*l;const P=T-c.x,v=p-c.y,G=m-c.z,O=r.x-T,w=r.y-p,g=r.z-m;return P*O+v*w+G*g>0&&(r.x=T,r.y=p,r.z=m,t.x=(r.x-T)/n,t.y=(r.y-p)/n,t.z=(r.z-m)/n),r}function rn(c,i){i.set(0,0),c.forEach(t=>{i.x+=t.clientX,i.y+=t.clientY}),i.x/=c.length,i.y/=c.length}function on(c,i){return Re(c)?(console.warn(`${i} is not supported in OrthographicCamera`),!0):!1}class oc{constructor(){this._listeners={}}addEventListener(i,t){const e=this._listeners;e[i]===void 0&&(e[i]=[]),e[i].indexOf(t)===-1&&e[i].push(t)}hasEventListener(i,t){const e=this._listeners;return e[i]!==void 0&&e[i].indexOf(t)!==-1}removeEventListener(i,t){const s=this._listeners[i];if(s!==void 0){const n=s.indexOf(t);n!==-1&&s.splice(n,1)}}removeAllEventListeners(i){if(!i){this._listeners={};return}Array.isArray(this._listeners[i])&&(this._listeners[i].length=0)}dispatchEvent(i){const e=this._listeners[i.type];if(e!==void 0){i.target=this;const s=e.slice(0);for(let n=0,r=s.length;n<r;n++)s[n].call(this,i)}}}const ac="2.7.3",ts=1/8,Zr=typeof window<"u",cc=Zr&&/Mac/.test(navigator.platform),lc=!(Zr&&"PointerEvent"in window);let ct,pr,es,an,xt,ht,dt,Ze,di,re,oe,_e,Cr,Tr,kt,Ei,je,mr,cn,Rr,ln,hn,is;class bt extends oc{static install(i){ct=i.THREE,pr=Object.freeze(new ct.Vector3(0,0,0)),es=Object.freeze(new ct.Vector3(0,1,0)),an=Object.freeze(new ct.Vector3(0,0,1)),xt=new ct.Vector2,ht=new ct.Vector3,dt=new ct.Vector3,Ze=new ct.Vector3,di=new ct.Vector3,re=new ct.Vector3,oe=new ct.Vector3,_e=new ct.Vector3,Cr=new ct.Vector3,Tr=new ct.Vector3,kt=new ct.Spherical,Ei=new ct.Spherical,je=new ct.Box3,mr=new ct.Box3,cn=new ct.Sphere,Rr=new ct.Quaternion,ln=new ct.Quaternion,hn=new ct.Matrix4,is=new ct.Raycaster}static get ACTION(){return W}constructor(i,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=W.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Xe.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new ct.Vector3,this._focalOffsetVelocity=new ct.Vector3,this._zoomVelocity={value:0},this._truckInternal=(R,S,N)=>{let L,D;if(Pe(this._camera)){const P=ht.copy(this._camera.position).sub(this._target),v=this._camera.getEffectiveFOV()*ui,G=P.length()*Math.tan(v*.5);L=this.truckSpeed*R*G/this._elementRect.height,D=this.truckSpeed*S*G/this._elementRect.height}else if(Re(this._camera)){const P=this._camera;L=R*(P.right-P.left)/P.zoom/this._elementRect.width,D=S*(P.top-P.bottom)/P.zoom/this._elementRect.height}else return;this.verticalDragToForward?(N?this.setFocalOffset(this._focalOffsetEnd.x+L,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(L,0,!0),this.forward(-D,!0)):N?this.setFocalOffset(this._focalOffsetEnd.x+L,this._focalOffsetEnd.y+D,this._focalOffsetEnd.z,!0):this.truck(L,D,!0)},this._rotateInternal=(R,S)=>{const N=$e*this.azimuthRotateSpeed*R/this._elementRect.height,L=$e*this.polarRotateSpeed*S/this._elementRect.height;this.rotate(N,L,!0)},this._dollyInternal=(R,S,N)=>{const L=Math.pow(.95,-R*this.dollySpeed),D=this._sphericalEnd.radius,P=this._sphericalEnd.radius*L,v=te(P,this.minDistance,this.maxDistance),G=v-P;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(P,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(G,!0),this._dollyToNoClamp(v,!0)):this._dollyToNoClamp(v,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?P:v)-D,this._dollyControlCoord.set(S,N)),this._lastDollyDirection=Math.sign(-R)},this._zoomInternal=(R,S,N)=>{const L=Math.pow(.95,R*this.dollySpeed),D=this._zoom,P=this._zoom*L;this.zoomTo(P,!0),this.dollyToCursor&&(this._changedZoom+=P-D,this._dollyControlCoord.set(S,N))},typeof ct>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=i,this._yAxisUpSpace=new ct.Quaternion().setFromUnitVectors(this._camera.up,es),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=W.NONE,this._target=new ct.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new ct.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new ct.Spherical().setFromVector3(ht.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new ct.Vector3,new ct.Vector3,new ct.Vector3,new ct.Vector3],this._updateNearPlaneCorners(),this._boundary=new ct.Box3(new ct.Vector3(-1/0,-1/0,-1/0),new ct.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new ct.Vector2,this.mouseButtons={left:W.ROTATE,middle:W.DOLLY,right:W.TRUCK,wheel:Pe(this._camera)?W.DOLLY:Re(this._camera)?W.ZOOM:W.NONE},this.touches={one:W.TOUCH_ROTATE,two:Pe(this._camera)?W.TOUCH_DOLLY_TRUCK:Re(this._camera)?W.TOUCH_ZOOM_TRUCK:W.NONE,three:W.TOUCH_TRUCK};const e=new ct.Vector2,s=new ct.Vector2,n=new ct.Vector2,r=R=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const L=this._domElement.getBoundingClientRect(),D=R.clientX/L.width,P=R.clientY/L.height;if(D<this._interactiveArea.left||D>this._interactiveArea.right||P<this._interactiveArea.top||P>this._interactiveArea.bottom)return}const S=R.pointerType!=="mouse"?null:(R.buttons<.LEFT)===lt.LEFT?lt.LEFT:(R.buttons<.MIDDLE)===lt.MIDDLE?lt.MIDDLE:(R.buttons<.RIGHT)===lt.RIGHT?lt.RIGHT:null;if(S!==null){const L=this._findPointerByMouseButton(S);L&&this._disposePointer(L)}if((R.buttons<.LEFT)===lt.LEFT&&this._lockedPointer)return;const N={pointerId:R.pointerId,clientX:R.clientX,clientY:R.clientY,deltaX:0,deltaY:0,mouseButton:S};this._activePointers.push(N),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),this._isDragging=!0,E(R)},o=R=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const L=this._domElement.getBoundingClientRect(),D=R.clientX/L.width,P=R.clientY/L.height;if(D<this._interactiveArea.left||D>this._interactiveArea.right||P<this._interactiveArea.top||P>this._interactiveArea.bottom)return}const S=(R.buttons<.LEFT)===lt.LEFT?lt.LEFT:(R.buttons<.MIDDLE)===lt.MIDDLE?lt.MIDDLE:(R.buttons<.RIGHT)===lt.RIGHT?lt.RIGHT:null;if(S!==null){const L=this._findPointerByMouseButton(S);L&&this._disposePointer(L)}const N={pointerId:1,clientX:R.clientX,clientY:R.clientY,deltaX:0,deltaY:0,mouseButton:(R.buttons<.LEFT)===lt.LEFT?lt.LEFT:(R.buttons<.MIDDLE)===lt.LEFT?lt.MIDDLE:(R.buttons<.RIGHT)===lt.LEFT?lt.RIGHT:null};this._activePointers.push(N),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",f),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",f),this._isDragging=!0,E(R)},a=R=>{R.cancelable&&R.preventDefault();const S=R.pointerId,N=this._lockedPointer||this._findPointerById(S);if(N){if(N.clientX=R.clientX,N.clientY=R.clientY,N.deltaX=R.movementX,N.deltaY=R.movementY,this._state=0,R.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(R.buttons<.LEFT)===lt.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(R.buttons<.MIDDLE)===lt.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(R.buttons<.RIGHT)===lt.RIGHT&&(this._state=this._state|this.mouseButtons.right);T()}},l=R=>{const S=this._lockedPointer||this._findPointerById(1);S&&(S.clientX=R.clientX,S.clientY=R.clientY,S.deltaX=R.movementX,S.deltaY=R.movementY,this._state=0,(this._lockedPointer||(R.buttons<.LEFT)===lt.LEFT)&&(this._state=this._state|this.mouseButtons.left),(R.buttons<.MIDDLE)===lt.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(R.buttons<.RIGHT)===lt.RIGHT&&(this._state=this._state|this.mouseButtons.right),T())},h=R=>{const S=this._findPointerById(R.pointerId);if(!(S&&S===this._lockedPointer)){if(S&&this._disposePointer(S),R.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=W.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=W.NONE;p()}},f=()=>{const R=this._findPointerById(1);R&&R===this._lockedPointer||(R&&this._disposePointer(R),this._state=W.NONE,p())};let I=-1;const u=R=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===W.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const P=this._domElement.getBoundingClientRect(),v=R.clientX/P.width,G=R.clientY/P.height;if(v<this._interactiveArea.left||v>this._interactiveArea.right||G<this._interactiveArea.top||G>this._interactiveArea.bottom)return}if(R.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===W.ROTATE||this.mouseButtons.wheel===W.TRUCK){const P=performance.now();I-P<1e3&&this._getClientRect(this._elementRect),I=P}const S=cc?-1:-3,N=R.deltaMode===1?R.deltaY/S:R.deltaY/(S*10),L=this.dollyToCursor?(R.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,D=this.dollyToCursor?(R.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case W.ROTATE:{this._rotateInternal(R.deltaX,R.deltaY),this._isUserControllingRotate=!0;break}case W.TRUCK:{this._truckInternal(R.deltaX,R.deltaY,!1),this._isUserControllingTruck=!0;break}case W.OFFSET:{this._truckInternal(R.deltaX,R.deltaY,!0),this._isUserControllingOffset=!0;break}case W.DOLLY:{this._dollyInternal(-N,L,D),this._isUserControllingDolly=!0;break}case W.ZOOM:{this._zoomInternal(-N,L,D),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=R=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===bt.ACTION.NONE){const S=R instanceof PointerEvent?R.pointerId:(R instanceof MouseEvent,0),N=this._findPointerById(S);N&&this._disposePointer(N),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",f);return}R.preventDefault()}},E=R=>{if(!this._enabled)return;if(rn(this._activePointers,xt),this._getClientRect(this._elementRect),e.copy(xt),s.copy(xt),this._activePointers.length>=2){const N=xt.x-this._activePointers[1].clientX,L=xt.y-this._activePointers[1].clientY,D=Math.sqrt(N*N+L*L);n.set(0,D);const P=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,v=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;s.set(P,v)}if(this._state=0,!R)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in R&&R.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(R.buttons<.LEFT)===lt.LEFT&&(this._state=this._state|this.mouseButtons.left),(R.buttons<.MIDDLE)===lt.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(R.buttons<.RIGHT)===lt.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&W.ROTATE)===W.ROTATE||(this._state&W.TOUCH_ROTATE)===W.TOUCH_ROTATE||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&W.TRUCK)===W.TRUCK||(this._state&W.TOUCH_TRUCK)===W.TOUCH_TRUCK||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&W.DOLLY)===W.DOLLY||(this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&W.ZOOM)===W.ZOOM||(this._state&W.TOUCH_ZOOM)===W.TOUCH_ZOOM||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&W.OFFSET)===W.OFFSET||(this._state&W.TOUCH_OFFSET)===W.TOUCH_OFFSET||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},T=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,rn(this._activePointers,xt);const S=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,N=S?-S.deltaX:s.x-xt.x,L=S?-S.deltaY:s.y-xt.y;if(s.copy(xt),((this._state&W.ROTATE)===W.ROTATE||(this._state&W.TOUCH_ROTATE)===W.TOUCH_ROTATE||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(N,L),this._isUserControllingRotate=!0),(this._state&W.DOLLY)===W.DOLLY||(this._state&W.ZOOM)===W.ZOOM){const D=this.dollyToCursor?(e.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(e.y-this._elementRect.y)/this._elementRect.height*-2+1:0,v=this.dollyDragInverted?-1:1;(this._state&W.DOLLY)===W.DOLLY?(this._dollyInternal(v*L*ts,D,P),this._isUserControllingDolly=!0):(this._zoomInternal(v*L*ts,D,P),this._isUserControllingZoom=!0)}if((this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_ZOOM)===W.TOUCH_ZOOM||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE){const D=xt.x-this._activePointers[1].clientX,P=xt.y-this._activePointers[1].clientY,v=Math.sqrt(D*D+P*P),G=n.y-v;n.set(0,v);const O=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET?(this._dollyInternal(G*ts,O,w),this._isUserControllingDolly=!0):(this._zoomInternal(G*ts,O,w),this._isUserControllingZoom=!0)}((this._state&W.TRUCK)===W.TRUCK||(this._state&W.TOUCH_TRUCK)===W.TOUCH_TRUCK||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(N,L,!1),this._isUserControllingTruck=!0),((this._state&W.OFFSET)===W.OFFSET||(this._state&W.TOUCH_OFFSET)===W.TOUCH_OFFSET||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(N,L,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},p=()=>{rn(this._activePointers,xt),s.copy(xt),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",f),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",m),this._domElement.ownerDocument.addEventListener("pointerlockerror",F),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),E())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",m),this._domElement.ownerDocument.removeEventListener("pointerlockerror",F))};const m=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},F=()=>{this.unlockPointer()};this._addAllEventListeners=R=>{this._domElement=R,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",r),lc&&this._domElement.addEventListener("mousedown",o),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",r),this._domElement.removeEventListener("mousedown",o),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",f),this._domElement.ownerDocument.removeEventListener("pointerlockchange",m),this._domElement.ownerDocument.removeEventListener("pointerlockerror",F))},this.cancel=()=>{this._state!==W.NONE&&(this._state=W.NONE,this._activePointers.length=0,p())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(i){this._camera=i,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(i){this._enabled=i,this._domElement&&(i?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(i){this._spherical.radius===i&&this._sphericalEnd.radius===i||(this._spherical.radius=i,this._sphericalEnd.radius=i,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(i){this._spherical.theta===i&&this._sphericalEnd.theta===i||(this._spherical.theta=i,this._sphericalEnd.theta=i,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(i){this._spherical.phi===i&&this._sphericalEnd.phi===i||(this._spherical.phi=i,this._sphericalEnd.phi=i,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(i){this._boundaryEnclosesCamera=i,this._needsUpdate=!0}set interactiveArea(i){this._interactiveArea.width=te(i.width,0,1),this._interactiveArea.height=te(i.height,0,1),this._interactiveArea.x=te(i.x,0,1-this._interactiveArea.width),this._interactiveArea.y=te(i.y,0,1-this._interactiveArea.height)}addEventListener(i,t){super.addEventListener(i,t)}removeEventListener(i,t){super.removeEventListener(i,t)}rotate(i,t,e=!1){return this.rotateTo(this._sphericalEnd.theta+i,this._sphericalEnd.phi+t,e)}rotateAzimuthTo(i,t=!1){return this.rotateTo(i,this._sphericalEnd.phi,t)}rotatePolarTo(i,t=!1){return this.rotateTo(this._sphericalEnd.theta,i,t)}rotateTo(i,t,e=!1){this._isUserControllingRotate=!1;const s=te(i,this.minAzimuthAngle,this.maxAzimuthAngle),n=te(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=s,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,e||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const r=!e||Et(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Et(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(r)}dolly(i,t=!1){return this.dollyTo(this._sphericalEnd.radius-i,t)}dollyTo(i,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Xe.NONE,this._changedDolly=0,this._dollyToNoClamp(te(i,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(i,t=!1){const e=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const r=this._collisionTest(),o=Et(r,this._spherical.radius);if(!(e>i)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(i,r)}else this._sphericalEnd.radius=i;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||Et(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(i,t=!1){this._targetEnd.add(this._getCameraDirection(di).multiplyScalar(i)),t||this._target.copy(this._targetEnd);const e=!t||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(e)}zoom(i,t=!1){return this.zoomTo(this._zoomEnd+i,t)}zoomTo(i,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=te(i,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const e=!t||Et(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(e)}pan(i,t,e=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(i,t,e)}truck(i,t,e=!1){this._camera.updateMatrix(),re.setFromMatrixColumn(this._camera.matrix,0),oe.setFromMatrixColumn(this._camera.matrix,1),re.multiplyScalar(i),oe.multiplyScalar(-t);const s=ht.copy(re).add(oe),n=dt.copy(this._targetEnd).add(s);return this.moveTo(n.x,n.y,n.z,e)}forward(i,t=!1){ht.setFromMatrixColumn(this._camera.matrix,0),ht.crossVectors(this._camera.up,ht),ht.multiplyScalar(i);const e=dt.copy(this._targetEnd).add(ht);return this.moveTo(e.x,e.y,e.z,t)}elevate(i,t=!1){return ht.copy(this._camera.up).multiplyScalar(i),this.moveTo(this._targetEnd.x+ht.x,this._targetEnd.y+ht.y,this._targetEnd.z+ht.z,t)}moveTo(i,t,e,s=!1){this._isUserControllingTruck=!1;const n=ht.set(i,t,e).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,s||this._target.copy(this._targetEnd);const r=!s||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}lookInDirectionOf(i,t,e,s=!1){const o=ht.set(i,t,e).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(o.x,o.y,o.z,s)}fitToBox(i,t,{cover:e=!1,paddingLeft:s=0,paddingRight:n=0,paddingBottom:r=0,paddingTop:o=0}={}){const a=[],l=i.isBox3?je.copy(i):je.setFromObject(i);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=dr(this._sphericalEnd.theta,Ir),f=dr(this._sphericalEnd.phi,Ir);a.push(this.rotateTo(h,f,t));const I=ht.setFromSpherical(this._sphericalEnd).normalize(),u=Rr.setFromUnitVectors(I,an),d=Et(Math.abs(I.y),1);d&&u.multiply(ln.setFromAxisAngle(es,h)),u.multiply(this._yAxisUpSpaceInverse);const E=mr.makeEmpty();dt.copy(l.min).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.min).setX(l.max.x).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.min).setY(l.max.y).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).setZ(l.min.z).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.min).setZ(l.max.z).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).setY(l.min.y).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).setX(l.min.x).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).applyQuaternion(u),E.expandByPoint(dt),E.min.x-=s,E.min.y-=r,E.max.x+=n,E.max.y+=o,u.setFromUnitVectors(an,I),d&&u.premultiply(ln.invert()),u.premultiply(this._yAxisUpSpace);const T=E.getSize(ht),p=E.getCenter(dt).applyQuaternion(u);if(Pe(this._camera)){const m=this.getDistanceToFitBox(T.x,T.y,T.z,e);a.push(this.moveTo(p.x,p.y,p.z,t)),a.push(this.dollyTo(m,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(Re(this._camera)){const m=this._camera,F=m.right-m.left,R=m.top-m.bottom,S=e?Math.max(F/T.x,R/T.y):Math.min(F/T.x,R/T.y);a.push(this.moveTo(p.x,p.y,p.z,t)),a.push(this.zoomTo(S,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(i,t){const e=[],n=i instanceof ct.Sphere?cn.copy(i):bt.createBoundingSphere(i,cn);if(e.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),Pe(this._camera)){const r=this.getDistanceToFitSphere(n.radius);e.push(this.dollyTo(r,t))}else if(Re(this._camera)){const r=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,a=2*n.radius,l=Math.min(r/a,o/a);e.push(this.zoomTo(l,t))}return e.push(this.setFocalOffset(0,0,0,t)),Promise.all(e)}setLookAt(i,t,e,s,n,r,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Xe.NONE,this._changedDolly=0;const a=dt.set(s,n,r),l=ht.set(i,t,e);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold)&&Et(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Et(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Et(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(i,t,e,s,n,r,o,a,l,h,f,I,u,d=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Xe.NONE,this._changedDolly=0;const E=ht.set(s,n,r),T=dt.set(i,t,e);kt.setFromVector3(T.sub(E).applyQuaternion(this._yAxisUpSpace));const p=Ze.set(h,f,I),m=dt.set(o,a,l);Ei.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(E.lerp(p,u));const F=Ei.theta-kt.theta,R=Ei.phi-kt.phi,S=Ei.radius-kt.radius;this._sphericalEnd.set(kt.radius+S*u,kt.phi+R*u,kt.theta+F*u),this.normalizeRotations(),this._needsUpdate=!0,d||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const N=!d||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold)&&Et(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Et(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Et(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(N)}setPosition(i,t,e,s=!1){return this.setLookAt(i,t,e,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,s)}setTarget(i,t,e,s=!1){const n=this.getPosition(ht),r=this.setLookAt(n.x,n.y,n.z,i,t,e,s);return this._sphericalEnd.phi=te(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),r}setFocalOffset(i,t,e,s=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(i,t,e),this._needsUpdate=!0,s||this._focalOffset.copy(this._focalOffsetEnd);const n=!s||Et(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&Et(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&Et(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(i,t,e){this._camera.updateMatrixWorld(),re.setFromMatrixColumn(this._camera.matrixWorldInverse,0),oe.setFromMatrixColumn(this._camera.matrixWorldInverse,1),_e.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const s=ht.set(i,t,e),n=s.distanceTo(this._camera.position),r=s.sub(this._camera.position);re.multiplyScalar(r.x),oe.multiplyScalar(r.y),_e.multiplyScalar(r.z),ht.copy(re).add(oe).add(_e),ht.z=ht.z+n,this.dollyTo(n,!1),this.setFocalOffset(-ht.x,ht.y,-ht.z,!1),this.moveTo(i,t,e,!1)}setBoundary(i){if(!i){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(i),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(i,t,e,s){if(i===null){this._viewport=null;return}this._viewport=this._viewport||new ct.Vector4,typeof i=="number"?this._viewport.set(i,t,e,s):this._viewport.copy(i)}getDistanceToFitBox(i,t,e,s=!1){if(on(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=i/t,r=this._camera.getEffectiveFOV()*ui,o=this._camera.aspect;return((s?n>o:n<o)?t:i/o)*.5/Math.tan(r*.5)+e*.5}getDistanceToFitSphere(i){if(on(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*ui,e=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,s=1<this._camera.aspect?t:e;return i/Math.sin(s*.5)}getTarget(i,t=!0){return(i&&i.isVector3?i:new ct.Vector3).copy(t?this._targetEnd:this._target)}getPosition(i,t=!0){return(i&&i.isVector3?i:new ct.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(i,t=!0){return(i&&i instanceof ct.Spherical?i:new ct.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(i,t=!0){return(i&&i.isVector3?i:new ct.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%$e,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=$e),this._spherical.theta+=$e*Math.round((this._sphericalEnd.theta-this._spherical.theta)/$e)}reset(i=!1){if(!Et(this._camera.up.x,this._cameraUp0.x)||!Et(this._camera.up.y,this._cameraUp0.y)||!Et(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const e=this.getPosition(ht);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,i),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,i),this.zoomTo(this._zoom0,i)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,es),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const i=ht.subVectors(this._target,this._camera.position).normalize(),t=dt.crossVectors(i,this._camera.up);this._camera.up.crossVectors(t,i).normalize(),this._camera.updateMatrixWorld();const e=this.getPosition(ht);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}update(i){const t=this._sphericalEnd.theta-this._spherical.theta,e=this._sphericalEnd.phi-this._spherical.phi,s=this._sphericalEnd.radius-this._spherical.radius,n=Cr.subVectors(this._targetEnd,this._target),r=Tr.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(gt(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Ji(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,f,1/0,i),this._needsUpdate=!0}if(gt(e))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Ji(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,f,1/0,i),this._needsUpdate=!0}if(gt(s))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const f=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Ji(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,f,this.maxSpeed,i),this._needsUpdate=!0}if(gt(n.x)&>(n.y)&>(n.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const f=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;Er(this._target,this._targetEnd,this._targetVelocity,f,this.maxSpeed,i,this._target),this._needsUpdate=!0}if(gt(r.x)&>(r.y)&>(r.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const f=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;Er(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,f,this.maxSpeed,i,this._focalOffset),this._needsUpdate=!0}if(gt(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const f=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Ji(this._zoom,this._zoomEnd,this._zoomVelocity,f,1/0,i)}if(this.dollyToCursor){if(Pe(this._camera)&&this._changedDolly!==0){const f=this._spherical.radius-this._lastDistance,I=this._camera,u=this._getCameraDirection(di),d=ht.copy(u).cross(I.up).normalize();d.lengthSq()===0&&(d.x=1);const E=dt.crossVectors(d,u),T=this._sphericalEnd.radius*Math.tan(I.getEffectiveFOV()*ui*.5),m=(this._sphericalEnd.radius-f-this._sphericalEnd.radius)/this._sphericalEnd.radius,F=Ze.copy(this._targetEnd).add(d.multiplyScalar(this._dollyControlCoord.x*T*I.aspect)).add(E.multiplyScalar(this._dollyControlCoord.y*T)),R=ht.copy(this._targetEnd).lerp(F,m),S=this._lastDollyDirection===Xe.IN&&this._spherical.radius<=this.minDistance,N=this._lastDollyDirection===Xe.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(S||N)){this._sphericalEnd.radius-=f,this._spherical.radius-=f;const D=dt.copy(u).multiplyScalar(-f);R.add(D)}this._boundary.clampPoint(R,R);const L=dt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(L),this._changedDolly-=f,gt(this._changedDolly)&&(this._changedDolly=0)}else if(Re(this._camera)&&this._changedZoom!==0){const f=this._zoom-this._lastZoom,I=this._camera,u=ht.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(I.near+I.far)/(I.near-I.far)).unproject(I),d=dt.set(0,0,-1).applyQuaternion(I.quaternion),E=Ze.copy(u).add(d.multiplyScalar(-u.dot(I.up))),p=-(this._zoom-f-this._zoom)/this._zoom,m=this._getCameraDirection(di),F=this._targetEnd.dot(m),R=ht.copy(this._targetEnd).lerp(E,p),S=R.dot(m),N=m.multiplyScalar(S-F);R.sub(N),this._boundary.clampPoint(R,R);const L=dt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(L),this._changedZoom-=f,gt(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const a=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,a),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!gt(this._focalOffset.x)||!gt(this._focalOffset.y)||!gt(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),re.setFromMatrixColumn(this._camera.matrix,0),oe.setFromMatrixColumn(this._camera.matrix,1),_e.setFromMatrixColumn(this._camera.matrix,2),re.multiplyScalar(this._focalOffset.x),oe.multiplyScalar(-this._focalOffset.y),_e.multiplyScalar(this._focalOffset.z),ht.copy(re).add(oe).add(_e),this._camera.position.add(ht)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),ht.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const h=this._needsUpdate;return h&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):h?(this.dispatchEvent({type:"update"}),gt(t,this.restThreshold)&>(e,this.restThreshold)&>(s,this.restThreshold)&>(n.x,this.restThreshold)&>(n.y,this.restThreshold)&>(n.z,this.restThreshold)&>(r.x,this.restThreshold)&>(r.y,this.restThreshold)&>(r.z,this.restThreshold)&>(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!h&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=h,this._needsUpdate=!1,h}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:fi(this.maxDistance),minZoom:this.minZoom,maxZoom:fi(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:fi(this.maxPolarAngle),minAzimuthAngle:fi(this.minAzimuthAngle),maxAzimuthAngle:fi(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:ht.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(i,t=!1){const e=JSON.parse(i);this.enabled=e.enabled,this.minDistance=e.minDistance,this.maxDistance=Ii(e.maxDistance),this.minZoom=e.minZoom,this.maxZoom=Ii(e.maxZoom),this.minPolarAngle=e.minPolarAngle,this.maxPolarAngle=Ii(e.maxPolarAngle),this.minAzimuthAngle=Ii(e.minAzimuthAngle),this.maxAzimuthAngle=Ii(e.maxAzimuthAngle),this.smoothTime=e.smoothTime,this.draggingSmoothTime=e.draggingSmoothTime,this.dollySpeed=e.dollySpeed,this.truckSpeed=e.truckSpeed,this.dollyToCursor=e.dollyToCursor,this.verticalDragToForward=e.verticalDragToForward,this._target0.fromArray(e.target0),this._position0.fromArray(e.position0),this._zoom0=e.zoom0,this._focalOffset0.fromArray(e.focalOffset0),this.moveTo(e.target[0],e.target[1],e.target[2],t),kt.setFromVector3(ht.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(kt.theta,kt.phi,t),this.dollyTo(kt.radius,t),this.zoomTo(e.zoom,t),this.setFocalOffset(e.focalOffset[0],e.focalOffset[1],e.focalOffset[2],t),this._needsUpdate=!0}connect(i){if(this._domElement){console.warn("camera-controls is already connected.");return}i.setAttribute("data-camera-controls-version",ac),this._addAllEventListeners(i),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(i){return i.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(i){return this._getTargetDirection(i).negate()}_findPointerById(i){return this._activePointers.find(t=>t.pointerId===i)}_findPointerByMouseButton(i){return this._activePointers.find(t=>t.mouseButton===i)}_disposePointer(i){this._activePointers.splice(this._activePointers.indexOf(i),1)}_encloseToBoundary(i,t,e){const s=t.lengthSq();if(s===0)return i;const n=dt.copy(t).add(i),o=this._boundary.clampPoint(n,Ze).sub(n),a=o.lengthSq();if(a===0)return i.add(t);if(a===s)return i;if(e===0)return i.add(t).add(o);{const l=1+e*a/t.dot(o);return i.add(dt.copy(t).multiplyScalar(l)).add(o.multiplyScalar(1-e))}}_updateNearPlaneCorners(){if(Pe(this._camera)){const i=this._camera,t=i.near,e=i.getEffectiveFOV()*ui,s=Math.tan(e*.5)*t,n=s*i.aspect;this._nearPlaneCorners[0].set(-n,-s,0),this._nearPlaneCorners[1].set(n,-s,0),this._nearPlaneCorners[2].set(n,s,0),this._nearPlaneCorners[3].set(-n,s,0)}else if(Re(this._camera)){const i=this._camera,t=1/i.zoom,e=i.left*t,s=i.right*t,n=i.top*t,r=i.bottom*t;this._nearPlaneCorners[0].set(e,n,0),this._nearPlaneCorners[1].set(s,n,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(e,r,0)}}_collisionTest(){let i=1/0;if(!(this.colliderMeshes.length>=1)||on(this._camera,"_collisionTest"))return i;const e=this._getTargetDirection(di);hn.lookAt(pr,e,this._camera.up);for(let s=0;s<4;s++){const n=dt.copy(this._nearPlaneCorners[s]);n.applyMatrix4(hn);const r=Ze.addVectors(this._target,n);is.set(r,e),is.far=this._spherical.radius+1;const o=is.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<i&&(i=o[0].distance)}return i}_getClientRect(i){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return i.x=t.left,i.y=t.top,this._viewport?(i.x+=this._viewport.x,i.y+=t.height-this._viewport.w-this._viewport.y,i.width=this._viewport.z,i.height=this._viewport.w):(i.width=t.width,i.height=t.height),i}_createOnRestPromise(i){return i?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const e=()=>{this.removeEventListener("rest",e),t()};this.addEventListener("rest",e)}))}_addAllEventListeners(i){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(i){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(i){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(i,t=new ct.Sphere){const e=t,s=e.center;je.makeEmpty(),i.traverseVisible(r=>{r.isMesh&&je.expandByObject(r)}),je.getCenter(s);let n=0;return i.traverseVisible(r=>{if(!r.isMesh)return;const o=r,a=o.geometry.clone();a.applyMatrix4(o.matrixWorld);const h=a.attributes.position;for(let f=0,I=h.count;f<I;f++)ht.fromBufferAttribute(h,f),n=Math.max(n,s.distanceToSquared(ht))}),e.radius=Math.sqrt(n),e}}class Je extends Yr{constructor(t){super(t);C(this,"onBeforeUpdate",new q);C(this,"onAfterUpdate",new q);C(this,"onAspectUpdated",new q);C(this,"onDisposed",new q);C(this,"three");C(this,"_allControls",new Map);C(this,"updateAspect",()=>{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof b.OrthographicCamera){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const e=this.currentWorld.renderer.getSize();this.three.aspect=e.width/e.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}});this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:e,world:s})=>{if(e==="added"){const n=this.newCameraControls();this._allControls.set(s.uuid,n)}if(e==="removed"){const n=this._allControls.get(s.uuid);n&&(n.dispose(),this._allControls.delete(s.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const t=this._allControls.get(this.currentWorld.uuid);if(!t)throw new Error("Controls not found!");return t}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(t){this.currentWorld!==null&&(this.controls.enabled=t)}dispose(){this.setupEvents(!1),this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[t,e]of this._allControls)e.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,e=new b.PerspectiveCamera(60,t,1,1e3);return e.position.set(50,50,50),e.lookAt(new b.Vector3(0,0,0)),e}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");bt.install({THREE:Je.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,e=new bt(this.three,t);return e.smoothTime=.2,e.dollyToCursor=!0,e.infinityDolly=!0,e.minDistance=6,e}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:b.MOUSE,Vector2:b.Vector2,Vector3:b.Vector3,Vector4:b.Vector4,Quaternion:b.Quaternion,Matrix4:b.Matrix4,Spherical:b.Spherical,Box3:b.Box3,Sphere:b.Sphere,Raycaster:b.Raycaster,MathUtils:b.MathUtils}}}const As=class As extends mt{constructor(t){super(t);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"list",new Qt);C(this,"enabled",!0);t.add(As.uuid,this)}create(){const t=new Hr(this.components),e=t.uuid;if(this.list.has(e))throw new Error("There is already a world with this name!");return this.list.set(e,t),t}delete(t){if(!this.list.has(t.uuid))throw new Error("The provided world is not found in the list!");this.list.delete(t.uuid),t.dispose()}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[e,s]of this.list)s.update(t)}};C(As,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let Pi=As;function hc(c,i,t,e){return new Promise((s,n)=>{function r(){const o=c.clientWaitSync(i,t,0);if(o===c.WAIT_FAILED){n();return}if(o===c.TIMEOUT_EXPIRED){setTimeout(r,e);return}s()}r()})}async function uc(c,i,t,e,s,n,r){const o=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await hc(c,o,0,10),c.deleteSync(o),c.bindBuffer(i,t),c.getBufferSubData(i,e,s,n,r),c.bindBuffer(i,null)}async function Bn(c,i,t,e,s,n,r,o){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,o.byteLength,c.STREAM_READ),c.readPixels(i,t,e,s,n,r,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await uc(c,c.PIXEL_PACK_BUFFER,a,0,o),c.deleteBuffer(a),o}class fc extends ye{constructor(){super(...arguments);C(this,"_config",{enabled:{value:!0,type:"Boolean"},width:{type:"Number",interpolable:!0,value:512,min:32,max:1024},height:{type:"Number",interpolable:!0,value:512,min:32,max:1024},autoUpdate:{value:!0,type:"Boolean"},renderDebugFrame:{value:!1,type:"Boolean"},updateInterval:{type:"Number",interpolable:!0,value:1,min:0,max:1},threshold:{type:"Number",interpolable:!0,value:100,min:1,max:512}});C(this,"_interval",null)}get enabled(){return this._config.enabled.value}set enabled(t){this._config.enabled.value=t,this._component.enabled=t}get width(){return this._config.width.value}set width(t){this.setWidthHeight(t,this.height)}get height(){return this._config.height.value}set height(t){this.setWidthHeight(this.width,t)}get autoUpdate(){return this._config.autoUpdate.value}set autoUpdate(t){this.setAutoAndInterval(t,this.updateInterval)}get updateInterval(){return this._config.updateInterval.value}set updateInterval(t){this.setAutoAndInterval(this.autoUpdate,t)}get renderDebugFrame(){return this._config.renderDebugFrame.value}set renderDebugFrame(t){this._config.renderDebugFrame.value=t}get threshold(){return this._config.threshold.value}set threshold(t){this._config.threshold.value=t}setWidthHeight(t,e){if(t<=0||e<=0)throw new Error("The width and height of the culler renderer must be more than 0!");this._config.width.value=t,this._config.height.value=e,this.resetRenderTarget()}setAutoAndInterval(t,e){if(e<=0)throw new Error("The updateInterval of the culler renderer must be more than 0!");this._config.autoUpdate.value=t,this._config.updateInterval.value=e,this.resetInterval(t)}resetRenderTarget(){this._component.renderTarget.dispose(),this._component.renderTarget=new b.WebGLRenderTarget(this.width,this.height),this._component.bufferSize=this.width*this.height*4,this._component.buffer=new Uint8Array(this._component.bufferSize)}resetInterval(t){this._interval!==null&&window.clearInterval(this._interval),t&&(this._interval=window.setInterval(async()=>{this._component.preventUpdate||await this._component.updateVisibility()},this.updateInterval))}}class jr{constructor(i,t){C(this,"onSetup",new q);C(this,"onDisposed",new q);C(this,"onViewUpdated",new fe);C(this,"enabled",!0);C(this,"needsUpdate",!1);C(this,"components");C(this,"renderTarget",new b.WebGLRenderTarget);C(this,"bufferSize",1);C(this,"buffer",new Uint8Array);C(this,"preventUpdate",!1);C(this,"config");C(this,"isSetup",!1);C(this,"world");C(this,"renderer");C(this,"_defaultConfig",{enabled:!0,height:512,width:512,updateInterval:1e3,autoUpdate:!0,renderDebugFrame:!1,threshold:100});C(this,"worker");C(this,"scene",new b.Scene);C(this,"_availableColor",1);C(this,"_isWorkerBusy",!1);C(this,"updateVisibility",async i=>{if(!this.enabled||!this.needsUpdate&&!i||this._isWorkerBusy)return;this._isWorkerBusy=!0;const t=this.world.camera.three;t.updateMatrix();const{width:e,height:s}=this.config;this.renderer.setSize(e,s),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,t);const n=this.renderer.getContext();await Bn(n,0,0,e,s,n.RGBA,n.UNSIGNED_BYTE,this.buffer),this.renderer.setRenderTarget(null),this.config.renderDebugFrame&&this.renderer.render(this.scene,t),this.worker.postMessage({buffer:this.buffer}),this.needsUpdate=!1});if(!t.renderer)throw new Error("The given world must have a renderer!");this.components=i,this.config=new fc(this,this.components,"Culler renderer"),this.world=t,this.renderer=new b.WebGLRenderer,this.renderer.clippingPlanes=t.renderer.clippingPlanes;const e=`
|
|
10
|
+
*/const lt={LEFT:1,RIGHT:2,MIDDLE:4},W=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Xe={NONE:0,IN:1,OUT:-1};function Pe(c){return c.isPerspectiveCamera}function Re(c){return c.isOrthographicCamera}const $e=Math.PI*2,Ir=Math.PI/2,$r=1e-5,ui=Math.PI/180;function te(c,i,t){return Math.max(i,Math.min(t,c))}function gt(c,i=$r){return Math.abs(c)<i}function Et(c,i,t=$r){return gt(c-i,t)}function dr(c,i){return Math.round(c/i)*i}function fi(c){return isFinite(c)?c:c<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Ii(c){return Math.abs(c)<Number.MAX_VALUE?c:c*(1/0)}function Ji(c,i,t,e,s=1/0,n){e=Math.max(1e-4,e);const r=2/e,o=r*n,a=1/(1+o+.48*o*o+.235*o*o*o);let l=c-i;const h=i,f=s*e;l=te(l,-f,f),i=c-l;const I=(t.value+r*l)*n;t.value=(t.value-r*I)*a;let u=i+(l+I)*a;return h-c>0==u>h&&(u=h,t.value=(u-h)/n),u}function Er(c,i,t,e,s=1/0,n,r){e=Math.max(1e-4,e);const o=2/e,a=o*n,l=1/(1+a+.48*a*a+.235*a*a*a);let h=i.x,f=i.y,I=i.z,u=c.x-h,d=c.y-f,E=c.z-I;const T=h,p=f,m=I,F=s*e,R=F*F,S=u*u+d*d+E*E;if(S>R){const U=Math.sqrt(S);u=u/U*F,d=d/U*F,E=E/U*F}h=c.x-u,f=c.y-d,I=c.z-E;const N=(t.x+o*u)*n,L=(t.y+o*d)*n,D=(t.z+o*E)*n;t.x=(t.x-o*N)*l,t.y=(t.y-o*L)*l,t.z=(t.z-o*D)*l,r.x=h+(u+N)*l,r.y=f+(d+L)*l,r.z=I+(E+D)*l;const P=T-c.x,v=p-c.y,G=m-c.z,O=r.x-T,w=r.y-p,g=r.z-m;return P*O+v*w+G*g>0&&(r.x=T,r.y=p,r.z=m,t.x=(r.x-T)/n,t.y=(r.y-p)/n,t.z=(r.z-m)/n),r}function rn(c,i){i.set(0,0),c.forEach(t=>{i.x+=t.clientX,i.y+=t.clientY}),i.x/=c.length,i.y/=c.length}function on(c,i){return Re(c)?(console.warn(`${i} is not supported in OrthographicCamera`),!0):!1}class ac{constructor(){this._listeners={}}addEventListener(i,t){const e=this._listeners;e[i]===void 0&&(e[i]=[]),e[i].indexOf(t)===-1&&e[i].push(t)}hasEventListener(i,t){const e=this._listeners;return e[i]!==void 0&&e[i].indexOf(t)!==-1}removeEventListener(i,t){const s=this._listeners[i];if(s!==void 0){const n=s.indexOf(t);n!==-1&&s.splice(n,1)}}removeAllEventListeners(i){if(!i){this._listeners={};return}Array.isArray(this._listeners[i])&&(this._listeners[i].length=0)}dispatchEvent(i){const e=this._listeners[i.type];if(e!==void 0){i.target=this;const s=e.slice(0);for(let n=0,r=s.length;n<r;n++)s[n].call(this,i)}}}const cc="2.7.3",ts=1/8,Zr=typeof window<"u",lc=Zr&&/Mac/.test(navigator.platform),hc=!(Zr&&"PointerEvent"in window);let ct,pr,es,an,xt,ht,dt,Ze,di,re,oe,_e,Cr,Tr,kt,Ei,je,mr,cn,Rr,ln,hn,is;class bt extends ac{static install(i){ct=i.THREE,pr=Object.freeze(new ct.Vector3(0,0,0)),es=Object.freeze(new ct.Vector3(0,1,0)),an=Object.freeze(new ct.Vector3(0,0,1)),xt=new ct.Vector2,ht=new ct.Vector3,dt=new ct.Vector3,Ze=new ct.Vector3,di=new ct.Vector3,re=new ct.Vector3,oe=new ct.Vector3,_e=new ct.Vector3,Cr=new ct.Vector3,Tr=new ct.Vector3,kt=new ct.Spherical,Ei=new ct.Spherical,je=new ct.Box3,mr=new ct.Box3,cn=new ct.Sphere,Rr=new ct.Quaternion,ln=new ct.Quaternion,hn=new ct.Matrix4,is=new ct.Raycaster}static get ACTION(){return W}constructor(i,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=W.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Xe.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new ct.Vector3,this._focalOffsetVelocity=new ct.Vector3,this._zoomVelocity={value:0},this._truckInternal=(R,S,N)=>{let L,D;if(Pe(this._camera)){const P=ht.copy(this._camera.position).sub(this._target),v=this._camera.getEffectiveFOV()*ui,G=P.length()*Math.tan(v*.5);L=this.truckSpeed*R*G/this._elementRect.height,D=this.truckSpeed*S*G/this._elementRect.height}else if(Re(this._camera)){const P=this._camera;L=R*(P.right-P.left)/P.zoom/this._elementRect.width,D=S*(P.top-P.bottom)/P.zoom/this._elementRect.height}else return;this.verticalDragToForward?(N?this.setFocalOffset(this._focalOffsetEnd.x+L,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(L,0,!0),this.forward(-D,!0)):N?this.setFocalOffset(this._focalOffsetEnd.x+L,this._focalOffsetEnd.y+D,this._focalOffsetEnd.z,!0):this.truck(L,D,!0)},this._rotateInternal=(R,S)=>{const N=$e*this.azimuthRotateSpeed*R/this._elementRect.height,L=$e*this.polarRotateSpeed*S/this._elementRect.height;this.rotate(N,L,!0)},this._dollyInternal=(R,S,N)=>{const L=Math.pow(.95,-R*this.dollySpeed),D=this._sphericalEnd.radius,P=this._sphericalEnd.radius*L,v=te(P,this.minDistance,this.maxDistance),G=v-P;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(P,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(G,!0),this._dollyToNoClamp(v,!0)):this._dollyToNoClamp(v,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?P:v)-D,this._dollyControlCoord.set(S,N)),this._lastDollyDirection=Math.sign(-R)},this._zoomInternal=(R,S,N)=>{const L=Math.pow(.95,R*this.dollySpeed),D=this._zoom,P=this._zoom*L;this.zoomTo(P,!0),this.dollyToCursor&&(this._changedZoom+=P-D,this._dollyControlCoord.set(S,N))},typeof ct>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=i,this._yAxisUpSpace=new ct.Quaternion().setFromUnitVectors(this._camera.up,es),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=W.NONE,this._target=new ct.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new ct.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new ct.Spherical().setFromVector3(ht.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new ct.Vector3,new ct.Vector3,new ct.Vector3,new ct.Vector3],this._updateNearPlaneCorners(),this._boundary=new ct.Box3(new ct.Vector3(-1/0,-1/0,-1/0),new ct.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new ct.Vector2,this.mouseButtons={left:W.ROTATE,middle:W.DOLLY,right:W.TRUCK,wheel:Pe(this._camera)?W.DOLLY:Re(this._camera)?W.ZOOM:W.NONE},this.touches={one:W.TOUCH_ROTATE,two:Pe(this._camera)?W.TOUCH_DOLLY_TRUCK:Re(this._camera)?W.TOUCH_ZOOM_TRUCK:W.NONE,three:W.TOUCH_TRUCK};const e=new ct.Vector2,s=new ct.Vector2,n=new ct.Vector2,r=R=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const L=this._domElement.getBoundingClientRect(),D=R.clientX/L.width,P=R.clientY/L.height;if(D<this._interactiveArea.left||D>this._interactiveArea.right||P<this._interactiveArea.top||P>this._interactiveArea.bottom)return}const S=R.pointerType!=="mouse"?null:(R.buttons<.LEFT)===lt.LEFT?lt.LEFT:(R.buttons<.MIDDLE)===lt.MIDDLE?lt.MIDDLE:(R.buttons<.RIGHT)===lt.RIGHT?lt.RIGHT:null;if(S!==null){const L=this._findPointerByMouseButton(S);L&&this._disposePointer(L)}if((R.buttons<.LEFT)===lt.LEFT&&this._lockedPointer)return;const N={pointerId:R.pointerId,clientX:R.clientX,clientY:R.clientY,deltaX:0,deltaY:0,mouseButton:S};this._activePointers.push(N),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),this._isDragging=!0,E(R)},o=R=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const L=this._domElement.getBoundingClientRect(),D=R.clientX/L.width,P=R.clientY/L.height;if(D<this._interactiveArea.left||D>this._interactiveArea.right||P<this._interactiveArea.top||P>this._interactiveArea.bottom)return}const S=(R.buttons<.LEFT)===lt.LEFT?lt.LEFT:(R.buttons<.MIDDLE)===lt.MIDDLE?lt.MIDDLE:(R.buttons<.RIGHT)===lt.RIGHT?lt.RIGHT:null;if(S!==null){const L=this._findPointerByMouseButton(S);L&&this._disposePointer(L)}const N={pointerId:1,clientX:R.clientX,clientY:R.clientY,deltaX:0,deltaY:0,mouseButton:(R.buttons<.LEFT)===lt.LEFT?lt.LEFT:(R.buttons<.MIDDLE)===lt.LEFT?lt.MIDDLE:(R.buttons<.RIGHT)===lt.LEFT?lt.RIGHT:null};this._activePointers.push(N),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",f),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",f),this._isDragging=!0,E(R)},a=R=>{R.cancelable&&R.preventDefault();const S=R.pointerId,N=this._lockedPointer||this._findPointerById(S);if(N){if(N.clientX=R.clientX,N.clientY=R.clientY,N.deltaX=R.movementX,N.deltaY=R.movementY,this._state=0,R.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(R.buttons<.LEFT)===lt.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(R.buttons<.MIDDLE)===lt.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(R.buttons<.RIGHT)===lt.RIGHT&&(this._state=this._state|this.mouseButtons.right);T()}},l=R=>{const S=this._lockedPointer||this._findPointerById(1);S&&(S.clientX=R.clientX,S.clientY=R.clientY,S.deltaX=R.movementX,S.deltaY=R.movementY,this._state=0,(this._lockedPointer||(R.buttons<.LEFT)===lt.LEFT)&&(this._state=this._state|this.mouseButtons.left),(R.buttons<.MIDDLE)===lt.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(R.buttons<.RIGHT)===lt.RIGHT&&(this._state=this._state|this.mouseButtons.right),T())},h=R=>{const S=this._findPointerById(R.pointerId);if(!(S&&S===this._lockedPointer)){if(S&&this._disposePointer(S),R.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=W.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=W.NONE;p()}},f=()=>{const R=this._findPointerById(1);R&&R===this._lockedPointer||(R&&this._disposePointer(R),this._state=W.NONE,p())};let I=-1;const u=R=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===W.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const P=this._domElement.getBoundingClientRect(),v=R.clientX/P.width,G=R.clientY/P.height;if(v<this._interactiveArea.left||v>this._interactiveArea.right||G<this._interactiveArea.top||G>this._interactiveArea.bottom)return}if(R.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===W.ROTATE||this.mouseButtons.wheel===W.TRUCK){const P=performance.now();I-P<1e3&&this._getClientRect(this._elementRect),I=P}const S=lc?-1:-3,N=R.deltaMode===1?R.deltaY/S:R.deltaY/(S*10),L=this.dollyToCursor?(R.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,D=this.dollyToCursor?(R.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case W.ROTATE:{this._rotateInternal(R.deltaX,R.deltaY),this._isUserControllingRotate=!0;break}case W.TRUCK:{this._truckInternal(R.deltaX,R.deltaY,!1),this._isUserControllingTruck=!0;break}case W.OFFSET:{this._truckInternal(R.deltaX,R.deltaY,!0),this._isUserControllingOffset=!0;break}case W.DOLLY:{this._dollyInternal(-N,L,D),this._isUserControllingDolly=!0;break}case W.ZOOM:{this._zoomInternal(-N,L,D),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=R=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===bt.ACTION.NONE){const S=R instanceof PointerEvent?R.pointerId:(R instanceof MouseEvent,0),N=this._findPointerById(S);N&&this._disposePointer(N),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",f);return}R.preventDefault()}},E=R=>{if(!this._enabled)return;if(rn(this._activePointers,xt),this._getClientRect(this._elementRect),e.copy(xt),s.copy(xt),this._activePointers.length>=2){const N=xt.x-this._activePointers[1].clientX,L=xt.y-this._activePointers[1].clientY,D=Math.sqrt(N*N+L*L);n.set(0,D);const P=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,v=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;s.set(P,v)}if(this._state=0,!R)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in R&&R.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(R.buttons<.LEFT)===lt.LEFT&&(this._state=this._state|this.mouseButtons.left),(R.buttons<.MIDDLE)===lt.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(R.buttons<.RIGHT)===lt.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&W.ROTATE)===W.ROTATE||(this._state&W.TOUCH_ROTATE)===W.TOUCH_ROTATE||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&W.TRUCK)===W.TRUCK||(this._state&W.TOUCH_TRUCK)===W.TOUCH_TRUCK||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&W.DOLLY)===W.DOLLY||(this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&W.ZOOM)===W.ZOOM||(this._state&W.TOUCH_ZOOM)===W.TOUCH_ZOOM||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&W.OFFSET)===W.OFFSET||(this._state&W.TOUCH_OFFSET)===W.TOUCH_OFFSET||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},T=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,rn(this._activePointers,xt);const S=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,N=S?-S.deltaX:s.x-xt.x,L=S?-S.deltaY:s.y-xt.y;if(s.copy(xt),((this._state&W.ROTATE)===W.ROTATE||(this._state&W.TOUCH_ROTATE)===W.TOUCH_ROTATE||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(N,L),this._isUserControllingRotate=!0),(this._state&W.DOLLY)===W.DOLLY||(this._state&W.ZOOM)===W.ZOOM){const D=this.dollyToCursor?(e.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(e.y-this._elementRect.y)/this._elementRect.height*-2+1:0,v=this.dollyDragInverted?-1:1;(this._state&W.DOLLY)===W.DOLLY?(this._dollyInternal(v*L*ts,D,P),this._isUserControllingDolly=!0):(this._zoomInternal(v*L*ts,D,P),this._isUserControllingZoom=!0)}if((this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_ZOOM)===W.TOUCH_ZOOM||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE){const D=xt.x-this._activePointers[1].clientX,P=xt.y-this._activePointers[1].clientY,v=Math.sqrt(D*D+P*P),G=n.y-v;n.set(0,v);const O=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET?(this._dollyInternal(G*ts,O,w),this._isUserControllingDolly=!0):(this._zoomInternal(G*ts,O,w),this._isUserControllingZoom=!0)}((this._state&W.TRUCK)===W.TRUCK||(this._state&W.TOUCH_TRUCK)===W.TOUCH_TRUCK||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(N,L,!1),this._isUserControllingTruck=!0),((this._state&W.OFFSET)===W.OFFSET||(this._state&W.TOUCH_OFFSET)===W.TOUCH_OFFSET||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(N,L,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},p=()=>{rn(this._activePointers,xt),s.copy(xt),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",f),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",m),this._domElement.ownerDocument.addEventListener("pointerlockerror",F),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),E())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",m),this._domElement.ownerDocument.removeEventListener("pointerlockerror",F))};const m=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},F=()=>{this.unlockPointer()};this._addAllEventListeners=R=>{this._domElement=R,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",r),hc&&this._domElement.addEventListener("mousedown",o),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",r),this._domElement.removeEventListener("mousedown",o),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",f),this._domElement.ownerDocument.removeEventListener("pointerlockchange",m),this._domElement.ownerDocument.removeEventListener("pointerlockerror",F))},this.cancel=()=>{this._state!==W.NONE&&(this._state=W.NONE,this._activePointers.length=0,p())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(i){this._camera=i,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(i){this._enabled=i,this._domElement&&(i?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(i){this._spherical.radius===i&&this._sphericalEnd.radius===i||(this._spherical.radius=i,this._sphericalEnd.radius=i,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(i){this._spherical.theta===i&&this._sphericalEnd.theta===i||(this._spherical.theta=i,this._sphericalEnd.theta=i,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(i){this._spherical.phi===i&&this._sphericalEnd.phi===i||(this._spherical.phi=i,this._sphericalEnd.phi=i,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(i){this._boundaryEnclosesCamera=i,this._needsUpdate=!0}set interactiveArea(i){this._interactiveArea.width=te(i.width,0,1),this._interactiveArea.height=te(i.height,0,1),this._interactiveArea.x=te(i.x,0,1-this._interactiveArea.width),this._interactiveArea.y=te(i.y,0,1-this._interactiveArea.height)}addEventListener(i,t){super.addEventListener(i,t)}removeEventListener(i,t){super.removeEventListener(i,t)}rotate(i,t,e=!1){return this.rotateTo(this._sphericalEnd.theta+i,this._sphericalEnd.phi+t,e)}rotateAzimuthTo(i,t=!1){return this.rotateTo(i,this._sphericalEnd.phi,t)}rotatePolarTo(i,t=!1){return this.rotateTo(this._sphericalEnd.theta,i,t)}rotateTo(i,t,e=!1){this._isUserControllingRotate=!1;const s=te(i,this.minAzimuthAngle,this.maxAzimuthAngle),n=te(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=s,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,e||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const r=!e||Et(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Et(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(r)}dolly(i,t=!1){return this.dollyTo(this._sphericalEnd.radius-i,t)}dollyTo(i,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Xe.NONE,this._changedDolly=0,this._dollyToNoClamp(te(i,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(i,t=!1){const e=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const r=this._collisionTest(),o=Et(r,this._spherical.radius);if(!(e>i)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(i,r)}else this._sphericalEnd.radius=i;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||Et(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(i,t=!1){this._targetEnd.add(this._getCameraDirection(di).multiplyScalar(i)),t||this._target.copy(this._targetEnd);const e=!t||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(e)}zoom(i,t=!1){return this.zoomTo(this._zoomEnd+i,t)}zoomTo(i,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=te(i,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const e=!t||Et(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(e)}pan(i,t,e=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(i,t,e)}truck(i,t,e=!1){this._camera.updateMatrix(),re.setFromMatrixColumn(this._camera.matrix,0),oe.setFromMatrixColumn(this._camera.matrix,1),re.multiplyScalar(i),oe.multiplyScalar(-t);const s=ht.copy(re).add(oe),n=dt.copy(this._targetEnd).add(s);return this.moveTo(n.x,n.y,n.z,e)}forward(i,t=!1){ht.setFromMatrixColumn(this._camera.matrix,0),ht.crossVectors(this._camera.up,ht),ht.multiplyScalar(i);const e=dt.copy(this._targetEnd).add(ht);return this.moveTo(e.x,e.y,e.z,t)}elevate(i,t=!1){return ht.copy(this._camera.up).multiplyScalar(i),this.moveTo(this._targetEnd.x+ht.x,this._targetEnd.y+ht.y,this._targetEnd.z+ht.z,t)}moveTo(i,t,e,s=!1){this._isUserControllingTruck=!1;const n=ht.set(i,t,e).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,s||this._target.copy(this._targetEnd);const r=!s||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}lookInDirectionOf(i,t,e,s=!1){const o=ht.set(i,t,e).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(o.x,o.y,o.z,s)}fitToBox(i,t,{cover:e=!1,paddingLeft:s=0,paddingRight:n=0,paddingBottom:r=0,paddingTop:o=0}={}){const a=[],l=i.isBox3?je.copy(i):je.setFromObject(i);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=dr(this._sphericalEnd.theta,Ir),f=dr(this._sphericalEnd.phi,Ir);a.push(this.rotateTo(h,f,t));const I=ht.setFromSpherical(this._sphericalEnd).normalize(),u=Rr.setFromUnitVectors(I,an),d=Et(Math.abs(I.y),1);d&&u.multiply(ln.setFromAxisAngle(es,h)),u.multiply(this._yAxisUpSpaceInverse);const E=mr.makeEmpty();dt.copy(l.min).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.min).setX(l.max.x).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.min).setY(l.max.y).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).setZ(l.min.z).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.min).setZ(l.max.z).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).setY(l.min.y).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).setX(l.min.x).applyQuaternion(u),E.expandByPoint(dt),dt.copy(l.max).applyQuaternion(u),E.expandByPoint(dt),E.min.x-=s,E.min.y-=r,E.max.x+=n,E.max.y+=o,u.setFromUnitVectors(an,I),d&&u.premultiply(ln.invert()),u.premultiply(this._yAxisUpSpace);const T=E.getSize(ht),p=E.getCenter(dt).applyQuaternion(u);if(Pe(this._camera)){const m=this.getDistanceToFitBox(T.x,T.y,T.z,e);a.push(this.moveTo(p.x,p.y,p.z,t)),a.push(this.dollyTo(m,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(Re(this._camera)){const m=this._camera,F=m.right-m.left,R=m.top-m.bottom,S=e?Math.max(F/T.x,R/T.y):Math.min(F/T.x,R/T.y);a.push(this.moveTo(p.x,p.y,p.z,t)),a.push(this.zoomTo(S,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(i,t){const e=[],n=i instanceof ct.Sphere?cn.copy(i):bt.createBoundingSphere(i,cn);if(e.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),Pe(this._camera)){const r=this.getDistanceToFitSphere(n.radius);e.push(this.dollyTo(r,t))}else if(Re(this._camera)){const r=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,a=2*n.radius,l=Math.min(r/a,o/a);e.push(this.zoomTo(l,t))}return e.push(this.setFocalOffset(0,0,0,t)),Promise.all(e)}setLookAt(i,t,e,s,n,r,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Xe.NONE,this._changedDolly=0;const a=dt.set(s,n,r),l=ht.set(i,t,e);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold)&&Et(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Et(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Et(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(i,t,e,s,n,r,o,a,l,h,f,I,u,d=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Xe.NONE,this._changedDolly=0;const E=ht.set(s,n,r),T=dt.set(i,t,e);kt.setFromVector3(T.sub(E).applyQuaternion(this._yAxisUpSpace));const p=Ze.set(h,f,I),m=dt.set(o,a,l);Ei.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(E.lerp(p,u));const F=Ei.theta-kt.theta,R=Ei.phi-kt.phi,S=Ei.radius-kt.radius;this._sphericalEnd.set(kt.radius+S*u,kt.phi+R*u,kt.theta+F*u),this.normalizeRotations(),this._needsUpdate=!0,d||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const N=!d||Et(this._target.x,this._targetEnd.x,this.restThreshold)&&Et(this._target.y,this._targetEnd.y,this.restThreshold)&&Et(this._target.z,this._targetEnd.z,this.restThreshold)&&Et(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Et(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Et(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(N)}setPosition(i,t,e,s=!1){return this.setLookAt(i,t,e,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,s)}setTarget(i,t,e,s=!1){const n=this.getPosition(ht),r=this.setLookAt(n.x,n.y,n.z,i,t,e,s);return this._sphericalEnd.phi=te(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),r}setFocalOffset(i,t,e,s=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(i,t,e),this._needsUpdate=!0,s||this._focalOffset.copy(this._focalOffsetEnd);const n=!s||Et(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&Et(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&Et(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(i,t,e){this._camera.updateMatrixWorld(),re.setFromMatrixColumn(this._camera.matrixWorldInverse,0),oe.setFromMatrixColumn(this._camera.matrixWorldInverse,1),_e.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const s=ht.set(i,t,e),n=s.distanceTo(this._camera.position),r=s.sub(this._camera.position);re.multiplyScalar(r.x),oe.multiplyScalar(r.y),_e.multiplyScalar(r.z),ht.copy(re).add(oe).add(_e),ht.z=ht.z+n,this.dollyTo(n,!1),this.setFocalOffset(-ht.x,ht.y,-ht.z,!1),this.moveTo(i,t,e,!1)}setBoundary(i){if(!i){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(i),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(i,t,e,s){if(i===null){this._viewport=null;return}this._viewport=this._viewport||new ct.Vector4,typeof i=="number"?this._viewport.set(i,t,e,s):this._viewport.copy(i)}getDistanceToFitBox(i,t,e,s=!1){if(on(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=i/t,r=this._camera.getEffectiveFOV()*ui,o=this._camera.aspect;return((s?n>o:n<o)?t:i/o)*.5/Math.tan(r*.5)+e*.5}getDistanceToFitSphere(i){if(on(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*ui,e=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,s=1<this._camera.aspect?t:e;return i/Math.sin(s*.5)}getTarget(i,t=!0){return(i&&i.isVector3?i:new ct.Vector3).copy(t?this._targetEnd:this._target)}getPosition(i,t=!0){return(i&&i.isVector3?i:new ct.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(i,t=!0){return(i&&i instanceof ct.Spherical?i:new ct.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(i,t=!0){return(i&&i.isVector3?i:new ct.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%$e,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=$e),this._spherical.theta+=$e*Math.round((this._sphericalEnd.theta-this._spherical.theta)/$e)}reset(i=!1){if(!Et(this._camera.up.x,this._cameraUp0.x)||!Et(this._camera.up.y,this._cameraUp0.y)||!Et(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const e=this.getPosition(ht);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,i),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,i),this.zoomTo(this._zoom0,i)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,es),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const i=ht.subVectors(this._target,this._camera.position).normalize(),t=dt.crossVectors(i,this._camera.up);this._camera.up.crossVectors(t,i).normalize(),this._camera.updateMatrixWorld();const e=this.getPosition(ht);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}update(i){const t=this._sphericalEnd.theta-this._spherical.theta,e=this._sphericalEnd.phi-this._spherical.phi,s=this._sphericalEnd.radius-this._spherical.radius,n=Cr.subVectors(this._targetEnd,this._target),r=Tr.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(gt(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Ji(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,f,1/0,i),this._needsUpdate=!0}if(gt(e))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Ji(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,f,1/0,i),this._needsUpdate=!0}if(gt(s))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const f=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Ji(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,f,this.maxSpeed,i),this._needsUpdate=!0}if(gt(n.x)&>(n.y)&>(n.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const f=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;Er(this._target,this._targetEnd,this._targetVelocity,f,this.maxSpeed,i,this._target),this._needsUpdate=!0}if(gt(r.x)&>(r.y)&>(r.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const f=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;Er(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,f,this.maxSpeed,i,this._focalOffset),this._needsUpdate=!0}if(gt(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const f=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Ji(this._zoom,this._zoomEnd,this._zoomVelocity,f,1/0,i)}if(this.dollyToCursor){if(Pe(this._camera)&&this._changedDolly!==0){const f=this._spherical.radius-this._lastDistance,I=this._camera,u=this._getCameraDirection(di),d=ht.copy(u).cross(I.up).normalize();d.lengthSq()===0&&(d.x=1);const E=dt.crossVectors(d,u),T=this._sphericalEnd.radius*Math.tan(I.getEffectiveFOV()*ui*.5),m=(this._sphericalEnd.radius-f-this._sphericalEnd.radius)/this._sphericalEnd.radius,F=Ze.copy(this._targetEnd).add(d.multiplyScalar(this._dollyControlCoord.x*T*I.aspect)).add(E.multiplyScalar(this._dollyControlCoord.y*T)),R=ht.copy(this._targetEnd).lerp(F,m),S=this._lastDollyDirection===Xe.IN&&this._spherical.radius<=this.minDistance,N=this._lastDollyDirection===Xe.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(S||N)){this._sphericalEnd.radius-=f,this._spherical.radius-=f;const D=dt.copy(u).multiplyScalar(-f);R.add(D)}this._boundary.clampPoint(R,R);const L=dt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(L),this._changedDolly-=f,gt(this._changedDolly)&&(this._changedDolly=0)}else if(Re(this._camera)&&this._changedZoom!==0){const f=this._zoom-this._lastZoom,I=this._camera,u=ht.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(I.near+I.far)/(I.near-I.far)).unproject(I),d=dt.set(0,0,-1).applyQuaternion(I.quaternion),E=Ze.copy(u).add(d.multiplyScalar(-u.dot(I.up))),p=-(this._zoom-f-this._zoom)/this._zoom,m=this._getCameraDirection(di),F=this._targetEnd.dot(m),R=ht.copy(this._targetEnd).lerp(E,p),S=R.dot(m),N=m.multiplyScalar(S-F);R.sub(N),this._boundary.clampPoint(R,R);const L=dt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(L),this._changedZoom-=f,gt(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const a=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,a),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!gt(this._focalOffset.x)||!gt(this._focalOffset.y)||!gt(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),re.setFromMatrixColumn(this._camera.matrix,0),oe.setFromMatrixColumn(this._camera.matrix,1),_e.setFromMatrixColumn(this._camera.matrix,2),re.multiplyScalar(this._focalOffset.x),oe.multiplyScalar(-this._focalOffset.y),_e.multiplyScalar(this._focalOffset.z),ht.copy(re).add(oe).add(_e),this._camera.position.add(ht)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),ht.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const h=this._needsUpdate;return h&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):h?(this.dispatchEvent({type:"update"}),gt(t,this.restThreshold)&>(e,this.restThreshold)&>(s,this.restThreshold)&>(n.x,this.restThreshold)&>(n.y,this.restThreshold)&>(n.z,this.restThreshold)&>(r.x,this.restThreshold)&>(r.y,this.restThreshold)&>(r.z,this.restThreshold)&>(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!h&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=h,this._needsUpdate=!1,h}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:fi(this.maxDistance),minZoom:this.minZoom,maxZoom:fi(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:fi(this.maxPolarAngle),minAzimuthAngle:fi(this.minAzimuthAngle),maxAzimuthAngle:fi(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:ht.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(i,t=!1){const e=JSON.parse(i);this.enabled=e.enabled,this.minDistance=e.minDistance,this.maxDistance=Ii(e.maxDistance),this.minZoom=e.minZoom,this.maxZoom=Ii(e.maxZoom),this.minPolarAngle=e.minPolarAngle,this.maxPolarAngle=Ii(e.maxPolarAngle),this.minAzimuthAngle=Ii(e.minAzimuthAngle),this.maxAzimuthAngle=Ii(e.maxAzimuthAngle),this.smoothTime=e.smoothTime,this.draggingSmoothTime=e.draggingSmoothTime,this.dollySpeed=e.dollySpeed,this.truckSpeed=e.truckSpeed,this.dollyToCursor=e.dollyToCursor,this.verticalDragToForward=e.verticalDragToForward,this._target0.fromArray(e.target0),this._position0.fromArray(e.position0),this._zoom0=e.zoom0,this._focalOffset0.fromArray(e.focalOffset0),this.moveTo(e.target[0],e.target[1],e.target[2],t),kt.setFromVector3(ht.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(kt.theta,kt.phi,t),this.dollyTo(kt.radius,t),this.zoomTo(e.zoom,t),this.setFocalOffset(e.focalOffset[0],e.focalOffset[1],e.focalOffset[2],t),this._needsUpdate=!0}connect(i){if(this._domElement){console.warn("camera-controls is already connected.");return}i.setAttribute("data-camera-controls-version",cc),this._addAllEventListeners(i),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(i){return i.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(i){return this._getTargetDirection(i).negate()}_findPointerById(i){return this._activePointers.find(t=>t.pointerId===i)}_findPointerByMouseButton(i){return this._activePointers.find(t=>t.mouseButton===i)}_disposePointer(i){this._activePointers.splice(this._activePointers.indexOf(i),1)}_encloseToBoundary(i,t,e){const s=t.lengthSq();if(s===0)return i;const n=dt.copy(t).add(i),o=this._boundary.clampPoint(n,Ze).sub(n),a=o.lengthSq();if(a===0)return i.add(t);if(a===s)return i;if(e===0)return i.add(t).add(o);{const l=1+e*a/t.dot(o);return i.add(dt.copy(t).multiplyScalar(l)).add(o.multiplyScalar(1-e))}}_updateNearPlaneCorners(){if(Pe(this._camera)){const i=this._camera,t=i.near,e=i.getEffectiveFOV()*ui,s=Math.tan(e*.5)*t,n=s*i.aspect;this._nearPlaneCorners[0].set(-n,-s,0),this._nearPlaneCorners[1].set(n,-s,0),this._nearPlaneCorners[2].set(n,s,0),this._nearPlaneCorners[3].set(-n,s,0)}else if(Re(this._camera)){const i=this._camera,t=1/i.zoom,e=i.left*t,s=i.right*t,n=i.top*t,r=i.bottom*t;this._nearPlaneCorners[0].set(e,n,0),this._nearPlaneCorners[1].set(s,n,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(e,r,0)}}_collisionTest(){let i=1/0;if(!(this.colliderMeshes.length>=1)||on(this._camera,"_collisionTest"))return i;const e=this._getTargetDirection(di);hn.lookAt(pr,e,this._camera.up);for(let s=0;s<4;s++){const n=dt.copy(this._nearPlaneCorners[s]);n.applyMatrix4(hn);const r=Ze.addVectors(this._target,n);is.set(r,e),is.far=this._spherical.radius+1;const o=is.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<i&&(i=o[0].distance)}return i}_getClientRect(i){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return i.x=t.left,i.y=t.top,this._viewport?(i.x+=this._viewport.x,i.y+=t.height-this._viewport.w-this._viewport.y,i.width=this._viewport.z,i.height=this._viewport.w):(i.width=t.width,i.height=t.height),i}_createOnRestPromise(i){return i?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const e=()=>{this.removeEventListener("rest",e),t()};this.addEventListener("rest",e)}))}_addAllEventListeners(i){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(i){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(i){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(i,t=new ct.Sphere){const e=t,s=e.center;je.makeEmpty(),i.traverseVisible(r=>{r.isMesh&&je.expandByObject(r)}),je.getCenter(s);let n=0;return i.traverseVisible(r=>{if(!r.isMesh)return;const o=r,a=o.geometry.clone();a.applyMatrix4(o.matrixWorld);const h=a.attributes.position;for(let f=0,I=h.count;f<I;f++)ht.fromBufferAttribute(h,f),n=Math.max(n,s.distanceToSquared(ht))}),e.radius=Math.sqrt(n),e}}class Je extends Yr{constructor(t){super(t);C(this,"onBeforeUpdate",new q);C(this,"onAfterUpdate",new q);C(this,"onAspectUpdated",new q);C(this,"onDisposed",new q);C(this,"three");C(this,"_allControls",new Map);C(this,"updateAspect",()=>{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof b.OrthographicCamera){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const e=this.currentWorld.renderer.getSize();this.three.aspect=e.width/e.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}});this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:e,world:s})=>{if(e==="added"){const n=this.newCameraControls();this._allControls.set(s.uuid,n)}if(e==="removed"){const n=this._allControls.get(s.uuid);n&&(n.dispose(),this._allControls.delete(s.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const t=this._allControls.get(this.currentWorld.uuid);if(!t)throw new Error("Controls not found!");return t}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(t){this.currentWorld!==null&&(this.controls.enabled=t)}dispose(){this.setupEvents(!1),this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[t,e]of this._allControls)e.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,e=new b.PerspectiveCamera(60,t,1,1e3);return e.position.set(50,50,50),e.lookAt(new b.Vector3(0,0,0)),e}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");bt.install({THREE:Je.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,e=new bt(this.three,t);return e.smoothTime=.2,e.dollyToCursor=!0,e.infinityDolly=!0,e.minDistance=6,e}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:b.MOUSE,Vector2:b.Vector2,Vector3:b.Vector3,Vector4:b.Vector4,Quaternion:b.Quaternion,Matrix4:b.Matrix4,Spherical:b.Spherical,Box3:b.Box3,Sphere:b.Sphere,Raycaster:b.Raycaster,MathUtils:b.MathUtils}}}const As=class As extends mt{constructor(t){super(t);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"list",new Qt);C(this,"enabled",!0);t.add(As.uuid,this)}create(){const t=new Hr(this.components),e=t.uuid;if(this.list.has(e))throw new Error("There is already a world with this name!");return this.list.set(e,t),t}delete(t){if(!this.list.has(t.uuid))throw new Error("The provided world is not found in the list!");this.list.delete(t.uuid),t.dispose()}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[e,s]of this.list)s.update(t)}};C(As,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let Pi=As;function uc(c,i,t,e){return new Promise((s,n)=>{function r(){const o=c.clientWaitSync(i,t,0);if(o===c.WAIT_FAILED){n();return}if(o===c.TIMEOUT_EXPIRED){setTimeout(r,e);return}s()}r()})}async function fc(c,i,t,e,s,n,r){const o=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await uc(c,o,0,10),c.deleteSync(o),c.bindBuffer(i,t),c.getBufferSubData(i,e,s,n,r),c.bindBuffer(i,null)}async function Bn(c,i,t,e,s,n,r,o){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,o.byteLength,c.STREAM_READ),c.readPixels(i,t,e,s,n,r,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await fc(c,c.PIXEL_PACK_BUFFER,a,0,o),c.deleteBuffer(a),o}class Ic extends ye{constructor(){super(...arguments);C(this,"_config",{enabled:{value:!0,type:"Boolean"},width:{type:"Number",interpolable:!0,value:512,min:32,max:1024},height:{type:"Number",interpolable:!0,value:512,min:32,max:1024},autoUpdate:{value:!0,type:"Boolean"},renderDebugFrame:{value:!1,type:"Boolean"},updateInterval:{type:"Number",interpolable:!0,value:1,min:0,max:1},threshold:{type:"Number",interpolable:!0,value:100,min:1,max:512}});C(this,"_interval",null)}get enabled(){return this._config.enabled.value}set enabled(t){this._config.enabled.value=t,this._component.enabled=t}get width(){return this._config.width.value}set width(t){this.setWidthHeight(t,this.height)}get height(){return this._config.height.value}set height(t){this.setWidthHeight(this.width,t)}get autoUpdate(){return this._config.autoUpdate.value}set autoUpdate(t){this.setAutoAndInterval(t,this.updateInterval)}get updateInterval(){return this._config.updateInterval.value}set updateInterval(t){this.setAutoAndInterval(this.autoUpdate,t)}get renderDebugFrame(){return this._config.renderDebugFrame.value}set renderDebugFrame(t){this._config.renderDebugFrame.value=t}get threshold(){return this._config.threshold.value}set threshold(t){this._config.threshold.value=t}setWidthHeight(t,e){if(t<=0||e<=0)throw new Error("The width and height of the culler renderer must be more than 0!");this._config.width.value=t,this._config.height.value=e,this.resetRenderTarget()}setAutoAndInterval(t,e){if(e<=0)throw new Error("The updateInterval of the culler renderer must be more than 0!");this._config.autoUpdate.value=t,this._config.updateInterval.value=e,this.resetInterval(t)}resetRenderTarget(){this._component.renderTarget.dispose(),this._component.renderTarget=new b.WebGLRenderTarget(this.width,this.height),this._component.bufferSize=this.width*this.height*4,this._component.buffer=new Uint8Array(this._component.bufferSize)}resetInterval(t){this._interval!==null&&window.clearInterval(this._interval),t&&(this._interval=window.setInterval(async()=>{this._component.preventUpdate||await this._component.updateVisibility()},this.updateInterval))}}class jr{constructor(i,t){C(this,"onSetup",new q);C(this,"onDisposed",new q);C(this,"onViewUpdated",new fe);C(this,"enabled",!0);C(this,"needsUpdate",!1);C(this,"components");C(this,"renderTarget",new b.WebGLRenderTarget);C(this,"bufferSize",1);C(this,"buffer",new Uint8Array);C(this,"preventUpdate",!1);C(this,"config");C(this,"isSetup",!1);C(this,"world");C(this,"renderer");C(this,"_defaultConfig",{enabled:!0,height:512,width:512,updateInterval:1e3,autoUpdate:!0,renderDebugFrame:!1,threshold:100});C(this,"worker");C(this,"scene",new b.Scene);C(this,"_availableColor",1);C(this,"_isWorkerBusy",!1);C(this,"updateVisibility",async i=>{if(!this.enabled||!this.needsUpdate&&!i||this._isWorkerBusy)return;this._isWorkerBusy=!0;const t=this.world.camera.three;t.updateMatrix();const{width:e,height:s}=this.config;this.renderer.setSize(e,s),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,t);const n=this.renderer.getContext();await Bn(n,0,0,e,s,n.RGBA,n.UNSIGNED_BYTE,this.buffer),this.renderer.setRenderTarget(null),this.config.renderDebugFrame&&this.renderer.render(this.scene,t),this.worker.postMessage({buffer:this.buffer}),this.needsUpdate=!1});if(!t.renderer)throw new Error("The given world must have a renderer!");this.components=i,this.config=new Ic(this,this.components,"Culler renderer"),this.world=t,this.renderer=new b.WebGLRenderer,this.renderer.clippingPlanes=t.renderer.clippingPlanes;const e=`
|
|
11
11
|
addEventListener("message", (event) => {
|
|
12
12
|
const { buffer } = event.data;
|
|
13
13
|
const colors = new Map();
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
postMessage({ colors });
|
|
26
26
|
});
|
|
27
|
-
`,s=new Blob([e],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(s)),this.setup()}dispose(){this.enabled=!1,this.config.autoUpdate=!1,this.components.get(Ne).list.delete(this.config.uuid);for(const t of this.scene.children)t.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.renderTarget.dispose(),this.buffer=null,this.onDisposed.reset()}setup(i){const t={...this._defaultConfig,...i},{width:e,height:s}=t;this.config.setWidthHeight(e,s);const{updateInterval:n,autoUpdate:r}=t;this.config.setAutoAndInterval(r,n),this.config.threshold=t.threshold,this.isSetup=!0,this.onSetup.trigger()}getAvailableColor(){let i=BigInt(this._availableColor.toString());const t=[];do t.unshift(Number(i%256n)),i/=256n;while(i);for(;t.length!==3;)t.unshift(0);const[e,s,n]=t,r=`${e}-${s}-${n}`;return{r:e,g:s,b:n,code:r}}increaseColor(){if(this._availableColor===256*256*256){console.warn("Color can't be increased over 256 x 256 x 256!");return}this._availableColor++}decreaseColor(){if(this._availableColor===1){console.warn("Color can't be decreased under 0!");return}this._availableColor--}}class qr extends jr{constructor(t,e){super(t,e);C(this,"onViewUpdated",new q);C(this,"colorMeshes",new Map);C(this,"_colorCodeMeshMap",new Map);C(this,"_meshIDColorCodeMap",new Map);C(this,"_currentVisibleMeshes",new Set);C(this,"_recentlyHiddenMeshes",new Set);C(this,"_transparentMat",new b.MeshBasicMaterial({transparent:!0,opacity:0}));C(this,"handleWorkerMessage",async t=>{if(this.preventUpdate)return;const e=t.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[s,n]of e){if(n<this.config.threshold)continue;const r=this._colorCodeMeshMap.get(s);r&&(this._currentVisibleMeshes.add(r),this._recentlyHiddenMeshes.delete(r))}this.onViewUpdated.trigger({seen:this._currentVisibleMeshes,unseen:this._recentlyHiddenMeshes}),this._isWorkerBusy=!1});this.worker.addEventListener("message",this.handleWorkerMessage),this.onViewUpdated.add(({seen:s,unseen:n})=>{for(const r of s)r.visible=!0;for(const r of n)r.visible=!1})}get threshold(){return this.config.threshold}set threshold(t){this.config.threshold=t}dispose(){super.dispose(),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const t=this.components.get(Ce);for(const e in this.colorMeshes){const s=this.colorMeshes.get(e);s&&t.destroy(s,!0)}this.colorMeshes.clear()}add(t){if(!this.enabled)return;if(this.preventUpdate){console.log("Culler processing not finished yet.");return}this.preventUpdate=!0;const e=t instanceof b.InstancedMesh,{geometry:s,material:n}=t,{colorMaterial:r,code:o}=this.getAvailableMaterial();let a;if(Array.isArray(n)){let f=!0;const I=[];for(const u of n)An.isTransparent(u)?I.push(this._transparentMat):(f=!1,I.push(r));if(f){r.dispose(),this.preventUpdate=!1;return}a=I}else if(An.isTransparent(n)){r.dispose(),this.preventUpdate=!1;return}else a=r;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const l=e?t.count:1,h=new b.InstancedMesh(s,a,l);e?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new b.Matrix4),t.visible=!1,t.updateWorldMatrix(!0,!1),h.applyMatrix4(t.matrixWorld),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(t.uuid,h),this.increaseColor(),this.preventUpdate=!1}remove(t){if(this.preventUpdate){console.log("Culler processing not finished yet.");return}this.preventUpdate=!0;const e=this.components.get(Ce);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const s=this.colorMeshes.get(t.uuid),n=this._meshIDColorCodeMap.get(t.uuid);if(!s||!n){this.preventUpdate=!1;return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),s.geometry=void 0,s.material=[],e.destroy(s,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.preventUpdate=!1}updateInstanced(t){for(const e of t){const s=this.colorMeshes.get(e.uuid);s&&(s.count=e.count)}}getAvailableMaterial(){const{r:t,g:e,b:s,code:n}=this.getAvailableColor(),r=b.ColorManagement.enabled;b.ColorManagement.enabled=!1;const o=new b.Color(`rgb(${t}, ${e}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const a=this.world.renderer.clippingPlanes,l=new b.MeshBasicMaterial({color:o,clippingPlanes:a,side:b.DoubleSide});return b.ColorManagement.enabled=r,{colorMaterial:l,code:n}}}const Si=class Si extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"_enabled",!0);C(this,"list",new Map);t.add(Si.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[e,s]of this.list)s.enabled=t}create(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new qr(this.components,t);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Si.uuid),this.onDisposed.reset();for(const[t,e]of this.list)e.dispose();this.list.clear()}updateInstanced(t){for(const[,e]of this.list)e.updateInstanced(t)}};C(Si,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let fs=Si;class
|
|
27
|
+
`,s=new Blob([e],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(s)),this.setup()}dispose(){this.enabled=!1,this.config.autoUpdate=!1,this.components.get(Ne).list.delete(this.config.uuid);for(const t of this.scene.children)t.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.renderTarget.dispose(),this.buffer=null,this.onDisposed.reset()}setup(i){const t={...this._defaultConfig,...i},{width:e,height:s}=t;this.config.setWidthHeight(e,s);const{updateInterval:n,autoUpdate:r}=t;this.config.setAutoAndInterval(r,n),this.config.threshold=t.threshold,this.isSetup=!0,this.onSetup.trigger()}getAvailableColor(){let i=BigInt(this._availableColor.toString());const t=[];do t.unshift(Number(i%256n)),i/=256n;while(i);for(;t.length!==3;)t.unshift(0);const[e,s,n]=t,r=`${e}-${s}-${n}`;return{r:e,g:s,b:n,code:r}}increaseColor(){if(this._availableColor===256*256*256){console.warn("Color can't be increased over 256 x 256 x 256!");return}this._availableColor++}decreaseColor(){if(this._availableColor===1){console.warn("Color can't be decreased under 0!");return}this._availableColor--}}class qr extends jr{constructor(t,e){super(t,e);C(this,"onViewUpdated",new q);C(this,"colorMeshes",new Map);C(this,"_colorCodeMeshMap",new Map);C(this,"_meshIDColorCodeMap",new Map);C(this,"_currentVisibleMeshes",new Set);C(this,"_recentlyHiddenMeshes",new Set);C(this,"_transparentMat",new b.MeshBasicMaterial({transparent:!0,opacity:0}));C(this,"handleWorkerMessage",async t=>{if(this.preventUpdate)return;const e=t.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[s,n]of e){if(n<this.config.threshold)continue;const r=this._colorCodeMeshMap.get(s);r&&(this._currentVisibleMeshes.add(r),this._recentlyHiddenMeshes.delete(r))}this.onViewUpdated.trigger({seen:this._currentVisibleMeshes,unseen:this._recentlyHiddenMeshes}),this._isWorkerBusy=!1});this.worker.addEventListener("message",this.handleWorkerMessage),this.onViewUpdated.add(({seen:s,unseen:n})=>{for(const r of s)r.visible=!0;for(const r of n)r.visible=!1})}get threshold(){return this.config.threshold}set threshold(t){this.config.threshold=t}dispose(){super.dispose(),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const t=this.components.get(Ce);for(const e in this.colorMeshes){const s=this.colorMeshes.get(e);s&&t.destroy(s,!0)}this.colorMeshes.clear()}add(t){if(!this.enabled)return;if(this.preventUpdate){console.log("Culler processing not finished yet.");return}this.preventUpdate=!0;const e=t instanceof b.InstancedMesh,{geometry:s,material:n}=t,{colorMaterial:r,code:o}=this.getAvailableMaterial();let a;if(Array.isArray(n)){let f=!0;const I=[];for(const u of n)An.isTransparent(u)?I.push(this._transparentMat):(f=!1,I.push(r));if(f){r.dispose(),this.preventUpdate=!1;return}a=I}else if(An.isTransparent(n)){r.dispose(),this.preventUpdate=!1;return}else a=r;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const l=e?t.count:1,h=new b.InstancedMesh(s,a,l);e?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new b.Matrix4),t.visible=!1,t.updateWorldMatrix(!0,!1),h.applyMatrix4(t.matrixWorld),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(t.uuid,h),this.increaseColor(),this.preventUpdate=!1}remove(t){if(this.preventUpdate){console.log("Culler processing not finished yet.");return}this.preventUpdate=!0;const e=this.components.get(Ce);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const s=this.colorMeshes.get(t.uuid),n=this._meshIDColorCodeMap.get(t.uuid);if(!s||!n){this.preventUpdate=!1;return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),s.geometry=void 0,s.material=[],e.destroy(s,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.preventUpdate=!1}updateInstanced(t){for(const e of t){const s=this.colorMeshes.get(e.uuid);s&&(s.count=e.count)}}getAvailableMaterial(){const{r:t,g:e,b:s,code:n}=this.getAvailableColor(),r=b.ColorManagement.enabled;b.ColorManagement.enabled=!1;const o=new b.Color(`rgb(${t}, ${e}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const a=this.world.renderer.clippingPlanes,l=new b.MeshBasicMaterial({color:o,clippingPlanes:a,side:b.DoubleSide});return b.ColorManagement.enabled=r,{colorMaterial:l,code:n}}}const Si=class Si extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"_enabled",!0);C(this,"list",new Map);t.add(Si.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[e,s]of this.list)s.enabled=t}create(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new qr(this.components,t);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Si.uuid),this.onDisposed.reset();for(const[t,e]of this.list)e.dispose();this.list.clear()}updateInstanced(t){for(const[,e]of this.list)e.updateInstanced(t)}};C(Si,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let fs=Si;class dc{constructor(i,t){C(this,"onDisposed",new q);C(this,"onDistanceComputed",new q);C(this,"excludedObjects",new Set);C(this,"enabled",!0);C(this,"renderDebugFrame",!1);C(this,"components");C(this,"scene",new b.Scene);C(this,"camera",new b.OrthographicCamera(-1,1,1,-1,0,1));C(this,"depthMaterial");C(this,"world");C(this,"renderer");C(this,"worker");C(this,"_width",512);C(this,"_height",512);C(this,"_postQuad");C(this,"tempRT");C(this,"resultRT");C(this,"bufferSize");C(this,"_buffer");C(this,"_isWorkerBusy",!1);C(this,"compute",async()=>{if(!this.enabled||this.world.isDisposing||this._isWorkerBusy)return;this._isWorkerBusy=!0,this.world.camera.three.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.tempRT);const i="visibilityBeforeDistanceCheck";for(const e of this.excludedObjects)e.userData[i]=e.visible,e.visible=!1;this.renderer.render(this.world.scene.three,this.world.camera.three);for(const e of this.excludedObjects)e.userData[i]!==void 0&&(e.visible=e.userData[i]);this.depthMaterial.uniforms.tDiffuse.value=this.tempRT.texture,this.depthMaterial.uniforms.tDepth.value=this.tempRT.depthTexture,this.renderer.setRenderTarget(this.resultRT),this.renderer.render(this.scene,this.camera);const t=this.renderer.getContext();try{await Bn(t,0,0,this._width,this._height,t.RGBA,t.UNSIGNED_BYTE,this._buffer)}catch{this.renderer.setRenderTarget(null),this._isWorkerBusy=!1;return}this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,this.camera),this.worker.postMessage({buffer:this._buffer})});C(this,"handleWorkerMessage",i=>{if(!this.enabled||this.world.isDisposing)return;const t=i.data.colors;let e=Number.MAX_VALUE;for(const a of t)a!==0&&a<e&&(e=a);const s=this.world.camera.three||b.OrthographicCamera,r=(e/255-1)*-1*(s.far-s.near),o=Math.min(r,s.far);this.onDistanceComputed.trigger(o),this._isWorkerBusy=!1});if(!t.renderer)throw new Error("The given world must have a renderer!");this.components=i,this.world=t;const e=t.camera.three;this.renderer=new b.WebGLRenderer,this.tempRT=new b.WebGLRenderTarget(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.tempRT.texture.minFilter=b.NearestFilter,this.tempRT.texture.magFilter=b.NearestFilter,this.tempRT.stencilBuffer=!1,this.tempRT.samples=0,this.tempRT.depthTexture=new b.DepthTexture(this._width,this._height),this.tempRT.depthTexture.format=b.DepthFormat,this.tempRT.depthTexture.type=b.UnsignedShortType,this.resultRT=new b.WebGLRenderTarget(this._width,this._height),this.depthMaterial=new b.ShaderMaterial({vertexShader:`
|
|
28
28
|
varying vec2 vUv;
|
|
29
29
|
|
|
30
30
|
void main() {
|
|
@@ -64,7 +64,7 @@ void main() {
|
|
|
64
64
|
}
|
|
65
65
|
postMessage({ colors });
|
|
66
66
|
});
|
|
67
|
-
`,r=new Blob([n],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(r)),this.worker.addEventListener("message",this.handleWorkerMessage)}dispose(){this.enabled=!1,this.onDistanceComputed.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.tempRT.dispose(),this.resultRT.dispose();const i=[...this.scene.children];this.excludedObjects.clear();for(const t of i)t.removeFromParent();this._postQuad.geometry.dispose(),this._postQuad.removeFromParent(),this._buffer=null,this.onDisposed.reset()}}class
|
|
67
|
+
`,r=new Blob([n],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(r)),this.worker.addEventListener("message",this.handleWorkerMessage)}dispose(){this.enabled=!1,this.onDistanceComputed.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.tempRT.dispose(),this.resultRT.dispose();const i=[...this.scene.children];this.excludedObjects.clear();for(const t of i)t.removeFromParent();this._postQuad.geometry.dispose(),this._postQuad.removeFromParent(),this._buffer=null,this.onDisposed.reset()}}class Ec extends Xr{constructor(){super(...arguments);C(this,"_distanceRenderer");C(this,"autoBias",!0);C(this,"_defaultShadowConfig",{cascade:1,resolution:512});C(this,"_lightsWithShadow",new Map);C(this,"_isComputingShadows",!1);C(this,"_shadowsEnabled",!0);C(this,"_bias",0);C(this,"recomputeShadows",t=>{if(!this._shadowsEnabled)return;if(this.autoBias&&(this.bias=t/-1e5),t*=1.5,!this.currentWorld)throw new Error("A world needs to be assigned to the scene before computing shadows!");if(!this._lightsWithShadow.size)throw new Error("No shadows found!");const s=this.currentWorld.camera.three;if(!(s instanceof b.PerspectiveCamera)&&!(s instanceof b.OrthographicCamera))throw new Error("Invalid camera type!");const n=new b.Vector3;s.getWorldDirection(n);let r=t;const o=new b.Vector3;o.copy(this.config.directionalLight.position),o.normalize();for(const[a,l]of this._lightsWithShadow){const h=this.directionalLights.get(l);if(!h)throw new Error("Light not found.");const f=new b.Vector3;f.copy(n);const I=a===this._lightsWithShadow.size-1,u=I?r/2:r*2/3;f.multiplyScalar(u),f.add(s.position);const d=r-u,E=new b.Vector3;E.copy(o),E.multiplyScalar(d),h.target.position.copy(f),h.position.copy(f),h.position.add(E),h.shadow.camera.right=d,h.shadow.camera.left=-d,h.shadow.camera.top=d,h.shadow.camera.bottom=-d,h.shadow.camera.far=d*2,h.shadow.camera.updateProjectionMatrix(),h.shadow.camera.updateMatrix(),I||(r/=3)}this._isComputingShadows=!1})}get bias(){return this._bias}set bias(t){this._bias=t;for(const[,e]of this._lightsWithShadow){const s=this.directionalLights.get(e);s&&(s.shadow.bias=t)}}get shadowsEnabled(){return this._shadowsEnabled}set shadowsEnabled(t){this._shadowsEnabled=t;for(const[,e]of this.directionalLights)e.castShadow=t}get distanceRenderer(){if(!this._distanceRenderer)throw new Error("You must set up this component before accessing the distance renderer!");return this._distanceRenderer}setup(t){super.setup(t);const e={...this._defaultConfig,...this._defaultShadowConfig,...t};if(e.cascade<=0)throw new Error("Config.shadows.cascade must be a natural number greater than 0!");if(e.cascade>1)throw new Error("Multiple shadows not supported yet!");if(!this.currentWorld)throw new Error("A world needs to be assigned to the scene before setting it up!");for(const[,s]of this.directionalLights)s.target.removeFromParent(),s.removeFromParent(),s.dispose();this.directionalLights.clear(),this._distanceRenderer||(this._distanceRenderer=new dc(this.components,this.currentWorld),this._distanceRenderer.onDistanceComputed.add(this.recomputeShadows)),this._lightsWithShadow.clear();for(let s=0;s<e.cascade;s++){const n=new b.DirectionalLight;n.intensity=this.config.directionalLight.intensity,n.color=this.config.directionalLight.color,n.position.copy(this.config.directionalLight.position),n.shadow.mapSize.width=e.resolution,n.shadow.mapSize.height=e.resolution,this.three.add(n,n.target),this.directionalLights.set(n.uuid,n),this._lightsWithShadow.set(s,n.uuid),n.castShadow=!0,n.shadow.bias=this._bias}}dispose(){super.dispose(),this._distanceRenderer&&this._distanceRenderer.dispose(),this._lightsWithShadow.clear()}async updateShadows(){this._isComputingShadows||!this._shadowsEnabled||(this._isComputingShadows=!0,await this.distanceRenderer.compute())}}class Qr{constructor(i){C(this,"_event");C(this,"_position",new b.Vector2);C(this,"onDisposed",new q);C(this,"updateMouseInfo",i=>{this._event=i});this.dom=i,this.setupEvents(!0)}get position(){if(this._event){const i=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(i,this._event),this._position.y=this.getPositionY(i,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(i,t){return-((this.getDataObject(t).clientY-i.top)/(i.bottom-i.top))*2+1}getPositionX(i,t){return(this.getDataObject(t).clientX-i.left)/(i.right-i.left)*2-1}getDataObject(i){return i instanceof MouseEvent?i:i.touches[0]}setupEvents(i){i?(this.dom.addEventListener("pointermove",this.updateMouseInfo),this.dom.addEventListener("touchstart",this.updateMouseInfo)):(this.dom.removeEventListener("pointermove",this.updateMouseInfo),this.dom.removeEventListener("touchstart",this.updateMouseInfo))}}class Kr{constructor(i,t){C(this,"enabled",!0);C(this,"components");C(this,"onDisposed",new q);C(this,"mouse");C(this,"three",new b.Raycaster);C(this,"world");const e=t.renderer;if(!e)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new Qr(e.three.domElement),this.components=i}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(i=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const t=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,t),this.intersect(i)}castRayFromVector(i,t,e=Array.from(this.world.meshes)){return this.three.set(i,t),this.intersect(e)}intersect(i=Array.from(this.world.meshes)){const t=this.three.intersectObjects(i),e=this.filterClippingPlanes(t);return e.length>0?e[0]:null}filterClippingPlanes(i){if(!this.world.renderer)throw new Error("Renderer not found!");const t=this.world.renderer.three;if(!t.clippingPlanes)return i;const e=t.clippingPlanes;return i.length<=0||!e||(e==null?void 0:e.length)<=0?i:i.filter(s=>e.every(n=>n.distanceToPoint(s.point)>0))}}const Fs=class Fs extends mt{constructor(t){super(t);C(this,"enabled",!0);C(this,"list",new Map);C(this,"onDisposed",new q);t.add(Fs.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new Kr(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}};C(Fs,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let ve=Fs;class Jr extends ye{constructor(){super(...arguments);C(this,"_config",{visible:{value:!0,type:"Boolean"},color:{value:new b.Color,type:"Color"},primarySize:{type:"Number",interpolable:!0,value:1,min:0,max:1e3},secondarySize:{type:"Number",interpolable:!0,value:10,min:0,max:1e3},distance:{type:"Number",interpolable:!0,value:500,min:0,max:500}})}get visible(){return this._config.visible.value}set visible(t){this._config.visible.value=t,this._component.visible=t}get color(){return this._config.color.value}set color(t){this._config.color.value=t,this._component.material.uniforms.uColor.value=t,this._component.material.uniformsNeedUpdate=!0}get primarySize(){return this._config.primarySize.value}set primarySize(t){this._config.primarySize.value=t,this._component.material.uniforms.uSize1.value=t,this._component.material.uniformsNeedUpdate=!0}get secondarySize(){return this._config.secondarySize.value}set secondarySize(t){this._config.secondarySize.value=t,this._component.material.uniforms.uSize2.value=t,this._component.material.uniformsNeedUpdate=!0}get distance(){return this._config.distance.value}set distance(t){this._config.distance.value=t,this._component.material.uniforms.uDistance.value=t,this._component.material.uniformsNeedUpdate=!0}}class to{constructor(i,t){C(this,"onDisposed",new q);C(this,"onSetup",new q);C(this,"isSetup",!1);C(this,"world");C(this,"components");C(this,"config");C(this,"_defaultConfig",{visible:!0,color:new b.Color(12303291),primarySize:1,secondarySize:10,distance:500});C(this,"three");C(this,"_fade",3);C(this,"updateZoom",()=>{this.world.camera instanceof Je&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)});this.world=t;const{color:e,primarySize:s,secondarySize:n,distance:r}=this._defaultConfig;this.components=i,this.config=new Jr(this,this.components,"Grid");const o=new b.PlaneGeometry(2,2,1,1),a=new b.ShaderMaterial({side:b.DoubleSide,uniforms:{uSize1:{value:s},uSize2:{value:n},uColor:{value:e},uDistance:{value:r},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:`
|
|
68
68
|
|
|
69
69
|
varying vec3 worldPosition;
|
|
70
70
|
|
|
@@ -125,7 +125,7 @@ void main() {
|
|
|
125
125
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
`,extensions:{derivatives:!0}});this.three=new b.Mesh(o,a),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(i){i?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(i){this._fade=i?3:0,this.material.uniforms.uFade.value=this._fade}setup(i){const t={...this._defaultConfig,...i};this.config.visible=!0,this.config.color=t.color,this.config.primarySize=t.primarySize,this.config.secondarySize=t.secondarySize,this.config.distance=t.distance,this.isSetup=!0,this.onSetup.trigger()}dispose(){this.setupEvents(!1),this.components.get(Ne).list.delete(this.config.uuid),this.components.get(Ce).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(i){if(this.world.isDisposing||!(this.world.camera instanceof Je))return;const t=this.world.camera.controls;i?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}const Ss=class Ss extends mt{constructor(t){super(t);C(this,"list",new Map);C(this,"onDisposed",new q);C(this,"enabled",!0);t.add(Ss.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const e=new to(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};C(Ss,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let Fn=Ss;const Me=new y.Raycaster,Dt=new y.Vector3,me=new y.Vector3,St=new y.Quaternion,gr={X:new y.Vector3(1,0,0),Y:new y.Vector3(0,1,0),Z:new y.Vector3(0,0,1)},un={type:"change"},Ar={type:"mouseDown"},Fr={type:"mouseUp",mode:null},Sr={type:"objectChange"};class Ec extends y.Object3D{constructor(i,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const e=new gc;this._gizmo=e,this.add(e);const s=new Ac;this._plane=s,this.add(s);const n=this;function r(m,F){let R=F;Object.defineProperty(n,m,{get:function(){return R!==void 0?R:F},set:function(S){R!==S&&(R=S,s[m]=S,e[m]=S,n.dispatchEvent({type:m+"-changed",value:S}),n.dispatchEvent(un))}}),n[m]=F,s[m]=F,e[m]=F}r("camera",i),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const o=new y.Vector3,a=new y.Vector3,l=new y.Quaternion,h=new y.Quaternion,f=new y.Vector3,I=new y.Quaternion,u=new y.Vector3,d=new y.Vector3,E=new y.Vector3,T=0,p=new y.Vector3;r("worldPosition",o),r("worldPositionStart",a),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",f),r("cameraQuaternion",I),r("pointStart",u),r("pointEnd",d),r("rotationAxis",E),r("rotationAngle",T),r("eye",p),this._offset=new y.Vector3,this._startNorm=new y.Vector3,this._endNorm=new y.Vector3,this._cameraScale=new y.Vector3,this._parentPosition=new y.Vector3,this._parentQuaternion=new y.Quaternion,this._parentQuaternionInv=new y.Quaternion,this._parentScale=new y.Vector3,this._worldScaleStart=new y.Vector3,this._worldQuaternionInv=new y.Quaternion,this._worldScale=new y.Vector3,this._positionStart=new y.Vector3,this._quaternionStart=new y.Quaternion,this._scaleStart=new y.Vector3,this._getPointer=pc.bind(this),this._onPointerDown=Tc.bind(this),this._onPointerHover=Cc.bind(this),this._onPointerMove=mc.bind(this),this._onPointerUp=Rc.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(i){if(this.object===void 0||this.dragging===!0)return;Me.setFromCamera(i,this.camera);const t=fn(this._gizmo.picker[this.mode],Me);t?this.axis=t.object.name:this.axis=null}pointerDown(i){if(!(this.object===void 0||this.dragging===!0||i.button!==0)&&this.axis!==null){Me.setFromCamera(i,this.camera);const t=fn(this._plane,Me,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Ar.mode=this.mode,this.dispatchEvent(Ar)}}pointerMove(i){const t=this.axis,e=this.mode,s=this.object;let n=this.space;if(e==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),s===void 0||t===null||this.dragging===!1||i.button!==-1)return;Me.setFromCamera(i,this.camera);const r=fn(this._plane,Me,!0);if(r){if(this.pointEnd.copy(r.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(s.position.applyQuaternion(St.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),n==="world"&&(s.parent&&s.position.add(Dt.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(Dt.setFromMatrixPosition(s.parent.matrixWorld))));else if(e==="scale"){if(t.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),me.set(o,o,o)}else Dt.copy(this.pointStart),me.copy(this.pointEnd),Dt.applyQuaternion(this._worldQuaternionInv),me.applyQuaternion(this._worldQuaternionInv),me.divide(Dt),t.search("X")===-1&&(me.x=1),t.search("Y")===-1&&(me.y=1),t.search("Z")===-1&&(me.z=1);s.scale.copy(this._scaleStart).multiply(me),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(Dt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Dt.copy(this.rotationAxis).cross(this.eye))*o):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(gr[t]),Dt.copy(gr[t]),n==="local"&&Dt.applyQuaternion(this.worldQuaternion),Dt.cross(this.eye),Dt.length()===0?a=!0:this.rotationAngle=this._offset.dot(Dt.normalize())*o),(t==="E"||a)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),n==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(St.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(St.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(un),this.dispatchEvent(Sr)}}pointerUp(i){i.button===0&&(this.dragging&&this.axis!==null&&(Fr.mode=this.mode,this.dispatchEvent(Fr)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(i){i.geometry&&i.geometry.dispose(),i.material&&i.material.dispose()})}attach(i){return this.object=i,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(un),this.dispatchEvent(Sr),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Me}getMode(){return this.mode}setMode(i){this.mode=i}setTranslationSnap(i){this.translationSnap=i}setRotationSnap(i){this.rotationSnap=i}setScaleSnap(i){this.scaleSnap=i}setSize(i){this.size=i}setSpace(i){this.space=i}}function pc(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const i=this.domElement.getBoundingClientRect();return{x:(c.clientX-i.left)/i.width*2-1,y:-(c.clientY-i.top)/i.height*2+1,button:c.button}}}function Cc(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function Tc(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function mc(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Rc(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function fn(c,i,t){const e=i.intersectObject(c,!0);for(let s=0;s<e.length;s++)if(e[s].object.visible||t)return e[s];return!1}const ss=new y.Euler,Tt=new y.Vector3(0,1,0),Or=new y.Vector3(0,0,0),Nr=new y.Matrix4,ns=new y.Quaternion,hs=new y.Quaternion,ae=new y.Vector3,yr=new y.Matrix4,Ri=new y.Vector3(1,0,0),we=new y.Vector3(0,1,0),gi=new y.Vector3(0,0,1),rs=new y.Vector3,pi=new y.Vector3,Ci=new y.Vector3;class gc extends y.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const i=new y.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new y.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=i.clone();e.opacity=.15;const s=t.clone();s.opacity=.5;const n=i.clone();n.color.setHex(16711680);const r=i.clone();r.color.setHex(65280);const o=i.clone();o.color.setHex(255);const a=i.clone();a.color.setHex(16711680),a.opacity=.5;const l=i.clone();l.color.setHex(65280),l.opacity=.5;const h=i.clone();h.color.setHex(255),h.opacity=.5;const f=i.clone();f.opacity=.25;const I=i.clone();I.color.setHex(16776960),I.opacity=.25,i.clone().color.setHex(16776960);const d=i.clone();d.color.setHex(7895160);const E=new y.CylinderGeometry(0,.04,.1,12);E.translate(0,.05,0);const T=new y.BoxGeometry(.08,.08,.08);T.translate(0,.04,0);const p=new y.BufferGeometry;p.setAttribute("position",new y.Float32BufferAttribute([0,0,0,1,0,0],3));const m=new y.CylinderGeometry(.0075,.0075,.5,3);m.translate(0,.25,0);function F(U,Q){const z=new y.TorusGeometry(U,.0075,3,64,Q*Math.PI*2);return z.rotateY(Math.PI/2),z.rotateX(Math.PI/2),z}function R(){const U=new y.BufferGeometry;return U.setAttribute("position",new y.Float32BufferAttribute([0,0,0,1,1,1],3)),U}const S={X:[[new y.Mesh(E,n),[.5,0,0],[0,0,-Math.PI/2]],[new y.Mesh(E,n),[-.5,0,0],[0,0,Math.PI/2]],[new y.Mesh(m,n),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new y.Mesh(E,r),[0,.5,0]],[new y.Mesh(E,r),[0,-.5,0],[Math.PI,0,0]],[new y.Mesh(m,r)]],Z:[[new y.Mesh(E,o),[0,0,.5],[Math.PI/2,0,0]],[new y.Mesh(E,o),[0,0,-.5],[-Math.PI/2,0,0]],[new y.Mesh(m,o),null,[Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.OctahedronGeometry(.1,0),f.clone()),[0,0,0]]],XY:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),a.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},N={X:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.OctahedronGeometry(.2,0),e)]],XY:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]]},L={START:[[new y.Mesh(new y.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],END:[[new y.Mesh(new y.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],DELTA:[[new y.Line(R(),s),null,null,null,"helper"]],X:[[new y.Line(p,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new y.Line(p,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new y.Line(p,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D={XYZE:[[new y.Mesh(F(.5,1),d),null,[0,Math.PI/2,0]]],X:[[new y.Mesh(F(.5,.5),n)]],Y:[[new y.Mesh(F(.5,.5),r),null,[0,0,-Math.PI/2]]],Z:[[new y.Mesh(F(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new y.Mesh(F(.75,1),I),null,[0,Math.PI/2,0]]]},P={AXIS:[[new y.Line(p,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},v={XYZE:[[new y.Mesh(new y.SphereGeometry(.25,10,8),e)]],X:[[new y.Mesh(new y.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new y.Mesh(new y.TorusGeometry(.5,.1,4,24),e),[0,0,0],[Math.PI/2,0,0]]],Z:[[new y.Mesh(new y.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,0,-Math.PI/2]]],E:[[new y.Mesh(new y.TorusGeometry(.75,.1,2,24),e)]]},G={X:[[new y.Mesh(T,n),[.5,0,0],[0,0,-Math.PI/2]],[new y.Mesh(m,n),[0,0,0],[0,0,-Math.PI/2]],[new y.Mesh(T,n),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new y.Mesh(T,r),[0,.5,0]],[new y.Mesh(m,r)],[new y.Mesh(T,r),[0,-.5,0],[0,0,Math.PI]]],Z:[[new y.Mesh(T,o),[0,0,.5],[Math.PI/2,0,0]],[new y.Mesh(m,o),[0,0,0],[Math.PI/2,0,0]],[new y.Mesh(T,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),a),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.BoxGeometry(.1,.1,.1),f.clone())]]},O={X:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.2),e),[0,0,0]]]},w={X:[[new y.Line(p,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new y.Line(p,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new y.Line(p,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function g(U){const Q=new y.Object3D;for(const z in U)for(let et=U[z].length;et--;){const X=U[z][et][0].clone(),nt=U[z][et][1],Y=U[z][et][2],B=U[z][et][3],rt=U[z][et][4];X.name=z,X.tag=rt,nt&&X.position.set(nt[0],nt[1],nt[2]),Y&&X.rotation.set(Y[0],Y[1],Y[2]),B&&X.scale.set(B[0],B[1],B[2]),X.updateMatrix();const it=X.geometry.clone();it.applyMatrix4(X.matrix),X.geometry=it,X.renderOrder=1/0,X.position.set(0,0,0),X.rotation.set(0,0,0),X.scale.set(1,1,1),Q.add(X)}return Q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=g(S)),this.add(this.gizmo.rotate=g(D)),this.add(this.gizmo.scale=g(G)),this.add(this.picker.translate=g(N)),this.add(this.picker.rotate=g(v)),this.add(this.picker.scale=g(O)),this.add(this.helper.translate=g(L)),this.add(this.helper.rotate=g(P)),this.add(this.helper.scale=g(w)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(i){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:hs;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let n=0;n<s.length;n++){const r=s[n];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let o;if(this.camera.isOrthographicCamera?o=(this.camera.top-this.camera.bottom)/this.camera.zoom:o=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(o*this.size/4),r.tag==="helper"){r.visible=!1,r.name==="AXIS"?(r.visible=!!this.axis,this.axis==="X"&&(St.setFromEuler(ss.set(0,0,0)),r.quaternion.copy(e).multiply(St),Math.abs(Tt.copy(Ri).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Y"&&(St.setFromEuler(ss.set(0,0,Math.PI/2)),r.quaternion.copy(e).multiply(St),Math.abs(Tt.copy(we).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Z"&&(St.setFromEuler(ss.set(0,Math.PI/2,0)),r.quaternion.copy(e).multiply(St),Math.abs(Tt.copy(gi).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="XYZE"&&(St.setFromEuler(ss.set(0,Math.PI/2,0)),Tt.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Nr.lookAt(Or,Tt,we)),r.quaternion.multiply(St),r.visible=this.dragging),this.axis==="E"&&(r.visible=!1)):r.name==="START"?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name==="END"?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name==="DELTA"?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Dt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Dt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Dt),r.visible=this.dragging):(r.quaternion.copy(e),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(r.name==="X"&&Math.abs(Tt.copy(Ri).applyQuaternion(e).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Y"&&Math.abs(Tt.copy(we).applyQuaternion(e).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Z"&&Math.abs(Tt.copy(gi).applyQuaternion(e).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XY"&&Math.abs(Tt.copy(gi).applyQuaternion(e).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="YZ"&&Math.abs(Tt.copy(Ri).applyQuaternion(e).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XZ"&&Math.abs(Tt.copy(we).applyQuaternion(e).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)):this.mode==="rotate"&&(ns.copy(e),Tt.copy(this.eye).applyQuaternion(St.copy(e).invert()),r.name.search("E")!==-1&&r.quaternion.setFromRotationMatrix(Nr.lookAt(this.eye,Or,we)),r.name==="X"&&(St.setFromAxisAngle(Ri,Math.atan2(-Tt.y,Tt.z)),St.multiplyQuaternions(ns,St),r.quaternion.copy(St)),r.name==="Y"&&(St.setFromAxisAngle(we,Math.atan2(Tt.x,Tt.z)),St.multiplyQuaternions(ns,St),r.quaternion.copy(St)),r.name==="Z"&&(St.setFromAxisAngle(gi,Math.atan2(Tt.y,Tt.x)),St.multiplyQuaternions(ns,St),r.quaternion.copy(St))),r.visible=r.visible&&(r.name.indexOf("X")===-1||this.showX),r.visible=r.visible&&(r.name.indexOf("Y")===-1||this.showY),r.visible=r.visible&&(r.name.indexOf("Z")===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some(function(a){return r.name===a}))&&(r.material.color.setHex(16776960),r.material.opacity=1)}super.updateMatrixWorld(i)}}class Ac extends y.Mesh{constructor(){super(new y.PlaneGeometry(1e5,1e5,2,2),new y.MeshBasicMaterial({visible:!1,wireframe:!0,side:y.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(i){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),rs.copy(Ri).applyQuaternion(t==="local"?this.worldQuaternion:hs),pi.copy(we).applyQuaternion(t==="local"?this.worldQuaternion:hs),Ci.copy(gi).applyQuaternion(t==="local"?this.worldQuaternion:hs),Tt.copy(pi),this.mode){case"translate":case"scale":switch(this.axis){case"X":Tt.copy(this.eye).cross(rs),ae.copy(rs).cross(Tt);break;case"Y":Tt.copy(this.eye).cross(pi),ae.copy(pi).cross(Tt);break;case"Z":Tt.copy(this.eye).cross(Ci),ae.copy(Ci).cross(Tt);break;case"XY":ae.copy(Ci);break;case"YZ":ae.copy(rs);break;case"XZ":Tt.copy(Ci),ae.copy(pi);break;case"XYZ":case"E":ae.set(0,0,0);break}break;case"rotate":default:ae.set(0,0,0)}ae.length()===0?this.quaternion.copy(this.cameraQuaternion):(yr.lookAt(Dt.set(0,0,0),ae,Tt),this.quaternion.setFromRotationMatrix(yr)),super.updateMatrixWorld(i)}}class Gs{constructor(i,t,e,s,n,r=5,o=!0){C(this,"onDraggingStarted",new q);C(this,"onDraggingEnded",new q);C(this,"onDisposed",new q);C(this,"normal");C(this,"origin");C(this,"three",new b.Plane);C(this,"components");C(this,"world");C(this,"type","default");C(this,"_helper");C(this,"_visible",!0);C(this,"_enabled",!0);C(this,"_controlsActive",!1);C(this,"_arrowBoundBox",new b.Mesh);C(this,"_planeMesh");C(this,"_controls");C(this,"_hiddenMaterial",new b.MeshBasicMaterial({visible:!1}));C(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)});C(this,"changeDrag",i=>{this._visible=!i.value,this.preventCameraMovement(),this.notifyDraggingChanged(i)});if(this.components=i,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=s,this.origin=e,t.renderer.setPlane(!0,this.three),this._planeMesh=Gs.newPlaneMesh(r,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(s,e),o&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(i){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=i,this.world.renderer.setPlane(i,this.three)}get visible(){return this._visible}set visible(i){this._visible=i,this._controls.visible=i,this._helper.visible=i,this.toggleControls(i)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(i){this._planeMesh.material=i}get size(){return this._planeMesh.scale.x}set size(i){this._planeMesh.scale.set(i,i,i)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(i,t){this.reset(),this.normal.equals(i)||(this.normal.copy(i),this._helper.lookAt(i)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const i=new b.Vector3(1,0,0),t=new b.Vector3;this.normal.equals(i)||(this.normal.copy(i),this._helper.lookAt(i)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(i){if(i){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=i}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const i=this.world.camera.three,t=this.world.renderer.three.domElement,e=new Ec(i,t);return this.initializeControls(e),this.world.scene.three.add(e),e}initializeControls(i){i.attach(this._helper),i.showX=!1,i.showY=!1,i.setSpace("local"),this.createArrowBoundingBox(),i.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new b.CylinderGeometry(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(i){i.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const i=new b.Object3D;return i.lookAt(this.normal),i.position.copy(this.origin),this._planeMesh.position.z+=.01,i.add(this._planeMesh),this.world.scene.three.add(i),i}static newPlaneMesh(i,t){const e=new b.PlaneGeometry(1),s=new b.Mesh(e,t);return s.scale.set(i,i,i),s}}class Fc extends ye{constructor(){super(...arguments);C(this,"_config",{enabled:{value:!0,type:"Boolean"},visible:{value:!0,type:"Boolean"},color:{value:new b.Color,type:"Color"},opacity:{type:"Number",interpolable:!0,value:1,min:0,max:1},size:{type:"Number",interpolable:!0,value:2,min:0,max:100}})}get enabled(){return this._config.enabled.value}set enabled(t){this._config.enabled.value=t,this._component.enabled=t}get visible(){return this._config.visible.value}set visible(t){this._config.visible.value=t,this._component.visible=t}get color(){return this._config.color.value}set color(t){this._config.color.value=t,this._component.material.color.copy(t)}get opacity(){return this._config.opacity.value}set opacity(t){this._config.opacity.value=t,this._component.material.opacity=t}get size(){return this._config.size.value}set size(t){this._config.size.value=t,this._component.size=t}}const Qe=class Qe extends mt{constructor(t){super(t);C(this,"onSetup",new q);C(this,"onBeforeDrag",new q);C(this,"onAfterDrag",new q);C(this,"onBeforeCreate",new q);C(this,"onBeforeCancel",new q);C(this,"onAfterCancel",new q);C(this,"onBeforeDelete",new q);C(this,"onAfterCreate",new q);C(this,"onAfterDelete",new q);C(this,"onDisposed",new q);C(this,"isSetup",!1);C(this,"orthogonalY",!1);C(this,"toleranceOrthogonalY",.7);C(this,"Type",Gs);C(this,"list",[]);C(this,"config",new Fc(this,this.components,"Clipper",Qe.uuid));C(this,"_defaultConfig",{color:new b.Color(12255487),opacity:.2,size:2});C(this,"_material",new b.MeshBasicMaterial({color:12255487,side:b.DoubleSide,transparent:!0,opacity:.2}));C(this,"_size",5);C(this,"_enabled",!1);C(this,"_visible",!0);C(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()});C(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()});this.components.add(Qe.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const e of this.list)e.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const e of this.list)e.visible=t}get material(){return this._material}set material(t){this._material=t;for(const e of this.list)e.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const e of this.list)e.size=t}dispose(){this._enabled=!1,this.components.get(Ne).list.delete(this.config.uuid);for(const e of this.list)e.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(Qe.uuid),this.onDisposed.reset()}create(t){const n=this.components.get(ve).get(t).castRay();return n?this.createPlaneFromIntersection(t,n):null}createFromNormalAndCoplanarPoint(t,e,s){const n=this.newPlane(t,s,e);return this.updateMaterialsAndPlanes(),n}delete(t,e){e||(e=this.pickPlane(t)),e&&this.deletePlane(e)}deleteAll(t){const e=[...this.list];for(const s of e)if(!t||t.has(s.type)){this.delete(s.world,s);const n=this.list.indexOf(s);n!==-1&&this.list.splice(n,1)}}setup(t){const e={...this._defaultConfig,...t};this.config.color=e.color,this.config.opacity=e.opacity,this.config.size=e.size,this.isSetup=!0,this.onSetup.trigger()}deletePlane(t){const e=this.list.indexOf(t);if(e!==-1){if(this.list.splice(e,1),!t.world.renderer)throw new Error("Renderer not found for this plane's world!");t.world.renderer.setPlane(!1,t.three),t.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(t)}}pickPlane(t){const s=this.components.get(ve).get(t),n=this.getAllPlaneMeshes(),r=s.castRay(n);if(r){const o=r.object;return this.list.find(a=>a.meshes.includes(o))}}getAllPlaneMeshes(){const t=[];for(const e of this.list)t.push(...e.meshes);return t}createPlaneFromIntersection(t,e){var a;if(!t.renderer)throw new Error("The given world must have a renderer!");const s=e.point.distanceTo(new b.Vector3(0,0,0)),n=(a=e.face)==null?void 0:a.normal;if(!s||!n)return null;const r=this.getWorldNormal(e,n),o=this.newPlane(t,e.point,r.negate());return o.visible=this._visible,o.size=this._size,t.renderer.setPlane(!0,o.three),this.updateMaterialsAndPlanes(),o}getWorldNormal(t,e){const s=t.object;let n=t.object.matrixWorld.clone();if(s instanceof b.InstancedMesh&&t.instanceId!==void 0){const l=new b.Matrix4;s.getMatrixAt(t.instanceId,l),n=l.multiply(n)}const o=new b.Matrix3().getNormalMatrix(n),a=e.clone().applyMatrix3(o).normalize();return this.normalizePlaneDirectionY(a),a}normalizePlaneDirectionY(t){this.orthogonalY&&(t.y>this.toleranceOrthogonalY&&(t.x=0,t.y=1,t.z=0),t.y<-this.toleranceOrthogonalY&&(t.x=0,t.y=-1,t.z=0))}newPlane(t,e,s){const n=new this.Type(this.components,t,e,s,this._material);return n.onDraggingStarted.add(this._onStartDragging),n.onDraggingEnded.add(this._onEndDragging),this.list.push(n),this.onAfterCreate.trigger(n),n}updateMaterialsAndPlanes(){const t=this.components.get(Pi);for(const[e,s]of t.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:n}=s.renderer;for(const r of s.meshes)if(r.material)if(Array.isArray(r.material))for(const o of r.material)o.clippingPlanes=n;else r.material.clippingPlanes=n}}};C(Qe,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let Is=Qe;class eo{constructor(i){C(this,"enabled",!1);C(this,"id","FirstPerson");this.camera=i}set(i){if(this.enabled=i,i){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const i=this.camera.controls,t=new b.Vector3;i.distance--,i.getPosition(t),i.minDistance=1,i.maxDistance=1,i.distance=1,i.moveTo(t.x,t.y,t.z),i.truckSpeed=50,i.mouseButtons.wheel=bt.ACTION.DOLLY,i.touches.two=bt.ACTION.TOUCH_ZOOM_TRUCK}}class io{constructor(i){C(this,"enabled",!0);C(this,"id","Orbit");this.camera=i,this.activateOrbitControls()}set(i){this.enabled=i,i&&this.activateOrbitControls()}activateOrbitControls(){const i=this.camera.controls;i.minDistance=1,i.maxDistance=300;const t=new b.Vector3;i.getPosition(t);const e=t.length();i.distance=e,i.truckSpeed=2;const{rotation:s}=this.camera.three,n=new b.Vector3(0,0,-1).applyEuler(s),r=t.addScaledVector(n,e);i.moveTo(r.x,r.y,r.z)}}class so{constructor(i){C(this,"enabled",!1);C(this,"id","Plan");C(this,"mouseAction1");C(this,"mouseAction2");C(this,"mouseInitialized",!1);C(this,"defaultAzimuthSpeed");C(this,"defaultPolarSpeed");this.camera=i,this.defaultAzimuthSpeed=i.controls.azimuthRotateSpeed,this.defaultPolarSpeed=i.controls.polarRotateSpeed}set(i){this.enabled=i;const t=this.camera.controls;t.azimuthRotateSpeed=i?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=i?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),i?(t.mouseButtons.left=bt.ACTION.TRUCK,t.touches.one=bt.ACTION.TOUCH_TRUCK,t.touches.two=bt.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=bt.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class no{constructor(i){C(this,"onChanged",new q);C(this,"current","Perspective");C(this,"camera");C(this,"matchOrthoDistanceEnabled",!1);C(this,"_component");C(this,"_previousDistance",-1);this._component=i,this.camera=i.three}async set(i){this.current!==i&&(i==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const t=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(t)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const i=this.getPerspectiveDims();if(!i)return;const{width:t,height:e}=i;this.setupOrthoCamera(e,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const i=this._component.currentWorld;if(!i||!i.renderer)return null;const t=new b.Vector3;this._component.threePersp.getWorldDirection(t);const e=new b.Vector3;this._component.controls.getTarget(e);const n=e.clone().sub(this._component.threePersp.position).dot(t),r=i.renderer.getSize(),o=r.x/r.y,a=this._component.threePersp,l=n*2*Math.atan(a.fov*(Math.PI/180)/2);return{width:l*o,height:l}}setupOrthoCamera(i,t){this._component.controls.mouseButtons.wheel=bt.ACTION.ZOOM,this._component.controls.mouseButtons.middle=bt.ACTION.ZOOM;const e=this._component.threePersp,s=this._component.threeOrtho;s.zoom=1,s.left=t/-2,s.right=t/2,s.top=i/2,s.bottom=i/-2,s.updateProjectionMatrix(),s.position.copy(e.position),s.quaternion.copy(e.quaternion),this._component.controls.camera=s}getDistance(){const i=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(i.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=bt.ACTION.DOLLY,this._component.controls.mouseButtons.middle=bt.ACTION.DOLLY;const i=this._component.threePersp,t=this._component.threeOrtho;i.position.copy(t.position),i.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=bt.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),i.updateProjectionMatrix(),this._component.controls.camera=i,this.camera=i,this.current="Perspective"}}class ro extends Je{constructor(t){super(t);C(this,"projection");C(this,"threeOrtho");C(this,"threePersp");C(this,"_userInputButtons",{});C(this,"_frustumSize",50);C(this,"_navigationModes",new Map);C(this,"_mode",null);C(this,"previousSize",null);this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new no(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(e=>{this.three=e,this.updateAspect()}),this.onWorldChanged.add(({action:e})=>{e==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new io(this)),this._navigationModes.set("FirstPerson",new eo(this)),this._navigationModes.set("Plan",new so(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone()))})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(t){if(this.mode!==null&&this.mode.id!==t){if(this.mode.set(!1),!this._navigationModes.has(t))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(t),this.mode.set(!0)}}async fit(t,e=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,n=Number.MIN_VALUE,r=new b.Vector3(s,s,s),o=new b.Vector3(n,n,n);for(const u of t){const d=new b.Box3().setFromObject(u);d.min.x<r.x&&(r.x=d.min.x),d.min.y<r.y&&(r.y=d.min.y),d.min.z<r.z&&(r.z=d.min.z),d.max.x>o.x&&(o.x=d.max.x),d.max.y>o.y&&(o.y=d.max.y),d.max.z>o.z&&(o.z=d.max.z)}const a=new b.Box3(r,o),l=new b.Vector3;a.getSize(l);const h=new b.Vector3;a.getCenter(h);const f=Math.max(l.x,l.y,l.z)*e,I=new b.Sphere(h,f);await this.controls.fitToSphere(I,!0)}setUserInput(t){t?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const t=window.innerWidth/window.innerHeight;return new b.OrthographicCamera(this._frustumSize*t/-2,this._frustumSize*t/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const t=this.currentWorld.renderer.getSize(),e=this.threeOrtho.top,s=this.threeOrtho.right,n=t.y/this.previousSize.y,r=t.x/this.previousSize.x,o=e*n,a=s*r;this.threeOrtho.left=-a,this.threeOrtho.right=a,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Sn=new Map([[k.IFCRELAGGREGATES,{forRelated:"Decomposes",forRelating:"IsDecomposedBy"}],[k.IFCRELASSOCIATESMATERIAL,{forRelated:"HasAssociations",forRelating:"AssociatedTo"}],[k.IFCRELASSOCIATESCLASSIFICATION,{forRelated:"HasAssociations",forRelating:"ClassificationForObjects"}],[k.IFCRELASSIGNSTOGROUP,{forRelated:"HasAssignments",forRelating:"IsGroupedBy"}],[k.IFCRELDEFINESBYPROPERTIES,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[k.IFCRELDEFINESBYTYPE,{forRelated:"IsTypedBy",forRelating:"Types"}],[k.IFCRELDEFINESBYTEMPLATE,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[k.IFCRELCONTAINEDINSPATIALSTRUCTURE,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[k.IFCRELFLOWCONTROLELEMENTS,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[k.IFCRELCONNECTSELEMENTS,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}],[k.IFCRELASSIGNSTOPRODUCT,{forRelated:"HasAssignments",forRelating:"ReferencedBy"}],[k.IFCRELDECLARES,{forRelated:"HasContext",forRelating:"Declares"}],[k.IFCRELASSIGNSTOCONTROL,{forRelated:"HasAssignments",forRelating:"Controls"}],[k.IFCRELNESTS,{forRelated:"Nests",forRelating:"IsNestedBy"}],[k.IFCRELASSOCIATESDOCUMENT,{forRelated:"HasAssociations",forRelating:"DocumentRefForObjects"}]]),oo={103090709:"IFCPROJECT",4097777520:"IFCSITE",4031249490:"IFCBUILDING",3124254112:"IFCBUILDINGSTOREY",3856911033:"IFCSPACE",1674181508:"IFCANNOTATION",25142252:"IFCCONTROLLER",32344328:"IFCBOILER",76236018:"IFCLAMP",90941305:"IFCPUMP",177149247:"IFCAIRTERMINALBOX",182646315:"IFCFLOWINSTRUMENT",263784265:"IFCFURNISHINGELEMENT",264262732:"IFCELECTRICGENERATOR",277319702:"IFCAUDIOVISUALAPPLIANCE",310824031:"IFCPIPEFITTING",331165859:"IFCSTAIR",342316401:"IFCDUCTFITTING",377706215:"IFCMECHANICALFASTENER",395920057:"IFCDOOR",402227799:"IFCELECTRICMOTOR",413509423:"IFCSYSTEMFURNITUREELEMENT",484807127:"IFCEVAPORATOR",486154966:"IFCWINDOWSTANDARDCASE",629592764:"IFCLIGHTFIXTURE",630975310:"IFCUNITARYCONTROLELEMENT",635142910:"IFCCABLECARRIERFITTING",639361253:"IFCCOIL",647756555:"IFCFASTENER",707683696:"IFCFLOWSTORAGEDEVICE",738039164:"IFCPROTECTIVEDEVICE",753842376:"IFCBEAM",812556717:"IFCTANK",819412036:"IFCFILTER",843113511:"IFCCOLUMN",862014818:"IFCELECTRICDISTRIBUTIONBOARD",900683007:"IFCFOOTING",905975707:"IFCCOLUMNSTANDARDCASE",926996030:"IFCVOIDINGFEATURE",979691226:"IFCREINFORCINGBAR",987401354:"IFCFLOWSEGMENT",1003880860:"IFCELECTRICTIMECONTROL",1051757585:"IFCCABLEFITTING",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1073191201:"IFCMEMBER",1095909175:"IFCBUILDINGELEMENTPROXY",1156407060:"IFCPLATESTANDARDCASE",1162798199:"IFCSWITCHINGDEVICE",1329646415:"IFCSHADINGDEVICE",1335981549:"IFCDISCRETEACCESSORY",1360408905:"IFCDUCTSILENCER",1404847402:"IFCSTACKTERMINAL",1426591983:"IFCFIRESUPPRESSIONTERMINAL",1437502449:"IFCMEDICALDEVICE",1509553395:"IFCFURNITURE",1529196076:"IFCSLAB",1620046519:"IFCTRANSPORTELEMENT",1634111441:"IFCAIRTERMINAL",1658829314:"IFCENERGYCONVERSIONDEVICE",1677625105:"IFCCIVILELEMENT",1687234759:"IFCPILE",1904799276:"IFCELECTRICAPPLIANCE",1911478936:"IFCMEMBERSTANDARDCASE",1945004755:"IFCDISTRIBUTIONELEMENT",1973544240:"IFCCOVERING",1999602285:"IFCSPACEHEATER",2016517767:"IFCROOF",2056796094:"IFCAIRTOAIRHEATRECOVERY",2058353004:"IFCFLOWCONTROLLER",2068733104:"IFCHUMIDIFIER",2176052936:"IFCJUNCTIONBOX",2188021234:"IFCFLOWMETER",2223149337:"IFCFLOWTERMINAL",2262370178:"IFCRAILING",2272882330:"IFCCONDENSER",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",2320036040:"IFCREINFORCINGMESH",2347447852:"IFCTENDONANCHOR",2391383451:"IFCVIBRATIONISOLATOR",2391406946:"IFCWALL",2474470126:"IFCMOTORCONNECTION",2769231204:"IFCVIRTUALELEMENT",2814081492:"IFCENGINE",2906023776:"IFCBEAMSTANDARDCASE",2938176219:"IFCBURNER",2979338954:"IFCBUILDINGELEMENTPART",3024970846:"IFCRAMP",3026737570:"IFCTUBEBUNDLE",3027962421:"IFCSLABSTANDARDCASE",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",3053780830:"IFCSANITARYTERMINAL",3079942009:"IFCOPENINGSTANDARDCASE",3087945054:"IFCALARM",3101698114:"IFCSURFACEFEATURE",3127900445:"IFCSLABELEMENTEDCASE",3132237377:"IFCFLOWMOVINGDEVICE",3171933400:"IFCPLATE",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",3242481149:"IFCDOORSTANDARDCASE",3283111854:"IFCRAMPFLIGHT",3296154744:"IFCCHIMNEY",3304561284:"IFCWINDOW",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",3319311131:"IFCHEATEXCHANGER",3415622556:"IFCFAN",3420628829:"IFCSOLARDEVICE",3493046030:"IFCGEOGRAPHICELEMENT",3495092785:"IFCCURTAINWALL",3508470533:"IFCFLOWTREATMENTDEVICE",3512223829:"IFCWALLSTANDARDCASE",3518393246:"IFCDUCTSEGMENT",3571504051:"IFCCOMPRESSOR",3588315303:"IFCOPENINGELEMENT",3612865200:"IFCPIPESEGMENT",3640358203:"IFCCOOLINGTOWER",3651124850:"IFCPROJECTIONELEMENT",3694346114:"IFCOUTLET",3747195512:"IFCEVAPORATIVECOOLER",3758799889:"IFCCABLECARRIERSEGMENT",3824725483:"IFCTENDON",3825984169:"IFCTRANSFORMER",3902619387:"IFCCHILLER",4074379575:"IFCDAMPER",4086658281:"IFCSENSOR",4123344466:"IFCELEMENTASSEMBLY",4136498852:"IFCCOOLEDBEAM",4156078855:"IFCWALLELEMENTEDCASE",4175244083:"IFCINTERCEPTOR",4207607924:"IFCVALVE",4217484030:"IFCCABLESEGMENT",4237592921:"IFCWASTETERMINAL",4252922144:"IFCSTAIRFLIGHT",4278956645:"IFCFLOWFITTING",4288193352:"IFCACTUATOR",4292641817:"IFCUNITARYEQUIPMENT",3009204131:"IFCGRID"};class Sc{getAll(i,t){const e={},s=Object.keys(oo).map(n=>parseInt(n,10));for(let n=0;n<s.length;n++){const r=s[n],o=i.GetLineIDsWithType(t,r),a=o.size();for(let l=0;l<a;l++)e[o.get(l)]=r}return e}}const _i={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class be{static async getUnits(i){var r,o,a;const{IFCUNITASSIGNMENT:t}=k,e=await i.getAllPropertiesOfType(t);if(!e)return 1;const s=Object.keys(e),n=e[parseInt(s[0],10)];for(const l of n.Units){if(l.value===void 0||l.value===null)continue;const h=await i.getProperties(l.value);if(!h||!h.UnitType||!h.UnitType.value||h.UnitType.value!=="LENGTHUNIT")continue;let I=1,u=1;return h.Name.value==="METRE"&&(u=1),h.Name.value==="FOOT"&&(u=.3048),((r=h.Prefix)==null?void 0:r.value)==="MILLI"?I=.001:((o=h.Prefix)==null?void 0:o.value)==="CENTI"?I=.01:((a=h.Prefix)==null?void 0:a.value)==="DECI"&&(I=.1),u*I}return 1}static async findItemByGuid(i,t){var s;const e=i.getAllPropertiesIDs();for(const n of e){const r=await i.getProperties(n);if(r&&((s=r.GlobalId)==null?void 0:s.value)===t)return r}return null}static async getRelationMap(i,t,e){var a;const n=e??(async()=>{}),r={},o=i.getAllPropertiesIDs();for(const l of o){const h=await i.getProperties(l);if(!h)continue;const f=h.type===t,I=Object.keys(h).find(p=>p.startsWith("Relating")),u=Object.keys(h).find(p=>p.startsWith("Related"));if(!(f&&I&&u))continue;const d=await i.getProperties((a=h[I])==null?void 0:a.value),E=h[u];if(!d||!E||!(E&&Array.isArray(E)))continue;const T=E.map(p=>p.value);await n(d.expressID,T),r[d.expressID]=T}return r}static async getQsetQuantities(i,t,e){const n=e??(()=>{}),r=await i.getProperties(t);return!r||r.type!==k.IFCELEMENTQUANTITY?null:(r.Quantities??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetProps(i,t,e){const n=e??(()=>{}),r=await i.getProperties(t);return!r||r.type!==k.IFCPROPERTYSET?null:(r.HasProperties??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetRel(i,t){var o;if(!await i.getProperties(t))return null;const s=await i.getAllPropertiesOfType(k.IFCRELDEFINESBYPROPERTIES);if(!s)return null;const n=Object.values(s);let r=null;for(const a of n)((o=a.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(r=a.expressID);return r}static async getQsetRel(i,t){return be.getPsetRel(i,t)}static async getEntityName(i,t){var r;const e=await i.getProperties(t);if(!e)return{key:null,name:null};const s=Object.keys(e).find(o=>o.endsWith("Name"))??null,n=s?(r=e[s])==null?void 0:r.value:null;return{key:s,name:n}}static async getQuantityValue(i,t){const e=await i.getProperties(t);if(!e)return{key:null,value:null};const s=Object.keys(e).find(r=>r.endsWith("Value"))??null;let n;return s===null||e[s]===void 0||e[s]===null?n=null:n=e[s].value,{key:s,value:n}}static isRel(i){return _i[i].startsWith("IFCREL")}static async attributeExists(i,t,e){const s=await i.getProperties(t);return s?Object.keys(s).includes(e):!1}static async groupEntitiesByType(i,t){var s;const e=new Map;for(const n of t){const r=await i.getProperties(n);if(!r)continue;const o=r.type;e.get(o)||e.set(o,new Set),(s=e.get(o))==null||s.add(n)}return e}}const ao={IFCURIREFERENCE:"IfcUriReference",IFCTIME:"IfcTime",IFCTEMPERATURERATEOFCHANGEMEASURE:"IfcTemperatureRateOfChangeMeasure",IFCSOUNDPRESSURELEVELMEASURE:"IfcSoundPressureLevelMeasure",IFCSOUNDPOWERLEVELMEASURE:"IfcSoundPowerLevelMeasure",IFCPROPERTYSETDEFINITIONSET:"IfcPropertySetDefinitionSet",IFCPOSITIVEINTEGER:"IfcPositiveInteger",IFCNONNEGATIVELENGTHMEASURE:"IfcNonNegativeLengthMeasure",IFCLINEINDEX:"IfcLineIndex",IFCLANGUAGEID:"IfcLanguageId",IFCDURATION:"IfcDuration",IFCDAYINWEEKNUMBER:"IfcDayInWeekNumber",IFCDATETIME:"IfcDateTime",IFCDATE:"IfcDate",IFCCARDINALPOINTREFERENCE:"IfcCardinalPointReference",IFCBINARY:"IfcBinary",IFCAREADENSITYMEASURE:"IfcAreaDensityMeasure",IFCARCINDEX:"IfcArcIndex",IFCYEARNUMBER:"IfcYearNumber",IFCWARPINGMOMENTMEASURE:"IfcWarpingMomentMeasure",IFCWARPINGCONSTANTMEASURE:"IfcWarpingConstantMeasure",IFCVOLUMETRICFLOWRATEMEASURE:"IfcVolumetricFlowRateMeasure",IFCVOLUMEMEASURE:"IfcVolumeMeasure",IFCVAPORPERMEABILITYMEASURE:"IfcVaporPermeabilityMeasure",IFCTORQUEMEASURE:"IfcTorqueMeasure",IFCTIMESTAMP:"IfcTimestamp",IFCTIMEMEASURE:"IfcTimeMeasure",IFCTHERMODYNAMICTEMPERATUREMEASURE:"IfcThermodynamicTemperatureMeasure",IFCTHERMALTRANSMITTANCEMEASURE:"IfcThermalTransmittanceMeasure",IFCTHERMALRESISTANCEMEASURE:"IfcThermalResistanceMeasure",IFCTHERMALEXPANSIONCOEFFICIENTMEASURE:"IfcThermalExpansionCoefficientMeasure",IFCTHERMALCONDUCTIVITYMEASURE:"IfcThermalConductivityMeasure",IFCTHERMALADMITTANCEMEASURE:"IfcThermalAdmittanceMeasure",IFCTEXTTRANSFORMATION:"IfcTextTransformation",IFCTEXTFONTNAME:"IfcTextFontName",IFCTEXTDECORATION:"IfcTextDecoration",IFCTEXTALIGNMENT:"IfcTextAlignment",IFCTEXT:"IfcText",IFCTEMPERATUREGRADIENTMEASURE:"IfcTemperatureGradientMeasure",IFCSPECULARROUGHNESS:"IfcSpecularRoughness",IFCSPECULAREXPONENT:"IfcSpecularExponent",IFCSPECIFICHEATCAPACITYMEASURE:"IfcSpecificHeatCapacityMeasure",IFCSOUNDPRESSUREMEASURE:"IfcSoundPressureMeasure",IFCSOUNDPOWERMEASURE:"IfcSoundPowerMeasure",IFCSOLIDANGLEMEASURE:"IfcSolidAngleMeasure",IFCSHEARMODULUSMEASURE:"IfcShearModulusMeasure",IFCSECTIONALAREAINTEGRALMEASURE:"IfcSectionalAreaIntegralMeasure",IFCSECTIONMODULUSMEASURE:"IfcSectionModulusMeasure",IFCSECONDINMINUTE:"IfcSecondInMinute",IFCROTATIONALSTIFFNESSMEASURE:"IfcRotationalStiffnessMeasure",IFCROTATIONALMASSMEASURE:"IfcRotationalMassMeasure",IFCROTATIONALFREQUENCYMEASURE:"IfcRotationalFrequencyMeasure",IFCREAL:"IfcReal",IFCRATIOMEASURE:"IfcRatioMeasure",IFCRADIOACTIVITYMEASURE:"IfcRadioactivityMeasure",IFCPRESSUREMEASURE:"IfcPressureMeasure",IFCPRESENTABLETEXT:"IfcPresentableText",IFCPOWERMEASURE:"IfcPowerMeasure",IFCPOSITIVERATIOMEASURE:"IfcPositiveRatioMeasure",IFCPOSITIVEPLANEANGLEMEASURE:"IfcPositivePlaneAngleMeasure",IFCPOSITIVELENGTHMEASURE:"IfcPositiveLengthMeasure",IFCPLANEANGLEMEASURE:"IfcPlaneAngleMeasure",IFCPLANARFORCEMEASURE:"IfcPlanarForceMeasure",IFCPARAMETERVALUE:"IfcParameterValue",IFCPHMEASURE:"IfcPhMeasure",IFCNUMERICMEASURE:"IfcNumericMeasure",IFCNORMALISEDRATIOMEASURE:"IfcNormalisedRatioMeasure",IFCMONTHINYEARNUMBER:"IfcMonthInYearNumber",IFCMONETARYMEASURE:"IfcMonetaryMeasure",IFCMOMENTOFINERTIAMEASURE:"IfcMomentOfInertiaMeasure",IFCMOLECULARWEIGHTMEASURE:"IfcMolecularWeightMeasure",IFCMOISTUREDIFFUSIVITYMEASURE:"IfcMoistureDiffusivityMeasure",IFCMODULUSOFSUBGRADEREACTIONMEASURE:"IfcModulusOfSubgradeReactionMeasure",IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE:"IfcModulusOfRotationalSubgradeReactionMeasure",IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE:"IfcModulusOfLinearSubgradeReactionMeasure",IFCMODULUSOFELASTICITYMEASURE:"IfcModulusOfElasticityMeasure",IFCMINUTEINHOUR:"IfcMinuteInHour",IFCMASSPERLENGTHMEASURE:"IfcMassPerLengthMeasure",IFCMASSMEASURE:"IfcMassMeasure",IFCMASSFLOWRATEMEASURE:"IfcMassFlowRateMeasure",IFCMASSDENSITYMEASURE:"IfcMassDensityMeasure",IFCMAGNETICFLUXMEASURE:"IfcMagneticFluxMeasure",IFCMAGNETICFLUXDENSITYMEASURE:"IfcMagneticFluxDensityMeasure",IFCLUMINOUSINTENSITYMEASURE:"IfcLuminousIntensityMeasure",IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE:"IfcLuminousIntensityDistributionMeasure",IFCLUMINOUSFLUXMEASURE:"IfcLuminousFluxMeasure",IFCLOGICAL:"IfcLogical",IFCLINEARVELOCITYMEASURE:"IfcLinearVelocityMeasure",IFCLINEARSTIFFNESSMEASURE:"IfcLinearStiffnessMeasure",IFCLINEARMOMENTMEASURE:"IfcLinearMomentMeasure",IFCLINEARFORCEMEASURE:"IfcLinearForceMeasure",IFCLENGTHMEASURE:"IfcLengthMeasure",IFCLABEL:"IfcLabel",IFCKINEMATICVISCOSITYMEASURE:"IfcKinematicViscosityMeasure",IFCISOTHERMALMOISTURECAPACITYMEASURE:"IfcIsothermalMoistureCapacityMeasure",IFCIONCONCENTRATIONMEASURE:"IfcIonConcentrationMeasure",IFCINTEGERCOUNTRATEMEASURE:"IfcIntegerCountRateMeasure",IFCINTEGER:"IfcInteger",IFCINDUCTANCEMEASURE:"IfcInductanceMeasure",IFCILLUMINANCEMEASURE:"IfcIlluminanceMeasure",IFCIDENTIFIER:"IfcIdentifier",IFCHOURINDAY:"IfcHourInDay",IFCHEATINGVALUEMEASURE:"IfcHeatingValueMeasure",IFCHEATFLUXDENSITYMEASURE:"IfcHeatFluxDensityMeasure",IFCGLOBALLYUNIQUEID:"IfcGloballyUniqueId",IFCFREQUENCYMEASURE:"IfcFrequencyMeasure",IFCFORCEMEASURE:"IfcForceMeasure",IFCFONTWEIGHT:"IfcFontWeight",IFCFONTVARIANT:"IfcFontVariant",IFCFONTSTYLE:"IfcFontStyle",IFCENERGYMEASURE:"IfcEnergyMeasure",IFCELECTRICVOLTAGEMEASURE:"IfcElectricVoltageMeasure",IFCELECTRICRESISTANCEMEASURE:"IfcElectricResistanceMeasure",IFCELECTRICCURRENTMEASURE:"IfcElectricCurrentMeasure",IFCELECTRICCONDUCTANCEMEASURE:"IfcElectricConductanceMeasure",IFCELECTRICCHARGEMEASURE:"IfcElectricChargeMeasure",IFCELECTRICCAPACITANCEMEASURE:"IfcElectricCapacitanceMeasure",IFCDYNAMICVISCOSITYMEASURE:"IfcDynamicViscosityMeasure",IFCDOSEEQUIVALENTMEASURE:"IfcDoseEquivalentMeasure",IFCDIMENSIONCOUNT:"IfcDimensionCount",IFCDESCRIPTIVEMEASURE:"IfcDescriptiveMeasure",IFCDAYLIGHTSAVINGHOUR:"IfcDaylightSavingHour",IFCDAYINMONTHNUMBER:"IfcDayInMonthNumber",IFCCURVATUREMEASURE:"IfcCurvatureMeasure",IFCCOUNTMEASURE:"IfcCountMeasure",IFCCONTEXTDEPENDENTMEASURE:"IfcContextDependentMeasure",IFCCOMPOUNDPLANEANGLEMEASURE:"IfcCompoundPlaneAngleMeasure",IFCCOMPLEXNUMBER:"IfcComplexNumber",IFCBOXALIGNMENT:"IfcBoxAlignment",IFCBOOLEAN:"IfcBoolean",IFCAREAMEASURE:"IfcAreaMeasure",IFCANGULARVELOCITYMEASURE:"IfcAngularVelocityMeasure",IFCAMOUNTOFSUBSTANCEMEASURE:"IfcAmountOfSubstanceMeasure",IFCACCELERATIONMEASURE:"IfcAccelerationMeasure",IFCABSORBEDDOSEMEASURE:"IfcAbsorbedDoseMeasure",IFCGEOSLICE:"IfcGeoSlice",IFCGEOMODEL:"IfcGeoModel",IFCELECTRICFLOWTREATMENTDEVICE:"IfcElectricFlowTreatmentDevice",IFCDISTRIBUTIONBOARD:"IfcDistributionBoard",IFCCONVEYORSEGMENT:"IfcConveyorSegment",IFCCAISSONFOUNDATION:"IfcCaissonFoundation",IFCBOREHOLE:"IfcBorehole",IFCBEARING:"IfcBearing",IFCALIGNMENT:"IfcAlignment",IFCTRACKELEMENT:"IfcTrackElement",IFCSIGNAL:"IfcSignal",IFCREINFORCEDSOIL:"IfcReinforcedSoil",IFCRAIL:"IfcRail",IFCPAVEMENT:"IfcPavement",IFCNAVIGATIONELEMENT:"IfcNavigationElement",IFCMOORINGDEVICE:"IfcMooringDevice",IFCMOBILETELECOMMUNICATIONSAPPLIANCE:"IfcMobileTelecommunicationsAppliance",IFCLIQUIDTERMINAL:"IfcLiquidTerminal",IFCLINEARPOSITIONINGELEMENT:"IfcLinearPositioningElement",IFCKERB:"IfcKerb",IFCGEOTECHNICALASSEMBLY:"IfcGeotechnicalAssembly",IFCELECTRICFLOWTREATMENTDEVICETYPE:"IfcElectricFlowTreatmentDeviceType",IFCEARTHWORKSFILL:"IfcEarthworksFill",IFCEARTHWORKSELEMENT:"IfcEarthworksElement",IFCEARTHWORKSCUT:"IfcEarthworksCut",IFCDISTRIBUTIONBOARDTYPE:"IfcDistributionBoardType",IFCDEEPFOUNDATION:"IfcDeepFoundation",IFCCOURSE:"IfcCourse",IFCCONVEYORSEGMENTTYPE:"IfcConveyorSegmentType",IFCCAISSONFOUNDATIONTYPE:"IfcCaissonFoundationType",IFCBUILTSYSTEM:"IfcBuiltSystem",IFCBUILTELEMENT:"IfcBuiltElement",IFCBRIDGEPART:"IfcBridgePart",IFCBRIDGE:"IfcBridge",IFCBEARINGTYPE:"IfcBearingType",IFCALIGNMENTVERTICAL:"IfcAlignmentVertical",IFCALIGNMENTSEGMENT:"IfcAlignmentSegment",IFCALIGNMENTHORIZONTAL:"IfcAlignmentHorizontal",IFCALIGNMENTCANT:"IfcAlignmentCant",IFCVIBRATIONDAMPERTYPE:"IfcVibrationDamperType",IFCVIBRATIONDAMPER:"IfcVibrationDamper",IFCVEHICLE:"IfcVehicle",IFCTRANSPORTATIONDEVICE:"IfcTransportationDevice",IFCTRACKELEMENTTYPE:"IfcTrackElementType",IFCTENDONCONDUITTYPE:"IfcTendonConduitType",IFCTENDONCONDUIT:"IfcTendonConduit",IFCSINESPIRAL:"IfcSineSpiral",IFCSIGNALTYPE:"IfcSignalType",IFCSIGNTYPE:"IfcSignType",IFCSIGN:"IfcSign",IFCSEVENTHORDERPOLYNOMIALSPIRAL:"IfcSeventhOrderPolynomialSpiral",IFCSEGMENTEDREFERENCECURVE:"IfcSegmentedReferenceCurve",IFCSECONDORDERPOLYNOMIALSPIRAL:"IfcSecondOrderPolynomialSpiral",IFCROADPART:"IfcRoadPart",IFCROAD:"IfcRoad",IFCRELADHERESTOELEMENT:"IfcRelAdheresToElement",IFCREFERENT:"IfcReferent",IFCRAILWAYPART:"IfcRailwayPart",IFCRAILWAY:"IfcRailway",IFCRAILTYPE:"IfcRailType",IFCPOSITIONINGELEMENT:"IfcPositioningElement",IFCPAVEMENTTYPE:"IfcPavementType",IFCNAVIGATIONELEMENTTYPE:"IfcNavigationElementType",IFCMOORINGDEVICETYPE:"IfcMooringDeviceType",IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE:"IfcMobileTelecommunicationsApplianceType",IFCMARINEPART:"IfcMarinePart",IFCMARINEFACILITY:"IfcMarineFacility",IFCLIQUIDTERMINALTYPE:"IfcLiquidTerminalType",IFCLINEARELEMENT:"IfcLinearElement",IFCKERBTYPE:"IfcKerbType",IFCIMPACTPROTECTIONDEVICETYPE:"IfcImpactProtectionDeviceType",IFCIMPACTPROTECTIONDEVICE:"IfcImpactProtectionDevice",IFCGRADIENTCURVE:"IfcGradientCurve",IFCGEOTECHNICALSTRATUM:"IfcGeotechnicalStratum",IFCGEOTECHNICALELEMENT:"IfcGeotechnicalElement",IFCFACILITYPARTCOMMON:"IfcFacilityPartCommon",IFCFACILITYPART:"IfcFacilityPart",IFCFACILITY:"IfcFacility",IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID:"IfcDirectrixDerivedReferenceSweptAreaSolid",IFCDEEPFOUNDATIONTYPE:"IfcDeepFoundationType",IFCCOURSETYPE:"IfcCourseType",IFCCOSINESPIRAL:"IfcCosineSpiral",IFCCLOTHOID:"IfcClothoid",IFCBUILTELEMENTTYPE:"IfcBuiltElementType",IFCVEHICLETYPE:"IfcVehicleType",IFCTRIANGULATEDIRREGULARNETWORK:"IfcTriangulatedIrregularNetwork",IFCTRANSPORTATIONDEVICETYPE:"IfcTransportationDeviceType",IFCTHIRDORDERPOLYNOMIALSPIRAL:"IfcThirdOrderPolynomialSpiral",IFCSPIRAL:"IfcSpiral",IFCSECTIONEDSURFACE:"IfcSectionedSurface",IFCSECTIONEDSOLIDHORIZONTAL:"IfcSectionedSolidHorizontal",IFCSECTIONEDSOLID:"IfcSectionedSolid",IFCRELPOSITIONS:"IfcRelPositions",IFCRELASSOCIATESPROFILEDEF:"IfcRelAssociatesProfileDef",IFCPOLYNOMIALCURVE:"IfcPolynomialCurve",IFCOFFSETCURVEBYDISTANCES:"IfcOffsetCurveByDistances",IFCOFFSETCURVE:"IfcOffsetCurve",IFCINDEXEDPOLYGONALTEXTUREMAP:"IfcIndexedPolygonalTextureMap",IFCDIRECTRIXCURVESWEPTAREASOLID:"IfcDirectrixCurveSweptAreaSolid",IFCCURVESEGMENT:"IfcCurveSegment",IFCAXIS2PLACEMENTLINEAR:"IfcAxis2PlacementLinear",IFCSEGMENT:"IfcSegment",IFCPOINTBYDISTANCEEXPRESSION:"IfcPointByDistanceExpression",IFCOPENCROSSPROFILEDEF:"IfcOpenCrossProfileDef",IFCLINEARPLACEMENT:"IfcLinearPlacement",IFCALIGNMENTHORIZONTALSEGMENT:"IfcAlignmentHorizontalSegment",IFCALIGNMENTCANTSEGMENT:"IfcAlignmentCantSegment",IFCTEXTURECOORDINATEINDICESWITHVOIDS:"IfcTextureCoordinateIndicesWithVoids",IFCTEXTURECOORDINATEINDICES:"IfcTextureCoordinateIndices",IFCQUANTITYNUMBER:"IfcQuantityNumber",IFCALIGNMENTVERTICALSEGMENT:"IfcAlignmentVerticalSegment",IFCALIGNMENTPARAMETERSEGMENT:"IfcAlignmentParameterSegment",IFCCONTROLLER:"IfcController",IFCALARM:"IfcAlarm",IFCACTUATOR:"IfcActuator",IFCUNITARYCONTROLELEMENT:"IfcUnitaryControlElement",IFCSENSOR:"IfcSensor",IFCPROTECTIVEDEVICETRIPPINGUNIT:"IfcProtectiveDeviceTrippingUnit",IFCFLOWINSTRUMENT:"IfcFlowInstrument",IFCFIRESUPPRESSIONTERMINAL:"IfcFireSuppressionTerminal",IFCFILTER:"IfcFilter",IFCFAN:"IfcFan",IFCELECTRICTIMECONTROL:"IfcElectricTimeControl",IFCELECTRICMOTOR:"IfcElectricMotor",IFCELECTRICGENERATOR:"IfcElectricGenerator",IFCELECTRICFLOWSTORAGEDEVICE:"IfcElectricFlowStorageDevice",IFCELECTRICDISTRIBUTIONBOARD:"IfcElectricDistributionBoard",IFCELECTRICAPPLIANCE:"IfcElectricAppliance",IFCDUCTSILENCER:"IfcDuctSilencer",IFCDUCTSEGMENT:"IfcDuctSegment",IFCDUCTFITTING:"IfcDuctFitting",IFCDISTRIBUTIONCIRCUIT:"IfcDistributionCircuit",IFCDAMPER:"IfcDamper",IFCCOOLINGTOWER:"IfcCoolingTower",IFCCOOLEDBEAM:"IfcCooledBeam",IFCCONDENSER:"IfcCondenser",IFCCOMPRESSOR:"IfcCompressor",IFCCOMMUNICATIONSAPPLIANCE:"IfcCommunicationsAppliance",IFCCOIL:"IfcCoil",IFCCHILLER:"IfcChiller",IFCCABLESEGMENT:"IfcCableSegment",IFCCABLEFITTING:"IfcCableFitting",IFCCABLECARRIERSEGMENT:"IfcCableCarrierSegment",IFCCABLECARRIERFITTING:"IfcCableCarrierFitting",IFCBURNER:"IfcBurner",IFCBOILER:"IfcBoiler",IFCBEAMSTANDARDCASE:"IfcBeamStandardCase",IFCAUDIOVISUALAPPLIANCE:"IfcAudioVisualAppliance",IFCAIRTOAIRHEATRECOVERY:"IfcAirToAirHeatRecovery",IFCAIRTERMINALBOX:"IfcAirTerminalBox",IFCAIRTERMINAL:"IfcAirTerminal",IFCWINDOWSTANDARDCASE:"IfcWindowStandardCase",IFCWASTETERMINAL:"IfcWasteTerminal",IFCWALLELEMENTEDCASE:"IfcWallElementedCase",IFCVALVE:"IfcValve",IFCUNITARYEQUIPMENT:"IfcUnitaryEquipment",IFCUNITARYCONTROLELEMENTTYPE:"IfcUnitaryControlElementType",IFCTUBEBUNDLE:"IfcTubeBundle",IFCTRANSFORMER:"IfcTransformer",IFCTANK:"IfcTank",IFCSWITCHINGDEVICE:"IfcSwitchingDevice",IFCSTRUCTURALLOADCASE:"IfcStructuralLoadCase",IFCSTACKTERMINAL:"IfcStackTerminal",IFCSPACEHEATER:"IfcSpaceHeater",IFCSOLARDEVICE:"IfcSolarDevice",IFCSLABSTANDARDCASE:"IfcSlabStandardCase",IFCSLABELEMENTEDCASE:"IfcSlabElementedCase",IFCSHADINGDEVICE:"IfcShadingDevice",IFCSANITARYTERMINAL:"IfcSanitaryTerminal",IFCREINFORCINGBARTYPE:"IfcReinforcingBarType",IFCRATIONALBSPLINECURVEWITHKNOTS:"IfcRationalBSplineCurveWithKnots",IFCPUMP:"IfcPump",IFCPROTECTIVEDEVICETRIPPINGUNITTYPE:"IfcProtectiveDeviceTrippingUnitType",IFCPROTECTIVEDEVICE:"IfcProtectiveDevice",IFCPLATESTANDARDCASE:"IfcPlateStandardCase",IFCPIPESEGMENT:"IfcPipeSegment",IFCPIPEFITTING:"IfcPipeFitting",IFCOUTLET:"IfcOutlet",IFCOUTERBOUNDARYCURVE:"IfcOuterBoundaryCurve",IFCMOTORCONNECTION:"IfcMotorConnection",IFCMEMBERSTANDARDCASE:"IfcMemberStandardCase",IFCMEDICALDEVICE:"IfcMedicalDevice",IFCLIGHTFIXTURE:"IfcLightFixture",IFCLAMP:"IfcLamp",IFCJUNCTIONBOX:"IfcJunctionBox",IFCINTERCEPTOR:"IfcInterceptor",IFCHUMIDIFIER:"IfcHumidifier",IFCHEATEXCHANGER:"IfcHeatExchanger",IFCFLOWMETER:"IfcFlowMeter",IFCEXTERNALSPATIALELEMENT:"IfcExternalSpatialElement",IFCEVAPORATOR:"IfcEvaporator",IFCEVAPORATIVECOOLER:"IfcEvaporativeCooler",IFCENGINE:"IfcEngine",IFCELECTRICDISTRIBUTIONBOARDTYPE:"IfcElectricDistributionBoardType",IFCDOORSTANDARDCASE:"IfcDoorStandardCase",IFCDISTRIBUTIONSYSTEM:"IfcDistributionSystem",IFCCOMMUNICATIONSAPPLIANCETYPE:"IfcCommunicationsApplianceType",IFCCOLUMNSTANDARDCASE:"IfcColumnStandardCase",IFCCIVILELEMENT:"IfcCivilElement",IFCCHIMNEY:"IfcChimney",IFCCABLEFITTINGTYPE:"IfcCableFittingType",IFCBURNERTYPE:"IfcBurnerType",IFCBUILDINGSYSTEM:"IfcBuildingSystem",IFCBUILDINGELEMENTPARTTYPE:"IfcBuildingElementPartType",IFCBOUNDARYCURVE:"IfcBoundaryCurve",IFCBSPLINECURVEWITHKNOTS:"IfcBSplineCurveWithKnots",IFCAUDIOVISUALAPPLIANCETYPE:"IfcAudioVisualApplianceType",IFCWORKCALENDAR:"IfcWorkCalendar",IFCWINDOWTYPE:"IfcWindowType",IFCVOIDINGFEATURE:"IfcVoidingFeature",IFCVIBRATIONISOLATOR:"IfcVibrationIsolator",IFCTENDONTYPE:"IfcTendonType",IFCTENDONANCHORTYPE:"IfcTendonAnchorType",IFCSYSTEMFURNITUREELEMENT:"IfcSystemFurnitureElement",IFCSURFACEFEATURE:"IfcSurfaceFeature",IFCSTRUCTURALSURFACEACTION:"IfcStructuralSurfaceAction",IFCSTRUCTURALCURVEREACTION:"IfcStructuralCurveReaction",IFCSTRUCTURALCURVEACTION:"IfcStructuralCurveAction",IFCSTAIRTYPE:"IfcStairType",IFCSOLARDEVICETYPE:"IfcSolarDeviceType",IFCSHADINGDEVICETYPE:"IfcShadingDeviceType",IFCSEAMCURVE:"IfcSeamCurve",IFCROOFTYPE:"IfcRoofType",IFCREINFORCINGMESHTYPE:"IfcReinforcingMeshType",IFCREINFORCINGELEMENTTYPE:"IfcReinforcingElementType",IFCRATIONALBSPLINESURFACEWITHKNOTS:"IfcRationalBSplineSurfaceWithKnots",IFCRAMPTYPE:"IfcRampType",IFCPOLYGONALFACESET:"IfcPolygonalFaceSet",IFCPILETYPE:"IfcPileType",IFCOPENINGSTANDARDCASE:"IfcOpeningStandardCase",IFCMEDICALDEVICETYPE:"IfcMedicalDeviceType",IFCINTERSECTIONCURVE:"IfcIntersectionCurve",IFCINTERCEPTORTYPE:"IfcInterceptorType",IFCINDEXEDPOLYCURVE:"IfcIndexedPolyCurve",IFCGEOGRAPHICELEMENT:"IfcGeographicElement",IFCFURNITURE:"IfcFurniture",IFCFOOTINGTYPE:"IfcFootingType",IFCEXTERNALSPATIALSTRUCTUREELEMENT:"IfcExternalSpatialStructureElement",IFCEVENT:"IfcEvent",IFCENGINETYPE:"IfcEngineType",IFCELEMENTASSEMBLYTYPE:"IfcElementAssemblyType",IFCDOORTYPE:"IfcDoorType",IFCCYLINDRICALSURFACE:"IfcCylindricalSurface",IFCCONSTRUCTIONPRODUCTRESOURCETYPE:"IfcConstructionProductResourceType",IFCCONSTRUCTIONMATERIALRESOURCETYPE:"IfcConstructionMaterialResourceType",IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE:"IfcConstructionEquipmentResourceType",IFCCOMPOSITECURVEONSURFACE:"IfcCompositeCurveOnSurface",IFCCOMPLEXPROPERTYTEMPLATE:"IfcComplexPropertyTemplate",IFCCIVILELEMENTTYPE:"IfcCivilElementType",IFCCHIMNEYTYPE:"IfcChimneyType",IFCBSPLINESURFACEWITHKNOTS:"IfcBSplineSurfaceWithKnots",IFCBSPLINESURFACE:"IfcBSplineSurface",IFCADVANCEDBREPWITHVOIDS:"IfcAdvancedBrepWithVoids",IFCADVANCEDBREP:"IfcAdvancedBrep",IFCTRIANGULATEDFACESET:"IfcTriangulatedFaceSet",IFCTOROIDALSURFACE:"IfcToroidalSurface",IFCTESSELLATEDFACESET:"IfcTessellatedFaceSet",IFCTASKTYPE:"IfcTaskType",IFCSURFACECURVE:"IfcSurfaceCurve",IFCSUBCONTRACTRESOURCETYPE:"IfcSubContractResourceType",IFCSTRUCTURALSURFACEREACTION:"IfcStructuralSurfaceReaction",IFCSPHERICALSURFACE:"IfcSphericalSurface",IFCSPATIALZONETYPE:"IfcSpatialZoneType",IFCSPATIALZONE:"IfcSpatialZone",IFCSPATIALELEMENTTYPE:"IfcSpatialElementType",IFCSPATIALELEMENT:"IfcSpatialElement",IFCSIMPLEPROPERTYTEMPLATE:"IfcSimplePropertyTemplate",IFCREVOLVEDAREASOLIDTAPERED:"IfcRevolvedAreaSolidTapered",IFCREPARAMETRISEDCOMPOSITECURVESEGMENT:"IfcReparametrisedCompositeCurveSegment",IFCRELSPACEBOUNDARY2NDLEVEL:"IfcRelSpaceBoundary2ndLevel",IFCRELSPACEBOUNDARY1STLEVEL:"IfcRelSpaceBoundary1stLevel",IFCRELINTERFERESELEMENTS:"IfcRelInterferesElements",IFCRELDEFINESBYTEMPLATE:"IfcRelDefinesByTemplate",IFCRELDEFINESBYOBJECT:"IfcRelDefinesByObject",IFCRELDECLARES:"IfcRelDeclares",IFCRELASSIGNSTOGROUPBYFACTOR:"IfcRelAssignsToGroupByFactor",IFCPROPERTYTEMPLATE:"IfcPropertyTemplate",IFCPROPERTYSETTEMPLATE:"IfcPropertySetTemplate",IFCPROJECTLIBRARY:"IfcProjectLibrary",IFCPROCEDURETYPE:"IfcProcedureType",IFCPREDEFINEDPROPERTYSET:"IfcPredefinedPropertySet",IFCPCURVE:"IfcPCurve",IFCLABORRESOURCETYPE:"IfcLaborResourceType",IFCINDEXEDPOLYGONALFACEWITHVOIDS:"IfcIndexedPolygonalFaceWithVoids",IFCINDEXEDPOLYGONALFACE:"IfcIndexedPolygonalFace",IFCGEOGRAPHICELEMENTTYPE:"IfcGeographicElementType",IFCFIXEDREFERENCESWEPTAREASOLID:"IfcFixedReferenceSweptAreaSolid",IFCEXTRUDEDAREASOLIDTAPERED:"IfcExtrudedAreaSolidTapered",IFCEVENTTYPE:"IfcEventType",IFCCURVEBOUNDEDSURFACE:"IfcCurveBoundedSurface",IFCCREWRESOURCETYPE:"IfcCrewResourceType",IFCCONTEXT:"IfcContext",IFCCONSTRUCTIONRESOURCETYPE:"IfcConstructionResourceType",IFCCARTESIANPOINTLIST3D:"IfcCartesianPointList3D",IFCCARTESIANPOINTLIST2D:"IfcCartesianPointList2D",IFCCARTESIANPOINTLIST:"IfcCartesianPointList",IFCADVANCEDFACE:"IfcAdvancedFace",IFCTYPERESOURCE:"IfcTypeResource",IFCTYPEPROCESS:"IfcTypeProcess",IFCTESSELLATEDITEM:"IfcTessellatedItem",IFCSWEPTDISKSOLIDPOLYGONAL:"IfcSweptDiskSolidPolygonal",IFCRESOURCETIME:"IfcResourceTime",IFCRESOURCECONSTRAINTRELATIONSHIP:"IfcResourceConstraintRelationship",IFCRESOURCEAPPROVALRELATIONSHIP:"IfcResourceApprovalRelationship",IFCQUANTITYSET:"IfcQuantitySet",IFCPROPERTYTEMPLATEDEFINITION:"IfcPropertyTemplateDefinition",IFCPREDEFINEDPROPERTIES:"IfcPredefinedProperties",IFCMIRROREDPROFILEDEF:"IfcMirroredProfileDef",IFCMATERIALRELATIONSHIP:"IfcMaterialRelationship",IFCMATERIALPROFILESETUSAGETAPERING:"IfcMaterialProfileSetUsageTapering",IFCMATERIALPROFILESETUSAGE:"IfcMaterialProfileSetUsage",IFCMATERIALCONSTITUENTSET:"IfcMaterialConstituentSet",IFCMATERIALCONSTITUENT:"IfcMaterialConstituent",IFCLAGTIME:"IfcLagTime",IFCINDEXEDTRIANGLETEXTUREMAP:"IfcIndexedTriangleTextureMap",IFCINDEXEDTEXTUREMAP:"IfcIndexedTextureMap",IFCINDEXEDCOLOURMAP:"IfcIndexedColourMap",IFCEXTERNALREFERENCERELATIONSHIP:"IfcExternalReferenceRelationship",IFCEXTENDEDPROPERTIES:"IfcExtendedProperties",IFCEVENTTIME:"IfcEventTime",IFCCONVERSIONBASEDUNITWITHOFFSET:"IfcConversionBasedUnitWithOffset",IFCCOLOURRGBLIST:"IfcColourRgbList",IFCWORKTIME:"IfcWorkTime",IFCTIMEPERIOD:"IfcTimePeriod",IFCTEXTUREVERTEXLIST:"IfcTextureVertexList",IFCTASKTIMERECURRING:"IfcTaskTimeRecurring",IFCTASKTIME:"IfcTaskTime",IFCTABLECOLUMN:"IfcTableColumn",IFCSURFACEREINFORCEMENTAREA:"IfcSurfaceReinforcementArea",IFCSTRUCTURALLOADORRESULT:"IfcStructuralLoadOrResult",IFCSTRUCTURALLOADCONFIGURATION:"IfcStructuralLoadConfiguration",IFCSCHEDULINGTIME:"IfcSchedulingTime",IFCRESOURCELEVELRELATIONSHIP:"IfcResourceLevelRelationship",IFCREFERENCE:"IfcReference",IFCRECURRENCEPATTERN:"IfcRecurrencePattern",IFCPROPERTYABSTRACTION:"IfcPropertyAbstraction",IFCPROJECTEDCRS:"IfcProjectedCrs",IFCPRESENTATIONITEM:"IfcPresentationItem",IFCMATERIALUSAGEDEFINITION:"IfcMaterialUsageDefinition",IFCMATERIALPROFILEWITHOFFSETS:"IfcMaterialProfileWithOffsets",IFCMATERIALPROFILESET:"IfcMaterialProfileSet",IFCMATERIALPROFILE:"IfcMaterialProfile",IFCMATERIALLAYERWITHOFFSETS:"IfcMaterialLayerWithOffsets",IFCMATERIALDEFINITION:"IfcMaterialDefinition",IFCMAPCONVERSION:"IfcMapConversion",IFCEXTERNALINFORMATION:"IfcExternalInformation",IFCCOORDINATEREFERENCESYSTEM:"IfcCoordinateReferenceSystem",IFCCOORDINATEOPERATION:"IfcCoordinateOperation",IFCCONNECTIONVOLUMEGEOMETRY:"IfcConnectionVolumeGeometry",IFCREINFORCINGBAR:"IfcReinforcingBar",IFCELECTRICDISTRIBUTIONPOINT:"IfcElectricDistributionPoint",IFCDISTRIBUTIONCONTROLELEMENT:"IfcDistributionControlElement",IFCDISTRIBUTIONCHAMBERELEMENT:"IfcDistributionChamberElement",IFCCONTROLLERTYPE:"IfcControllerType",IFCCHAMFEREDGEFEATURE:"IfcChamferEdgeFeature",IFCBEAM:"IfcBeam",IFCALARMTYPE:"IfcAlarmType",IFCACTUATORTYPE:"IfcActuatorType",IFCWINDOW:"IfcWindow",IFCWALLSTANDARDCASE:"IfcWallStandardCase",IFCWALL:"IfcWall",IFCVIBRATIONISOLATORTYPE:"IfcVibrationIsolatorType",IFCTENDONANCHOR:"IfcTendonAnchor",IFCTENDON:"IfcTendon",IFCSTRUCTURALANALYSISMODEL:"IfcStructuralAnalysisModel",IFCSTAIRFLIGHT:"IfcStairFlight",IFCSTAIR:"IfcStair",IFCSLAB:"IfcSlab",IFCSENSORTYPE:"IfcSensorType",IFCROUNDEDEDGEFEATURE:"IfcRoundedEdgeFeature",IFCROOF:"IfcRoof",IFCREINFORCINGMESH:"IfcReinforcingMesh",IFCREINFORCINGELEMENT:"IfcReinforcingElement",IFCRATIONALBEZIERCURVE:"IfcRationalBezierCurve",IFCRAMPFLIGHT:"IfcRampFlight",IFCRAMP:"IfcRamp",IFCRAILING:"IfcRailing",IFCPLATE:"IfcPlate",IFCPILE:"IfcPile",IFCMEMBER:"IfcMember",IFCFOOTING:"IfcFooting",IFCFLOWTREATMENTDEVICE:"IfcFlowTreatmentDevice",IFCFLOWTERMINAL:"IfcFlowTerminal",IFCFLOWSTORAGEDEVICE:"IfcFlowStorageDevice",IFCFLOWSEGMENT:"IfcFlowSegment",IFCFLOWMOVINGDEVICE:"IfcFlowMovingDevice",IFCFLOWINSTRUMENTTYPE:"IfcFlowInstrumentType",IFCFLOWFITTING:"IfcFlowFitting",IFCFLOWCONTROLLER:"IfcFlowController",IFCFIRESUPPRESSIONTERMINALTYPE:"IfcFireSuppressionTerminalType",IFCFILTERTYPE:"IfcFilterType",IFCFANTYPE:"IfcFanType",IFCENERGYCONVERSIONDEVICE:"IfcEnergyConversionDevice",IFCELECTRICALELEMENT:"IfcElectricalElement",IFCELECTRICALCIRCUIT:"IfcElectricalCircuit",IFCELECTRICTIMECONTROLTYPE:"IfcElectricTimeControlType",IFCELECTRICMOTORTYPE:"IfcElectricMotorType",IFCELECTRICHEATERTYPE:"IfcElectricHeaterType",IFCELECTRICGENERATORTYPE:"IfcElectricGeneratorType",IFCELECTRICFLOWSTORAGEDEVICETYPE:"IfcElectricFlowStorageDeviceType",IFCELECTRICAPPLIANCETYPE:"IfcElectricApplianceType",IFCEDGEFEATURE:"IfcEdgeFeature",IFCDUCTSILENCERTYPE:"IfcDuctSilencerType",IFCDUCTSEGMENTTYPE:"IfcDuctSegmentType",IFCDUCTFITTINGTYPE:"IfcDuctFittingType",IFCDOOR:"IfcDoor",IFCDISTRIBUTIONPORT:"IfcDistributionPort",IFCDISTRIBUTIONFLOWELEMENT:"IfcDistributionFlowElement",IFCDISTRIBUTIONELEMENT:"IfcDistributionElement",IFCDISTRIBUTIONCONTROLELEMENTTYPE:"IfcDistributionControlElementType",IFCDISTRIBUTIONCHAMBERELEMENTTYPE:"IfcDistributionChamberElementType",IFCDISCRETEACCESSORYTYPE:"IfcDiscreteAccessoryType",IFCDISCRETEACCESSORY:"IfcDiscreteAccessory",IFCDIAMETERDIMENSION:"IfcDiameterDimension",IFCDAMPERTYPE:"IfcDamperType",IFCCURTAINWALL:"IfcCurtainWall",IFCCOVERING:"IfcCovering",IFCCOOLINGTOWERTYPE:"IfcCoolingTowerType",IFCCOOLEDBEAMTYPE:"IfcCooledBeamType",IFCCONSTRUCTIONPRODUCTRESOURCE:"IfcConstructionProductResource",IFCCONSTRUCTIONMATERIALRESOURCE:"IfcConstructionMaterialResource",IFCCONSTRUCTIONEQUIPMENTRESOURCE:"IfcConstructionEquipmentResource",IFCCONDITIONCRITERION:"IfcConditionCriterion",IFCCONDITION:"IfcCondition",IFCCONDENSERTYPE:"IfcCondenserType",IFCCOMPRESSORTYPE:"IfcCompressorType",IFCCOLUMN:"IfcColumn",IFCCOILTYPE:"IfcCoilType",IFCCIRCLE:"IfcCircle",IFCCHILLERTYPE:"IfcChillerType",IFCCABLESEGMENTTYPE:"IfcCableSegmentType",IFCCABLECARRIERSEGMENTTYPE:"IfcCableCarrierSegmentType",IFCCABLECARRIERFITTINGTYPE:"IfcCableCarrierFittingType",IFCBUILDINGELEMENTPROXYTYPE:"IfcBuildingElementProxyType",IFCBUILDINGELEMENTPROXY:"IfcBuildingElementProxy",IFCBUILDINGELEMENTPART:"IfcBuildingElementPart",IFCBUILDINGELEMENTCOMPONENT:"IfcBuildingElementComponent",IFCBUILDINGELEMENT:"IfcBuildingElement",IFCBOILERTYPE:"IfcBoilerType",IFCBEZIERCURVE:"IfcBezierCurve",IFCBEAMTYPE:"IfcBeamType",IFCBSPLINECURVE:"IfcBSplineCurve",IFCASSET:"IfcAsset",IFCANGULARDIMENSION:"IfcAngularDimension",IFCAIRTOAIRHEATRECOVERYTYPE:"IfcAirToAirHeatRecoveryType",IFCAIRTERMINALTYPE:"IfcAirTerminalType",IFCAIRTERMINALBOXTYPE:"IfcAirTerminalBoxType",IFCACTIONREQUEST:"IfcActionRequest",IFC2DCOMPOSITECURVE:"Ifc2DCompositeCurve",IFCZONE:"IfcZone",IFCWORKSCHEDULE:"IfcWorkSchedule",IFCWORKPLAN:"IfcWorkPlan",IFCWORKCONTROL:"IfcWorkControl",IFCWASTETERMINALTYPE:"IfcWasteTerminalType",IFCWALLTYPE:"IfcWallType",IFCVIRTUALELEMENT:"IfcVirtualElement",IFCVALVETYPE:"IfcValveType",IFCUNITARYEQUIPMENTTYPE:"IfcUnitaryEquipmentType",IFCTUBEBUNDLETYPE:"IfcTubeBundleType",IFCTRIMMEDCURVE:"IfcTrimmedCurve",IFCTRANSPORTELEMENT:"IfcTransportElement",IFCTRANSFORMERTYPE:"IfcTransformerType",IFCTIMESERIESSCHEDULE:"IfcTimeSeriesSchedule",IFCTANKTYPE:"IfcTankType",IFCSYSTEM:"IfcSystem",IFCSWITCHINGDEVICETYPE:"IfcSwitchingDeviceType",IFCSUBCONTRACTRESOURCE:"IfcSubContractResource",IFCSTRUCTURALSURFACECONNECTION:"IfcStructuralSurfaceConnection",IFCSTRUCTURALRESULTGROUP:"IfcStructuralResultGroup",IFCSTRUCTURALPOINTREACTION:"IfcStructuralPointReaction",IFCSTRUCTURALPOINTCONNECTION:"IfcStructuralPointConnection",IFCSTRUCTURALPOINTACTION:"IfcStructuralPointAction",IFCSTRUCTURALPLANARACTIONVARYING:"IfcStructuralPlanarActionVarying",IFCSTRUCTURALPLANARACTION:"IfcStructuralPlanarAction",IFCSTRUCTURALLOADGROUP:"IfcStructuralLoadGroup",IFCSTRUCTURALLINEARACTIONVARYING:"IfcStructuralLinearActionVarying",IFCSTRUCTURALLINEARACTION:"IfcStructuralLinearAction",IFCSTRUCTURALCURVEMEMBERVARYING:"IfcStructuralCurveMemberVarying",IFCSTRUCTURALCURVEMEMBER:"IfcStructuralCurveMember",IFCSTRUCTURALCURVECONNECTION:"IfcStructuralCurveConnection",IFCSTRUCTURALCONNECTION:"IfcStructuralConnection",IFCSTRUCTURALACTION:"IfcStructuralAction",IFCSTAIRFLIGHTTYPE:"IfcStairFlightType",IFCSTACKTERMINALTYPE:"IfcStackTerminalType",IFCSPACETYPE:"IfcSpaceType",IFCSPACEPROGRAM:"IfcSpaceProgram",IFCSPACEHEATERTYPE:"IfcSpaceHeaterType",IFCSPACE:"IfcSpace",IFCSLABTYPE:"IfcSlabType",IFCSITE:"IfcSite",IFCSERVICELIFE:"IfcServiceLife",IFCSCHEDULETIMECONTROL:"IfcScheduleTimeControl",IFCSANITARYTERMINALTYPE:"IfcSanitaryTerminalType",IFCRELASSIGNSTASKS:"IfcRelAssignsTasks",IFCRELAGGREGATES:"IfcRelAggregates",IFCRAMPFLIGHTTYPE:"IfcRampFlightType",IFCRAILINGTYPE:"IfcRailingType",IFCRADIUSDIMENSION:"IfcRadiusDimension",IFCPUMPTYPE:"IfcPumpType",IFCPROTECTIVEDEVICETYPE:"IfcProtectiveDeviceType",IFCPROJECTIONELEMENT:"IfcProjectionElement",IFCPROJECTORDERRECORD:"IfcProjectOrderRecord",IFCPROJECTORDER:"IfcProjectOrder",IFCPROCEDURE:"IfcProcedure",IFCPORT:"IfcPort",IFCPOLYLINE:"IfcPolyline",IFCPLATETYPE:"IfcPlateType",IFCPIPESEGMENTTYPE:"IfcPipeSegmentType",IFCPIPEFITTINGTYPE:"IfcPipeFittingType",IFCPERMIT:"IfcPermit",IFCPERFORMANCEHISTORY:"IfcPerformanceHistory",IFCOUTLETTYPE:"IfcOutletType",IFCORDERACTION:"IfcOrderAction",IFCOPENINGELEMENT:"IfcOpeningElement",IFCOCCUPANT:"IfcOccupant",IFCMOVE:"IfcMove",IFCMOTORCONNECTIONTYPE:"IfcMotorConnectionType",IFCMEMBERTYPE:"IfcMemberType",IFCMECHANICALFASTENERTYPE:"IfcMechanicalFastenerType",IFCMECHANICALFASTENER:"IfcMechanicalFastener",IFCLINEARDIMENSION:"IfcLinearDimension",IFCLIGHTFIXTURETYPE:"IfcLightFixtureType",IFCLAMPTYPE:"IfcLampType",IFCLABORRESOURCE:"IfcLaborResource",IFCJUNCTIONBOXTYPE:"IfcJunctionBoxType",IFCINVENTORY:"IfcInventory",IFCHUMIDIFIERTYPE:"IfcHumidifierType",IFCHEATEXCHANGERTYPE:"IfcHeatExchangerType",IFCGROUP:"IfcGroup",IFCGRID:"IfcGrid",IFCGASTERMINALTYPE:"IfcGasTerminalType",IFCFURNITURESTANDARD:"IfcFurnitureStandard",IFCFURNISHINGELEMENT:"IfcFurnishingElement",IFCFLOWTREATMENTDEVICETYPE:"IfcFlowTreatmentDeviceType",IFCFLOWTERMINALTYPE:"IfcFlowTerminalType",IFCFLOWSTORAGEDEVICETYPE:"IfcFlowStorageDeviceType",IFCFLOWSEGMENTTYPE:"IfcFlowSegmentType",IFCFLOWMOVINGDEVICETYPE:"IfcFlowMovingDeviceType",IFCFLOWMETERTYPE:"IfcFlowMeterType",IFCFLOWFITTINGTYPE:"IfcFlowFittingType",IFCFLOWCONTROLLERTYPE:"IfcFlowControllerType",IFCFEATUREELEMENTSUBTRACTION:"IfcFeatureElementSubtraction",IFCFEATUREELEMENTADDITION:"IfcFeatureElementAddition",IFCFEATUREELEMENT:"IfcFeatureElement",IFCFASTENERTYPE:"IfcFastenerType",IFCFASTENER:"IfcFastener",IFCFACETEDBREPWITHVOIDS:"IfcFacetedBrepWithVoids",IFCFACETEDBREP:"IfcFacetedBrep",IFCEVAPORATORTYPE:"IfcEvaporatorType",IFCEVAPORATIVECOOLERTYPE:"IfcEvaporativeCoolerType",IFCEQUIPMENTSTANDARD:"IfcEquipmentStandard",IFCEQUIPMENTELEMENT:"IfcEquipmentElement",IFCENERGYCONVERSIONDEVICETYPE:"IfcEnergyConversionDeviceType",IFCELLIPSE:"IfcEllipse",IFCELEMENTCOMPONENTTYPE:"IfcElementComponentType",IFCELEMENTCOMPONENT:"IfcElementComponent",IFCELEMENTASSEMBLY:"IfcElementAssembly",IFCELEMENT:"IfcElement",IFCELECTRICALBASEPROPERTIES:"IfcElectricalBaseProperties",IFCDISTRIBUTIONFLOWELEMENTTYPE:"IfcDistributionFlowElementType",IFCDISTRIBUTIONELEMENTTYPE:"IfcDistributionElementType",IFCDIMENSIONCURVEDIRECTEDCALLOUT:"IfcDimensionCurveDirectedCallout",IFCCURTAINWALLTYPE:"IfcCurtainWallType",IFCCREWRESOURCE:"IfcCrewResource",IFCCOVERINGTYPE:"IfcCoveringType",IFCCOSTSCHEDULE:"IfcCostSchedule",IFCCOSTITEM:"IfcCostItem",IFCCONTROL:"IfcControl",IFCCONSTRUCTIONRESOURCE:"IfcConstructionResource",IFCCONIC:"IfcConic",IFCCOMPOSITECURVE:"IfcCompositeCurve",IFCCOLUMNTYPE:"IfcColumnType",IFCCIRCLEHOLLOWPROFILEDEF:"IfcCircleHollowProfileDef",IFCBUILDINGSTOREY:"IfcBuildingStorey",IFCBUILDINGELEMENTTYPE:"IfcBuildingElementType",IFCBUILDING:"IfcBuilding",IFCBOUNDEDCURVE:"IfcBoundedCurve",IFCBOOLEANCLIPPINGRESULT:"IfcBooleanClippingResult",IFCBLOCK:"IfcBlock",IFCASYMMETRICISHAPEPROFILEDEF:"IfcAsymmetricIShapeProfileDef",IFCANNOTATION:"IfcAnnotation",IFCACTOR:"IfcActor",IFCTRANSPORTELEMENTTYPE:"IfcTransportElementType",IFCTASK:"IfcTask",IFCSYSTEMFURNITUREELEMENTTYPE:"IfcSystemFurnitureElementType",IFCSURFACEOFREVOLUTION:"IfcSurfaceOfRevolution",IFCSURFACEOFLINEAREXTRUSION:"IfcSurfaceOfLinearExtrusion",IFCSURFACECURVESWEPTAREASOLID:"IfcSurfaceCurveSweptAreaSolid",IFCSTRUCTUREDDIMENSIONCALLOUT:"IfcStructuredDimensionCallout",IFCSTRUCTURALSURFACEMEMBERVARYING:"IfcStructuralSurfaceMemberVarying",IFCSTRUCTURALSURFACEMEMBER:"IfcStructuralSurfaceMember",IFCSTRUCTURALREACTION:"IfcStructuralReaction",IFCSTRUCTURALMEMBER:"IfcStructuralMember",IFCSTRUCTURALITEM:"IfcStructuralItem",IFCSTRUCTURALACTIVITY:"IfcStructuralActivity",IFCSPHERE:"IfcSphere",IFCSPATIALSTRUCTUREELEMENTTYPE:"IfcSpatialStructureElementType",IFCSPATIALSTRUCTUREELEMENT:"IfcSpatialStructureElement",IFCRIGHTCIRCULARCYLINDER:"IfcRightCircularCylinder",IFCRIGHTCIRCULARCONE:"IfcRightCircularCone",IFCREVOLVEDAREASOLID:"IfcRevolvedAreaSolid",IFCRESOURCE:"IfcResource",IFCRELVOIDSELEMENT:"IfcRelVoidsElement",IFCRELSPACEBOUNDARY:"IfcRelSpaceBoundary",IFCRELSERVICESBUILDINGS:"IfcRelServicesBuildings",IFCRELSEQUENCE:"IfcRelSequence",IFCRELSCHEDULESCOSTITEMS:"IfcRelSchedulesCostItems",IFCRELREFERENCEDINSPATIALSTRUCTURE:"IfcRelReferencedInSpatialStructure",IFCRELPROJECTSELEMENT:"IfcRelProjectsElement",IFCRELOVERRIDESPROPERTIES:"IfcRelOverridesProperties",IFCRELOCCUPIESSPACES:"IfcRelOccupiesSpaces",IFCRELNESTS:"IfcRelNests",IFCRELINTERACTIONREQUIREMENTS:"IfcRelInteractionRequirements",IFCRELFLOWCONTROLELEMENTS:"IfcRelFlowControlElements",IFCRELFILLSELEMENT:"IfcRelFillsElement",IFCRELDEFINESBYTYPE:"IfcRelDefinesByType",IFCRELDEFINESBYPROPERTIES:"IfcRelDefinesByProperties",IFCRELDEFINES:"IfcRelDefines",IFCRELDECOMPOSES:"IfcRelDecomposes",IFCRELCOVERSSPACES:"IfcRelCoversSpaces",IFCRELCOVERSBLDGELEMENTS:"IfcRelCoversBldgElements",IFCRELCONTAINEDINSPATIALSTRUCTURE:"IfcRelContainedInSpatialStructure",IFCRELCONNECTSWITHREALIZINGELEMENTS:"IfcRelConnectsWithRealizingElements",IFCRELCONNECTSWITHECCENTRICITY:"IfcRelConnectsWithEccentricity",IFCRELCONNECTSSTRUCTURALMEMBER:"IfcRelConnectsStructuralMember",IFCRELCONNECTSSTRUCTURALELEMENT:"IfcRelConnectsStructuralElement",IFCRELCONNECTSSTRUCTURALACTIVITY:"IfcRelConnectsStructuralActivity",IFCRELCONNECTSPORTS:"IfcRelConnectsPorts",IFCRELCONNECTSPORTTOELEMENT:"IfcRelConnectsPortToElement",IFCRELCONNECTSPATHELEMENTS:"IfcRelConnectsPathElements",IFCRELCONNECTSELEMENTS:"IfcRelConnectsElements",IFCRELCONNECTS:"IfcRelConnects",IFCRELASSOCIATESPROFILEPROPERTIES:"IfcRelAssociatesProfileProperties",IFCRELASSOCIATESMATERIAL:"IfcRelAssociatesMaterial",IFCRELASSOCIATESLIBRARY:"IfcRelAssociatesLibrary",IFCRELASSOCIATESDOCUMENT:"IfcRelAssociatesDocument",IFCRELASSOCIATESCONSTRAINT:"IfcRelAssociatesConstraint",IFCRELASSOCIATESCLASSIFICATION:"IfcRelAssociatesClassification",IFCRELASSOCIATESAPPROVAL:"IfcRelAssociatesApproval",IFCRELASSOCIATESAPPLIEDVALUE:"IfcRelAssociatesAppliedValue",IFCRELASSOCIATES:"IfcRelAssociates",IFCRELASSIGNSTORESOURCE:"IfcRelAssignsToResource",IFCRELASSIGNSTOPROJECTORDER:"IfcRelAssignsToProjectOrder",IFCRELASSIGNSTOPRODUCT:"IfcRelAssignsToProduct",IFCRELASSIGNSTOPROCESS:"IfcRelAssignsToProcess",IFCRELASSIGNSTOGROUP:"IfcRelAssignsToGroup",IFCRELASSIGNSTOCONTROL:"IfcRelAssignsToControl",IFCRELASSIGNSTOACTOR:"IfcRelAssignsToActor",IFCRELASSIGNS:"IfcRelAssigns",IFCRECTANGULARTRIMMEDSURFACE:"IfcRectangularTrimmedSurface",IFCRECTANGULARPYRAMID:"IfcRectangularPyramid",IFCRECTANGLEHOLLOWPROFILEDEF:"IfcRectangleHollowProfileDef",IFCPROXY:"IfcProxy",IFCPROPERTYSET:"IfcPropertySet",IFCPROJECTIONCURVE:"IfcProjectionCurve",IFCPROJECT:"IfcProject",IFCPRODUCT:"IfcProduct",IFCPROCESS:"IfcProcess",IFCPLANE:"IfcPlane",IFCPLANARBOX:"IfcPlanarBox",IFCPERMEABLECOVERINGPROPERTIES:"IfcPermeableCoveringProperties",IFCOFFSETCURVE3D:"IfcOffsetCurve3D",IFCOFFSETCURVE2D:"IfcOffsetCurve2D",IFCOBJECT:"IfcObject",IFCMANIFOLDSOLIDBREP:"IfcManifoldSolidBrep",IFCLINE:"IfcLine",IFCLSHAPEPROFILEDEF:"IfcLShapeProfileDef",IFCISHAPEPROFILEDEF:"IfcIShapeProfileDef",IFCGEOMETRICCURVESET:"IfcGeometricCurveSet",IFCFURNITURETYPE:"IfcFurnitureType",IFCFURNISHINGELEMENTTYPE:"IfcFurnishingElementType",IFCFLUIDFLOWPROPERTIES:"IfcFluidFlowProperties",IFCFILLAREASTYLETILES:"IfcFillAreaStyleTiles",IFCFILLAREASTYLETILESYMBOLWITHSTYLE:"IfcFillAreaStyleTileSymbolWithStyle",IFCFILLAREASTYLEHATCHING:"IfcFillAreaStyleHatching",IFCFACEBASEDSURFACEMODEL:"IfcFaceBasedSurfaceModel",IFCEXTRUDEDAREASOLID:"IfcExtrudedAreaSolid",IFCENERGYPROPERTIES:"IfcEnergyProperties",IFCELLIPSEPROFILEDEF:"IfcEllipseProfileDef",IFCELEMENTARYSURFACE:"IfcElementarySurface",IFCELEMENTTYPE:"IfcElementType",IFCELEMENTQUANTITY:"IfcElementQuantity",IFCEDGELOOP:"IfcEdgeLoop",IFCDRAUGHTINGPREDEFINEDCURVEFONT:"IfcDraughtingPredefinedCurveFont",IFCDRAUGHTINGPREDEFINEDCOLOUR:"IfcDraughtingPredefinedColour",IFCDRAUGHTINGCALLOUT:"IfcDraughtingCallout",IFCDOORSTYLE:"IfcDoorStyle",IFCDOORPANELPROPERTIES:"IfcDoorPanelProperties",IFCDOORLININGPROPERTIES:"IfcDoorLiningProperties",IFCDIRECTION:"IfcDirection",IFCDIMENSIONCURVETERMINATOR:"IfcDimensionCurveTerminator",IFCDIMENSIONCURVE:"IfcDimensionCurve",IFCDEFINEDSYMBOL:"IfcDefinedSymbol",IFCCURVEBOUNDEDPLANE:"IfcCurveBoundedPlane",IFCCURVE:"IfcCurve",IFCCSGSOLID:"IfcCsgSolid",IFCCSGPRIMITIVE3D:"IfcCsgPrimitive3D",IFCCRANERAILFSHAPEPROFILEDEF:"IfcCraneRailFShapeProfileDef",IFCCRANERAILASHAPEPROFILEDEF:"IfcCraneRailAShapeProfileDef",IFCCOMPOSITECURVESEGMENT:"IfcCompositeCurveSegment",IFCCLOSEDSHELL:"IfcClosedShell",IFCCIRCLEPROFILEDEF:"IfcCircleProfileDef",IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM:"IfcCartesianTransformationOperator3DNonUniform",IFCCARTESIANTRANSFORMATIONOPERATOR3D:"IfcCartesianTransformationOperator3D",IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM:"IfcCartesianTransformationOperator2DNonUniform",IFCCARTESIANTRANSFORMATIONOPERATOR2D:"IfcCartesianTransformationOperator2D",IFCCARTESIANTRANSFORMATIONOPERATOR:"IfcCartesianTransformationOperator",IFCCARTESIANPOINT:"IfcCartesianPoint",IFCCSHAPEPROFILEDEF:"IfcCShapeProfileDef",IFCBOXEDHALFSPACE:"IfcBoxedHalfSpace",IFCBOUNDINGBOX:"IfcBoundingBox",IFCBOUNDEDSURFACE:"IfcBoundedSurface",IFCBOOLEANRESULT:"IfcBooleanResult",IFCAXIS2PLACEMENT3D:"IfcAxis2Placement3D",IFCAXIS2PLACEMENT2D:"IfcAxis2Placement2D",IFCAXIS1PLACEMENT:"IfcAxis1Placement",IFCANNOTATIONSURFACE:"IfcAnnotationSurface",IFCANNOTATIONFILLAREAOCCURRENCE:"IfcAnnotationFillAreaOccurrence",IFCANNOTATIONFILLAREA:"IfcAnnotationFillArea",IFCANNOTATIONCURVEOCCURRENCE:"IfcAnnotationCurveOccurrence",IFCZSHAPEPROFILEDEF:"IfcZShapeProfileDef",IFCWINDOWSTYLE:"IfcWindowStyle",IFCWINDOWPANELPROPERTIES:"IfcWindowPanelProperties",IFCWINDOWLININGPROPERTIES:"IfcWindowLiningProperties",IFCVERTEXLOOP:"IfcVertexLoop",IFCVECTOR:"IfcVector",IFCUSHAPEPROFILEDEF:"IfcUShapeProfileDef",IFCTYPEPRODUCT:"IfcTypeProduct",IFCTYPEOBJECT:"IfcTypeObject",IFCTWODIRECTIONREPEATFACTOR:"IfcTwoDirectionRepeatFactor",IFCTRAPEZIUMPROFILEDEF:"IfcTrapeziumProfileDef",IFCTEXTLITERALWITHEXTENT:"IfcTextLiteralWithExtent",IFCTEXTLITERAL:"IfcTextLiteral",IFCTERMINATORSYMBOL:"IfcTerminatorSymbol",IFCTSHAPEPROFILEDEF:"IfcTShapeProfileDef",IFCSWEPTSURFACE:"IfcSweptSurface",IFCSWEPTDISKSOLID:"IfcSweptDiskSolid",IFCSWEPTAREASOLID:"IfcSweptAreaSolid",IFCSURFACESTYLERENDERING:"IfcSurfaceStyleRendering",IFCSURFACE:"IfcSurface",IFCSUBEDGE:"IfcSubedge",IFCSTRUCTURALSTEELPROFILEPROPERTIES:"IfcStructuralSteelProfileProperties",IFCSTRUCTURALPROFILEPROPERTIES:"IfcStructuralProfileProperties",IFCSTRUCTURALLOADSINGLEFORCEWARPING:"IfcStructuralLoadSingleForceWarping",IFCSTRUCTURALLOADSINGLEFORCE:"IfcStructuralLoadSingleForce",IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION:"IfcStructuralLoadSingleDisplacementDistortion",IFCSTRUCTURALLOADSINGLEDISPLACEMENT:"IfcStructuralLoadSingleDisplacement",IFCSTRUCTURALLOADPLANARFORCE:"IfcStructuralLoadPlanarForce",IFCSTRUCTURALLOADLINEARFORCE:"IfcStructuralLoadLinearForce",IFCSPACETHERMALLOADPROPERTIES:"IfcSpaceThermalLoadProperties",IFCSOUNDVALUE:"IfcSoundValue",IFCSOUNDPROPERTIES:"IfcSoundProperties",IFCSOLIDMODEL:"IfcSolidModel",IFCSLIPPAGECONNECTIONCONDITION:"IfcSlippageConnectionCondition",IFCSHELLBASEDSURFACEMODEL:"IfcShellBasedSurfaceModel",IFCSERVICELIFEFACTOR:"IfcServiceLifeFactor",IFCSECTIONEDSPINE:"IfcSectionedSpine",IFCROUNDEDRECTANGLEPROFILEDEF:"IfcRoundedRectangleProfileDef",IFCRELATIONSHIP:"IfcRelationship",IFCREINFORCEMENTDEFINITIONPROPERTIES:"IfcReinforcementDefinitionProperties",IFCREGULARTIMESERIES:"IfcRegularTimeSeries",IFCRECTANGLEPROFILEDEF:"IfcRectangleProfileDef",IFCPROPERTYTABLEVALUE:"IfcPropertyTableValue",IFCPROPERTYSINGLEVALUE:"IfcPropertySingleValue",IFCPROPERTYSETDEFINITION:"IfcPropertySetDefinition",IFCPROPERTYREFERENCEVALUE:"IfcPropertyReferenceValue",IFCPROPERTYLISTVALUE:"IfcPropertyListValue",IFCPROPERTYENUMERATEDVALUE:"IfcPropertyEnumeratedValue",IFCPROPERTYDEFINITION:"IfcPropertyDefinition",IFCPROPERTYBOUNDEDVALUE:"IfcPropertyBoundedValue",IFCPRODUCTDEFINITIONSHAPE:"IfcProductDefinitionShape",IFCPREDEFINEDPOINTMARKERSYMBOL:"IfcPredefinedPointMarkerSymbol",IFCPREDEFINEDDIMENSIONSYMBOL:"IfcPredefinedDimensionSymbol",IFCPREDEFINEDCURVEFONT:"IfcPredefinedCurveFont",IFCPREDEFINEDCOLOUR:"IfcPredefinedColour",IFCPOLYGONALBOUNDEDHALFSPACE:"IfcPolygonalBoundedHalfSpace",IFCPOLYLOOP:"IfcPolyLoop",IFCPOINTONSURFACE:"IfcPointOnSurface",IFCPOINTONCURVE:"IfcPointOnCurve",IFCPOINT:"IfcPoint",IFCPLANAREXTENT:"IfcPlanarExtent",IFCPLACEMENT:"IfcPlacement",IFCPIXELTEXTURE:"IfcPixelTexture",IFCPHYSICALCOMPLEXQUANTITY:"IfcPhysicalComplexQuantity",IFCPATH:"IfcPath",IFCPARAMETERIZEDPROFILEDEF:"IfcParameterizedProfileDef",IFCORIENTEDEDGE:"IfcOrientedEdge",IFCOPENSHELL:"IfcOpenShell",IFCONEDIRECTIONREPEATFACTOR:"IfcOneDirectionRepeatFactor",IFCOBJECTDEFINITION:"IfcObjectDefinition",IFCMECHANICALCONCRETEMATERIALPROPERTIES:"IfcMechanicalConcreteMaterialProperties",IFCMATERIALDEFINITIONREPRESENTATION:"IfcMaterialDefinitionRepresentation",IFCMAPPEDITEM:"IfcMappedItem",IFCLOOP:"IfcLoop",IFCLOCALPLACEMENT:"IfcLocalPlacement",IFCLIGHTSOURCESPOT:"IfcLightSourceSpot",IFCLIGHTSOURCEPOSITIONAL:"IfcLightSourcePositional",IFCLIGHTSOURCEGONIOMETRIC:"IfcLightSourceGoniometric",IFCLIGHTSOURCEDIRECTIONAL:"IfcLightSourceDirectional",IFCLIGHTSOURCEAMBIENT:"IfcLightSourceAmbient",IFCLIGHTSOURCE:"IfcLightSource",IFCIRREGULARTIMESERIES:"IfcIrregularTimeSeries",IFCIMAGETEXTURE:"IfcImageTexture",IFCHYGROSCOPICMATERIALPROPERTIES:"IfcHygroscopicMaterialProperties",IFCHALFSPACESOLID:"IfcHalfSpaceSolid",IFCGRIDPLACEMENT:"IfcGridPlacement",IFCGEOMETRICSET:"IfcGeometricSet",IFCGEOMETRICREPRESENTATIONSUBCONTEXT:"IfcGeometricRepresentationSubContext",IFCGEOMETRICREPRESENTATIONITEM:"IfcGeometricRepresentationItem",IFCGEOMETRICREPRESENTATIONCONTEXT:"IfcGeometricRepresentationContext",IFCGENERALPROFILEPROPERTIES:"IfcGeneralProfileProperties",IFCGENERALMATERIALPROPERTIES:"IfcGeneralMaterialProperties",IFCFUELPROPERTIES:"IfcFuelProperties",IFCFILLAREASTYLE:"IfcFillAreaStyle",IFCFAILURECONNECTIONCONDITION:"IfcFailureConnectionCondition",IFCFACESURFACE:"IfcFaceSurface",IFCFACEOUTERBOUND:"IfcFaceOuterBound",IFCFACEBOUND:"IfcFaceBound",IFCFACE:"IfcFace",IFCEXTENDEDMATERIALPROPERTIES:"IfcExtendedMaterialProperties",IFCEDGECURVE:"IfcEdgeCurve",IFCEDGE:"IfcEdge",IFCDRAUGHTINGPREDEFINEDTEXTFONT:"IfcDraughtingPredefinedTextFont",IFCDOCUMENTREFERENCE:"IfcDocumentReference",IFCDIMENSIONPAIR:"IfcDimensionPair",IFCDIMENSIONCALLOUTRELATIONSHIP:"IfcDimensionCalloutRelationship",IFCDERIVEDPROFILEDEF:"IfcDerivedProfileDef",IFCCURVESTYLE:"IfcCurveStyle",IFCCONVERSIONBASEDUNIT:"IfcConversionBasedUnit",IFCCONTEXTDEPENDENTUNIT:"IfcContextDependentUnit",IFCCONNECTIONPOINTECCENTRICITY:"IfcConnectionPointEccentricity",IFCCONNECTIONCURVEGEOMETRY:"IfcConnectionCurveGeometry",IFCCONNECTEDFACESET:"IfcConnectedFaceSet",IFCCOMPOSITEPROFILEDEF:"IfcCompositeProfileDef",IFCCOMPLEXPROPERTY:"IfcComplexProperty",IFCCOLOURRGB:"IfcColourRgb",IFCCLASSIFICATIONREFERENCE:"IfcClassificationReference",IFCCENTERLINEPROFILEDEF:"IfcCenterLineProfileDef",IFCBLOBTEXTURE:"IfcBlobTexture",IFCARBITRARYPROFILEDEFWITHVOIDS:"IfcArbitraryProfileDefWithVoids",IFCARBITRARYOPENPROFILEDEF:"IfcArbitraryOpenProfileDef",IFCARBITRARYCLOSEDPROFILEDEF:"IfcArbitraryClosedProfileDef",IFCANNOTATIONTEXTOCCURRENCE:"IfcAnnotationTextOccurrence",IFCANNOTATIONSYMBOLOCCURRENCE:"IfcAnnotationSymbolOccurrence",IFCANNOTATIONSURFACEOCCURRENCE:"IfcAnnotationSurfaceOccurrence",IFCANNOTATIONOCCURRENCE:"IfcAnnotationOccurrence",IFCWATERPROPERTIES:"IfcWaterProperties",IFCVIRTUALGRIDINTERSECTION:"IfcVirtualGridIntersection",IFCVERTEXPOINT:"IfcVertexPoint",IFCVERTEXBASEDTEXTUREMAP:"IfcVertexBasedTextureMap",IFCVERTEX:"IfcVertex",IFCUNITASSIGNMENT:"IfcUnitAssignment",IFCTOPOLOGYREPRESENTATION:"IfcTopologyRepresentation",IFCTOPOLOGICALREPRESENTATIONITEM:"IfcTopologicalRepresentationItem",IFCTIMESERIESVALUE:"IfcTimeSeriesValue",IFCTIMESERIESREFERENCERELATIONSHIP:"IfcTimeSeriesReferenceRelationship",IFCTIMESERIES:"IfcTimeSeries",IFCTHERMALMATERIALPROPERTIES:"IfcThermalMaterialProperties",IFCTEXTUREVERTEX:"IfcTextureVertex",IFCTEXTUREMAP:"IfcTextureMap",IFCTEXTURECOORDINATEGENERATOR:"IfcTextureCoordinateGenerator",IFCTEXTURECOORDINATE:"IfcTextureCoordinate",IFCTEXTSTYLEWITHBOXCHARACTERISTICS:"IfcTextStyleWithBoxCharacteristics",IFCTEXTSTYLETEXTMODEL:"IfcTextStyleTextModel",IFCTEXTSTYLEFORDEFINEDFONT:"IfcTextStyleForDefinedFont",IFCTEXTSTYLEFONTMODEL:"IfcTextStyleFontModel",IFCTEXTSTYLE:"IfcTextStyle",IFCTELECOMADDRESS:"IfcTelecomAddress",IFCTABLEROW:"IfcTableRow",IFCTABLE:"IfcTable",IFCSYMBOLSTYLE:"IfcSymbolStyle",IFCSURFACETEXTURE:"IfcSurfaceTexture",IFCSURFACESTYLEWITHTEXTURES:"IfcSurfaceStyleWithTextures",IFCSURFACESTYLESHADING:"IfcSurfaceStyleShading",IFCSURFACESTYLEREFRACTION:"IfcSurfaceStyleRefraction",IFCSURFACESTYLELIGHTING:"IfcSurfaceStyleLighting",IFCSURFACESTYLE:"IfcSurfaceStyle",IFCSTYLEDREPRESENTATION:"IfcStyledRepresentation",IFCSTYLEDITEM:"IfcStyledItem",IFCSTYLEMODEL:"IfcStyleModel",IFCSTRUCTURALLOADTEMPERATURE:"IfcStructuralLoadTemperature",IFCSTRUCTURALLOADSTATIC:"IfcStructuralLoadStatic",IFCSTRUCTURALLOAD:"IfcStructuralLoad",IFCSTRUCTURALCONNECTIONCONDITION:"IfcStructuralConnectionCondition",IFCSIMPLEPROPERTY:"IfcSimpleProperty",IFCSHAPEREPRESENTATION:"IfcShapeRepresentation",IFCSHAPEMODEL:"IfcShapeModel",IFCSHAPEASPECT:"IfcShapeAspect",IFCSECTIONREINFORCEMENTPROPERTIES:"IfcSectionReinforcementProperties",IFCSECTIONPROPERTIES:"IfcSectionProperties",IFCSIUNIT:"IfcSIUnit",IFCROOT:"IfcRoot",IFCRIBPLATEPROFILEPROPERTIES:"IfcRibPlateProfileProperties",IFCREPRESENTATIONMAP:"IfcRepresentationMap",IFCREPRESENTATIONITEM:"IfcRepresentationItem",IFCREPRESENTATIONCONTEXT:"IfcRepresentationContext",IFCREPRESENTATION:"IfcRepresentation",IFCRELAXATION:"IfcRelaxation",IFCREINFORCEMENTBARPROPERTIES:"IfcReinforcementBarProperties",IFCREFERENCESVALUEDOCUMENT:"IfcReferencesValueDocument",IFCQUANTITYWEIGHT:"IfcQuantityWeight",IFCQUANTITYVOLUME:"IfcQuantityVolume",IFCQUANTITYTIME:"IfcQuantityTime",IFCQUANTITYLENGTH:"IfcQuantityLength",IFCQUANTITYCOUNT:"IfcQuantityCount",IFCQUANTITYAREA:"IfcQuantityArea",IFCPROPERTYENUMERATION:"IfcPropertyEnumeration",IFCPROPERTYDEPENDENCYRELATIONSHIP:"IfcPropertyDependencyRelationship",IFCPROPERTYCONSTRAINTRELATIONSHIP:"IfcPropertyConstraintRelationship",IFCPROPERTY:"IfcProperty",IFCPROFILEPROPERTIES:"IfcProfileProperties",IFCPROFILEDEF:"IfcProfileDef",IFCPRODUCTSOFCOMBUSTIONPROPERTIES:"IfcProductsOfCombustionProperties",IFCPRODUCTREPRESENTATION:"IfcProductRepresentation",IFCPRESENTATIONSTYLEASSIGNMENT:"IfcPresentationStyleAssignment",IFCPRESENTATIONSTYLE:"IfcPresentationStyle",IFCPRESENTATIONLAYERWITHSTYLE:"IfcPresentationLayerWithStyle",IFCPRESENTATIONLAYERASSIGNMENT:"IfcPresentationLayerAssignment",IFCPREDEFINEDTEXTFONT:"IfcPredefinedTextFont",IFCPREDEFINEDTERMINATORSYMBOL:"IfcPredefinedTerminatorSymbol",IFCPREDEFINEDSYMBOL:"IfcPredefinedSymbol",IFCPREDEFINEDITEM:"IfcPredefinedItem",IFCPOSTALADDRESS:"IfcPostalAddress",IFCPHYSICALSIMPLEQUANTITY:"IfcPhysicalSimpleQuantity",IFCPHYSICALQUANTITY:"IfcPhysicalQuantity",IFCPERSONANDORGANIZATION:"IfcPersonAndOrganization",IFCPERSON:"IfcPerson",IFCOWNERHISTORY:"IfcOwnerHistory",IFCORGANIZATIONRELATIONSHIP:"IfcOrganizationRelationship",IFCORGANIZATION:"IfcOrganization",IFCOPTICALMATERIALPROPERTIES:"IfcOpticalMaterialProperties",IFCOBJECTIVE:"IfcObjective",IFCOBJECTPLACEMENT:"IfcObjectPlacement",IFCNAMEDUNIT:"IfcNamedUnit",IFCMONETARYUNIT:"IfcMonetaryUnit",IFCMETRIC:"IfcMetric",IFCMECHANICALSTEELMATERIALPROPERTIES:"IfcMechanicalSteelMaterialProperties",IFCMECHANICALMATERIALPROPERTIES:"IfcMechanicalMaterialProperties",IFCMEASUREWITHUNIT:"IfcMeasureWithUnit",IFCMATERIALPROPERTIES:"IfcMaterialProperties",IFCMATERIALLIST:"IfcMaterialList",IFCMATERIALLAYERSETUSAGE:"IfcMaterialLayerSetUsage",IFCMATERIALLAYERSET:"IfcMaterialLayerSet",IFCMATERIALLAYER:"IfcMaterialLayer",IFCMATERIALCLASSIFICATIONRELATIONSHIP:"IfcMaterialClassificationRelationship",IFCMATERIAL:"IfcMaterial",IFCLOCALTIME:"IfcLocalTime",IFCLIGHTINTENSITYDISTRIBUTION:"IfcLightIntensityDistribution",IFCLIGHTDISTRIBUTIONDATA:"IfcLightDistributionData",IFCLIBRARYREFERENCE:"IfcLibraryReference",IFCLIBRARYINFORMATION:"IfcLibraryInformation",IFCIRREGULARTIMESERIESVALUE:"IfcIrregularTimeSeriesValue",IFCGRIDAXIS:"IfcGridAxis",IFCEXTERNALLYDEFINEDTEXTFONT:"IfcExternallyDefinedTextFont",IFCEXTERNALLYDEFINEDSYMBOL:"IfcExternallyDefinedSymbol",IFCEXTERNALLYDEFINEDSURFACESTYLE:"IfcExternallyDefinedSurfaceStyle",IFCEXTERNALLYDEFINEDHATCHSTYLE:"IfcExternallyDefinedHatchStyle",IFCEXTERNALREFERENCE:"IfcExternalReference",IFCENVIRONMENTALIMPACTVALUE:"IfcEnvironmentalImpactValue",IFCDRAUGHTINGCALLOUTRELATIONSHIP:"IfcDraughtingCalloutRelationship",IFCDOCUMENTINFORMATIONRELATIONSHIP:"IfcDocumentInformationRelationship",IFCDOCUMENTINFORMATION:"IfcDocumentInformation",IFCDOCUMENTELECTRONICFORMAT:"IfcDocumentElectronicFormat",IFCDIMENSIONALEXPONENTS:"IfcDimensionalExponents",IFCDERIVEDUNITELEMENT:"IfcDerivedUnitElement",IFCDERIVEDUNIT:"IfcDerivedUnit",IFCDATEANDTIME:"IfcDateAndTime",IFCCURVESTYLEFONTPATTERN:"IfcCurveStyleFontPattern",IFCCURVESTYLEFONTANDSCALING:"IfcCurveStyleFontAndScaling",IFCCURVESTYLEFONT:"IfcCurveStyleFont",IFCCURRENCYRELATIONSHIP:"IfcCurrencyRelationship",IFCCOSTVALUE:"IfcCostValue",IFCCOORDINATEDUNIVERSALTIMEOFFSET:"IfcCoordinatedUniversalTimeOffset",IFCCONSTRAINTRELATIONSHIP:"IfcConstraintRelationship",IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP:"IfcConstraintClassificationRelationship",IFCCONSTRAINTAGGREGATIONRELATIONSHIP:"IfcConstraintAggregationRelationship",IFCCONSTRAINT:"IfcConstraint",IFCCONNECTIONSURFACEGEOMETRY:"IfcConnectionSurfaceGeometry",IFCCONNECTIONPORTGEOMETRY:"IfcConnectionPortGeometry",IFCCONNECTIONPOINTGEOMETRY:"IfcConnectionPointGeometry",IFCCONNECTIONGEOMETRY:"IfcConnectionGeometry",IFCCOLOURSPECIFICATION:"IfcColourSpecification",IFCCLASSIFICATIONNOTATIONFACET:"IfcClassificationNotationFacet",IFCCLASSIFICATIONNOTATION:"IfcClassificationNotation",IFCCLASSIFICATIONITEMRELATIONSHIP:"IfcClassificationItemRelationship",IFCCLASSIFICATIONITEM:"IfcClassificationItem",IFCCLASSIFICATION:"IfcClassification",IFCCALENDARDATE:"IfcCalendarDate",IFCBOUNDARYNODECONDITIONWARPING:"IfcBoundaryNodeConditionWarping",IFCBOUNDARYNODECONDITION:"IfcBoundaryNodeCondition",IFCBOUNDARYFACECONDITION:"IfcBoundaryFaceCondition",IFCBOUNDARYEDGECONDITION:"IfcBoundaryEdgeCondition",IFCBOUNDARYCONDITION:"IfcBoundaryCondition",IFCAPPROVALRELATIONSHIP:"IfcApprovalRelationship",IFCAPPROVALPROPERTYRELATIONSHIP:"IfcApprovalPropertyRelationship",IFCAPPROVALACTORRELATIONSHIP:"IfcApprovalActorRelationship",IFCAPPROVAL:"IfcApproval",IFCAPPLIEDVALUERELATIONSHIP:"IfcAppliedValueRelationship",IFCAPPLIEDVALUE:"IfcAppliedValue",IFCAPPLICATION:"IfcApplication",IFCADDRESS:"IfcAddress",IFCACTORROLE:"IfcActorRole"};class Oc{constructor(){C(this,"factor",1);C(this,"complement",1)}apply(i){const e=this.getScaleMatrix().multiply(i);i.copy(e)}setUp(i){var n,r,o;this.factor=1;const t=this.getLengthUnits(i);if(!t)return;const e=t==null,s=t.Name===void 0||t.Name===null;e||s||(t.Name.value==="FOOT"&&(this.factor=.3048),((n=t.Prefix)==null?void 0:n.value)==="MILLI"?this.complement=.001:((r=t.Prefix)==null?void 0:r.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(i){try{const e=i.GetLineIDsWithType(0,k.IFCUNITASSIGNMENT).get(0),s=i.GetLine(0,e);for(const n of s.Units){if(!n||n.value===null||n.value===void 0)continue;const r=i.GetLine(0,n.value);if(r.UnitType&&r.UnitType.value==="LENGTHUNIT")return r}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const i=this.factor;return new b.Matrix4().fromArray([i,0,0,0,0,i,0,0,0,0,i,0,0,0,0,1])}}class co{constructor(){C(this,"itemsByFloor",{});C(this,"_units",new Oc)}setUp(i){this._units.setUp(i),this.cleanUp();try{const t=i.GetLineIDsWithType(0,k.IFCRELCONTAINEDINSPATIALSTRUCTURE),e=new Set,s=i.GetLineIDsWithType(0,k.IFCSPACE);for(let l=0;l<s.size();l++)e.add(s.get(l));const n=i.GetLineIDsWithType(0,k.IFCRELAGGREGATES),r=n.size();for(let l=0;l<r;l++){const h=n.get(l),f=i.GetLine(0,h);if(!f||!f.RelatingObject||!f.RelatedObjects)continue;const I=f.RelatingObject.value,u=f.RelatedObjects;for(const d of u){const E=d.value;e.has(E)&&(this.itemsByFloor[E]=I)}}const o={},a=t.size();for(let l=0;l<a;l++){const h=t.get(l),f=i.GetLine(0,h);if(!f||!f.RelatingStructure||!f.RelatedElements)continue;const I=f.RelatingStructure.value,u=f.RelatedElements;if(e.has(I))for(const d of u){o[I]||(o[I]=[]);const E=d.value;o[I].push(E)}else for(const d of u){const E=d.value;this.itemsByFloor[E]=I}}for(const l in o){const h=this.itemsByFloor[l];if(h!==void 0){const f=o[l];for(const I of f)this.itemsByFloor[I]=h}}for(let l=0;l<r;l++){const h=n.get(l),f=i.GetLine(0,h);if(!f||!f.RelatingObject||!f.RelatedObjects)continue;const I=f.RelatingObject.value,u=f.RelatedObjects;for(const d of u){const E=d.value,T=this.itemsByFloor[I];T!==void 0&&(this.itemsByFloor[E]=T)}}}catch{console.log("Could not get floors.")}}cleanUp(){this.itemsByFloor={}}}class zs{constructor(){C(this,"includeProperties",!0);C(this,"optionalCategories",[k.IFCSPACE]);C(this,"wasm",{path:"",absolute:!1,logLevel:k.LogLevel.LOG_LEVEL_OFF});C(this,"excludedCategories",new Set);C(this,"includedCategories",new Set);C(this,"saveLocations",!1);C(this,"webIfc",{COORDINATE_TO_ORIGIN:!0});C(this,"autoSetWasm",!0);C(this,"customLocateFileHandler",null)}}class lo{constructor(){C(this,"defLineMat",new b.LineBasicMaterial({color:16777215}))}read(i){const t=i.GetAllAlignments(0),e=i.GetAllCrossSections2D(0),s=i.GetAllCrossSections3D(0),n={IfcAlignment:t,IfcCrossSection2D:e,IfcCrossSection3D:s};return this.get(n)}get(i){if(i.IfcAlignment){const t=new Map;for(const e of i.IfcAlignment){const s=new jt.Alignment;s.absolute=this.getCurves(e.curve3D,s),s.horizontal=this.getCurves(e.horizontal,s),s.vertical=this.getCurves(e.vertical,s),t.set(t.size,s)}return{alignments:t,coordinationMatrix:new b.Matrix4}}}getCurves(i,t){const e=[];let s=0;for(const n of i){const r={};if(n.data)for(const I of n.data){const[u,d]=I.split(": "),E=parseFloat(d);r[u]=E||d}const{points:o}=n,a=new Float32Array(o.length*3);for(let I=0;I<o.length;I++){const{x:u,y:d,z:E}=o[I];a[I*3]=u,a[I*3+1]=d,a[I*3+2]=E||0}const l=new b.BufferAttribute(a,3),h=new b.EdgesGeometry;h.setAttribute("position",l);const f=new jt.CurveMesh(s,r,t,h,this.defLineMat);e.push(f.curve),s++}return e}}class ho{getNameInfo(i){var f;const t={},{arguments:e}=i.GetHeaderLine(0,k.FILE_NAME)||{};if(!e)return t;const[s,n,r,o,a,l,h]=e;if(s!=null&&s.value&&(t.name=s.value),n!=null&&n.value&&(t.creationDate=new Date(n.value)),r){t.author={};const[I,u]=r;I!=null&&I.value&&(t.author.name=I.value),u!=null&&u.value&&(t.author.email=u.value)}return o&&((f=o[0])!=null&&f.value)&&(t.organization=o[0].value),a!=null&&a.value&&(t.preprocessorVersion=a==null?void 0:a.value),l!=null&&l.value&&(t.originatingSystem=l==null?void 0:l.value),h!=null&&h.value&&(t.authorization=h==null?void 0:h.value),t}getDescriptionInfo(i){var r;const t={},{arguments:e}=i.GetHeaderLine(0,k.FILE_DESCRIPTION)||{};if(!e)return t;const[s,n]=e;if(Array.isArray(s)&&((r=s[0])!=null&&r.value)){const o=s[0].value.match(/\[([^\]]+)\]/);o&&o[1]&&(t.viewDefinition=o[1])}return n!=null&&n.value&&(t.implementationLevel=n.value),t}}class uo{static get(i,t){const e=[k.IFCPROJECT,k.IFCSITE,k.IFCBUILDING,k.IFCBUILDINGSTOREY,k.IFCSPACE,k.IFCROAD,k.IFCFACILITY,k.IFCFACILITYPART,k.IFCBRIDGE],s=i.data;for(const n of e){const r=t.GetLineIDsWithType(0,n),o=r.size();for(let a=0;a<o;a++){const l=r.get(a);s.has(l)||s.set(l,[[],[0,n]])}}}}const Vn=new Set([1123145078,574549367,1675464909,2059837836,3798115385,32440307,3125803723,3207858831,2740243338,2624227202,4240577450,3615266464,3724593414,220341763,477187591,1878645084,1300840506,3303107099,1607154358,1878645084,846575682,1351298697,2417041796,3049322572,3331915920,1416205885,776857604,3285139300,3958052878,2827736869,2732653382,673634403,3448662350,4142052618,2924175390,803316827,2556980723,1809719519,2205249479,807026263,3737207727,1660063152,2347385850,2705031697,3732776249,2485617015,2611217952,1704287377,2937912522,2770003689,1281925730,1484403080,3448662350,4142052618,3800577675,4006246654,3590301190,1383045692,2775532180,2047409740,370225590,3593883385,2665983363,4124623270,812098782,3649129432,987898635,1105321065,3510044353,1635779807,2603310189,3406155212,1310608509,4261334040,2736907675,3649129432,1136057603,1260505505,4182860854,2713105998,2898889636,59481748,3749851601,3486308946,3150382593,1062206242,3264961684,15328376,1485152156,370225590,1981873012,2859738748,45288368,2614616156,2732653382,775493141,2147822146,2601014836,2629017746,1186437898,2367409068,1213902940,3632507154,3900360178,476780140,1472233963,2804161546,3008276851,738692330,374418227,315944413,3905492369,3570813810,2571569899,178912537,2294589976,1437953363,2133299955,572779678,3092502836,388784114,2624227202,1425443689,3057273783,2347385850,1682466193,2519244187,2839578677,3958567839,2513912981,2830218821,427810014]),Os=class Os extends mt{constructor(t){super(t);C(this,"enabled",!0);t.add(Os.uuid,this)}async export(t,e,s=!1,n=!0){const r={},o=new Set(t.GetIfcEntityList(e)),a=new Set([k.IFCPROJECT,k.IFCSITE,k.IFCBUILDING,k.IFCBUILDINGSTOREY,k.IFCSPACE]);for(const l of a)o.add(l);for(const l of o){if(Vn.has(l))continue;const h=a.has(l)&&n,f=t.GetLineIDsWithType(e,l);for(const I of f)try{const u=t.GetLine(0,I,h,s);r[u.expressID]=u}catch{console.log(`Could not get property ${I}, with recursive ${h} and indirect ${s}.`)}}return r}};C(Os,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let ds=Os;const Oi=class Oi extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onIfcStartedLoading",new q);C(this,"onSetup",new q);C(this,"settings",new zs);C(this,"webIfc",new k.IfcAPI);C(this,"enabled",!0);C(this,"_material",new b.MeshLambertMaterial);C(this,"_spatialTree",new co);C(this,"_metaData",new ho);C(this,"_fragmentInstances",new Map);C(this,"_civil",new lo);C(this,"_visitedFragments",new Map);C(this,"_materialT",new b.MeshLambertMaterial({transparent:!0,opacity:.5}));this.components.add(Oi.uuid,this),this.settings.excludedCategories.add(k.IFCOPENINGELEMENT)}dispose(){this.webIfc=null,this.onDisposed.trigger(Oi.uuid),this.onDisposed.reset()}async setup(t){this.settings={...this.settings,...t},this.settings.autoSetWasm&&await this.autoSetWasm(),this.onSetup.trigger()}async load(t,e=!0,s=""){const n=performance.now();this.onIfcStartedLoading.trigger(),await this.readIfcFile(t);const r=await this.getAllGeometries();r.name=s;const a=await this.components.get(ds).export(this.webIfc,0);r.setLocalProperties(a);const l=this.components.get(pt);l.groups.set(r.uuid,r);for(const h of r.items)l.list.set(h.id,h),h.mesh.uuid=h.id,h.group=r;l.onFragmentsLoaded.trigger(r),e&&l.coordinate([r]);for(const[h]of r.data){const f=a[h];if(!f||!f.GlobalId)continue;const I=f.GlobalId.value||f.GlobalId;r.globalToExpressIDs.set(I,h)}return uo.get(r,this.webIfc),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-n} ms!`),r}async readIfcFile(t){const{path:e,absolute:s,logLevel:n}=this.settings.wasm;return this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(this.settings.customLocateFileHandler||void 0),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(t,this.settings.webIfc)}cleanUp(){try{this.webIfc.Dispose()}catch{console.log("Web-ifc wasn't disposed.")}this.webIfc=null,this.webIfc=new k.IfcAPI,this._visitedFragments.clear(),this._fragmentInstances.clear()}async getAllGeometries(){this._spatialTree.setUp(this.webIfc);const t=this.webIfc.GetIfcEntityList(0),e=new jt.FragmentsGroup;e.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};const s=[];for(const r of t){if(!this.webIfc.IsIfcElement(r)&&r!==k.IFCSPACE)continue;const o=this.settings.includedCategories;if(o.size>0&&!o.has(r))continue;if(this.settings.excludedCategories.has(r))continue;const a=this.webIfc.GetLineIDsWithType(0,r),l=a.size();for(let h=0;h<l;h++){const f=a.get(h);s.push(f);const I=this._spatialTree.itemsByFloor[f]||0;e.data.set(f,[[],[I,r]])}}this._spatialTree.cleanUp(),this.webIfc.StreamMeshes(0,s,r=>{this.getMesh(r,e)});for(const r of this._visitedFragments){const{index:o,fragment:a}=r[1];e.keyFragments.set(o,a.id)}for(const r of e.items){const o=this._fragmentInstances.get(r.id);if(!o)throw new Error("Fragment not found!");const a=[];for(const[l,h]of o)a.push(h);r.add(a)}const n=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(n),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),n=t.expressID;for(let r=0;r<s;r++){const o=t.geometries.get(r),{x:a,y:l,z:h,w:f}=o.color,I=f!==1,{geometryExpressID:u}=o,d=`${u}-${I}`;if(!this._visitedFragments.has(d)){const S=this.getGeometry(this.webIfc,u),N=I?this._materialT:this._material,L=new jt.Fragment(S,N,1);e.add(L.mesh),e.items.push(L);const D=this._visitedFragments.size;this._visitedFragments.set(d,{index:D,fragment:L})}const E=new b.Color().setRGB(a,l,h,"srgb"),T=new b.Matrix4;T.fromArray(o.flatTransformation);const p=this._visitedFragments.get(d);if(p===void 0)throw new Error("Error getting geometry data for streaming!");const m=e.data.get(n);if(!m)throw new Error("Data not found!");m[0].push(p.index);const{fragment:F}=p;this._fragmentInstances.has(F.id)||this._fragmentInstances.set(F.id,new Map);const R=this._fragmentInstances.get(F.id);if(!R)throw new Error("Instances not found!");if(R.has(n)){const S=R.get(n);if(!S)throw new Error("Instance not found!");S.transforms.push(T),S.colors&&S.colors.push(E)}else R.set(n,{id:n,transforms:[T],colors:[E]})}}getGeometry(t,e){const s=t.GetGeometry(0,e),n=t.GetIndexArray(s.GetIndexData(),s.GetIndexDataSize()),r=t.GetVertexArray(s.GetVertexData(),s.GetVertexDataSize()),o=new Float32Array(r.length/2),a=new Float32Array(r.length/2);for(let I=0;I<r.length;I+=6)o[I/2]=r[I],o[I/2+1]=r[I+1],o[I/2+2]=r[I+2],a[I/2]=r[I+3],a[I/2+1]=r[I+4],a[I/2+2]=r[I+5];const l=new b.BufferGeometry,h=new b.BufferAttribute(o,3),f=new b.BufferAttribute(a,3);return l.setAttribute("position",h),l.setAttribute("normal",f),l.setIndex(Array.from(n)),s.delete(),l}async autoSetWasm(){const t=await fetch(`https://unpkg.com/@thatopen/components@${Li.release}/package.json`);if(!t.ok){console.warn("Couldn't get openbim-components package.json. Set wasm settings manually.");return}const e=await t.json();if(!("web-ifc"in e.peerDependencies))console.warn("Couldn't get web-ifc from peer dependencies in openbim-components. Set wasm settings manually.");else{const s=e.peerDependencies["web-ifc"];this.settings.wasm.path=`https://unpkg.com/web-ifc@${s}/`,this.settings.wasm.absolute=!0}}};C(Oi,"uuid","a659add7-1418-4771-a0d6-7d4d438e4624");let Es=Oi;const fo={IfcRelAssignsToControl:{related:5,relating:7},IfcRelAssignsToGroup:{related:5,relating:7},IfcRelAssignsToProduct:{related:5,relating:7},IfcRelAssociatesClassification:{related:5,relating:6},IfcRelAssociatesMaterial:{related:5,relating:6},IfcRelAssociatesDocument:{related:5,relating:6},IfcRelContainedInSpatialStructure:{related:5,relating:6},IfcRelFlowControlElements:{related:5,relating:6},IfcRelConnectsElements:{related:7,relating:6},IfcRelDeclares:{related:6,relating:5},IfcRelAggregates:{related:6,relating:5},IfcRelNests:{related:6,relating:5},IfcRelDefinesByProperties:{related:5,relating:6},IfcRelDefinesByType:{related:5,relating:6},IfcRelDefinesByTemplate:{related:5,relating:6}},Io={[k.IFCRELASSIGNSTOCONTROL]:"IfcRelAssignsToControl",[k.IFCRELASSIGNSTOGROUP]:"IfcRelAssignsToGroup",[k.IFCRELASSIGNSTOPRODUCT]:"IfcRelAssignsToProduct",[k.IFCRELASSOCIATESCLASSIFICATION]:"IfcRelAssociatesClassification",[k.IFCRELASSOCIATESMATERIAL]:"IfcRelAssociatesMaterial",[k.IFCRELASSOCIATESDOCUMENT]:"IfcRelAssociatesDocument",[k.IFCRELCONTAINEDINSPATIALSTRUCTURE]:"IfcRelContainedInSpatialStructure",[k.IFCRELCONNECTSELEMENTS]:"IfcRelConnectsElements",[k.IFCRELFLOWCONTROLELEMENTS]:"IfcRelFlowControlElements",[k.IFCRELDECLARES]:"IfcRelDeclares",[k.IFCRELAGGREGATES]:"IfcRelAggregates",[k.IFCRELNESTS]:"IfcRelNests",[k.IFCRELDEFINESBYPROPERTIES]:"IfcRelDefinesByProperties",[k.IFCRELDEFINESBYTYPE]:"IfcRelDefinesByType",[k.IFCRELDEFINESBYTEMPLATE]:"IfcRelDefinesByTemplate"},Ae=class Ae extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onRequestFile",new q);C(this,"ifcToExport",null);C(this,"onElementToPset",new q);C(this,"onPropToPset",new q);C(this,"onPsetRemoved",new q);C(this,"onDataChanged",new q);C(this,"wasm",{path:"/",absolute:!1});C(this,"enabled",!0);C(this,"attributeListeners",{});C(this,"selectedModel");C(this,"changeMap",{});this.components.add(Ae.uuid,this)}dispose(){this.selectedModel=void 0,this.attributeListeners={},this.changeMap={},this.onElementToPset.reset(),this.onPropToPset.reset(),this.onPsetRemoved.reset(),this.onDataChanged.reset(),this.onDisposed.trigger(Ae.uuid),this.onDisposed.reset()}static getIFCSchema(t){const e=t.ifcMetadata.schema;if(!e)throw new Error("IFC Schema not found");return e.startsWith("IFC2X3")?"IFC2X3":e.startsWith("IFC4")&&e.replace("IFC4","")===""?"IFC4":e.startsWith("IFC4X3")?"IFC4X3":e}async setData(t,...e){for(const s of e){const{expressID:n}=s;(!n||n===-1)&&(s.expressID=this.getNewExpressID(t)),await t.setProperties(s.expressID,s),this.registerChange(t,s.expressID)}}async newPset(t,e,s){const n=Ae.getIFCSchema(t),{ownerHistoryHandle:r}=await this.getOwnerHistory(t),o=this.newGUID(t),a=new k[n].IfcLabel(e),l=s?new k[n].IfcText(s):null,h=new k[n].IfcPropertySet(o,r,a,l,[]);h.expressID=this.getNewExpressID(t);const f=this.newGUID(t),I=new k[n].IfcRelDefinesByProperties(f,r,null,null,[],new k.Handle(h.expressID));return I.expressID=this.getNewExpressID(t),await this.setData(t,h,I),{pset:h,rel:I}}async removePset(t,...e){for(const s of e){const n=await t.getProperties(s);if((n==null?void 0:n.type)!==k.IFCPROPERTYSET)continue;const r=await be.getPsetRel(t,s);if(r&&(await t.setProperties(r,null),this.registerChange(t,r)),n){for(const o of n.HasProperties)await t.setProperties(o.value,null);await t.setProperties(s,null),this.onPsetRemoved.trigger({model:t,psetID:s}),this.registerChange(t,s)}}}newSingleStringProperty(t,e,s,n){return this.newSingleProperty(t,e,s,n)}newSingleNumericProperty(t,e,s,n){return this.newSingleProperty(t,e,s,n)}newSingleBooleanProperty(t,e,s,n){return this.newSingleProperty(t,e,s,n)}async removePsetProp(t,e,s){const n=await t.getProperties(e),r=await t.getProperties(s);!n||!r||n.type===k.IFCPROPERTYSET&&r&&(n.HasProperties=n.HasProperties.filter(o=>o.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}addElementToPset(t,e,...s){this.components.get(Bt).addEntitiesRelation(t,e,{type:k.IFCRELDEFINESBYPROPERTIES,inv:"IsDefinedBy"},...s)}async addPropToPset(t,e,...s){const n=await t.getProperties(e);if(n){for(const r of s){if(n.HasProperties.includes(r))continue;const o=new k.Handle(r);n.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:r})}this.registerChange(t,e)}}async createIfcRel(t,e,s,n){const r=Io[e];if(!r)throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const o=t.ifcMetadata.schema,a=fo[r],l=k[o][r];if(!(a&&l))throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const h=[new k[o].IfcGloballyUniqueId(Kt.create())],{related:f,relating:I}=a,d=[...new Set(n)].map(p=>new k.Handle(p)),E=(p,m)=>{for(let F=p;F<m-1;F++)h.push(null)};f<I?(E(1,f),h.push(d),E(f,I),h.push(new k.Handle(s))):(E(1,I),E(I,f),h.push(new k.Handle(s)),h.push(d));const T=new l(...h);return await this.setData(t,T),T}async saveToIfc(t,e){const s=this.components.get(Es),n=s.webIfc,r=await s.readIfcFile(e);await this.components.get(Bt).applyRelationChanges();const a=this.changeMap[t.uuid]??[];for(const h of a){const f=await t.getProperties(h);f?n.WriteLine(r,f):n.DeleteLine(r,h)}const l=n.SaveModel(r);return s.webIfc.CloseModel(r),s.cleanUp(),l}async getEntityRef(t,e){const s=await t.getAllPropertiesOfType(e);if(!s)return null;const n=[];for(const r in s){const o=new k.Handle(Number(r));n.push(o)}return n}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const n=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(n)return n;const r=await t.getProperties(e);if(!r)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=r[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const a=o.value;if(a===void 0||a==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const l=new q;return Object.defineProperty(r[s],"value",{get(){return this._value},async set(h){this._value=h,l.trigger(h)}}),r[s].value=a,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=l,l}getNewExpressID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=Ae.getIFCSchema(t);return new k[e].IfcGloballyUniqueId(Kt.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(k.IFCOWNERHISTORY);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),n=e[s[0]],r=new k.Handle(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,n){const r=Ae.getIFCSchema(t),o=new k[r].IfcIdentifier(s),a=new k[r][e](n),l=new k[r].IfcPropertySingleValue(o,null,a,null);return l.expressID=this.getNewExpressID(t),await this.setData(t,l),l}};C(Ae,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let ps=Ae;const Ni=class Ni extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onRelationsIndexed",new q);C(this,"relationMaps",{});C(this,"enabled",!0);C(this,"_relToAttributesMap",Sn);C(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom","ReferencedBy","Declares","HasContext","Controls","IsNestedBy","Nests","DocumentRefForObjects"]);C(this,"_ifcRels",[k.IFCRELAGGREGATES,k.IFCRELASSOCIATESMATERIAL,k.IFCRELASSOCIATESCLASSIFICATION,k.IFCRELASSIGNSTOGROUP,k.IFCRELDEFINESBYPROPERTIES,k.IFCRELDEFINESBYTYPE,k.IFCRELDEFINESBYTEMPLATE,k.IFCRELCONTAINEDINSPATIALSTRUCTURE,k.IFCRELFLOWCONTROLELEMENTS,k.IFCRELCONNECTSELEMENTS,k.IFCRELASSIGNSTOPRODUCT,k.IFCRELDECLARES,k.IFCRELASSIGNSTOCONTROL,k.IFCRELNESTS,k.IFCRELASSOCIATESDOCUMENT]);C(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});C(this,"_changeMap",{});C(this,"onEntitiesRelated",new q);this.components.add(Ni.uuid,this),t.get(pt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,n){const r=Object.keys(e).find(f=>f.startsWith("Relating")),o=Object.keys(e).find(f=>f.startsWith("Related"));if(!(r&&o))return;const a=e[r].value,l=e[o].map(f=>f.value),h=this.getAttributeIndex(n);if(h!==null){let f=t.get(a);f||(f=new Map,t.set(a,f));let I=f.get(h);I||(I=[],f.set(h,I));for(const u of l)I.push(u)}for(const f of l){const I=this.getAttributeIndex(s);if(I===null)continue;let u=t.get(f);u||(u=new Map,t.set(f,u));let d=u.get(I);d||(d=[],u.set(I,d)),d.push(a)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const n=await t.getAllPropertiesOfType(s);if(!n)continue;const r=this._relToAttributesMap.get(s);if(!r)continue;const{forRelated:o,forRelating:a}=r;for(const l in n){const h=n[l];this.indexRelations(e,h,o,a)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const n of this._ifcRels){const r=this._relToAttributesMap.get(n);if(!r)continue;const{forRelated:o,forRelating:a}=r,l=t.GetLineIDsWithType(e,n);for(let h=0;h<l.size();h++){const f=await t.properties.getItemProperties(e,l.get(h));this.indexRelations(s,f,o,a)}}return this.onRelationsIndexed.trigger({modelID:e.toString(),relationsMap:s}),s}getEntityRelations(t,e,s){const n=t instanceof Dn.FragmentsGroup?t.uuid:t,r=this.relationMaps[n];if(!r)throw new Error(`IfcRelationsIndexer: model ${n} has no relations indexed.`);const o=r.get(e),a=this.getAttributeIndex(s);if(o===void 0||a===null)return null;const l=o.get(a);return l||null}serializeRelations(t){const e={};for(const[s,n]of t.entries()){e[s]||(e[s]={});for(const[r,o]of n.entries())e[s][r]=o}return JSON.stringify(e)}serializeModelRelations(t){const e=this.relationMaps[t.uuid];return e?this.serializeRelations(e):null}serializeAllRelations(){const t={};for(const e in this.relationMaps){const s=this.relationMaps[e],n={};for(const[r,o]of s.entries()){n[r]||(n[r]={});for(const[a,l]of o.entries())n[r][a]=l}t[e]=n}return JSON.stringify(t)}getRelationsMapFromJSON(t){const e=JSON.parse(t),s=new Map;for(const n in e){const r=e[n],o=new Map;for(const a in r)o.set(Number(a),r[a]);s.set(Number(n),o)}return s}dispose(){this.relationMaps={},this.components.get(pt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(Ni.uuid),this.onDisposed.reset()}getEntitiesWithRelation(t,e,s){const n=this.relationMaps[t.uuid];if(!n)throw new Error("IfcRelationsIndexer: the model relations are not indexed!");const r=new Set;for(const[o,a]of n){const l=this.getAttributeIndex(e);if(l===null)throw new Error("IfcRelationsIndexer: invalid inverse attribute name");const h=a.get(l);h&&h.includes(s)&&r.add(o)}return r}addEntityRelations(t,e,s,...n){const r=this.getEntityRelations(t,e,s);if(r)r.push(...n);else{const o=this.getAttributeIndex(s);if(!o)throw new Error(`IfcRelationsIndexer: ${s} is not a valid relation name.`);const a=this.relationMaps[t.uuid].get(e);a==null||a.set(o,n)}}async applyRelationChanges(){const t=this.components.get(pt),e=this.components.get(ps);for(const s in this._changeMap){const n=t.groups.get(s);if(!n)continue;const r=this._changeMap[s];for(const[o,a]of r)for(const[l,h]of a){const{related:f,relID:I}=h;if(I){const u=await n.getProperties(I);if(!u)continue;const d=Object.keys(u),E=d.find(p=>p.startsWith("Related")),T=d.find(p=>p.startsWith("Relating"));if(!(E&&T))continue;u[E]=[...f].map(p=>new k.Handle(p)),u[T]=new k.Handle(l),await e.setData(n,u)}else{const u=await e.createIfcRel(n,o,l,[...f]);if(!u)continue;h.relID=u.expressID}}}}addEntitiesRelation(t,e,s,...n){const{type:r,inv:o}=s,a=this.relationMaps[t.uuid];if(!a||!this._ifcRels.includes(r))return;const l=Sn.get(r);if(!l)return;const{forRelated:h,forRelating:f}=l;if(!(h===o||f===o))return;let I=this._changeMap[t.uuid];I||(I=new Qt,this._changeMap[t.uuid]=I);const u=f===o?[e]:n,d=h===o?[e]:n;let E=I.get(r);E||(E=new Qt,E.onItemSet.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:u,relatedIDs:d})),E.onItemUpdated.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:u,relatedIDs:d})),I.set(r,E));for(const T of u){let p=E.get(T);p||(p={related:new Ie},E.set(T,p)),p.related.add(...d)}for(const T of u){let p=a.get(T);p||(p=new Map,a.set(T,p));const m=this.getAttributeIndex(f);if(m!==null){let F=p.get(m);F||(F=[],p.set(m,F)),F.push(...d)}}for(const T of d){let p=a.get(T);p||(p=new Map,a.set(T,p));const m=this.getAttributeIndex(h);if(m===null)continue;let F=p.get(m);F||(F=[],p.set(m,F)),F.push(...u)}}getEntityChildren(t,e,s=new Set){if(s.add(e),this.relationMaps[t.uuid]===void 0)throw new Error("The provided model has no indices. You have to generate them first.");const r=this.getEntityRelations(t,e,"IsDecomposedBy");if(r)for(const a of r)this.getEntityChildren(t,a,s);const o=this.getEntityRelations(t,e,"ContainsElements");if(o)for(const a of o)this.getEntityChildren(t,a,s);return s}};C(Ni,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let Bt=Ni;const Ns=class Ns extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onFragmentsLoaded",new q);C(this,"onFragmentsDisposed",new q);C(this,"list",new Qt);C(this,"groups",new Qt);C(this,"baseCoordinationModel","");C(this,"baseCoordinationMatrix",new b.Matrix4);C(this,"enabled",!0);C(this,"_loader",new Dn.Serializer);this.components.add(Ns.uuid,this)}get meshes(){const t=[];for(const[e,s]of this.list)t.push(s.mesh);return t}dispose(){for(const[t,e]of this.groups)e.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(t){const{uuid:e}=t,s=[];for(const n of t.items)s.push(n.id),this.list.delete(n.id);t.dispose(!0),this.groups.delete(t.uuid),this.groups.size===0&&(this.baseCoordinationModel="",this.baseCoordinationMatrix=new b.Matrix4),this.onFragmentsDisposed.trigger({groupID:e,fragmentIDs:s})}load(t,e){const n={...{coordinate:!0},...e},{coordinate:r,name:o,properties:a,relationsMap:l}=n,h=this._loader.import(t);e&&(h.isStreamed=e.isStreamed||!1),o&&(h.name=o);for(const f of h.items)f.group=h,this.list.set(f.id,f);return r&&this.coordinate([h]),this.groups.set(h.uuid,h),a&&h.setLocalProperties(a),l&&this.components.get(Bt).setRelationMap(h,l),this.onFragmentsLoaded.trigger(h),h}export(t){return this._loader.export(t)}getModelIdMap(t){const e={};for(const s in t){const n=this.list.get(s);if(!(n&&n.group))continue;const r=n.group;r.uuid in e||(e[r.uuid]=new Set);const o=t[s];for(const a of o)e[r.uuid].add(a)}return e}modelIdToFragmentIdMap(t){let e={};for(const s in t){const n=this.groups.get(s);if(!n)continue;const r=t[s],o=n.getFragmentMap(r);e={...e,...o}}return e}guidToFragmentIdMap(t){const e={};for(const[n,r]of this.groups){n in e||(e[n]=new Set);for(const o of t){const a=r.globalToExpressIDs.get(o);a&&e[n].add(a)}}return this.modelIdToFragmentIdMap(e)}fragmentIdMapToGuids(t){const e=[],s=this.getModelIdMap(t);for(const n in s){const r=this.groups.get(n);if(!r)continue;const o=s[n];for(const a of o)for(const[l,h]of r.globalToExpressIDs.entries())if(h===a){e.push(l);break}}return e}coordinate(t=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const s=t.pop();if(!s)return;this.baseCoordinationModel=s.uuid,this.baseCoordinationMatrix=s.coordinationMatrix.clone()}if(t.length)for(const s of t)s.coordinationMatrix.equals(this.baseCoordinationMatrix)||(s.position.set(0,0,0),s.rotation.set(0,0,0),s.scale.set(1,1,1),s.updateMatrix(),this.applyBaseCoordinateSystem(s,s.coordinationMatrix))}applyBaseCoordinateSystem(t,e){e&&t.applyMatrix4(e.clone().invert()),t.applyMatrix4(this.baseCoordinationMatrix)}clone(t,e){const s=t.cloneGroup(e);this.groups.set(s.uuid,s);for(const n of s.items)this.list.set(n.id,n);return s}};C(Ns,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let pt=Ns;var os=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nc(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}function as(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Eo={exports:{}};/*!
|
|
128
|
+
`,extensions:{derivatives:!0}});this.three=new b.Mesh(o,a),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(i){i?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(i){this._fade=i?3:0,this.material.uniforms.uFade.value=this._fade}setup(i){const t={...this._defaultConfig,...i};this.config.visible=!0,this.config.color=t.color,this.config.primarySize=t.primarySize,this.config.secondarySize=t.secondarySize,this.config.distance=t.distance,this.isSetup=!0,this.onSetup.trigger()}dispose(){this.setupEvents(!1),this.components.get(Ne).list.delete(this.config.uuid),this.components.get(Ce).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(i){if(this.world.isDisposing||!(this.world.camera instanceof Je))return;const t=this.world.camera.controls;i?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}const Ss=class Ss extends mt{constructor(t){super(t);C(this,"list",new Map);C(this,"onDisposed",new q);C(this,"enabled",!0);t.add(Ss.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const e=new to(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};C(Ss,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let Fn=Ss;const Me=new y.Raycaster,Dt=new y.Vector3,me=new y.Vector3,St=new y.Quaternion,gr={X:new y.Vector3(1,0,0),Y:new y.Vector3(0,1,0),Z:new y.Vector3(0,0,1)},un={type:"change"},Ar={type:"mouseDown"},Fr={type:"mouseUp",mode:null},Sr={type:"objectChange"};class pc extends y.Object3D{constructor(i,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const e=new Ac;this._gizmo=e,this.add(e);const s=new Fc;this._plane=s,this.add(s);const n=this;function r(m,F){let R=F;Object.defineProperty(n,m,{get:function(){return R!==void 0?R:F},set:function(S){R!==S&&(R=S,s[m]=S,e[m]=S,n.dispatchEvent({type:m+"-changed",value:S}),n.dispatchEvent(un))}}),n[m]=F,s[m]=F,e[m]=F}r("camera",i),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const o=new y.Vector3,a=new y.Vector3,l=new y.Quaternion,h=new y.Quaternion,f=new y.Vector3,I=new y.Quaternion,u=new y.Vector3,d=new y.Vector3,E=new y.Vector3,T=0,p=new y.Vector3;r("worldPosition",o),r("worldPositionStart",a),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",f),r("cameraQuaternion",I),r("pointStart",u),r("pointEnd",d),r("rotationAxis",E),r("rotationAngle",T),r("eye",p),this._offset=new y.Vector3,this._startNorm=new y.Vector3,this._endNorm=new y.Vector3,this._cameraScale=new y.Vector3,this._parentPosition=new y.Vector3,this._parentQuaternion=new y.Quaternion,this._parentQuaternionInv=new y.Quaternion,this._parentScale=new y.Vector3,this._worldScaleStart=new y.Vector3,this._worldQuaternionInv=new y.Quaternion,this._worldScale=new y.Vector3,this._positionStart=new y.Vector3,this._quaternionStart=new y.Quaternion,this._scaleStart=new y.Vector3,this._getPointer=Cc.bind(this),this._onPointerDown=mc.bind(this),this._onPointerHover=Tc.bind(this),this._onPointerMove=Rc.bind(this),this._onPointerUp=gc.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(i){if(this.object===void 0||this.dragging===!0)return;Me.setFromCamera(i,this.camera);const t=fn(this._gizmo.picker[this.mode],Me);t?this.axis=t.object.name:this.axis=null}pointerDown(i){if(!(this.object===void 0||this.dragging===!0||i.button!==0)&&this.axis!==null){Me.setFromCamera(i,this.camera);const t=fn(this._plane,Me,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Ar.mode=this.mode,this.dispatchEvent(Ar)}}pointerMove(i){const t=this.axis,e=this.mode,s=this.object;let n=this.space;if(e==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),s===void 0||t===null||this.dragging===!1||i.button!==-1)return;Me.setFromCamera(i,this.camera);const r=fn(this._plane,Me,!0);if(r){if(this.pointEnd.copy(r.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(s.position.applyQuaternion(St.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),n==="world"&&(s.parent&&s.position.add(Dt.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(Dt.setFromMatrixPosition(s.parent.matrixWorld))));else if(e==="scale"){if(t.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),me.set(o,o,o)}else Dt.copy(this.pointStart),me.copy(this.pointEnd),Dt.applyQuaternion(this._worldQuaternionInv),me.applyQuaternion(this._worldQuaternionInv),me.divide(Dt),t.search("X")===-1&&(me.x=1),t.search("Y")===-1&&(me.y=1),t.search("Z")===-1&&(me.z=1);s.scale.copy(this._scaleStart).multiply(me),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(Dt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Dt.copy(this.rotationAxis).cross(this.eye))*o):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(gr[t]),Dt.copy(gr[t]),n==="local"&&Dt.applyQuaternion(this.worldQuaternion),Dt.cross(this.eye),Dt.length()===0?a=!0:this.rotationAngle=this._offset.dot(Dt.normalize())*o),(t==="E"||a)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),n==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(St.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(St.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(un),this.dispatchEvent(Sr)}}pointerUp(i){i.button===0&&(this.dragging&&this.axis!==null&&(Fr.mode=this.mode,this.dispatchEvent(Fr)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(i){i.geometry&&i.geometry.dispose(),i.material&&i.material.dispose()})}attach(i){return this.object=i,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(un),this.dispatchEvent(Sr),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Me}getMode(){return this.mode}setMode(i){this.mode=i}setTranslationSnap(i){this.translationSnap=i}setRotationSnap(i){this.rotationSnap=i}setScaleSnap(i){this.scaleSnap=i}setSize(i){this.size=i}setSpace(i){this.space=i}}function Cc(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const i=this.domElement.getBoundingClientRect();return{x:(c.clientX-i.left)/i.width*2-1,y:-(c.clientY-i.top)/i.height*2+1,button:c.button}}}function Tc(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function mc(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function Rc(c){this.enabled&&this.pointerMove(this._getPointer(c))}function gc(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function fn(c,i,t){const e=i.intersectObject(c,!0);for(let s=0;s<e.length;s++)if(e[s].object.visible||t)return e[s];return!1}const ss=new y.Euler,Tt=new y.Vector3(0,1,0),Or=new y.Vector3(0,0,0),Nr=new y.Matrix4,ns=new y.Quaternion,hs=new y.Quaternion,ae=new y.Vector3,yr=new y.Matrix4,Ri=new y.Vector3(1,0,0),we=new y.Vector3(0,1,0),gi=new y.Vector3(0,0,1),rs=new y.Vector3,pi=new y.Vector3,Ci=new y.Vector3;class Ac extends y.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const i=new y.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new y.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=i.clone();e.opacity=.15;const s=t.clone();s.opacity=.5;const n=i.clone();n.color.setHex(16711680);const r=i.clone();r.color.setHex(65280);const o=i.clone();o.color.setHex(255);const a=i.clone();a.color.setHex(16711680),a.opacity=.5;const l=i.clone();l.color.setHex(65280),l.opacity=.5;const h=i.clone();h.color.setHex(255),h.opacity=.5;const f=i.clone();f.opacity=.25;const I=i.clone();I.color.setHex(16776960),I.opacity=.25,i.clone().color.setHex(16776960);const d=i.clone();d.color.setHex(7895160);const E=new y.CylinderGeometry(0,.04,.1,12);E.translate(0,.05,0);const T=new y.BoxGeometry(.08,.08,.08);T.translate(0,.04,0);const p=new y.BufferGeometry;p.setAttribute("position",new y.Float32BufferAttribute([0,0,0,1,0,0],3));const m=new y.CylinderGeometry(.0075,.0075,.5,3);m.translate(0,.25,0);function F(U,Q){const z=new y.TorusGeometry(U,.0075,3,64,Q*Math.PI*2);return z.rotateY(Math.PI/2),z.rotateX(Math.PI/2),z}function R(){const U=new y.BufferGeometry;return U.setAttribute("position",new y.Float32BufferAttribute([0,0,0,1,1,1],3)),U}const S={X:[[new y.Mesh(E,n),[.5,0,0],[0,0,-Math.PI/2]],[new y.Mesh(E,n),[-.5,0,0],[0,0,Math.PI/2]],[new y.Mesh(m,n),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new y.Mesh(E,r),[0,.5,0]],[new y.Mesh(E,r),[0,-.5,0],[Math.PI,0,0]],[new y.Mesh(m,r)]],Z:[[new y.Mesh(E,o),[0,0,.5],[Math.PI/2,0,0]],[new y.Mesh(E,o),[0,0,-.5],[-Math.PI/2,0,0]],[new y.Mesh(m,o),null,[Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.OctahedronGeometry(.1,0),f.clone()),[0,0,0]]],XY:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),a.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},N={X:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.OctahedronGeometry(.2,0),e)]],XY:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]]},L={START:[[new y.Mesh(new y.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],END:[[new y.Mesh(new y.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],DELTA:[[new y.Line(R(),s),null,null,null,"helper"]],X:[[new y.Line(p,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new y.Line(p,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new y.Line(p,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D={XYZE:[[new y.Mesh(F(.5,1),d),null,[0,Math.PI/2,0]]],X:[[new y.Mesh(F(.5,.5),n)]],Y:[[new y.Mesh(F(.5,.5),r),null,[0,0,-Math.PI/2]]],Z:[[new y.Mesh(F(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new y.Mesh(F(.75,1),I),null,[0,Math.PI/2,0]]]},P={AXIS:[[new y.Line(p,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},v={XYZE:[[new y.Mesh(new y.SphereGeometry(.25,10,8),e)]],X:[[new y.Mesh(new y.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new y.Mesh(new y.TorusGeometry(.5,.1,4,24),e),[0,0,0],[Math.PI/2,0,0]]],Z:[[new y.Mesh(new y.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,0,-Math.PI/2]]],E:[[new y.Mesh(new y.TorusGeometry(.75,.1,2,24),e)]]},G={X:[[new y.Mesh(T,n),[.5,0,0],[0,0,-Math.PI/2]],[new y.Mesh(m,n),[0,0,0],[0,0,-Math.PI/2]],[new y.Mesh(T,n),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new y.Mesh(T,r),[0,.5,0]],[new y.Mesh(m,r)],[new y.Mesh(T,r),[0,-.5,0],[0,0,Math.PI]]],Z:[[new y.Mesh(T,o),[0,0,.5],[Math.PI/2,0,0]],[new y.Mesh(m,o),[0,0,0],[Math.PI/2,0,0]],[new y.Mesh(T,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),a),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.BoxGeometry(.1,.1,.1),f.clone())]]},O={X:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new y.Mesh(new y.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y.Mesh(new y.BoxGeometry(.2,.2,.2),e),[0,0,0]]]},w={X:[[new y.Line(p,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new y.Line(p,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new y.Line(p,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function g(U){const Q=new y.Object3D;for(const z in U)for(let et=U[z].length;et--;){const X=U[z][et][0].clone(),nt=U[z][et][1],Y=U[z][et][2],B=U[z][et][3],rt=U[z][et][4];X.name=z,X.tag=rt,nt&&X.position.set(nt[0],nt[1],nt[2]),Y&&X.rotation.set(Y[0],Y[1],Y[2]),B&&X.scale.set(B[0],B[1],B[2]),X.updateMatrix();const it=X.geometry.clone();it.applyMatrix4(X.matrix),X.geometry=it,X.renderOrder=1/0,X.position.set(0,0,0),X.rotation.set(0,0,0),X.scale.set(1,1,1),Q.add(X)}return Q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=g(S)),this.add(this.gizmo.rotate=g(D)),this.add(this.gizmo.scale=g(G)),this.add(this.picker.translate=g(N)),this.add(this.picker.rotate=g(v)),this.add(this.picker.scale=g(O)),this.add(this.helper.translate=g(L)),this.add(this.helper.rotate=g(P)),this.add(this.helper.scale=g(w)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(i){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:hs;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let n=0;n<s.length;n++){const r=s[n];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let o;if(this.camera.isOrthographicCamera?o=(this.camera.top-this.camera.bottom)/this.camera.zoom:o=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(o*this.size/4),r.tag==="helper"){r.visible=!1,r.name==="AXIS"?(r.visible=!!this.axis,this.axis==="X"&&(St.setFromEuler(ss.set(0,0,0)),r.quaternion.copy(e).multiply(St),Math.abs(Tt.copy(Ri).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Y"&&(St.setFromEuler(ss.set(0,0,Math.PI/2)),r.quaternion.copy(e).multiply(St),Math.abs(Tt.copy(we).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Z"&&(St.setFromEuler(ss.set(0,Math.PI/2,0)),r.quaternion.copy(e).multiply(St),Math.abs(Tt.copy(gi).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="XYZE"&&(St.setFromEuler(ss.set(0,Math.PI/2,0)),Tt.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Nr.lookAt(Or,Tt,we)),r.quaternion.multiply(St),r.visible=this.dragging),this.axis==="E"&&(r.visible=!1)):r.name==="START"?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name==="END"?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name==="DELTA"?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Dt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Dt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Dt),r.visible=this.dragging):(r.quaternion.copy(e),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(r.name==="X"&&Math.abs(Tt.copy(Ri).applyQuaternion(e).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Y"&&Math.abs(Tt.copy(we).applyQuaternion(e).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Z"&&Math.abs(Tt.copy(gi).applyQuaternion(e).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XY"&&Math.abs(Tt.copy(gi).applyQuaternion(e).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="YZ"&&Math.abs(Tt.copy(Ri).applyQuaternion(e).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XZ"&&Math.abs(Tt.copy(we).applyQuaternion(e).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)):this.mode==="rotate"&&(ns.copy(e),Tt.copy(this.eye).applyQuaternion(St.copy(e).invert()),r.name.search("E")!==-1&&r.quaternion.setFromRotationMatrix(Nr.lookAt(this.eye,Or,we)),r.name==="X"&&(St.setFromAxisAngle(Ri,Math.atan2(-Tt.y,Tt.z)),St.multiplyQuaternions(ns,St),r.quaternion.copy(St)),r.name==="Y"&&(St.setFromAxisAngle(we,Math.atan2(Tt.x,Tt.z)),St.multiplyQuaternions(ns,St),r.quaternion.copy(St)),r.name==="Z"&&(St.setFromAxisAngle(gi,Math.atan2(Tt.y,Tt.x)),St.multiplyQuaternions(ns,St),r.quaternion.copy(St))),r.visible=r.visible&&(r.name.indexOf("X")===-1||this.showX),r.visible=r.visible&&(r.name.indexOf("Y")===-1||this.showY),r.visible=r.visible&&(r.name.indexOf("Z")===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some(function(a){return r.name===a}))&&(r.material.color.setHex(16776960),r.material.opacity=1)}super.updateMatrixWorld(i)}}class Fc extends y.Mesh{constructor(){super(new y.PlaneGeometry(1e5,1e5,2,2),new y.MeshBasicMaterial({visible:!1,wireframe:!0,side:y.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(i){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),rs.copy(Ri).applyQuaternion(t==="local"?this.worldQuaternion:hs),pi.copy(we).applyQuaternion(t==="local"?this.worldQuaternion:hs),Ci.copy(gi).applyQuaternion(t==="local"?this.worldQuaternion:hs),Tt.copy(pi),this.mode){case"translate":case"scale":switch(this.axis){case"X":Tt.copy(this.eye).cross(rs),ae.copy(rs).cross(Tt);break;case"Y":Tt.copy(this.eye).cross(pi),ae.copy(pi).cross(Tt);break;case"Z":Tt.copy(this.eye).cross(Ci),ae.copy(Ci).cross(Tt);break;case"XY":ae.copy(Ci);break;case"YZ":ae.copy(rs);break;case"XZ":Tt.copy(Ci),ae.copy(pi);break;case"XYZ":case"E":ae.set(0,0,0);break}break;case"rotate":default:ae.set(0,0,0)}ae.length()===0?this.quaternion.copy(this.cameraQuaternion):(yr.lookAt(Dt.set(0,0,0),ae,Tt),this.quaternion.setFromRotationMatrix(yr)),super.updateMatrixWorld(i)}}class Gs{constructor(i,t,e,s,n,r=5,o=!0){C(this,"onDraggingStarted",new q);C(this,"onDraggingEnded",new q);C(this,"onDisposed",new q);C(this,"normal");C(this,"origin");C(this,"three",new b.Plane);C(this,"components");C(this,"world");C(this,"type","default");C(this,"_helper");C(this,"_visible",!0);C(this,"_enabled",!0);C(this,"_controlsActive",!1);C(this,"_arrowBoundBox",new b.Mesh);C(this,"_planeMesh");C(this,"_controls");C(this,"_hiddenMaterial",new b.MeshBasicMaterial({visible:!1}));C(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)});C(this,"changeDrag",i=>{this._visible=!i.value,this.preventCameraMovement(),this.notifyDraggingChanged(i)});if(this.components=i,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=s,this.origin=e,t.renderer.setPlane(!0,this.three),this._planeMesh=Gs.newPlaneMesh(r,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(s,e),o&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(i){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=i,this.world.renderer.setPlane(i,this.three)}get visible(){return this._visible}set visible(i){this._visible=i,this._controls.visible=i,this._helper.visible=i,this.toggleControls(i)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(i){this._planeMesh.material=i}get size(){return this._planeMesh.scale.x}set size(i){this._planeMesh.scale.set(i,i,i)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(i,t){this.reset(),this.normal.equals(i)||(this.normal.copy(i),this._helper.lookAt(i)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const i=new b.Vector3(1,0,0),t=new b.Vector3;this.normal.equals(i)||(this.normal.copy(i),this._helper.lookAt(i)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(i){if(i){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=i}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const i=this.world.camera.three,t=this.world.renderer.three.domElement,e=new pc(i,t);return this.initializeControls(e),this.world.scene.three.add(e),e}initializeControls(i){i.attach(this._helper),i.showX=!1,i.showY=!1,i.setSpace("local"),this.createArrowBoundingBox(),i.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new b.CylinderGeometry(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(i){i.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const i=new b.Object3D;return i.lookAt(this.normal),i.position.copy(this.origin),this._planeMesh.position.z+=.01,i.add(this._planeMesh),this.world.scene.three.add(i),i}static newPlaneMesh(i,t){const e=new b.PlaneGeometry(1),s=new b.Mesh(e,t);return s.scale.set(i,i,i),s}}class Sc extends ye{constructor(){super(...arguments);C(this,"_config",{enabled:{value:!0,type:"Boolean"},visible:{value:!0,type:"Boolean"},color:{value:new b.Color,type:"Color"},opacity:{type:"Number",interpolable:!0,value:1,min:0,max:1},size:{type:"Number",interpolable:!0,value:2,min:0,max:100}})}get enabled(){return this._config.enabled.value}set enabled(t){this._config.enabled.value=t,this._component.enabled=t}get visible(){return this._config.visible.value}set visible(t){this._config.visible.value=t,this._component.visible=t}get color(){return this._config.color.value}set color(t){this._config.color.value=t,this._component.material.color.copy(t)}get opacity(){return this._config.opacity.value}set opacity(t){this._config.opacity.value=t,this._component.material.opacity=t}get size(){return this._config.size.value}set size(t){this._config.size.value=t,this._component.size=t}}const Qe=class Qe extends mt{constructor(t){super(t);C(this,"onSetup",new q);C(this,"onBeforeDrag",new q);C(this,"onAfterDrag",new q);C(this,"onBeforeCreate",new q);C(this,"onBeforeCancel",new q);C(this,"onAfterCancel",new q);C(this,"onBeforeDelete",new q);C(this,"onAfterCreate",new q);C(this,"onAfterDelete",new q);C(this,"onDisposed",new q);C(this,"isSetup",!1);C(this,"orthogonalY",!1);C(this,"toleranceOrthogonalY",.7);C(this,"Type",Gs);C(this,"list",[]);C(this,"config",new Sc(this,this.components,"Clipper",Qe.uuid));C(this,"_defaultConfig",{color:new b.Color(12255487),opacity:.2,size:2});C(this,"_material",new b.MeshBasicMaterial({color:12255487,side:b.DoubleSide,transparent:!0,opacity:.2}));C(this,"_size",5);C(this,"_enabled",!1);C(this,"_visible",!0);C(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()});C(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()});this.components.add(Qe.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const e of this.list)e.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const e of this.list)e.visible=t}get material(){return this._material}set material(t){this._material=t;for(const e of this.list)e.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const e of this.list)e.size=t}dispose(){this._enabled=!1,this.components.get(Ne).list.delete(this.config.uuid);for(const e of this.list)e.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(Qe.uuid),this.onDisposed.reset()}create(t){const n=this.components.get(ve).get(t).castRay();return n?this.createPlaneFromIntersection(t,n):null}createFromNormalAndCoplanarPoint(t,e,s){const n=this.newPlane(t,s,e);return this.updateMaterialsAndPlanes(),n}delete(t,e){e||(e=this.pickPlane(t)),e&&this.deletePlane(e)}deleteAll(t){const e=[...this.list];for(const s of e)if(!t||t.has(s.type)){this.delete(s.world,s);const n=this.list.indexOf(s);n!==-1&&this.list.splice(n,1)}}setup(t){const e={...this._defaultConfig,...t};this.config.color=e.color,this.config.opacity=e.opacity,this.config.size=e.size,this.isSetup=!0,this.onSetup.trigger()}deletePlane(t){const e=this.list.indexOf(t);if(e!==-1){if(this.list.splice(e,1),!t.world.renderer)throw new Error("Renderer not found for this plane's world!");t.world.renderer.setPlane(!1,t.three),t.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(t)}}pickPlane(t){const s=this.components.get(ve).get(t),n=this.getAllPlaneMeshes(),r=s.castRay(n);if(r){const o=r.object;return this.list.find(a=>a.meshes.includes(o))}}getAllPlaneMeshes(){const t=[];for(const e of this.list)t.push(...e.meshes);return t}createPlaneFromIntersection(t,e){var a;if(!t.renderer)throw new Error("The given world must have a renderer!");const s=e.point.distanceTo(new b.Vector3(0,0,0)),n=(a=e.face)==null?void 0:a.normal;if(!s||!n)return null;const r=this.getWorldNormal(e,n),o=this.newPlane(t,e.point,r.negate());return o.visible=this._visible,o.size=this._size,t.renderer.setPlane(!0,o.three),this.updateMaterialsAndPlanes(),o}getWorldNormal(t,e){const s=t.object;let n=t.object.matrixWorld.clone();if(s instanceof b.InstancedMesh&&t.instanceId!==void 0){const l=new b.Matrix4;s.getMatrixAt(t.instanceId,l),n=l.multiply(n)}const o=new b.Matrix3().getNormalMatrix(n),a=e.clone().applyMatrix3(o).normalize();return this.normalizePlaneDirectionY(a),a}normalizePlaneDirectionY(t){this.orthogonalY&&(t.y>this.toleranceOrthogonalY&&(t.x=0,t.y=1,t.z=0),t.y<-this.toleranceOrthogonalY&&(t.x=0,t.y=-1,t.z=0))}newPlane(t,e,s){const n=new this.Type(this.components,t,e,s,this._material);return n.onDraggingStarted.add(this._onStartDragging),n.onDraggingEnded.add(this._onEndDragging),this.list.push(n),this.onAfterCreate.trigger(n),n}updateMaterialsAndPlanes(){const t=this.components.get(Pi);for(const[e,s]of t.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:n}=s.renderer;for(const r of s.meshes)if(r.material)if(Array.isArray(r.material))for(const o of r.material)o.clippingPlanes=n;else r.material.clippingPlanes=n}}};C(Qe,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let Is=Qe;class eo{constructor(i){C(this,"enabled",!1);C(this,"id","FirstPerson");this.camera=i}set(i){if(this.enabled=i,i){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const i=this.camera.controls,t=new b.Vector3;i.distance--,i.getPosition(t),i.minDistance=1,i.maxDistance=1,i.distance=1,i.moveTo(t.x,t.y,t.z),i.truckSpeed=50,i.mouseButtons.wheel=bt.ACTION.DOLLY,i.touches.two=bt.ACTION.TOUCH_ZOOM_TRUCK}}class io{constructor(i){C(this,"enabled",!0);C(this,"id","Orbit");this.camera=i,this.activateOrbitControls()}set(i){this.enabled=i,i&&this.activateOrbitControls()}activateOrbitControls(){const i=this.camera.controls;i.minDistance=1,i.maxDistance=300;const t=new b.Vector3;i.getPosition(t);const e=t.length();i.distance=e,i.truckSpeed=2;const{rotation:s}=this.camera.three,n=new b.Vector3(0,0,-1).applyEuler(s),r=t.addScaledVector(n,e);i.moveTo(r.x,r.y,r.z)}}class so{constructor(i){C(this,"enabled",!1);C(this,"id","Plan");C(this,"mouseAction1");C(this,"mouseAction2");C(this,"mouseInitialized",!1);C(this,"defaultAzimuthSpeed");C(this,"defaultPolarSpeed");this.camera=i,this.defaultAzimuthSpeed=i.controls.azimuthRotateSpeed,this.defaultPolarSpeed=i.controls.polarRotateSpeed}set(i){this.enabled=i;const t=this.camera.controls;t.azimuthRotateSpeed=i?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=i?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),i?(t.mouseButtons.left=bt.ACTION.TRUCK,t.touches.one=bt.ACTION.TOUCH_TRUCK,t.touches.two=bt.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=bt.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class no{constructor(i){C(this,"onChanged",new q);C(this,"current","Perspective");C(this,"camera");C(this,"matchOrthoDistanceEnabled",!1);C(this,"_component");C(this,"_previousDistance",-1);this._component=i,this.camera=i.three}async set(i){this.current!==i&&(i==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const t=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(t)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const i=this.getPerspectiveDims();if(!i)return;const{width:t,height:e}=i;this.setupOrthoCamera(e,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const i=this._component.currentWorld;if(!i||!i.renderer)return null;const t=new b.Vector3;this._component.threePersp.getWorldDirection(t);const e=new b.Vector3;this._component.controls.getTarget(e);const n=e.clone().sub(this._component.threePersp.position).dot(t),r=i.renderer.getSize(),o=r.x/r.y,a=this._component.threePersp,l=n*2*Math.atan(a.fov*(Math.PI/180)/2);return{width:l*o,height:l}}setupOrthoCamera(i,t){this._component.controls.mouseButtons.wheel=bt.ACTION.ZOOM,this._component.controls.mouseButtons.middle=bt.ACTION.ZOOM;const e=this._component.threePersp,s=this._component.threeOrtho;s.zoom=1,s.left=t/-2,s.right=t/2,s.top=i/2,s.bottom=i/-2,s.updateProjectionMatrix(),s.position.copy(e.position),s.quaternion.copy(e.quaternion),this._component.controls.camera=s}getDistance(){const i=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(i.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=bt.ACTION.DOLLY,this._component.controls.mouseButtons.middle=bt.ACTION.DOLLY;const i=this._component.threePersp,t=this._component.threeOrtho;i.position.copy(t.position),i.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=bt.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),i.updateProjectionMatrix(),this._component.controls.camera=i,this.camera=i,this.current="Perspective"}}class ro extends Je{constructor(t){super(t);C(this,"projection");C(this,"threeOrtho");C(this,"threePersp");C(this,"_userInputButtons",{});C(this,"_frustumSize",50);C(this,"_navigationModes",new Map);C(this,"_mode",null);C(this,"previousSize",null);this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new no(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(e=>{this.three=e,this.updateAspect()}),this.onWorldChanged.add(({action:e})=>{e==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new io(this)),this._navigationModes.set("FirstPerson",new eo(this)),this._navigationModes.set("Plan",new so(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone()))})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(t){if(this.mode!==null&&this.mode.id!==t){if(this.mode.set(!1),!this._navigationModes.has(t))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(t),this.mode.set(!0)}}async fit(t,e=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,n=Number.MIN_VALUE,r=new b.Vector3(s,s,s),o=new b.Vector3(n,n,n);for(const u of t){const d=new b.Box3().setFromObject(u);d.min.x<r.x&&(r.x=d.min.x),d.min.y<r.y&&(r.y=d.min.y),d.min.z<r.z&&(r.z=d.min.z),d.max.x>o.x&&(o.x=d.max.x),d.max.y>o.y&&(o.y=d.max.y),d.max.z>o.z&&(o.z=d.max.z)}const a=new b.Box3(r,o),l=new b.Vector3;a.getSize(l);const h=new b.Vector3;a.getCenter(h);const f=Math.max(l.x,l.y,l.z)*e,I=new b.Sphere(h,f);await this.controls.fitToSphere(I,!0)}setUserInput(t){t?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const t=window.innerWidth/window.innerHeight;return new b.OrthographicCamera(this._frustumSize*t/-2,this._frustumSize*t/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const t=this.currentWorld.renderer.getSize(),e=this.threeOrtho.top,s=this.threeOrtho.right,n=t.y/this.previousSize.y,r=t.x/this.previousSize.x,o=e*n,a=s*r;this.threeOrtho.left=-a,this.threeOrtho.right=a,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Sn=new Map([[k.IFCRELAGGREGATES,{forRelated:"Decomposes",forRelating:"IsDecomposedBy"}],[k.IFCRELASSOCIATESMATERIAL,{forRelated:"HasAssociations",forRelating:"AssociatedTo"}],[k.IFCRELASSOCIATESCLASSIFICATION,{forRelated:"HasAssociations",forRelating:"ClassificationForObjects"}],[k.IFCRELASSIGNSTOGROUP,{forRelated:"HasAssignments",forRelating:"IsGroupedBy"}],[k.IFCRELDEFINESBYPROPERTIES,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[k.IFCRELDEFINESBYTYPE,{forRelated:"IsTypedBy",forRelating:"Types"}],[k.IFCRELDEFINESBYTEMPLATE,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[k.IFCRELCONTAINEDINSPATIALSTRUCTURE,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[k.IFCRELFLOWCONTROLELEMENTS,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[k.IFCRELCONNECTSELEMENTS,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}],[k.IFCRELASSIGNSTOPRODUCT,{forRelated:"HasAssignments",forRelating:"ReferencedBy"}],[k.IFCRELDECLARES,{forRelated:"HasContext",forRelating:"Declares"}],[k.IFCRELASSIGNSTOCONTROL,{forRelated:"HasAssignments",forRelating:"Controls"}],[k.IFCRELNESTS,{forRelated:"Nests",forRelating:"IsNestedBy"}],[k.IFCRELASSOCIATESDOCUMENT,{forRelated:"HasAssociations",forRelating:"DocumentRefForObjects"}]]),oo={103090709:"IFCPROJECT",4097777520:"IFCSITE",4031249490:"IFCBUILDING",3124254112:"IFCBUILDINGSTOREY",3856911033:"IFCSPACE",1674181508:"IFCANNOTATION",25142252:"IFCCONTROLLER",32344328:"IFCBOILER",76236018:"IFCLAMP",90941305:"IFCPUMP",177149247:"IFCAIRTERMINALBOX",182646315:"IFCFLOWINSTRUMENT",263784265:"IFCFURNISHINGELEMENT",264262732:"IFCELECTRICGENERATOR",277319702:"IFCAUDIOVISUALAPPLIANCE",310824031:"IFCPIPEFITTING",331165859:"IFCSTAIR",342316401:"IFCDUCTFITTING",377706215:"IFCMECHANICALFASTENER",395920057:"IFCDOOR",402227799:"IFCELECTRICMOTOR",413509423:"IFCSYSTEMFURNITUREELEMENT",484807127:"IFCEVAPORATOR",486154966:"IFCWINDOWSTANDARDCASE",629592764:"IFCLIGHTFIXTURE",630975310:"IFCUNITARYCONTROLELEMENT",635142910:"IFCCABLECARRIERFITTING",639361253:"IFCCOIL",647756555:"IFCFASTENER",707683696:"IFCFLOWSTORAGEDEVICE",738039164:"IFCPROTECTIVEDEVICE",753842376:"IFCBEAM",812556717:"IFCTANK",819412036:"IFCFILTER",843113511:"IFCCOLUMN",862014818:"IFCELECTRICDISTRIBUTIONBOARD",900683007:"IFCFOOTING",905975707:"IFCCOLUMNSTANDARDCASE",926996030:"IFCVOIDINGFEATURE",979691226:"IFCREINFORCINGBAR",987401354:"IFCFLOWSEGMENT",1003880860:"IFCELECTRICTIMECONTROL",1051757585:"IFCCABLEFITTING",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1073191201:"IFCMEMBER",1095909175:"IFCBUILDINGELEMENTPROXY",1156407060:"IFCPLATESTANDARDCASE",1162798199:"IFCSWITCHINGDEVICE",1329646415:"IFCSHADINGDEVICE",1335981549:"IFCDISCRETEACCESSORY",1360408905:"IFCDUCTSILENCER",1404847402:"IFCSTACKTERMINAL",1426591983:"IFCFIRESUPPRESSIONTERMINAL",1437502449:"IFCMEDICALDEVICE",1509553395:"IFCFURNITURE",1529196076:"IFCSLAB",1620046519:"IFCTRANSPORTELEMENT",1634111441:"IFCAIRTERMINAL",1658829314:"IFCENERGYCONVERSIONDEVICE",1677625105:"IFCCIVILELEMENT",1687234759:"IFCPILE",1904799276:"IFCELECTRICAPPLIANCE",1911478936:"IFCMEMBERSTANDARDCASE",1945004755:"IFCDISTRIBUTIONELEMENT",1973544240:"IFCCOVERING",1999602285:"IFCSPACEHEATER",2016517767:"IFCROOF",2056796094:"IFCAIRTOAIRHEATRECOVERY",2058353004:"IFCFLOWCONTROLLER",2068733104:"IFCHUMIDIFIER",2176052936:"IFCJUNCTIONBOX",2188021234:"IFCFLOWMETER",2223149337:"IFCFLOWTERMINAL",2262370178:"IFCRAILING",2272882330:"IFCCONDENSER",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",2320036040:"IFCREINFORCINGMESH",2347447852:"IFCTENDONANCHOR",2391383451:"IFCVIBRATIONISOLATOR",2391406946:"IFCWALL",2474470126:"IFCMOTORCONNECTION",2769231204:"IFCVIRTUALELEMENT",2814081492:"IFCENGINE",2906023776:"IFCBEAMSTANDARDCASE",2938176219:"IFCBURNER",2979338954:"IFCBUILDINGELEMENTPART",3024970846:"IFCRAMP",3026737570:"IFCTUBEBUNDLE",3027962421:"IFCSLABSTANDARDCASE",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",3053780830:"IFCSANITARYTERMINAL",3079942009:"IFCOPENINGSTANDARDCASE",3087945054:"IFCALARM",3101698114:"IFCSURFACEFEATURE",3127900445:"IFCSLABELEMENTEDCASE",3132237377:"IFCFLOWMOVINGDEVICE",3171933400:"IFCPLATE",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",3242481149:"IFCDOORSTANDARDCASE",3283111854:"IFCRAMPFLIGHT",3296154744:"IFCCHIMNEY",3304561284:"IFCWINDOW",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",3319311131:"IFCHEATEXCHANGER",3415622556:"IFCFAN",3420628829:"IFCSOLARDEVICE",3493046030:"IFCGEOGRAPHICELEMENT",3495092785:"IFCCURTAINWALL",3508470533:"IFCFLOWTREATMENTDEVICE",3512223829:"IFCWALLSTANDARDCASE",3518393246:"IFCDUCTSEGMENT",3571504051:"IFCCOMPRESSOR",3588315303:"IFCOPENINGELEMENT",3612865200:"IFCPIPESEGMENT",3640358203:"IFCCOOLINGTOWER",3651124850:"IFCPROJECTIONELEMENT",3694346114:"IFCOUTLET",3747195512:"IFCEVAPORATIVECOOLER",3758799889:"IFCCABLECARRIERSEGMENT",3824725483:"IFCTENDON",3825984169:"IFCTRANSFORMER",3902619387:"IFCCHILLER",4074379575:"IFCDAMPER",4086658281:"IFCSENSOR",4123344466:"IFCELEMENTASSEMBLY",4136498852:"IFCCOOLEDBEAM",4156078855:"IFCWALLELEMENTEDCASE",4175244083:"IFCINTERCEPTOR",4207607924:"IFCVALVE",4217484030:"IFCCABLESEGMENT",4237592921:"IFCWASTETERMINAL",4252922144:"IFCSTAIRFLIGHT",4278956645:"IFCFLOWFITTING",4288193352:"IFCACTUATOR",4292641817:"IFCUNITARYEQUIPMENT",3009204131:"IFCGRID"};class Oc{getAll(i,t){const e={},s=Object.keys(oo).map(n=>parseInt(n,10));for(let n=0;n<s.length;n++){const r=s[n],o=i.GetLineIDsWithType(t,r),a=o.size();for(let l=0;l<a;l++)e[o.get(l)]=r}return e}}const _i={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class be{static async getUnits(i){var r,o,a;const{IFCUNITASSIGNMENT:t}=k,e=await i.getAllPropertiesOfType(t);if(!e)return 1;const s=Object.keys(e),n=e[parseInt(s[0],10)];for(const l of n.Units){if(l.value===void 0||l.value===null)continue;const h=await i.getProperties(l.value);if(!h||!h.UnitType||!h.UnitType.value||h.UnitType.value!=="LENGTHUNIT")continue;let I=1,u=1;return h.Name.value==="METRE"&&(u=1),h.Name.value==="FOOT"&&(u=.3048),((r=h.Prefix)==null?void 0:r.value)==="MILLI"?I=.001:((o=h.Prefix)==null?void 0:o.value)==="CENTI"?I=.01:((a=h.Prefix)==null?void 0:a.value)==="DECI"&&(I=.1),u*I}return 1}static async findItemByGuid(i,t){var s;const e=i.getAllPropertiesIDs();for(const n of e){const r=await i.getProperties(n);if(r&&((s=r.GlobalId)==null?void 0:s.value)===t)return r}return null}static async getRelationMap(i,t,e){var a;const n=e??(async()=>{}),r={},o=i.getAllPropertiesIDs();for(const l of o){const h=await i.getProperties(l);if(!h)continue;const f=h.type===t,I=Object.keys(h).find(p=>p.startsWith("Relating")),u=Object.keys(h).find(p=>p.startsWith("Related"));if(!(f&&I&&u))continue;const d=await i.getProperties((a=h[I])==null?void 0:a.value),E=h[u];if(!d||!E||!(E&&Array.isArray(E)))continue;const T=E.map(p=>p.value);await n(d.expressID,T),r[d.expressID]=T}return r}static async getQsetQuantities(i,t,e){const n=e??(()=>{}),r=await i.getProperties(t);return!r||r.type!==k.IFCELEMENTQUANTITY?null:(r.Quantities??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetProps(i,t,e){const n=e??(()=>{}),r=await i.getProperties(t);return!r||r.type!==k.IFCPROPERTYSET?null:(r.HasProperties??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetRel(i,t){var o;if(!await i.getProperties(t))return null;const s=await i.getAllPropertiesOfType(k.IFCRELDEFINESBYPROPERTIES);if(!s)return null;const n=Object.values(s);let r=null;for(const a of n)((o=a.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(r=a.expressID);return r}static async getQsetRel(i,t){return be.getPsetRel(i,t)}static async getEntityName(i,t){var r;const e=await i.getProperties(t);if(!e)return{key:null,name:null};const s=Object.keys(e).find(o=>o.endsWith("Name"))??null,n=s?(r=e[s])==null?void 0:r.value:null;return{key:s,name:n}}static async getQuantityValue(i,t){const e=await i.getProperties(t);if(!e)return{key:null,value:null};const s=Object.keys(e).find(r=>r.endsWith("Value"))??null;let n;return s===null||e[s]===void 0||e[s]===null?n=null:n=e[s].value,{key:s,value:n}}static isRel(i){return _i[i].startsWith("IFCREL")}static async attributeExists(i,t,e){const s=await i.getProperties(t);return s?Object.keys(s).includes(e):!1}static async groupEntitiesByType(i,t){var s;const e=new Map;for(const n of t){const r=await i.getProperties(n);if(!r)continue;const o=r.type;e.get(o)||e.set(o,new Set),(s=e.get(o))==null||s.add(n)}return e}}const ao={IFCURIREFERENCE:"IfcUriReference",IFCTIME:"IfcTime",IFCTEMPERATURERATEOFCHANGEMEASURE:"IfcTemperatureRateOfChangeMeasure",IFCSOUNDPRESSURELEVELMEASURE:"IfcSoundPressureLevelMeasure",IFCSOUNDPOWERLEVELMEASURE:"IfcSoundPowerLevelMeasure",IFCPROPERTYSETDEFINITIONSET:"IfcPropertySetDefinitionSet",IFCPOSITIVEINTEGER:"IfcPositiveInteger",IFCNONNEGATIVELENGTHMEASURE:"IfcNonNegativeLengthMeasure",IFCLINEINDEX:"IfcLineIndex",IFCLANGUAGEID:"IfcLanguageId",IFCDURATION:"IfcDuration",IFCDAYINWEEKNUMBER:"IfcDayInWeekNumber",IFCDATETIME:"IfcDateTime",IFCDATE:"IfcDate",IFCCARDINALPOINTREFERENCE:"IfcCardinalPointReference",IFCBINARY:"IfcBinary",IFCAREADENSITYMEASURE:"IfcAreaDensityMeasure",IFCARCINDEX:"IfcArcIndex",IFCYEARNUMBER:"IfcYearNumber",IFCWARPINGMOMENTMEASURE:"IfcWarpingMomentMeasure",IFCWARPINGCONSTANTMEASURE:"IfcWarpingConstantMeasure",IFCVOLUMETRICFLOWRATEMEASURE:"IfcVolumetricFlowRateMeasure",IFCVOLUMEMEASURE:"IfcVolumeMeasure",IFCVAPORPERMEABILITYMEASURE:"IfcVaporPermeabilityMeasure",IFCTORQUEMEASURE:"IfcTorqueMeasure",IFCTIMESTAMP:"IfcTimestamp",IFCTIMEMEASURE:"IfcTimeMeasure",IFCTHERMODYNAMICTEMPERATUREMEASURE:"IfcThermodynamicTemperatureMeasure",IFCTHERMALTRANSMITTANCEMEASURE:"IfcThermalTransmittanceMeasure",IFCTHERMALRESISTANCEMEASURE:"IfcThermalResistanceMeasure",IFCTHERMALEXPANSIONCOEFFICIENTMEASURE:"IfcThermalExpansionCoefficientMeasure",IFCTHERMALCONDUCTIVITYMEASURE:"IfcThermalConductivityMeasure",IFCTHERMALADMITTANCEMEASURE:"IfcThermalAdmittanceMeasure",IFCTEXTTRANSFORMATION:"IfcTextTransformation",IFCTEXTFONTNAME:"IfcTextFontName",IFCTEXTDECORATION:"IfcTextDecoration",IFCTEXTALIGNMENT:"IfcTextAlignment",IFCTEXT:"IfcText",IFCTEMPERATUREGRADIENTMEASURE:"IfcTemperatureGradientMeasure",IFCSPECULARROUGHNESS:"IfcSpecularRoughness",IFCSPECULAREXPONENT:"IfcSpecularExponent",IFCSPECIFICHEATCAPACITYMEASURE:"IfcSpecificHeatCapacityMeasure",IFCSOUNDPRESSUREMEASURE:"IfcSoundPressureMeasure",IFCSOUNDPOWERMEASURE:"IfcSoundPowerMeasure",IFCSOLIDANGLEMEASURE:"IfcSolidAngleMeasure",IFCSHEARMODULUSMEASURE:"IfcShearModulusMeasure",IFCSECTIONALAREAINTEGRALMEASURE:"IfcSectionalAreaIntegralMeasure",IFCSECTIONMODULUSMEASURE:"IfcSectionModulusMeasure",IFCSECONDINMINUTE:"IfcSecondInMinute",IFCROTATIONALSTIFFNESSMEASURE:"IfcRotationalStiffnessMeasure",IFCROTATIONALMASSMEASURE:"IfcRotationalMassMeasure",IFCROTATIONALFREQUENCYMEASURE:"IfcRotationalFrequencyMeasure",IFCREAL:"IfcReal",IFCRATIOMEASURE:"IfcRatioMeasure",IFCRADIOACTIVITYMEASURE:"IfcRadioactivityMeasure",IFCPRESSUREMEASURE:"IfcPressureMeasure",IFCPRESENTABLETEXT:"IfcPresentableText",IFCPOWERMEASURE:"IfcPowerMeasure",IFCPOSITIVERATIOMEASURE:"IfcPositiveRatioMeasure",IFCPOSITIVEPLANEANGLEMEASURE:"IfcPositivePlaneAngleMeasure",IFCPOSITIVELENGTHMEASURE:"IfcPositiveLengthMeasure",IFCPLANEANGLEMEASURE:"IfcPlaneAngleMeasure",IFCPLANARFORCEMEASURE:"IfcPlanarForceMeasure",IFCPARAMETERVALUE:"IfcParameterValue",IFCPHMEASURE:"IfcPhMeasure",IFCNUMERICMEASURE:"IfcNumericMeasure",IFCNORMALISEDRATIOMEASURE:"IfcNormalisedRatioMeasure",IFCMONTHINYEARNUMBER:"IfcMonthInYearNumber",IFCMONETARYMEASURE:"IfcMonetaryMeasure",IFCMOMENTOFINERTIAMEASURE:"IfcMomentOfInertiaMeasure",IFCMOLECULARWEIGHTMEASURE:"IfcMolecularWeightMeasure",IFCMOISTUREDIFFUSIVITYMEASURE:"IfcMoistureDiffusivityMeasure",IFCMODULUSOFSUBGRADEREACTIONMEASURE:"IfcModulusOfSubgradeReactionMeasure",IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE:"IfcModulusOfRotationalSubgradeReactionMeasure",IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE:"IfcModulusOfLinearSubgradeReactionMeasure",IFCMODULUSOFELASTICITYMEASURE:"IfcModulusOfElasticityMeasure",IFCMINUTEINHOUR:"IfcMinuteInHour",IFCMASSPERLENGTHMEASURE:"IfcMassPerLengthMeasure",IFCMASSMEASURE:"IfcMassMeasure",IFCMASSFLOWRATEMEASURE:"IfcMassFlowRateMeasure",IFCMASSDENSITYMEASURE:"IfcMassDensityMeasure",IFCMAGNETICFLUXMEASURE:"IfcMagneticFluxMeasure",IFCMAGNETICFLUXDENSITYMEASURE:"IfcMagneticFluxDensityMeasure",IFCLUMINOUSINTENSITYMEASURE:"IfcLuminousIntensityMeasure",IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE:"IfcLuminousIntensityDistributionMeasure",IFCLUMINOUSFLUXMEASURE:"IfcLuminousFluxMeasure",IFCLOGICAL:"IfcLogical",IFCLINEARVELOCITYMEASURE:"IfcLinearVelocityMeasure",IFCLINEARSTIFFNESSMEASURE:"IfcLinearStiffnessMeasure",IFCLINEARMOMENTMEASURE:"IfcLinearMomentMeasure",IFCLINEARFORCEMEASURE:"IfcLinearForceMeasure",IFCLENGTHMEASURE:"IfcLengthMeasure",IFCLABEL:"IfcLabel",IFCKINEMATICVISCOSITYMEASURE:"IfcKinematicViscosityMeasure",IFCISOTHERMALMOISTURECAPACITYMEASURE:"IfcIsothermalMoistureCapacityMeasure",IFCIONCONCENTRATIONMEASURE:"IfcIonConcentrationMeasure",IFCINTEGERCOUNTRATEMEASURE:"IfcIntegerCountRateMeasure",IFCINTEGER:"IfcInteger",IFCINDUCTANCEMEASURE:"IfcInductanceMeasure",IFCILLUMINANCEMEASURE:"IfcIlluminanceMeasure",IFCIDENTIFIER:"IfcIdentifier",IFCHOURINDAY:"IfcHourInDay",IFCHEATINGVALUEMEASURE:"IfcHeatingValueMeasure",IFCHEATFLUXDENSITYMEASURE:"IfcHeatFluxDensityMeasure",IFCGLOBALLYUNIQUEID:"IfcGloballyUniqueId",IFCFREQUENCYMEASURE:"IfcFrequencyMeasure",IFCFORCEMEASURE:"IfcForceMeasure",IFCFONTWEIGHT:"IfcFontWeight",IFCFONTVARIANT:"IfcFontVariant",IFCFONTSTYLE:"IfcFontStyle",IFCENERGYMEASURE:"IfcEnergyMeasure",IFCELECTRICVOLTAGEMEASURE:"IfcElectricVoltageMeasure",IFCELECTRICRESISTANCEMEASURE:"IfcElectricResistanceMeasure",IFCELECTRICCURRENTMEASURE:"IfcElectricCurrentMeasure",IFCELECTRICCONDUCTANCEMEASURE:"IfcElectricConductanceMeasure",IFCELECTRICCHARGEMEASURE:"IfcElectricChargeMeasure",IFCELECTRICCAPACITANCEMEASURE:"IfcElectricCapacitanceMeasure",IFCDYNAMICVISCOSITYMEASURE:"IfcDynamicViscosityMeasure",IFCDOSEEQUIVALENTMEASURE:"IfcDoseEquivalentMeasure",IFCDIMENSIONCOUNT:"IfcDimensionCount",IFCDESCRIPTIVEMEASURE:"IfcDescriptiveMeasure",IFCDAYLIGHTSAVINGHOUR:"IfcDaylightSavingHour",IFCDAYINMONTHNUMBER:"IfcDayInMonthNumber",IFCCURVATUREMEASURE:"IfcCurvatureMeasure",IFCCOUNTMEASURE:"IfcCountMeasure",IFCCONTEXTDEPENDENTMEASURE:"IfcContextDependentMeasure",IFCCOMPOUNDPLANEANGLEMEASURE:"IfcCompoundPlaneAngleMeasure",IFCCOMPLEXNUMBER:"IfcComplexNumber",IFCBOXALIGNMENT:"IfcBoxAlignment",IFCBOOLEAN:"IfcBoolean",IFCAREAMEASURE:"IfcAreaMeasure",IFCANGULARVELOCITYMEASURE:"IfcAngularVelocityMeasure",IFCAMOUNTOFSUBSTANCEMEASURE:"IfcAmountOfSubstanceMeasure",IFCACCELERATIONMEASURE:"IfcAccelerationMeasure",IFCABSORBEDDOSEMEASURE:"IfcAbsorbedDoseMeasure",IFCGEOSLICE:"IfcGeoSlice",IFCGEOMODEL:"IfcGeoModel",IFCELECTRICFLOWTREATMENTDEVICE:"IfcElectricFlowTreatmentDevice",IFCDISTRIBUTIONBOARD:"IfcDistributionBoard",IFCCONVEYORSEGMENT:"IfcConveyorSegment",IFCCAISSONFOUNDATION:"IfcCaissonFoundation",IFCBOREHOLE:"IfcBorehole",IFCBEARING:"IfcBearing",IFCALIGNMENT:"IfcAlignment",IFCTRACKELEMENT:"IfcTrackElement",IFCSIGNAL:"IfcSignal",IFCREINFORCEDSOIL:"IfcReinforcedSoil",IFCRAIL:"IfcRail",IFCPAVEMENT:"IfcPavement",IFCNAVIGATIONELEMENT:"IfcNavigationElement",IFCMOORINGDEVICE:"IfcMooringDevice",IFCMOBILETELECOMMUNICATIONSAPPLIANCE:"IfcMobileTelecommunicationsAppliance",IFCLIQUIDTERMINAL:"IfcLiquidTerminal",IFCLINEARPOSITIONINGELEMENT:"IfcLinearPositioningElement",IFCKERB:"IfcKerb",IFCGEOTECHNICALASSEMBLY:"IfcGeotechnicalAssembly",IFCELECTRICFLOWTREATMENTDEVICETYPE:"IfcElectricFlowTreatmentDeviceType",IFCEARTHWORKSFILL:"IfcEarthworksFill",IFCEARTHWORKSELEMENT:"IfcEarthworksElement",IFCEARTHWORKSCUT:"IfcEarthworksCut",IFCDISTRIBUTIONBOARDTYPE:"IfcDistributionBoardType",IFCDEEPFOUNDATION:"IfcDeepFoundation",IFCCOURSE:"IfcCourse",IFCCONVEYORSEGMENTTYPE:"IfcConveyorSegmentType",IFCCAISSONFOUNDATIONTYPE:"IfcCaissonFoundationType",IFCBUILTSYSTEM:"IfcBuiltSystem",IFCBUILTELEMENT:"IfcBuiltElement",IFCBRIDGEPART:"IfcBridgePart",IFCBRIDGE:"IfcBridge",IFCBEARINGTYPE:"IfcBearingType",IFCALIGNMENTVERTICAL:"IfcAlignmentVertical",IFCALIGNMENTSEGMENT:"IfcAlignmentSegment",IFCALIGNMENTHORIZONTAL:"IfcAlignmentHorizontal",IFCALIGNMENTCANT:"IfcAlignmentCant",IFCVIBRATIONDAMPERTYPE:"IfcVibrationDamperType",IFCVIBRATIONDAMPER:"IfcVibrationDamper",IFCVEHICLE:"IfcVehicle",IFCTRANSPORTATIONDEVICE:"IfcTransportationDevice",IFCTRACKELEMENTTYPE:"IfcTrackElementType",IFCTENDONCONDUITTYPE:"IfcTendonConduitType",IFCTENDONCONDUIT:"IfcTendonConduit",IFCSINESPIRAL:"IfcSineSpiral",IFCSIGNALTYPE:"IfcSignalType",IFCSIGNTYPE:"IfcSignType",IFCSIGN:"IfcSign",IFCSEVENTHORDERPOLYNOMIALSPIRAL:"IfcSeventhOrderPolynomialSpiral",IFCSEGMENTEDREFERENCECURVE:"IfcSegmentedReferenceCurve",IFCSECONDORDERPOLYNOMIALSPIRAL:"IfcSecondOrderPolynomialSpiral",IFCROADPART:"IfcRoadPart",IFCROAD:"IfcRoad",IFCRELADHERESTOELEMENT:"IfcRelAdheresToElement",IFCREFERENT:"IfcReferent",IFCRAILWAYPART:"IfcRailwayPart",IFCRAILWAY:"IfcRailway",IFCRAILTYPE:"IfcRailType",IFCPOSITIONINGELEMENT:"IfcPositioningElement",IFCPAVEMENTTYPE:"IfcPavementType",IFCNAVIGATIONELEMENTTYPE:"IfcNavigationElementType",IFCMOORINGDEVICETYPE:"IfcMooringDeviceType",IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE:"IfcMobileTelecommunicationsApplianceType",IFCMARINEPART:"IfcMarinePart",IFCMARINEFACILITY:"IfcMarineFacility",IFCLIQUIDTERMINALTYPE:"IfcLiquidTerminalType",IFCLINEARELEMENT:"IfcLinearElement",IFCKERBTYPE:"IfcKerbType",IFCIMPACTPROTECTIONDEVICETYPE:"IfcImpactProtectionDeviceType",IFCIMPACTPROTECTIONDEVICE:"IfcImpactProtectionDevice",IFCGRADIENTCURVE:"IfcGradientCurve",IFCGEOTECHNICALSTRATUM:"IfcGeotechnicalStratum",IFCGEOTECHNICALELEMENT:"IfcGeotechnicalElement",IFCFACILITYPARTCOMMON:"IfcFacilityPartCommon",IFCFACILITYPART:"IfcFacilityPart",IFCFACILITY:"IfcFacility",IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID:"IfcDirectrixDerivedReferenceSweptAreaSolid",IFCDEEPFOUNDATIONTYPE:"IfcDeepFoundationType",IFCCOURSETYPE:"IfcCourseType",IFCCOSINESPIRAL:"IfcCosineSpiral",IFCCLOTHOID:"IfcClothoid",IFCBUILTELEMENTTYPE:"IfcBuiltElementType",IFCVEHICLETYPE:"IfcVehicleType",IFCTRIANGULATEDIRREGULARNETWORK:"IfcTriangulatedIrregularNetwork",IFCTRANSPORTATIONDEVICETYPE:"IfcTransportationDeviceType",IFCTHIRDORDERPOLYNOMIALSPIRAL:"IfcThirdOrderPolynomialSpiral",IFCSPIRAL:"IfcSpiral",IFCSECTIONEDSURFACE:"IfcSectionedSurface",IFCSECTIONEDSOLIDHORIZONTAL:"IfcSectionedSolidHorizontal",IFCSECTIONEDSOLID:"IfcSectionedSolid",IFCRELPOSITIONS:"IfcRelPositions",IFCRELASSOCIATESPROFILEDEF:"IfcRelAssociatesProfileDef",IFCPOLYNOMIALCURVE:"IfcPolynomialCurve",IFCOFFSETCURVEBYDISTANCES:"IfcOffsetCurveByDistances",IFCOFFSETCURVE:"IfcOffsetCurve",IFCINDEXEDPOLYGONALTEXTUREMAP:"IfcIndexedPolygonalTextureMap",IFCDIRECTRIXCURVESWEPTAREASOLID:"IfcDirectrixCurveSweptAreaSolid",IFCCURVESEGMENT:"IfcCurveSegment",IFCAXIS2PLACEMENTLINEAR:"IfcAxis2PlacementLinear",IFCSEGMENT:"IfcSegment",IFCPOINTBYDISTANCEEXPRESSION:"IfcPointByDistanceExpression",IFCOPENCROSSPROFILEDEF:"IfcOpenCrossProfileDef",IFCLINEARPLACEMENT:"IfcLinearPlacement",IFCALIGNMENTHORIZONTALSEGMENT:"IfcAlignmentHorizontalSegment",IFCALIGNMENTCANTSEGMENT:"IfcAlignmentCantSegment",IFCTEXTURECOORDINATEINDICESWITHVOIDS:"IfcTextureCoordinateIndicesWithVoids",IFCTEXTURECOORDINATEINDICES:"IfcTextureCoordinateIndices",IFCQUANTITYNUMBER:"IfcQuantityNumber",IFCALIGNMENTVERTICALSEGMENT:"IfcAlignmentVerticalSegment",IFCALIGNMENTPARAMETERSEGMENT:"IfcAlignmentParameterSegment",IFCCONTROLLER:"IfcController",IFCALARM:"IfcAlarm",IFCACTUATOR:"IfcActuator",IFCUNITARYCONTROLELEMENT:"IfcUnitaryControlElement",IFCSENSOR:"IfcSensor",IFCPROTECTIVEDEVICETRIPPINGUNIT:"IfcProtectiveDeviceTrippingUnit",IFCFLOWINSTRUMENT:"IfcFlowInstrument",IFCFIRESUPPRESSIONTERMINAL:"IfcFireSuppressionTerminal",IFCFILTER:"IfcFilter",IFCFAN:"IfcFan",IFCELECTRICTIMECONTROL:"IfcElectricTimeControl",IFCELECTRICMOTOR:"IfcElectricMotor",IFCELECTRICGENERATOR:"IfcElectricGenerator",IFCELECTRICFLOWSTORAGEDEVICE:"IfcElectricFlowStorageDevice",IFCELECTRICDISTRIBUTIONBOARD:"IfcElectricDistributionBoard",IFCELECTRICAPPLIANCE:"IfcElectricAppliance",IFCDUCTSILENCER:"IfcDuctSilencer",IFCDUCTSEGMENT:"IfcDuctSegment",IFCDUCTFITTING:"IfcDuctFitting",IFCDISTRIBUTIONCIRCUIT:"IfcDistributionCircuit",IFCDAMPER:"IfcDamper",IFCCOOLINGTOWER:"IfcCoolingTower",IFCCOOLEDBEAM:"IfcCooledBeam",IFCCONDENSER:"IfcCondenser",IFCCOMPRESSOR:"IfcCompressor",IFCCOMMUNICATIONSAPPLIANCE:"IfcCommunicationsAppliance",IFCCOIL:"IfcCoil",IFCCHILLER:"IfcChiller",IFCCABLESEGMENT:"IfcCableSegment",IFCCABLEFITTING:"IfcCableFitting",IFCCABLECARRIERSEGMENT:"IfcCableCarrierSegment",IFCCABLECARRIERFITTING:"IfcCableCarrierFitting",IFCBURNER:"IfcBurner",IFCBOILER:"IfcBoiler",IFCBEAMSTANDARDCASE:"IfcBeamStandardCase",IFCAUDIOVISUALAPPLIANCE:"IfcAudioVisualAppliance",IFCAIRTOAIRHEATRECOVERY:"IfcAirToAirHeatRecovery",IFCAIRTERMINALBOX:"IfcAirTerminalBox",IFCAIRTERMINAL:"IfcAirTerminal",IFCWINDOWSTANDARDCASE:"IfcWindowStandardCase",IFCWASTETERMINAL:"IfcWasteTerminal",IFCWALLELEMENTEDCASE:"IfcWallElementedCase",IFCVALVE:"IfcValve",IFCUNITARYEQUIPMENT:"IfcUnitaryEquipment",IFCUNITARYCONTROLELEMENTTYPE:"IfcUnitaryControlElementType",IFCTUBEBUNDLE:"IfcTubeBundle",IFCTRANSFORMER:"IfcTransformer",IFCTANK:"IfcTank",IFCSWITCHINGDEVICE:"IfcSwitchingDevice",IFCSTRUCTURALLOADCASE:"IfcStructuralLoadCase",IFCSTACKTERMINAL:"IfcStackTerminal",IFCSPACEHEATER:"IfcSpaceHeater",IFCSOLARDEVICE:"IfcSolarDevice",IFCSLABSTANDARDCASE:"IfcSlabStandardCase",IFCSLABELEMENTEDCASE:"IfcSlabElementedCase",IFCSHADINGDEVICE:"IfcShadingDevice",IFCSANITARYTERMINAL:"IfcSanitaryTerminal",IFCREINFORCINGBARTYPE:"IfcReinforcingBarType",IFCRATIONALBSPLINECURVEWITHKNOTS:"IfcRationalBSplineCurveWithKnots",IFCPUMP:"IfcPump",IFCPROTECTIVEDEVICETRIPPINGUNITTYPE:"IfcProtectiveDeviceTrippingUnitType",IFCPROTECTIVEDEVICE:"IfcProtectiveDevice",IFCPLATESTANDARDCASE:"IfcPlateStandardCase",IFCPIPESEGMENT:"IfcPipeSegment",IFCPIPEFITTING:"IfcPipeFitting",IFCOUTLET:"IfcOutlet",IFCOUTERBOUNDARYCURVE:"IfcOuterBoundaryCurve",IFCMOTORCONNECTION:"IfcMotorConnection",IFCMEMBERSTANDARDCASE:"IfcMemberStandardCase",IFCMEDICALDEVICE:"IfcMedicalDevice",IFCLIGHTFIXTURE:"IfcLightFixture",IFCLAMP:"IfcLamp",IFCJUNCTIONBOX:"IfcJunctionBox",IFCINTERCEPTOR:"IfcInterceptor",IFCHUMIDIFIER:"IfcHumidifier",IFCHEATEXCHANGER:"IfcHeatExchanger",IFCFLOWMETER:"IfcFlowMeter",IFCEXTERNALSPATIALELEMENT:"IfcExternalSpatialElement",IFCEVAPORATOR:"IfcEvaporator",IFCEVAPORATIVECOOLER:"IfcEvaporativeCooler",IFCENGINE:"IfcEngine",IFCELECTRICDISTRIBUTIONBOARDTYPE:"IfcElectricDistributionBoardType",IFCDOORSTANDARDCASE:"IfcDoorStandardCase",IFCDISTRIBUTIONSYSTEM:"IfcDistributionSystem",IFCCOMMUNICATIONSAPPLIANCETYPE:"IfcCommunicationsApplianceType",IFCCOLUMNSTANDARDCASE:"IfcColumnStandardCase",IFCCIVILELEMENT:"IfcCivilElement",IFCCHIMNEY:"IfcChimney",IFCCABLEFITTINGTYPE:"IfcCableFittingType",IFCBURNERTYPE:"IfcBurnerType",IFCBUILDINGSYSTEM:"IfcBuildingSystem",IFCBUILDINGELEMENTPARTTYPE:"IfcBuildingElementPartType",IFCBOUNDARYCURVE:"IfcBoundaryCurve",IFCBSPLINECURVEWITHKNOTS:"IfcBSplineCurveWithKnots",IFCAUDIOVISUALAPPLIANCETYPE:"IfcAudioVisualApplianceType",IFCWORKCALENDAR:"IfcWorkCalendar",IFCWINDOWTYPE:"IfcWindowType",IFCVOIDINGFEATURE:"IfcVoidingFeature",IFCVIBRATIONISOLATOR:"IfcVibrationIsolator",IFCTENDONTYPE:"IfcTendonType",IFCTENDONANCHORTYPE:"IfcTendonAnchorType",IFCSYSTEMFURNITUREELEMENT:"IfcSystemFurnitureElement",IFCSURFACEFEATURE:"IfcSurfaceFeature",IFCSTRUCTURALSURFACEACTION:"IfcStructuralSurfaceAction",IFCSTRUCTURALCURVEREACTION:"IfcStructuralCurveReaction",IFCSTRUCTURALCURVEACTION:"IfcStructuralCurveAction",IFCSTAIRTYPE:"IfcStairType",IFCSOLARDEVICETYPE:"IfcSolarDeviceType",IFCSHADINGDEVICETYPE:"IfcShadingDeviceType",IFCSEAMCURVE:"IfcSeamCurve",IFCROOFTYPE:"IfcRoofType",IFCREINFORCINGMESHTYPE:"IfcReinforcingMeshType",IFCREINFORCINGELEMENTTYPE:"IfcReinforcingElementType",IFCRATIONALBSPLINESURFACEWITHKNOTS:"IfcRationalBSplineSurfaceWithKnots",IFCRAMPTYPE:"IfcRampType",IFCPOLYGONALFACESET:"IfcPolygonalFaceSet",IFCPILETYPE:"IfcPileType",IFCOPENINGSTANDARDCASE:"IfcOpeningStandardCase",IFCMEDICALDEVICETYPE:"IfcMedicalDeviceType",IFCINTERSECTIONCURVE:"IfcIntersectionCurve",IFCINTERCEPTORTYPE:"IfcInterceptorType",IFCINDEXEDPOLYCURVE:"IfcIndexedPolyCurve",IFCGEOGRAPHICELEMENT:"IfcGeographicElement",IFCFURNITURE:"IfcFurniture",IFCFOOTINGTYPE:"IfcFootingType",IFCEXTERNALSPATIALSTRUCTUREELEMENT:"IfcExternalSpatialStructureElement",IFCEVENT:"IfcEvent",IFCENGINETYPE:"IfcEngineType",IFCELEMENTASSEMBLYTYPE:"IfcElementAssemblyType",IFCDOORTYPE:"IfcDoorType",IFCCYLINDRICALSURFACE:"IfcCylindricalSurface",IFCCONSTRUCTIONPRODUCTRESOURCETYPE:"IfcConstructionProductResourceType",IFCCONSTRUCTIONMATERIALRESOURCETYPE:"IfcConstructionMaterialResourceType",IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE:"IfcConstructionEquipmentResourceType",IFCCOMPOSITECURVEONSURFACE:"IfcCompositeCurveOnSurface",IFCCOMPLEXPROPERTYTEMPLATE:"IfcComplexPropertyTemplate",IFCCIVILELEMENTTYPE:"IfcCivilElementType",IFCCHIMNEYTYPE:"IfcChimneyType",IFCBSPLINESURFACEWITHKNOTS:"IfcBSplineSurfaceWithKnots",IFCBSPLINESURFACE:"IfcBSplineSurface",IFCADVANCEDBREPWITHVOIDS:"IfcAdvancedBrepWithVoids",IFCADVANCEDBREP:"IfcAdvancedBrep",IFCTRIANGULATEDFACESET:"IfcTriangulatedFaceSet",IFCTOROIDALSURFACE:"IfcToroidalSurface",IFCTESSELLATEDFACESET:"IfcTessellatedFaceSet",IFCTASKTYPE:"IfcTaskType",IFCSURFACECURVE:"IfcSurfaceCurve",IFCSUBCONTRACTRESOURCETYPE:"IfcSubContractResourceType",IFCSTRUCTURALSURFACEREACTION:"IfcStructuralSurfaceReaction",IFCSPHERICALSURFACE:"IfcSphericalSurface",IFCSPATIALZONETYPE:"IfcSpatialZoneType",IFCSPATIALZONE:"IfcSpatialZone",IFCSPATIALELEMENTTYPE:"IfcSpatialElementType",IFCSPATIALELEMENT:"IfcSpatialElement",IFCSIMPLEPROPERTYTEMPLATE:"IfcSimplePropertyTemplate",IFCREVOLVEDAREASOLIDTAPERED:"IfcRevolvedAreaSolidTapered",IFCREPARAMETRISEDCOMPOSITECURVESEGMENT:"IfcReparametrisedCompositeCurveSegment",IFCRELSPACEBOUNDARY2NDLEVEL:"IfcRelSpaceBoundary2ndLevel",IFCRELSPACEBOUNDARY1STLEVEL:"IfcRelSpaceBoundary1stLevel",IFCRELINTERFERESELEMENTS:"IfcRelInterferesElements",IFCRELDEFINESBYTEMPLATE:"IfcRelDefinesByTemplate",IFCRELDEFINESBYOBJECT:"IfcRelDefinesByObject",IFCRELDECLARES:"IfcRelDeclares",IFCRELASSIGNSTOGROUPBYFACTOR:"IfcRelAssignsToGroupByFactor",IFCPROPERTYTEMPLATE:"IfcPropertyTemplate",IFCPROPERTYSETTEMPLATE:"IfcPropertySetTemplate",IFCPROJECTLIBRARY:"IfcProjectLibrary",IFCPROCEDURETYPE:"IfcProcedureType",IFCPREDEFINEDPROPERTYSET:"IfcPredefinedPropertySet",IFCPCURVE:"IfcPCurve",IFCLABORRESOURCETYPE:"IfcLaborResourceType",IFCINDEXEDPOLYGONALFACEWITHVOIDS:"IfcIndexedPolygonalFaceWithVoids",IFCINDEXEDPOLYGONALFACE:"IfcIndexedPolygonalFace",IFCGEOGRAPHICELEMENTTYPE:"IfcGeographicElementType",IFCFIXEDREFERENCESWEPTAREASOLID:"IfcFixedReferenceSweptAreaSolid",IFCEXTRUDEDAREASOLIDTAPERED:"IfcExtrudedAreaSolidTapered",IFCEVENTTYPE:"IfcEventType",IFCCURVEBOUNDEDSURFACE:"IfcCurveBoundedSurface",IFCCREWRESOURCETYPE:"IfcCrewResourceType",IFCCONTEXT:"IfcContext",IFCCONSTRUCTIONRESOURCETYPE:"IfcConstructionResourceType",IFCCARTESIANPOINTLIST3D:"IfcCartesianPointList3D",IFCCARTESIANPOINTLIST2D:"IfcCartesianPointList2D",IFCCARTESIANPOINTLIST:"IfcCartesianPointList",IFCADVANCEDFACE:"IfcAdvancedFace",IFCTYPERESOURCE:"IfcTypeResource",IFCTYPEPROCESS:"IfcTypeProcess",IFCTESSELLATEDITEM:"IfcTessellatedItem",IFCSWEPTDISKSOLIDPOLYGONAL:"IfcSweptDiskSolidPolygonal",IFCRESOURCETIME:"IfcResourceTime",IFCRESOURCECONSTRAINTRELATIONSHIP:"IfcResourceConstraintRelationship",IFCRESOURCEAPPROVALRELATIONSHIP:"IfcResourceApprovalRelationship",IFCQUANTITYSET:"IfcQuantitySet",IFCPROPERTYTEMPLATEDEFINITION:"IfcPropertyTemplateDefinition",IFCPREDEFINEDPROPERTIES:"IfcPredefinedProperties",IFCMIRROREDPROFILEDEF:"IfcMirroredProfileDef",IFCMATERIALRELATIONSHIP:"IfcMaterialRelationship",IFCMATERIALPROFILESETUSAGETAPERING:"IfcMaterialProfileSetUsageTapering",IFCMATERIALPROFILESETUSAGE:"IfcMaterialProfileSetUsage",IFCMATERIALCONSTITUENTSET:"IfcMaterialConstituentSet",IFCMATERIALCONSTITUENT:"IfcMaterialConstituent",IFCLAGTIME:"IfcLagTime",IFCINDEXEDTRIANGLETEXTUREMAP:"IfcIndexedTriangleTextureMap",IFCINDEXEDTEXTUREMAP:"IfcIndexedTextureMap",IFCINDEXEDCOLOURMAP:"IfcIndexedColourMap",IFCEXTERNALREFERENCERELATIONSHIP:"IfcExternalReferenceRelationship",IFCEXTENDEDPROPERTIES:"IfcExtendedProperties",IFCEVENTTIME:"IfcEventTime",IFCCONVERSIONBASEDUNITWITHOFFSET:"IfcConversionBasedUnitWithOffset",IFCCOLOURRGBLIST:"IfcColourRgbList",IFCWORKTIME:"IfcWorkTime",IFCTIMEPERIOD:"IfcTimePeriod",IFCTEXTUREVERTEXLIST:"IfcTextureVertexList",IFCTASKTIMERECURRING:"IfcTaskTimeRecurring",IFCTASKTIME:"IfcTaskTime",IFCTABLECOLUMN:"IfcTableColumn",IFCSURFACEREINFORCEMENTAREA:"IfcSurfaceReinforcementArea",IFCSTRUCTURALLOADORRESULT:"IfcStructuralLoadOrResult",IFCSTRUCTURALLOADCONFIGURATION:"IfcStructuralLoadConfiguration",IFCSCHEDULINGTIME:"IfcSchedulingTime",IFCRESOURCELEVELRELATIONSHIP:"IfcResourceLevelRelationship",IFCREFERENCE:"IfcReference",IFCRECURRENCEPATTERN:"IfcRecurrencePattern",IFCPROPERTYABSTRACTION:"IfcPropertyAbstraction",IFCPROJECTEDCRS:"IfcProjectedCrs",IFCPRESENTATIONITEM:"IfcPresentationItem",IFCMATERIALUSAGEDEFINITION:"IfcMaterialUsageDefinition",IFCMATERIALPROFILEWITHOFFSETS:"IfcMaterialProfileWithOffsets",IFCMATERIALPROFILESET:"IfcMaterialProfileSet",IFCMATERIALPROFILE:"IfcMaterialProfile",IFCMATERIALLAYERWITHOFFSETS:"IfcMaterialLayerWithOffsets",IFCMATERIALDEFINITION:"IfcMaterialDefinition",IFCMAPCONVERSION:"IfcMapConversion",IFCEXTERNALINFORMATION:"IfcExternalInformation",IFCCOORDINATEREFERENCESYSTEM:"IfcCoordinateReferenceSystem",IFCCOORDINATEOPERATION:"IfcCoordinateOperation",IFCCONNECTIONVOLUMEGEOMETRY:"IfcConnectionVolumeGeometry",IFCREINFORCINGBAR:"IfcReinforcingBar",IFCELECTRICDISTRIBUTIONPOINT:"IfcElectricDistributionPoint",IFCDISTRIBUTIONCONTROLELEMENT:"IfcDistributionControlElement",IFCDISTRIBUTIONCHAMBERELEMENT:"IfcDistributionChamberElement",IFCCONTROLLERTYPE:"IfcControllerType",IFCCHAMFEREDGEFEATURE:"IfcChamferEdgeFeature",IFCBEAM:"IfcBeam",IFCALARMTYPE:"IfcAlarmType",IFCACTUATORTYPE:"IfcActuatorType",IFCWINDOW:"IfcWindow",IFCWALLSTANDARDCASE:"IfcWallStandardCase",IFCWALL:"IfcWall",IFCVIBRATIONISOLATORTYPE:"IfcVibrationIsolatorType",IFCTENDONANCHOR:"IfcTendonAnchor",IFCTENDON:"IfcTendon",IFCSTRUCTURALANALYSISMODEL:"IfcStructuralAnalysisModel",IFCSTAIRFLIGHT:"IfcStairFlight",IFCSTAIR:"IfcStair",IFCSLAB:"IfcSlab",IFCSENSORTYPE:"IfcSensorType",IFCROUNDEDEDGEFEATURE:"IfcRoundedEdgeFeature",IFCROOF:"IfcRoof",IFCREINFORCINGMESH:"IfcReinforcingMesh",IFCREINFORCINGELEMENT:"IfcReinforcingElement",IFCRATIONALBEZIERCURVE:"IfcRationalBezierCurve",IFCRAMPFLIGHT:"IfcRampFlight",IFCRAMP:"IfcRamp",IFCRAILING:"IfcRailing",IFCPLATE:"IfcPlate",IFCPILE:"IfcPile",IFCMEMBER:"IfcMember",IFCFOOTING:"IfcFooting",IFCFLOWTREATMENTDEVICE:"IfcFlowTreatmentDevice",IFCFLOWTERMINAL:"IfcFlowTerminal",IFCFLOWSTORAGEDEVICE:"IfcFlowStorageDevice",IFCFLOWSEGMENT:"IfcFlowSegment",IFCFLOWMOVINGDEVICE:"IfcFlowMovingDevice",IFCFLOWINSTRUMENTTYPE:"IfcFlowInstrumentType",IFCFLOWFITTING:"IfcFlowFitting",IFCFLOWCONTROLLER:"IfcFlowController",IFCFIRESUPPRESSIONTERMINALTYPE:"IfcFireSuppressionTerminalType",IFCFILTERTYPE:"IfcFilterType",IFCFANTYPE:"IfcFanType",IFCENERGYCONVERSIONDEVICE:"IfcEnergyConversionDevice",IFCELECTRICALELEMENT:"IfcElectricalElement",IFCELECTRICALCIRCUIT:"IfcElectricalCircuit",IFCELECTRICTIMECONTROLTYPE:"IfcElectricTimeControlType",IFCELECTRICMOTORTYPE:"IfcElectricMotorType",IFCELECTRICHEATERTYPE:"IfcElectricHeaterType",IFCELECTRICGENERATORTYPE:"IfcElectricGeneratorType",IFCELECTRICFLOWSTORAGEDEVICETYPE:"IfcElectricFlowStorageDeviceType",IFCELECTRICAPPLIANCETYPE:"IfcElectricApplianceType",IFCEDGEFEATURE:"IfcEdgeFeature",IFCDUCTSILENCERTYPE:"IfcDuctSilencerType",IFCDUCTSEGMENTTYPE:"IfcDuctSegmentType",IFCDUCTFITTINGTYPE:"IfcDuctFittingType",IFCDOOR:"IfcDoor",IFCDISTRIBUTIONPORT:"IfcDistributionPort",IFCDISTRIBUTIONFLOWELEMENT:"IfcDistributionFlowElement",IFCDISTRIBUTIONELEMENT:"IfcDistributionElement",IFCDISTRIBUTIONCONTROLELEMENTTYPE:"IfcDistributionControlElementType",IFCDISTRIBUTIONCHAMBERELEMENTTYPE:"IfcDistributionChamberElementType",IFCDISCRETEACCESSORYTYPE:"IfcDiscreteAccessoryType",IFCDISCRETEACCESSORY:"IfcDiscreteAccessory",IFCDIAMETERDIMENSION:"IfcDiameterDimension",IFCDAMPERTYPE:"IfcDamperType",IFCCURTAINWALL:"IfcCurtainWall",IFCCOVERING:"IfcCovering",IFCCOOLINGTOWERTYPE:"IfcCoolingTowerType",IFCCOOLEDBEAMTYPE:"IfcCooledBeamType",IFCCONSTRUCTIONPRODUCTRESOURCE:"IfcConstructionProductResource",IFCCONSTRUCTIONMATERIALRESOURCE:"IfcConstructionMaterialResource",IFCCONSTRUCTIONEQUIPMENTRESOURCE:"IfcConstructionEquipmentResource",IFCCONDITIONCRITERION:"IfcConditionCriterion",IFCCONDITION:"IfcCondition",IFCCONDENSERTYPE:"IfcCondenserType",IFCCOMPRESSORTYPE:"IfcCompressorType",IFCCOLUMN:"IfcColumn",IFCCOILTYPE:"IfcCoilType",IFCCIRCLE:"IfcCircle",IFCCHILLERTYPE:"IfcChillerType",IFCCABLESEGMENTTYPE:"IfcCableSegmentType",IFCCABLECARRIERSEGMENTTYPE:"IfcCableCarrierSegmentType",IFCCABLECARRIERFITTINGTYPE:"IfcCableCarrierFittingType",IFCBUILDINGELEMENTPROXYTYPE:"IfcBuildingElementProxyType",IFCBUILDINGELEMENTPROXY:"IfcBuildingElementProxy",IFCBUILDINGELEMENTPART:"IfcBuildingElementPart",IFCBUILDINGELEMENTCOMPONENT:"IfcBuildingElementComponent",IFCBUILDINGELEMENT:"IfcBuildingElement",IFCBOILERTYPE:"IfcBoilerType",IFCBEZIERCURVE:"IfcBezierCurve",IFCBEAMTYPE:"IfcBeamType",IFCBSPLINECURVE:"IfcBSplineCurve",IFCASSET:"IfcAsset",IFCANGULARDIMENSION:"IfcAngularDimension",IFCAIRTOAIRHEATRECOVERYTYPE:"IfcAirToAirHeatRecoveryType",IFCAIRTERMINALTYPE:"IfcAirTerminalType",IFCAIRTERMINALBOXTYPE:"IfcAirTerminalBoxType",IFCACTIONREQUEST:"IfcActionRequest",IFC2DCOMPOSITECURVE:"Ifc2DCompositeCurve",IFCZONE:"IfcZone",IFCWORKSCHEDULE:"IfcWorkSchedule",IFCWORKPLAN:"IfcWorkPlan",IFCWORKCONTROL:"IfcWorkControl",IFCWASTETERMINALTYPE:"IfcWasteTerminalType",IFCWALLTYPE:"IfcWallType",IFCVIRTUALELEMENT:"IfcVirtualElement",IFCVALVETYPE:"IfcValveType",IFCUNITARYEQUIPMENTTYPE:"IfcUnitaryEquipmentType",IFCTUBEBUNDLETYPE:"IfcTubeBundleType",IFCTRIMMEDCURVE:"IfcTrimmedCurve",IFCTRANSPORTELEMENT:"IfcTransportElement",IFCTRANSFORMERTYPE:"IfcTransformerType",IFCTIMESERIESSCHEDULE:"IfcTimeSeriesSchedule",IFCTANKTYPE:"IfcTankType",IFCSYSTEM:"IfcSystem",IFCSWITCHINGDEVICETYPE:"IfcSwitchingDeviceType",IFCSUBCONTRACTRESOURCE:"IfcSubContractResource",IFCSTRUCTURALSURFACECONNECTION:"IfcStructuralSurfaceConnection",IFCSTRUCTURALRESULTGROUP:"IfcStructuralResultGroup",IFCSTRUCTURALPOINTREACTION:"IfcStructuralPointReaction",IFCSTRUCTURALPOINTCONNECTION:"IfcStructuralPointConnection",IFCSTRUCTURALPOINTACTION:"IfcStructuralPointAction",IFCSTRUCTURALPLANARACTIONVARYING:"IfcStructuralPlanarActionVarying",IFCSTRUCTURALPLANARACTION:"IfcStructuralPlanarAction",IFCSTRUCTURALLOADGROUP:"IfcStructuralLoadGroup",IFCSTRUCTURALLINEARACTIONVARYING:"IfcStructuralLinearActionVarying",IFCSTRUCTURALLINEARACTION:"IfcStructuralLinearAction",IFCSTRUCTURALCURVEMEMBERVARYING:"IfcStructuralCurveMemberVarying",IFCSTRUCTURALCURVEMEMBER:"IfcStructuralCurveMember",IFCSTRUCTURALCURVECONNECTION:"IfcStructuralCurveConnection",IFCSTRUCTURALCONNECTION:"IfcStructuralConnection",IFCSTRUCTURALACTION:"IfcStructuralAction",IFCSTAIRFLIGHTTYPE:"IfcStairFlightType",IFCSTACKTERMINALTYPE:"IfcStackTerminalType",IFCSPACETYPE:"IfcSpaceType",IFCSPACEPROGRAM:"IfcSpaceProgram",IFCSPACEHEATERTYPE:"IfcSpaceHeaterType",IFCSPACE:"IfcSpace",IFCSLABTYPE:"IfcSlabType",IFCSITE:"IfcSite",IFCSERVICELIFE:"IfcServiceLife",IFCSCHEDULETIMECONTROL:"IfcScheduleTimeControl",IFCSANITARYTERMINALTYPE:"IfcSanitaryTerminalType",IFCRELASSIGNSTASKS:"IfcRelAssignsTasks",IFCRELAGGREGATES:"IfcRelAggregates",IFCRAMPFLIGHTTYPE:"IfcRampFlightType",IFCRAILINGTYPE:"IfcRailingType",IFCRADIUSDIMENSION:"IfcRadiusDimension",IFCPUMPTYPE:"IfcPumpType",IFCPROTECTIVEDEVICETYPE:"IfcProtectiveDeviceType",IFCPROJECTIONELEMENT:"IfcProjectionElement",IFCPROJECTORDERRECORD:"IfcProjectOrderRecord",IFCPROJECTORDER:"IfcProjectOrder",IFCPROCEDURE:"IfcProcedure",IFCPORT:"IfcPort",IFCPOLYLINE:"IfcPolyline",IFCPLATETYPE:"IfcPlateType",IFCPIPESEGMENTTYPE:"IfcPipeSegmentType",IFCPIPEFITTINGTYPE:"IfcPipeFittingType",IFCPERMIT:"IfcPermit",IFCPERFORMANCEHISTORY:"IfcPerformanceHistory",IFCOUTLETTYPE:"IfcOutletType",IFCORDERACTION:"IfcOrderAction",IFCOPENINGELEMENT:"IfcOpeningElement",IFCOCCUPANT:"IfcOccupant",IFCMOVE:"IfcMove",IFCMOTORCONNECTIONTYPE:"IfcMotorConnectionType",IFCMEMBERTYPE:"IfcMemberType",IFCMECHANICALFASTENERTYPE:"IfcMechanicalFastenerType",IFCMECHANICALFASTENER:"IfcMechanicalFastener",IFCLINEARDIMENSION:"IfcLinearDimension",IFCLIGHTFIXTURETYPE:"IfcLightFixtureType",IFCLAMPTYPE:"IfcLampType",IFCLABORRESOURCE:"IfcLaborResource",IFCJUNCTIONBOXTYPE:"IfcJunctionBoxType",IFCINVENTORY:"IfcInventory",IFCHUMIDIFIERTYPE:"IfcHumidifierType",IFCHEATEXCHANGERTYPE:"IfcHeatExchangerType",IFCGROUP:"IfcGroup",IFCGRID:"IfcGrid",IFCGASTERMINALTYPE:"IfcGasTerminalType",IFCFURNITURESTANDARD:"IfcFurnitureStandard",IFCFURNISHINGELEMENT:"IfcFurnishingElement",IFCFLOWTREATMENTDEVICETYPE:"IfcFlowTreatmentDeviceType",IFCFLOWTERMINALTYPE:"IfcFlowTerminalType",IFCFLOWSTORAGEDEVICETYPE:"IfcFlowStorageDeviceType",IFCFLOWSEGMENTTYPE:"IfcFlowSegmentType",IFCFLOWMOVINGDEVICETYPE:"IfcFlowMovingDeviceType",IFCFLOWMETERTYPE:"IfcFlowMeterType",IFCFLOWFITTINGTYPE:"IfcFlowFittingType",IFCFLOWCONTROLLERTYPE:"IfcFlowControllerType",IFCFEATUREELEMENTSUBTRACTION:"IfcFeatureElementSubtraction",IFCFEATUREELEMENTADDITION:"IfcFeatureElementAddition",IFCFEATUREELEMENT:"IfcFeatureElement",IFCFASTENERTYPE:"IfcFastenerType",IFCFASTENER:"IfcFastener",IFCFACETEDBREPWITHVOIDS:"IfcFacetedBrepWithVoids",IFCFACETEDBREP:"IfcFacetedBrep",IFCEVAPORATORTYPE:"IfcEvaporatorType",IFCEVAPORATIVECOOLERTYPE:"IfcEvaporativeCoolerType",IFCEQUIPMENTSTANDARD:"IfcEquipmentStandard",IFCEQUIPMENTELEMENT:"IfcEquipmentElement",IFCENERGYCONVERSIONDEVICETYPE:"IfcEnergyConversionDeviceType",IFCELLIPSE:"IfcEllipse",IFCELEMENTCOMPONENTTYPE:"IfcElementComponentType",IFCELEMENTCOMPONENT:"IfcElementComponent",IFCELEMENTASSEMBLY:"IfcElementAssembly",IFCELEMENT:"IfcElement",IFCELECTRICALBASEPROPERTIES:"IfcElectricalBaseProperties",IFCDISTRIBUTIONFLOWELEMENTTYPE:"IfcDistributionFlowElementType",IFCDISTRIBUTIONELEMENTTYPE:"IfcDistributionElementType",IFCDIMENSIONCURVEDIRECTEDCALLOUT:"IfcDimensionCurveDirectedCallout",IFCCURTAINWALLTYPE:"IfcCurtainWallType",IFCCREWRESOURCE:"IfcCrewResource",IFCCOVERINGTYPE:"IfcCoveringType",IFCCOSTSCHEDULE:"IfcCostSchedule",IFCCOSTITEM:"IfcCostItem",IFCCONTROL:"IfcControl",IFCCONSTRUCTIONRESOURCE:"IfcConstructionResource",IFCCONIC:"IfcConic",IFCCOMPOSITECURVE:"IfcCompositeCurve",IFCCOLUMNTYPE:"IfcColumnType",IFCCIRCLEHOLLOWPROFILEDEF:"IfcCircleHollowProfileDef",IFCBUILDINGSTOREY:"IfcBuildingStorey",IFCBUILDINGELEMENTTYPE:"IfcBuildingElementType",IFCBUILDING:"IfcBuilding",IFCBOUNDEDCURVE:"IfcBoundedCurve",IFCBOOLEANCLIPPINGRESULT:"IfcBooleanClippingResult",IFCBLOCK:"IfcBlock",IFCASYMMETRICISHAPEPROFILEDEF:"IfcAsymmetricIShapeProfileDef",IFCANNOTATION:"IfcAnnotation",IFCACTOR:"IfcActor",IFCTRANSPORTELEMENTTYPE:"IfcTransportElementType",IFCTASK:"IfcTask",IFCSYSTEMFURNITUREELEMENTTYPE:"IfcSystemFurnitureElementType",IFCSURFACEOFREVOLUTION:"IfcSurfaceOfRevolution",IFCSURFACEOFLINEAREXTRUSION:"IfcSurfaceOfLinearExtrusion",IFCSURFACECURVESWEPTAREASOLID:"IfcSurfaceCurveSweptAreaSolid",IFCSTRUCTUREDDIMENSIONCALLOUT:"IfcStructuredDimensionCallout",IFCSTRUCTURALSURFACEMEMBERVARYING:"IfcStructuralSurfaceMemberVarying",IFCSTRUCTURALSURFACEMEMBER:"IfcStructuralSurfaceMember",IFCSTRUCTURALREACTION:"IfcStructuralReaction",IFCSTRUCTURALMEMBER:"IfcStructuralMember",IFCSTRUCTURALITEM:"IfcStructuralItem",IFCSTRUCTURALACTIVITY:"IfcStructuralActivity",IFCSPHERE:"IfcSphere",IFCSPATIALSTRUCTUREELEMENTTYPE:"IfcSpatialStructureElementType",IFCSPATIALSTRUCTUREELEMENT:"IfcSpatialStructureElement",IFCRIGHTCIRCULARCYLINDER:"IfcRightCircularCylinder",IFCRIGHTCIRCULARCONE:"IfcRightCircularCone",IFCREVOLVEDAREASOLID:"IfcRevolvedAreaSolid",IFCRESOURCE:"IfcResource",IFCRELVOIDSELEMENT:"IfcRelVoidsElement",IFCRELSPACEBOUNDARY:"IfcRelSpaceBoundary",IFCRELSERVICESBUILDINGS:"IfcRelServicesBuildings",IFCRELSEQUENCE:"IfcRelSequence",IFCRELSCHEDULESCOSTITEMS:"IfcRelSchedulesCostItems",IFCRELREFERENCEDINSPATIALSTRUCTURE:"IfcRelReferencedInSpatialStructure",IFCRELPROJECTSELEMENT:"IfcRelProjectsElement",IFCRELOVERRIDESPROPERTIES:"IfcRelOverridesProperties",IFCRELOCCUPIESSPACES:"IfcRelOccupiesSpaces",IFCRELNESTS:"IfcRelNests",IFCRELINTERACTIONREQUIREMENTS:"IfcRelInteractionRequirements",IFCRELFLOWCONTROLELEMENTS:"IfcRelFlowControlElements",IFCRELFILLSELEMENT:"IfcRelFillsElement",IFCRELDEFINESBYTYPE:"IfcRelDefinesByType",IFCRELDEFINESBYPROPERTIES:"IfcRelDefinesByProperties",IFCRELDEFINES:"IfcRelDefines",IFCRELDECOMPOSES:"IfcRelDecomposes",IFCRELCOVERSSPACES:"IfcRelCoversSpaces",IFCRELCOVERSBLDGELEMENTS:"IfcRelCoversBldgElements",IFCRELCONTAINEDINSPATIALSTRUCTURE:"IfcRelContainedInSpatialStructure",IFCRELCONNECTSWITHREALIZINGELEMENTS:"IfcRelConnectsWithRealizingElements",IFCRELCONNECTSWITHECCENTRICITY:"IfcRelConnectsWithEccentricity",IFCRELCONNECTSSTRUCTURALMEMBER:"IfcRelConnectsStructuralMember",IFCRELCONNECTSSTRUCTURALELEMENT:"IfcRelConnectsStructuralElement",IFCRELCONNECTSSTRUCTURALACTIVITY:"IfcRelConnectsStructuralActivity",IFCRELCONNECTSPORTS:"IfcRelConnectsPorts",IFCRELCONNECTSPORTTOELEMENT:"IfcRelConnectsPortToElement",IFCRELCONNECTSPATHELEMENTS:"IfcRelConnectsPathElements",IFCRELCONNECTSELEMENTS:"IfcRelConnectsElements",IFCRELCONNECTS:"IfcRelConnects",IFCRELASSOCIATESPROFILEPROPERTIES:"IfcRelAssociatesProfileProperties",IFCRELASSOCIATESMATERIAL:"IfcRelAssociatesMaterial",IFCRELASSOCIATESLIBRARY:"IfcRelAssociatesLibrary",IFCRELASSOCIATESDOCUMENT:"IfcRelAssociatesDocument",IFCRELASSOCIATESCONSTRAINT:"IfcRelAssociatesConstraint",IFCRELASSOCIATESCLASSIFICATION:"IfcRelAssociatesClassification",IFCRELASSOCIATESAPPROVAL:"IfcRelAssociatesApproval",IFCRELASSOCIATESAPPLIEDVALUE:"IfcRelAssociatesAppliedValue",IFCRELASSOCIATES:"IfcRelAssociates",IFCRELASSIGNSTORESOURCE:"IfcRelAssignsToResource",IFCRELASSIGNSTOPROJECTORDER:"IfcRelAssignsToProjectOrder",IFCRELASSIGNSTOPRODUCT:"IfcRelAssignsToProduct",IFCRELASSIGNSTOPROCESS:"IfcRelAssignsToProcess",IFCRELASSIGNSTOGROUP:"IfcRelAssignsToGroup",IFCRELASSIGNSTOCONTROL:"IfcRelAssignsToControl",IFCRELASSIGNSTOACTOR:"IfcRelAssignsToActor",IFCRELASSIGNS:"IfcRelAssigns",IFCRECTANGULARTRIMMEDSURFACE:"IfcRectangularTrimmedSurface",IFCRECTANGULARPYRAMID:"IfcRectangularPyramid",IFCRECTANGLEHOLLOWPROFILEDEF:"IfcRectangleHollowProfileDef",IFCPROXY:"IfcProxy",IFCPROPERTYSET:"IfcPropertySet",IFCPROJECTIONCURVE:"IfcProjectionCurve",IFCPROJECT:"IfcProject",IFCPRODUCT:"IfcProduct",IFCPROCESS:"IfcProcess",IFCPLANE:"IfcPlane",IFCPLANARBOX:"IfcPlanarBox",IFCPERMEABLECOVERINGPROPERTIES:"IfcPermeableCoveringProperties",IFCOFFSETCURVE3D:"IfcOffsetCurve3D",IFCOFFSETCURVE2D:"IfcOffsetCurve2D",IFCOBJECT:"IfcObject",IFCMANIFOLDSOLIDBREP:"IfcManifoldSolidBrep",IFCLINE:"IfcLine",IFCLSHAPEPROFILEDEF:"IfcLShapeProfileDef",IFCISHAPEPROFILEDEF:"IfcIShapeProfileDef",IFCGEOMETRICCURVESET:"IfcGeometricCurveSet",IFCFURNITURETYPE:"IfcFurnitureType",IFCFURNISHINGELEMENTTYPE:"IfcFurnishingElementType",IFCFLUIDFLOWPROPERTIES:"IfcFluidFlowProperties",IFCFILLAREASTYLETILES:"IfcFillAreaStyleTiles",IFCFILLAREASTYLETILESYMBOLWITHSTYLE:"IfcFillAreaStyleTileSymbolWithStyle",IFCFILLAREASTYLEHATCHING:"IfcFillAreaStyleHatching",IFCFACEBASEDSURFACEMODEL:"IfcFaceBasedSurfaceModel",IFCEXTRUDEDAREASOLID:"IfcExtrudedAreaSolid",IFCENERGYPROPERTIES:"IfcEnergyProperties",IFCELLIPSEPROFILEDEF:"IfcEllipseProfileDef",IFCELEMENTARYSURFACE:"IfcElementarySurface",IFCELEMENTTYPE:"IfcElementType",IFCELEMENTQUANTITY:"IfcElementQuantity",IFCEDGELOOP:"IfcEdgeLoop",IFCDRAUGHTINGPREDEFINEDCURVEFONT:"IfcDraughtingPredefinedCurveFont",IFCDRAUGHTINGPREDEFINEDCOLOUR:"IfcDraughtingPredefinedColour",IFCDRAUGHTINGCALLOUT:"IfcDraughtingCallout",IFCDOORSTYLE:"IfcDoorStyle",IFCDOORPANELPROPERTIES:"IfcDoorPanelProperties",IFCDOORLININGPROPERTIES:"IfcDoorLiningProperties",IFCDIRECTION:"IfcDirection",IFCDIMENSIONCURVETERMINATOR:"IfcDimensionCurveTerminator",IFCDIMENSIONCURVE:"IfcDimensionCurve",IFCDEFINEDSYMBOL:"IfcDefinedSymbol",IFCCURVEBOUNDEDPLANE:"IfcCurveBoundedPlane",IFCCURVE:"IfcCurve",IFCCSGSOLID:"IfcCsgSolid",IFCCSGPRIMITIVE3D:"IfcCsgPrimitive3D",IFCCRANERAILFSHAPEPROFILEDEF:"IfcCraneRailFShapeProfileDef",IFCCRANERAILASHAPEPROFILEDEF:"IfcCraneRailAShapeProfileDef",IFCCOMPOSITECURVESEGMENT:"IfcCompositeCurveSegment",IFCCLOSEDSHELL:"IfcClosedShell",IFCCIRCLEPROFILEDEF:"IfcCircleProfileDef",IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM:"IfcCartesianTransformationOperator3DNonUniform",IFCCARTESIANTRANSFORMATIONOPERATOR3D:"IfcCartesianTransformationOperator3D",IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM:"IfcCartesianTransformationOperator2DNonUniform",IFCCARTESIANTRANSFORMATIONOPERATOR2D:"IfcCartesianTransformationOperator2D",IFCCARTESIANTRANSFORMATIONOPERATOR:"IfcCartesianTransformationOperator",IFCCARTESIANPOINT:"IfcCartesianPoint",IFCCSHAPEPROFILEDEF:"IfcCShapeProfileDef",IFCBOXEDHALFSPACE:"IfcBoxedHalfSpace",IFCBOUNDINGBOX:"IfcBoundingBox",IFCBOUNDEDSURFACE:"IfcBoundedSurface",IFCBOOLEANRESULT:"IfcBooleanResult",IFCAXIS2PLACEMENT3D:"IfcAxis2Placement3D",IFCAXIS2PLACEMENT2D:"IfcAxis2Placement2D",IFCAXIS1PLACEMENT:"IfcAxis1Placement",IFCANNOTATIONSURFACE:"IfcAnnotationSurface",IFCANNOTATIONFILLAREAOCCURRENCE:"IfcAnnotationFillAreaOccurrence",IFCANNOTATIONFILLAREA:"IfcAnnotationFillArea",IFCANNOTATIONCURVEOCCURRENCE:"IfcAnnotationCurveOccurrence",IFCZSHAPEPROFILEDEF:"IfcZShapeProfileDef",IFCWINDOWSTYLE:"IfcWindowStyle",IFCWINDOWPANELPROPERTIES:"IfcWindowPanelProperties",IFCWINDOWLININGPROPERTIES:"IfcWindowLiningProperties",IFCVERTEXLOOP:"IfcVertexLoop",IFCVECTOR:"IfcVector",IFCUSHAPEPROFILEDEF:"IfcUShapeProfileDef",IFCTYPEPRODUCT:"IfcTypeProduct",IFCTYPEOBJECT:"IfcTypeObject",IFCTWODIRECTIONREPEATFACTOR:"IfcTwoDirectionRepeatFactor",IFCTRAPEZIUMPROFILEDEF:"IfcTrapeziumProfileDef",IFCTEXTLITERALWITHEXTENT:"IfcTextLiteralWithExtent",IFCTEXTLITERAL:"IfcTextLiteral",IFCTERMINATORSYMBOL:"IfcTerminatorSymbol",IFCTSHAPEPROFILEDEF:"IfcTShapeProfileDef",IFCSWEPTSURFACE:"IfcSweptSurface",IFCSWEPTDISKSOLID:"IfcSweptDiskSolid",IFCSWEPTAREASOLID:"IfcSweptAreaSolid",IFCSURFACESTYLERENDERING:"IfcSurfaceStyleRendering",IFCSURFACE:"IfcSurface",IFCSUBEDGE:"IfcSubedge",IFCSTRUCTURALSTEELPROFILEPROPERTIES:"IfcStructuralSteelProfileProperties",IFCSTRUCTURALPROFILEPROPERTIES:"IfcStructuralProfileProperties",IFCSTRUCTURALLOADSINGLEFORCEWARPING:"IfcStructuralLoadSingleForceWarping",IFCSTRUCTURALLOADSINGLEFORCE:"IfcStructuralLoadSingleForce",IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION:"IfcStructuralLoadSingleDisplacementDistortion",IFCSTRUCTURALLOADSINGLEDISPLACEMENT:"IfcStructuralLoadSingleDisplacement",IFCSTRUCTURALLOADPLANARFORCE:"IfcStructuralLoadPlanarForce",IFCSTRUCTURALLOADLINEARFORCE:"IfcStructuralLoadLinearForce",IFCSPACETHERMALLOADPROPERTIES:"IfcSpaceThermalLoadProperties",IFCSOUNDVALUE:"IfcSoundValue",IFCSOUNDPROPERTIES:"IfcSoundProperties",IFCSOLIDMODEL:"IfcSolidModel",IFCSLIPPAGECONNECTIONCONDITION:"IfcSlippageConnectionCondition",IFCSHELLBASEDSURFACEMODEL:"IfcShellBasedSurfaceModel",IFCSERVICELIFEFACTOR:"IfcServiceLifeFactor",IFCSECTIONEDSPINE:"IfcSectionedSpine",IFCROUNDEDRECTANGLEPROFILEDEF:"IfcRoundedRectangleProfileDef",IFCRELATIONSHIP:"IfcRelationship",IFCREINFORCEMENTDEFINITIONPROPERTIES:"IfcReinforcementDefinitionProperties",IFCREGULARTIMESERIES:"IfcRegularTimeSeries",IFCRECTANGLEPROFILEDEF:"IfcRectangleProfileDef",IFCPROPERTYTABLEVALUE:"IfcPropertyTableValue",IFCPROPERTYSINGLEVALUE:"IfcPropertySingleValue",IFCPROPERTYSETDEFINITION:"IfcPropertySetDefinition",IFCPROPERTYREFERENCEVALUE:"IfcPropertyReferenceValue",IFCPROPERTYLISTVALUE:"IfcPropertyListValue",IFCPROPERTYENUMERATEDVALUE:"IfcPropertyEnumeratedValue",IFCPROPERTYDEFINITION:"IfcPropertyDefinition",IFCPROPERTYBOUNDEDVALUE:"IfcPropertyBoundedValue",IFCPRODUCTDEFINITIONSHAPE:"IfcProductDefinitionShape",IFCPREDEFINEDPOINTMARKERSYMBOL:"IfcPredefinedPointMarkerSymbol",IFCPREDEFINEDDIMENSIONSYMBOL:"IfcPredefinedDimensionSymbol",IFCPREDEFINEDCURVEFONT:"IfcPredefinedCurveFont",IFCPREDEFINEDCOLOUR:"IfcPredefinedColour",IFCPOLYGONALBOUNDEDHALFSPACE:"IfcPolygonalBoundedHalfSpace",IFCPOLYLOOP:"IfcPolyLoop",IFCPOINTONSURFACE:"IfcPointOnSurface",IFCPOINTONCURVE:"IfcPointOnCurve",IFCPOINT:"IfcPoint",IFCPLANAREXTENT:"IfcPlanarExtent",IFCPLACEMENT:"IfcPlacement",IFCPIXELTEXTURE:"IfcPixelTexture",IFCPHYSICALCOMPLEXQUANTITY:"IfcPhysicalComplexQuantity",IFCPATH:"IfcPath",IFCPARAMETERIZEDPROFILEDEF:"IfcParameterizedProfileDef",IFCORIENTEDEDGE:"IfcOrientedEdge",IFCOPENSHELL:"IfcOpenShell",IFCONEDIRECTIONREPEATFACTOR:"IfcOneDirectionRepeatFactor",IFCOBJECTDEFINITION:"IfcObjectDefinition",IFCMECHANICALCONCRETEMATERIALPROPERTIES:"IfcMechanicalConcreteMaterialProperties",IFCMATERIALDEFINITIONREPRESENTATION:"IfcMaterialDefinitionRepresentation",IFCMAPPEDITEM:"IfcMappedItem",IFCLOOP:"IfcLoop",IFCLOCALPLACEMENT:"IfcLocalPlacement",IFCLIGHTSOURCESPOT:"IfcLightSourceSpot",IFCLIGHTSOURCEPOSITIONAL:"IfcLightSourcePositional",IFCLIGHTSOURCEGONIOMETRIC:"IfcLightSourceGoniometric",IFCLIGHTSOURCEDIRECTIONAL:"IfcLightSourceDirectional",IFCLIGHTSOURCEAMBIENT:"IfcLightSourceAmbient",IFCLIGHTSOURCE:"IfcLightSource",IFCIRREGULARTIMESERIES:"IfcIrregularTimeSeries",IFCIMAGETEXTURE:"IfcImageTexture",IFCHYGROSCOPICMATERIALPROPERTIES:"IfcHygroscopicMaterialProperties",IFCHALFSPACESOLID:"IfcHalfSpaceSolid",IFCGRIDPLACEMENT:"IfcGridPlacement",IFCGEOMETRICSET:"IfcGeometricSet",IFCGEOMETRICREPRESENTATIONSUBCONTEXT:"IfcGeometricRepresentationSubContext",IFCGEOMETRICREPRESENTATIONITEM:"IfcGeometricRepresentationItem",IFCGEOMETRICREPRESENTATIONCONTEXT:"IfcGeometricRepresentationContext",IFCGENERALPROFILEPROPERTIES:"IfcGeneralProfileProperties",IFCGENERALMATERIALPROPERTIES:"IfcGeneralMaterialProperties",IFCFUELPROPERTIES:"IfcFuelProperties",IFCFILLAREASTYLE:"IfcFillAreaStyle",IFCFAILURECONNECTIONCONDITION:"IfcFailureConnectionCondition",IFCFACESURFACE:"IfcFaceSurface",IFCFACEOUTERBOUND:"IfcFaceOuterBound",IFCFACEBOUND:"IfcFaceBound",IFCFACE:"IfcFace",IFCEXTENDEDMATERIALPROPERTIES:"IfcExtendedMaterialProperties",IFCEDGECURVE:"IfcEdgeCurve",IFCEDGE:"IfcEdge",IFCDRAUGHTINGPREDEFINEDTEXTFONT:"IfcDraughtingPredefinedTextFont",IFCDOCUMENTREFERENCE:"IfcDocumentReference",IFCDIMENSIONPAIR:"IfcDimensionPair",IFCDIMENSIONCALLOUTRELATIONSHIP:"IfcDimensionCalloutRelationship",IFCDERIVEDPROFILEDEF:"IfcDerivedProfileDef",IFCCURVESTYLE:"IfcCurveStyle",IFCCONVERSIONBASEDUNIT:"IfcConversionBasedUnit",IFCCONTEXTDEPENDENTUNIT:"IfcContextDependentUnit",IFCCONNECTIONPOINTECCENTRICITY:"IfcConnectionPointEccentricity",IFCCONNECTIONCURVEGEOMETRY:"IfcConnectionCurveGeometry",IFCCONNECTEDFACESET:"IfcConnectedFaceSet",IFCCOMPOSITEPROFILEDEF:"IfcCompositeProfileDef",IFCCOMPLEXPROPERTY:"IfcComplexProperty",IFCCOLOURRGB:"IfcColourRgb",IFCCLASSIFICATIONREFERENCE:"IfcClassificationReference",IFCCENTERLINEPROFILEDEF:"IfcCenterLineProfileDef",IFCBLOBTEXTURE:"IfcBlobTexture",IFCARBITRARYPROFILEDEFWITHVOIDS:"IfcArbitraryProfileDefWithVoids",IFCARBITRARYOPENPROFILEDEF:"IfcArbitraryOpenProfileDef",IFCARBITRARYCLOSEDPROFILEDEF:"IfcArbitraryClosedProfileDef",IFCANNOTATIONTEXTOCCURRENCE:"IfcAnnotationTextOccurrence",IFCANNOTATIONSYMBOLOCCURRENCE:"IfcAnnotationSymbolOccurrence",IFCANNOTATIONSURFACEOCCURRENCE:"IfcAnnotationSurfaceOccurrence",IFCANNOTATIONOCCURRENCE:"IfcAnnotationOccurrence",IFCWATERPROPERTIES:"IfcWaterProperties",IFCVIRTUALGRIDINTERSECTION:"IfcVirtualGridIntersection",IFCVERTEXPOINT:"IfcVertexPoint",IFCVERTEXBASEDTEXTUREMAP:"IfcVertexBasedTextureMap",IFCVERTEX:"IfcVertex",IFCUNITASSIGNMENT:"IfcUnitAssignment",IFCTOPOLOGYREPRESENTATION:"IfcTopologyRepresentation",IFCTOPOLOGICALREPRESENTATIONITEM:"IfcTopologicalRepresentationItem",IFCTIMESERIESVALUE:"IfcTimeSeriesValue",IFCTIMESERIESREFERENCERELATIONSHIP:"IfcTimeSeriesReferenceRelationship",IFCTIMESERIES:"IfcTimeSeries",IFCTHERMALMATERIALPROPERTIES:"IfcThermalMaterialProperties",IFCTEXTUREVERTEX:"IfcTextureVertex",IFCTEXTUREMAP:"IfcTextureMap",IFCTEXTURECOORDINATEGENERATOR:"IfcTextureCoordinateGenerator",IFCTEXTURECOORDINATE:"IfcTextureCoordinate",IFCTEXTSTYLEWITHBOXCHARACTERISTICS:"IfcTextStyleWithBoxCharacteristics",IFCTEXTSTYLETEXTMODEL:"IfcTextStyleTextModel",IFCTEXTSTYLEFORDEFINEDFONT:"IfcTextStyleForDefinedFont",IFCTEXTSTYLEFONTMODEL:"IfcTextStyleFontModel",IFCTEXTSTYLE:"IfcTextStyle",IFCTELECOMADDRESS:"IfcTelecomAddress",IFCTABLEROW:"IfcTableRow",IFCTABLE:"IfcTable",IFCSYMBOLSTYLE:"IfcSymbolStyle",IFCSURFACETEXTURE:"IfcSurfaceTexture",IFCSURFACESTYLEWITHTEXTURES:"IfcSurfaceStyleWithTextures",IFCSURFACESTYLESHADING:"IfcSurfaceStyleShading",IFCSURFACESTYLEREFRACTION:"IfcSurfaceStyleRefraction",IFCSURFACESTYLELIGHTING:"IfcSurfaceStyleLighting",IFCSURFACESTYLE:"IfcSurfaceStyle",IFCSTYLEDREPRESENTATION:"IfcStyledRepresentation",IFCSTYLEDITEM:"IfcStyledItem",IFCSTYLEMODEL:"IfcStyleModel",IFCSTRUCTURALLOADTEMPERATURE:"IfcStructuralLoadTemperature",IFCSTRUCTURALLOADSTATIC:"IfcStructuralLoadStatic",IFCSTRUCTURALLOAD:"IfcStructuralLoad",IFCSTRUCTURALCONNECTIONCONDITION:"IfcStructuralConnectionCondition",IFCSIMPLEPROPERTY:"IfcSimpleProperty",IFCSHAPEREPRESENTATION:"IfcShapeRepresentation",IFCSHAPEMODEL:"IfcShapeModel",IFCSHAPEASPECT:"IfcShapeAspect",IFCSECTIONREINFORCEMENTPROPERTIES:"IfcSectionReinforcementProperties",IFCSECTIONPROPERTIES:"IfcSectionProperties",IFCSIUNIT:"IfcSIUnit",IFCROOT:"IfcRoot",IFCRIBPLATEPROFILEPROPERTIES:"IfcRibPlateProfileProperties",IFCREPRESENTATIONMAP:"IfcRepresentationMap",IFCREPRESENTATIONITEM:"IfcRepresentationItem",IFCREPRESENTATIONCONTEXT:"IfcRepresentationContext",IFCREPRESENTATION:"IfcRepresentation",IFCRELAXATION:"IfcRelaxation",IFCREINFORCEMENTBARPROPERTIES:"IfcReinforcementBarProperties",IFCREFERENCESVALUEDOCUMENT:"IfcReferencesValueDocument",IFCQUANTITYWEIGHT:"IfcQuantityWeight",IFCQUANTITYVOLUME:"IfcQuantityVolume",IFCQUANTITYTIME:"IfcQuantityTime",IFCQUANTITYLENGTH:"IfcQuantityLength",IFCQUANTITYCOUNT:"IfcQuantityCount",IFCQUANTITYAREA:"IfcQuantityArea",IFCPROPERTYENUMERATION:"IfcPropertyEnumeration",IFCPROPERTYDEPENDENCYRELATIONSHIP:"IfcPropertyDependencyRelationship",IFCPROPERTYCONSTRAINTRELATIONSHIP:"IfcPropertyConstraintRelationship",IFCPROPERTY:"IfcProperty",IFCPROFILEPROPERTIES:"IfcProfileProperties",IFCPROFILEDEF:"IfcProfileDef",IFCPRODUCTSOFCOMBUSTIONPROPERTIES:"IfcProductsOfCombustionProperties",IFCPRODUCTREPRESENTATION:"IfcProductRepresentation",IFCPRESENTATIONSTYLEASSIGNMENT:"IfcPresentationStyleAssignment",IFCPRESENTATIONSTYLE:"IfcPresentationStyle",IFCPRESENTATIONLAYERWITHSTYLE:"IfcPresentationLayerWithStyle",IFCPRESENTATIONLAYERASSIGNMENT:"IfcPresentationLayerAssignment",IFCPREDEFINEDTEXTFONT:"IfcPredefinedTextFont",IFCPREDEFINEDTERMINATORSYMBOL:"IfcPredefinedTerminatorSymbol",IFCPREDEFINEDSYMBOL:"IfcPredefinedSymbol",IFCPREDEFINEDITEM:"IfcPredefinedItem",IFCPOSTALADDRESS:"IfcPostalAddress",IFCPHYSICALSIMPLEQUANTITY:"IfcPhysicalSimpleQuantity",IFCPHYSICALQUANTITY:"IfcPhysicalQuantity",IFCPERSONANDORGANIZATION:"IfcPersonAndOrganization",IFCPERSON:"IfcPerson",IFCOWNERHISTORY:"IfcOwnerHistory",IFCORGANIZATIONRELATIONSHIP:"IfcOrganizationRelationship",IFCORGANIZATION:"IfcOrganization",IFCOPTICALMATERIALPROPERTIES:"IfcOpticalMaterialProperties",IFCOBJECTIVE:"IfcObjective",IFCOBJECTPLACEMENT:"IfcObjectPlacement",IFCNAMEDUNIT:"IfcNamedUnit",IFCMONETARYUNIT:"IfcMonetaryUnit",IFCMETRIC:"IfcMetric",IFCMECHANICALSTEELMATERIALPROPERTIES:"IfcMechanicalSteelMaterialProperties",IFCMECHANICALMATERIALPROPERTIES:"IfcMechanicalMaterialProperties",IFCMEASUREWITHUNIT:"IfcMeasureWithUnit",IFCMATERIALPROPERTIES:"IfcMaterialProperties",IFCMATERIALLIST:"IfcMaterialList",IFCMATERIALLAYERSETUSAGE:"IfcMaterialLayerSetUsage",IFCMATERIALLAYERSET:"IfcMaterialLayerSet",IFCMATERIALLAYER:"IfcMaterialLayer",IFCMATERIALCLASSIFICATIONRELATIONSHIP:"IfcMaterialClassificationRelationship",IFCMATERIAL:"IfcMaterial",IFCLOCALTIME:"IfcLocalTime",IFCLIGHTINTENSITYDISTRIBUTION:"IfcLightIntensityDistribution",IFCLIGHTDISTRIBUTIONDATA:"IfcLightDistributionData",IFCLIBRARYREFERENCE:"IfcLibraryReference",IFCLIBRARYINFORMATION:"IfcLibraryInformation",IFCIRREGULARTIMESERIESVALUE:"IfcIrregularTimeSeriesValue",IFCGRIDAXIS:"IfcGridAxis",IFCEXTERNALLYDEFINEDTEXTFONT:"IfcExternallyDefinedTextFont",IFCEXTERNALLYDEFINEDSYMBOL:"IfcExternallyDefinedSymbol",IFCEXTERNALLYDEFINEDSURFACESTYLE:"IfcExternallyDefinedSurfaceStyle",IFCEXTERNALLYDEFINEDHATCHSTYLE:"IfcExternallyDefinedHatchStyle",IFCEXTERNALREFERENCE:"IfcExternalReference",IFCENVIRONMENTALIMPACTVALUE:"IfcEnvironmentalImpactValue",IFCDRAUGHTINGCALLOUTRELATIONSHIP:"IfcDraughtingCalloutRelationship",IFCDOCUMENTINFORMATIONRELATIONSHIP:"IfcDocumentInformationRelationship",IFCDOCUMENTINFORMATION:"IfcDocumentInformation",IFCDOCUMENTELECTRONICFORMAT:"IfcDocumentElectronicFormat",IFCDIMENSIONALEXPONENTS:"IfcDimensionalExponents",IFCDERIVEDUNITELEMENT:"IfcDerivedUnitElement",IFCDERIVEDUNIT:"IfcDerivedUnit",IFCDATEANDTIME:"IfcDateAndTime",IFCCURVESTYLEFONTPATTERN:"IfcCurveStyleFontPattern",IFCCURVESTYLEFONTANDSCALING:"IfcCurveStyleFontAndScaling",IFCCURVESTYLEFONT:"IfcCurveStyleFont",IFCCURRENCYRELATIONSHIP:"IfcCurrencyRelationship",IFCCOSTVALUE:"IfcCostValue",IFCCOORDINATEDUNIVERSALTIMEOFFSET:"IfcCoordinatedUniversalTimeOffset",IFCCONSTRAINTRELATIONSHIP:"IfcConstraintRelationship",IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP:"IfcConstraintClassificationRelationship",IFCCONSTRAINTAGGREGATIONRELATIONSHIP:"IfcConstraintAggregationRelationship",IFCCONSTRAINT:"IfcConstraint",IFCCONNECTIONSURFACEGEOMETRY:"IfcConnectionSurfaceGeometry",IFCCONNECTIONPORTGEOMETRY:"IfcConnectionPortGeometry",IFCCONNECTIONPOINTGEOMETRY:"IfcConnectionPointGeometry",IFCCONNECTIONGEOMETRY:"IfcConnectionGeometry",IFCCOLOURSPECIFICATION:"IfcColourSpecification",IFCCLASSIFICATIONNOTATIONFACET:"IfcClassificationNotationFacet",IFCCLASSIFICATIONNOTATION:"IfcClassificationNotation",IFCCLASSIFICATIONITEMRELATIONSHIP:"IfcClassificationItemRelationship",IFCCLASSIFICATIONITEM:"IfcClassificationItem",IFCCLASSIFICATION:"IfcClassification",IFCCALENDARDATE:"IfcCalendarDate",IFCBOUNDARYNODECONDITIONWARPING:"IfcBoundaryNodeConditionWarping",IFCBOUNDARYNODECONDITION:"IfcBoundaryNodeCondition",IFCBOUNDARYFACECONDITION:"IfcBoundaryFaceCondition",IFCBOUNDARYEDGECONDITION:"IfcBoundaryEdgeCondition",IFCBOUNDARYCONDITION:"IfcBoundaryCondition",IFCAPPROVALRELATIONSHIP:"IfcApprovalRelationship",IFCAPPROVALPROPERTYRELATIONSHIP:"IfcApprovalPropertyRelationship",IFCAPPROVALACTORRELATIONSHIP:"IfcApprovalActorRelationship",IFCAPPROVAL:"IfcApproval",IFCAPPLIEDVALUERELATIONSHIP:"IfcAppliedValueRelationship",IFCAPPLIEDVALUE:"IfcAppliedValue",IFCAPPLICATION:"IfcApplication",IFCADDRESS:"IfcAddress",IFCACTORROLE:"IfcActorRole"};class Nc{constructor(){C(this,"factor",1);C(this,"complement",1)}apply(i){const e=this.getScaleMatrix().multiply(i);i.copy(e)}setUp(i){var n,r,o;this.factor=1;const t=this.getLengthUnits(i);if(!t)return;const e=t==null,s=t.Name===void 0||t.Name===null;e||s||(t.Name.value==="FOOT"&&(this.factor=.3048),((n=t.Prefix)==null?void 0:n.value)==="MILLI"?this.complement=.001:((r=t.Prefix)==null?void 0:r.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(i){try{const e=i.GetLineIDsWithType(0,k.IFCUNITASSIGNMENT).get(0),s=i.GetLine(0,e);for(const n of s.Units){if(!n||n.value===null||n.value===void 0)continue;const r=i.GetLine(0,n.value);if(r.UnitType&&r.UnitType.value==="LENGTHUNIT")return r}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const i=this.factor;return new b.Matrix4().fromArray([i,0,0,0,0,i,0,0,0,0,i,0,0,0,0,1])}}class co{constructor(){C(this,"itemsByFloor",{});C(this,"_units",new Nc)}setUp(i){this._units.setUp(i),this.cleanUp();try{const t=i.GetLineIDsWithType(0,k.IFCRELCONTAINEDINSPATIALSTRUCTURE),e=new Set,s=i.GetLineIDsWithType(0,k.IFCSPACE);for(let l=0;l<s.size();l++)e.add(s.get(l));const n=i.GetLineIDsWithType(0,k.IFCRELAGGREGATES),r=n.size();for(let l=0;l<r;l++){const h=n.get(l),f=i.GetLine(0,h);if(!f||!f.RelatingObject||!f.RelatedObjects)continue;const I=f.RelatingObject.value,u=f.RelatedObjects;for(const d of u){const E=d.value;e.has(E)&&(this.itemsByFloor[E]=I)}}const o={},a=t.size();for(let l=0;l<a;l++){const h=t.get(l),f=i.GetLine(0,h);if(!f||!f.RelatingStructure||!f.RelatedElements)continue;const I=f.RelatingStructure.value,u=f.RelatedElements;if(e.has(I))for(const d of u){o[I]||(o[I]=[]);const E=d.value;o[I].push(E)}else for(const d of u){const E=d.value;this.itemsByFloor[E]=I}}for(const l in o){const h=this.itemsByFloor[l];if(h!==void 0){const f=o[l];for(const I of f)this.itemsByFloor[I]=h}}for(let l=0;l<r;l++){const h=n.get(l),f=i.GetLine(0,h);if(!f||!f.RelatingObject||!f.RelatedObjects)continue;const I=f.RelatingObject.value,u=f.RelatedObjects;for(const d of u){const E=d.value,T=this.itemsByFloor[I];T!==void 0&&(this.itemsByFloor[E]=T)}}}catch{console.log("Could not get floors.")}}cleanUp(){this.itemsByFloor={}}}class zs{constructor(){C(this,"includeProperties",!0);C(this,"optionalCategories",[k.IFCSPACE]);C(this,"wasm",{path:"",absolute:!1,logLevel:k.LogLevel.LOG_LEVEL_OFF});C(this,"excludedCategories",new Set);C(this,"includedCategories",new Set);C(this,"saveLocations",!1);C(this,"webIfc",{COORDINATE_TO_ORIGIN:!0});C(this,"autoSetWasm",!0);C(this,"customLocateFileHandler",null)}}class lo{constructor(){C(this,"defLineMat",new b.LineBasicMaterial({color:16777215}))}read(i){const t=i.GetAllAlignments(0),e=i.GetAllCrossSections2D(0),s=i.GetAllCrossSections3D(0),n={IfcAlignment:t,IfcCrossSection2D:e,IfcCrossSection3D:s};return this.get(n)}get(i){if(i.IfcAlignment){const t=new Map;for(const e of i.IfcAlignment){const s=new jt.Alignment;s.absolute=this.getCurves(e.curve3D,s),s.horizontal=this.getCurves(e.horizontal,s),s.vertical=this.getCurves(e.vertical,s),t.set(t.size,s)}return{alignments:t,coordinationMatrix:new b.Matrix4}}}getCurves(i,t){const e=[];let s=0;for(const n of i){const r={};if(n.data)for(const I of n.data){const[u,d]=I.split(": "),E=parseFloat(d);r[u]=E||d}const{points:o}=n,a=new Float32Array(o.length*3);for(let I=0;I<o.length;I++){const{x:u,y:d,z:E}=o[I];a[I*3]=u,a[I*3+1]=d,a[I*3+2]=E||0}const l=new b.BufferAttribute(a,3),h=new b.EdgesGeometry;h.setAttribute("position",l);const f=new jt.CurveMesh(s,r,t,h,this.defLineMat);e.push(f.curve),s++}return e}}class ho{getNameInfo(i){var f;const t={},{arguments:e}=i.GetHeaderLine(0,k.FILE_NAME)||{};if(!e)return t;const[s,n,r,o,a,l,h]=e;if(s!=null&&s.value&&(t.name=s.value),n!=null&&n.value&&(t.creationDate=new Date(n.value)),r){t.author={};const[I,u]=r;I!=null&&I.value&&(t.author.name=I.value),u!=null&&u.value&&(t.author.email=u.value)}return o&&((f=o[0])!=null&&f.value)&&(t.organization=o[0].value),a!=null&&a.value&&(t.preprocessorVersion=a==null?void 0:a.value),l!=null&&l.value&&(t.originatingSystem=l==null?void 0:l.value),h!=null&&h.value&&(t.authorization=h==null?void 0:h.value),t}getDescriptionInfo(i){var r;const t={},{arguments:e}=i.GetHeaderLine(0,k.FILE_DESCRIPTION)||{};if(!e)return t;const[s,n]=e;if(Array.isArray(s)&&((r=s[0])!=null&&r.value)){const o=s[0].value.match(/\[([^\]]+)\]/);o&&o[1]&&(t.viewDefinition=o[1])}return n!=null&&n.value&&(t.implementationLevel=n.value),t}}class uo{static get(i,t){const e=[k.IFCPROJECT,k.IFCSITE,k.IFCBUILDING,k.IFCBUILDINGSTOREY,k.IFCSPACE,k.IFCROAD,k.IFCFACILITY,k.IFCFACILITYPART,k.IFCBRIDGE],s=i.data;for(const n of e){const r=t.GetLineIDsWithType(0,n),o=r.size();for(let a=0;a<o;a++){const l=r.get(a);s.has(l)||s.set(l,[[],[0,n]])}}}}const Vn=new Set([1123145078,574549367,1675464909,2059837836,3798115385,32440307,3125803723,3207858831,2740243338,2624227202,4240577450,3615266464,3724593414,220341763,477187591,1878645084,1300840506,3303107099,1607154358,1878645084,846575682,1351298697,2417041796,3049322572,3331915920,1416205885,776857604,3285139300,3958052878,2827736869,2732653382,673634403,3448662350,4142052618,2924175390,803316827,2556980723,1809719519,2205249479,807026263,3737207727,1660063152,2347385850,2705031697,3732776249,2485617015,2611217952,1704287377,2937912522,2770003689,1281925730,1484403080,3448662350,4142052618,3800577675,4006246654,3590301190,1383045692,2775532180,2047409740,370225590,3593883385,2665983363,4124623270,812098782,3649129432,987898635,1105321065,3510044353,1635779807,2603310189,3406155212,1310608509,4261334040,2736907675,3649129432,1136057603,1260505505,4182860854,2713105998,2898889636,59481748,3749851601,3486308946,3150382593,1062206242,3264961684,15328376,1485152156,370225590,1981873012,2859738748,45288368,2614616156,2732653382,775493141,2147822146,2601014836,2629017746,1186437898,2367409068,1213902940,3632507154,3900360178,476780140,1472233963,2804161546,3008276851,738692330,374418227,315944413,3905492369,3570813810,2571569899,178912537,2294589976,1437953363,2133299955,572779678,3092502836,388784114,2624227202,1425443689,3057273783,2347385850,1682466193,2519244187,2839578677,3958567839,2513912981,2830218821,427810014]),Os=class Os extends mt{constructor(t){super(t);C(this,"enabled",!0);t.add(Os.uuid,this)}async export(t,e,s=!1,n=!0){const r={},o=new Set(t.GetIfcEntityList(e)),a=new Set([k.IFCPROJECT,k.IFCSITE,k.IFCBUILDING,k.IFCBUILDINGSTOREY,k.IFCSPACE]);for(const l of a)o.add(l);for(const l of o){if(Vn.has(l))continue;const h=a.has(l)&&n,f=t.GetLineIDsWithType(e,l);for(const I of f)try{const u=t.GetLine(0,I,h,s);r[u.expressID]=u}catch{console.log(`Could not get property ${I}, with recursive ${h} and indirect ${s}.`)}}return r}};C(Os,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let ds=Os;const Oi=class Oi extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onIfcStartedLoading",new q);C(this,"onSetup",new q);C(this,"settings",new zs);C(this,"webIfc",new k.IfcAPI);C(this,"enabled",!0);C(this,"_material",new b.MeshLambertMaterial);C(this,"_spatialTree",new co);C(this,"_metaData",new ho);C(this,"_fragmentInstances",new Map);C(this,"_civil",new lo);C(this,"_visitedFragments",new Map);C(this,"_materialT",new b.MeshLambertMaterial({transparent:!0,opacity:.5}));this.components.add(Oi.uuid,this),this.settings.excludedCategories.add(k.IFCOPENINGELEMENT)}dispose(){this.webIfc=null,this.onDisposed.trigger(Oi.uuid),this.onDisposed.reset()}async setup(t){this.settings={...this.settings,...t},this.settings.autoSetWasm&&await this.autoSetWasm(),this.onSetup.trigger()}async load(t,e=!0,s=""){const n=performance.now();this.onIfcStartedLoading.trigger(),await this.readIfcFile(t);const r=await this.getAllGeometries();r.name=s;const a=await this.components.get(ds).export(this.webIfc,0);r.setLocalProperties(a);const l=this.components.get(pt);l.groups.set(r.uuid,r);for(const h of r.items)l.list.set(h.id,h),h.mesh.uuid=h.id,h.group=r;l.onFragmentsLoaded.trigger(r),e&&l.coordinate([r]);for(const[h]of r.data){const f=a[h];if(!f||!f.GlobalId)continue;const I=f.GlobalId.value||f.GlobalId;r.globalToExpressIDs.set(I,h)}return uo.get(r,this.webIfc),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-n} ms!`),r}async readIfcFile(t){const{path:e,absolute:s,logLevel:n}=this.settings.wasm;return this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(this.settings.customLocateFileHandler||void 0),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(t,this.settings.webIfc)}cleanUp(){try{this.webIfc.Dispose()}catch{console.log("Web-ifc wasn't disposed.")}this.webIfc=null,this.webIfc=new k.IfcAPI,this._visitedFragments.clear(),this._fragmentInstances.clear()}async getAllGeometries(){this._spatialTree.setUp(this.webIfc);const t=this.webIfc.GetIfcEntityList(0),e=new jt.FragmentsGroup;e.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};const s=[];for(const r of t){if(!this.webIfc.IsIfcElement(r)&&r!==k.IFCSPACE)continue;const o=this.settings.includedCategories;if(o.size>0&&!o.has(r))continue;if(this.settings.excludedCategories.has(r))continue;const a=this.webIfc.GetLineIDsWithType(0,r),l=a.size();for(let h=0;h<l;h++){const f=a.get(h);s.push(f);const I=this._spatialTree.itemsByFloor[f]||0;e.data.set(f,[[],[I,r]])}}this._spatialTree.cleanUp(),this.webIfc.StreamMeshes(0,s,r=>{this.getMesh(r,e)});for(const r of this._visitedFragments){const{index:o,fragment:a}=r[1];e.keyFragments.set(o,a.id)}for(const r of e.items){const o=this._fragmentInstances.get(r.id);if(!o)throw new Error("Fragment not found!");const a=[];for(const[l,h]of o)a.push(h);r.add(a)}const n=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(n),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),n=t.expressID;for(let r=0;r<s;r++){const o=t.geometries.get(r),{x:a,y:l,z:h,w:f}=o.color,I=f!==1,{geometryExpressID:u}=o,d=`${u}-${I}`;if(!this._visitedFragments.has(d)){const S=this.getGeometry(this.webIfc,u),N=I?this._materialT:this._material,L=new jt.Fragment(S,N,1);e.add(L.mesh),e.items.push(L);const D=this._visitedFragments.size;this._visitedFragments.set(d,{index:D,fragment:L})}const E=new b.Color().setRGB(a,l,h,"srgb"),T=new b.Matrix4;T.fromArray(o.flatTransformation);const p=this._visitedFragments.get(d);if(p===void 0)throw new Error("Error getting geometry data for streaming!");const m=e.data.get(n);if(!m)throw new Error("Data not found!");m[0].push(p.index);const{fragment:F}=p;this._fragmentInstances.has(F.id)||this._fragmentInstances.set(F.id,new Map);const R=this._fragmentInstances.get(F.id);if(!R)throw new Error("Instances not found!");if(R.has(n)){const S=R.get(n);if(!S)throw new Error("Instance not found!");S.transforms.push(T),S.colors&&S.colors.push(E)}else R.set(n,{id:n,transforms:[T],colors:[E]})}}getGeometry(t,e){const s=t.GetGeometry(0,e),n=t.GetIndexArray(s.GetIndexData(),s.GetIndexDataSize()),r=t.GetVertexArray(s.GetVertexData(),s.GetVertexDataSize()),o=new Float32Array(r.length/2),a=new Float32Array(r.length/2);for(let I=0;I<r.length;I+=6)o[I/2]=r[I],o[I/2+1]=r[I+1],o[I/2+2]=r[I+2],a[I/2]=r[I+3],a[I/2+1]=r[I+4],a[I/2+2]=r[I+5];const l=new b.BufferGeometry,h=new b.BufferAttribute(o,3),f=new b.BufferAttribute(a,3);return l.setAttribute("position",h),l.setAttribute("normal",f),l.setIndex(Array.from(n)),s.delete(),l}async autoSetWasm(){const t=await fetch(`https://unpkg.com/@thatopen/components@${Li.release}/package.json`);if(!t.ok){console.warn("Couldn't get openbim-components package.json. Set wasm settings manually.");return}const e=await t.json();if(!("web-ifc"in e.peerDependencies))console.warn("Couldn't get web-ifc from peer dependencies in openbim-components. Set wasm settings manually.");else{const s=e.peerDependencies["web-ifc"];this.settings.wasm.path=`https://unpkg.com/web-ifc@${s}/`,this.settings.wasm.absolute=!0}}};C(Oi,"uuid","a659add7-1418-4771-a0d6-7d4d438e4624");let Es=Oi;const fo={IfcRelAssignsToControl:{related:5,relating:7},IfcRelAssignsToGroup:{related:5,relating:7},IfcRelAssignsToProduct:{related:5,relating:7},IfcRelAssociatesClassification:{related:5,relating:6},IfcRelAssociatesMaterial:{related:5,relating:6},IfcRelAssociatesDocument:{related:5,relating:6},IfcRelContainedInSpatialStructure:{related:5,relating:6},IfcRelFlowControlElements:{related:5,relating:6},IfcRelConnectsElements:{related:7,relating:6},IfcRelDeclares:{related:6,relating:5},IfcRelAggregates:{related:6,relating:5},IfcRelNests:{related:6,relating:5},IfcRelDefinesByProperties:{related:5,relating:6},IfcRelDefinesByType:{related:5,relating:6},IfcRelDefinesByTemplate:{related:5,relating:6}},Io={[k.IFCRELASSIGNSTOCONTROL]:"IfcRelAssignsToControl",[k.IFCRELASSIGNSTOGROUP]:"IfcRelAssignsToGroup",[k.IFCRELASSIGNSTOPRODUCT]:"IfcRelAssignsToProduct",[k.IFCRELASSOCIATESCLASSIFICATION]:"IfcRelAssociatesClassification",[k.IFCRELASSOCIATESMATERIAL]:"IfcRelAssociatesMaterial",[k.IFCRELASSOCIATESDOCUMENT]:"IfcRelAssociatesDocument",[k.IFCRELCONTAINEDINSPATIALSTRUCTURE]:"IfcRelContainedInSpatialStructure",[k.IFCRELCONNECTSELEMENTS]:"IfcRelConnectsElements",[k.IFCRELFLOWCONTROLELEMENTS]:"IfcRelFlowControlElements",[k.IFCRELDECLARES]:"IfcRelDeclares",[k.IFCRELAGGREGATES]:"IfcRelAggregates",[k.IFCRELNESTS]:"IfcRelNests",[k.IFCRELDEFINESBYPROPERTIES]:"IfcRelDefinesByProperties",[k.IFCRELDEFINESBYTYPE]:"IfcRelDefinesByType",[k.IFCRELDEFINESBYTEMPLATE]:"IfcRelDefinesByTemplate"},Ae=class Ae extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onRequestFile",new q);C(this,"ifcToExport",null);C(this,"onElementToPset",new q);C(this,"onPropToPset",new q);C(this,"onPsetRemoved",new q);C(this,"onDataChanged",new q);C(this,"wasm",{path:"/",absolute:!1});C(this,"enabled",!0);C(this,"attributeListeners",{});C(this,"selectedModel");C(this,"changeMap",{});this.components.add(Ae.uuid,this)}dispose(){this.selectedModel=void 0,this.attributeListeners={},this.changeMap={},this.onElementToPset.reset(),this.onPropToPset.reset(),this.onPsetRemoved.reset(),this.onDataChanged.reset(),this.onDisposed.trigger(Ae.uuid),this.onDisposed.reset()}static getIFCSchema(t){const e=t.ifcMetadata.schema;if(!e)throw new Error("IFC Schema not found");return e.startsWith("IFC2X3")?"IFC2X3":e.startsWith("IFC4")&&e.replace("IFC4","")===""?"IFC4":e.startsWith("IFC4X3")?"IFC4X3":e}async setData(t,...e){for(const s of e){const{expressID:n}=s;(!n||n===-1)&&(s.expressID=this.getNewExpressID(t)),await t.setProperties(s.expressID,s),this.registerChange(t,s.expressID)}}async newPset(t,e,s){const n=Ae.getIFCSchema(t),{ownerHistoryHandle:r}=await this.getOwnerHistory(t),o=this.newGUID(t),a=new k[n].IfcLabel(e),l=s?new k[n].IfcText(s):null,h=new k[n].IfcPropertySet(o,r,a,l,[]);h.expressID=this.getNewExpressID(t);const f=this.newGUID(t),I=new k[n].IfcRelDefinesByProperties(f,r,null,null,[],new k.Handle(h.expressID));return I.expressID=this.getNewExpressID(t),await this.setData(t,h,I),{pset:h,rel:I}}async removePset(t,...e){for(const s of e){const n=await t.getProperties(s);if((n==null?void 0:n.type)!==k.IFCPROPERTYSET)continue;const r=await be.getPsetRel(t,s);if(r&&(await t.setProperties(r,null),this.registerChange(t,r)),n){for(const o of n.HasProperties)await t.setProperties(o.value,null);await t.setProperties(s,null),this.onPsetRemoved.trigger({model:t,psetID:s}),this.registerChange(t,s)}}}newSingleStringProperty(t,e,s,n){return this.newSingleProperty(t,e,s,n)}newSingleNumericProperty(t,e,s,n){return this.newSingleProperty(t,e,s,n)}newSingleBooleanProperty(t,e,s,n){return this.newSingleProperty(t,e,s,n)}async removePsetProp(t,e,s){const n=await t.getProperties(e),r=await t.getProperties(s);!n||!r||n.type===k.IFCPROPERTYSET&&r&&(n.HasProperties=n.HasProperties.filter(o=>o.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}addElementToPset(t,e,...s){this.components.get(Bt).addEntitiesRelation(t,e,{type:k.IFCRELDEFINESBYPROPERTIES,inv:"IsDefinedBy"},...s)}async addPropToPset(t,e,...s){const n=await t.getProperties(e);if(n){for(const r of s){if(n.HasProperties.includes(r))continue;const o=new k.Handle(r);n.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:r})}this.registerChange(t,e)}}async createIfcRel(t,e,s,n){const r=Io[e];if(!r)throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const o=t.ifcMetadata.schema,a=fo[r],l=k[o][r];if(!(a&&l))throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const h=[new k[o].IfcGloballyUniqueId(Kt.create())],{related:f,relating:I}=a,d=[...new Set(n)].map(p=>new k.Handle(p)),E=(p,m)=>{for(let F=p;F<m-1;F++)h.push(null)};f<I?(E(1,f),h.push(d),E(f,I),h.push(new k.Handle(s))):(E(1,I),E(I,f),h.push(new k.Handle(s)),h.push(d));const T=new l(...h);return await this.setData(t,T),T}async saveToIfc(t,e){const s=this.components.get(Es),n=s.webIfc,r=await s.readIfcFile(e);await this.components.get(Bt).applyRelationChanges();const a=this.changeMap[t.uuid]??[];for(const h of a){const f=await t.getProperties(h);f?n.WriteLine(r,f):n.DeleteLine(r,h)}const l=n.SaveModel(r);return s.webIfc.CloseModel(r),s.cleanUp(),l}async getEntityRef(t,e){const s=await t.getAllPropertiesOfType(e);if(!s)return null;const n=[];for(const r in s){const o=new k.Handle(Number(r));n.push(o)}return n}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const n=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(n)return n;const r=await t.getProperties(e);if(!r)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=r[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const a=o.value;if(a===void 0||a==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const l=new q;return Object.defineProperty(r[s],"value",{get(){return this._value},async set(h){this._value=h,l.trigger(h)}}),r[s].value=a,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=l,l}getNewExpressID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=Ae.getIFCSchema(t);return new k[e].IfcGloballyUniqueId(Kt.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(k.IFCOWNERHISTORY);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),n=e[s[0]],r=new k.Handle(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,n){const r=Ae.getIFCSchema(t),o=new k[r].IfcIdentifier(s),a=new k[r][e](n),l=new k[r].IfcPropertySingleValue(o,null,a,null);return l.expressID=this.getNewExpressID(t),await this.setData(t,l),l}};C(Ae,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let ps=Ae;const Ni=class Ni extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onRelationsIndexed",new q);C(this,"relationMaps",{});C(this,"enabled",!0);C(this,"_relToAttributesMap",Sn);C(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom","ReferencedBy","Declares","HasContext","Controls","IsNestedBy","Nests","DocumentRefForObjects"]);C(this,"_ifcRels",[k.IFCRELAGGREGATES,k.IFCRELASSOCIATESMATERIAL,k.IFCRELASSOCIATESCLASSIFICATION,k.IFCRELASSIGNSTOGROUP,k.IFCRELDEFINESBYPROPERTIES,k.IFCRELDEFINESBYTYPE,k.IFCRELDEFINESBYTEMPLATE,k.IFCRELCONTAINEDINSPATIALSTRUCTURE,k.IFCRELFLOWCONTROLELEMENTS,k.IFCRELCONNECTSELEMENTS,k.IFCRELASSIGNSTOPRODUCT,k.IFCRELDECLARES,k.IFCRELASSIGNSTOCONTROL,k.IFCRELNESTS,k.IFCRELASSOCIATESDOCUMENT]);C(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});C(this,"_changeMap",{});C(this,"onEntitiesRelated",new q);this.components.add(Ni.uuid,this),t.get(pt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,n){const r=Object.keys(e).find(f=>f.startsWith("Relating")),o=Object.keys(e).find(f=>f.startsWith("Related"));if(!(r&&o))return;const a=e[r].value,l=e[o].map(f=>f.value),h=this.getAttributeIndex(n);if(h!==null){let f=t.get(a);f||(f=new Map,t.set(a,f));let I=f.get(h);I||(I=[],f.set(h,I));for(const u of l)I.push(u)}for(const f of l){const I=this.getAttributeIndex(s);if(I===null)continue;let u=t.get(f);u||(u=new Map,t.set(f,u));let d=u.get(I);d||(d=[],u.set(I,d)),d.push(a)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const n=await t.getAllPropertiesOfType(s);if(!n)continue;const r=this._relToAttributesMap.get(s);if(!r)continue;const{forRelated:o,forRelating:a}=r;for(const l in n){const h=n[l];this.indexRelations(e,h,o,a)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const n of this._ifcRels){const r=this._relToAttributesMap.get(n);if(!r)continue;const{forRelated:o,forRelating:a}=r,l=t.GetLineIDsWithType(e,n);for(let h=0;h<l.size();h++){const f=await t.properties.getItemProperties(e,l.get(h));this.indexRelations(s,f,o,a)}}return this.onRelationsIndexed.trigger({modelID:e.toString(),relationsMap:s}),s}getEntityRelations(t,e,s){const n=t instanceof Dn.FragmentsGroup?t.uuid:t,r=this.relationMaps[n];if(!r)throw new Error(`IfcRelationsIndexer: model ${n} has no relations indexed.`);const o=r.get(e),a=this.getAttributeIndex(s);if(o===void 0||a===null)return null;const l=o.get(a);return l||null}serializeRelations(t){const e={};for(const[s,n]of t.entries()){e[s]||(e[s]={});for(const[r,o]of n.entries())e[s][r]=o}return JSON.stringify(e)}serializeModelRelations(t){const e=this.relationMaps[t.uuid];return e?this.serializeRelations(e):null}serializeAllRelations(){const t={};for(const e in this.relationMaps){const s=this.relationMaps[e],n={};for(const[r,o]of s.entries()){n[r]||(n[r]={});for(const[a,l]of o.entries())n[r][a]=l}t[e]=n}return JSON.stringify(t)}getRelationsMapFromJSON(t){const e=JSON.parse(t),s=new Map;for(const n in e){const r=e[n],o=new Map;for(const a in r)o.set(Number(a),r[a]);s.set(Number(n),o)}return s}dispose(){this.relationMaps={},this.components.get(pt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(Ni.uuid),this.onDisposed.reset()}getEntitiesWithRelation(t,e,s){const n=this.relationMaps[t.uuid];if(!n)throw new Error("IfcRelationsIndexer: the model relations are not indexed!");const r=new Set;for(const[o,a]of n){const l=this.getAttributeIndex(e);if(l===null)throw new Error("IfcRelationsIndexer: invalid inverse attribute name");const h=a.get(l);h&&h.includes(s)&&r.add(o)}return r}addEntityRelations(t,e,s,...n){const r=this.getEntityRelations(t,e,s);if(r)r.push(...n);else{const o=this.getAttributeIndex(s);if(!o)throw new Error(`IfcRelationsIndexer: ${s} is not a valid relation name.`);const a=this.relationMaps[t.uuid].get(e);a==null||a.set(o,n)}}async applyRelationChanges(){const t=this.components.get(pt),e=this.components.get(ps);for(const s in this._changeMap){const n=t.groups.get(s);if(!n)continue;const r=this._changeMap[s];for(const[o,a]of r)for(const[l,h]of a){const{related:f,relID:I}=h;if(I){const u=await n.getProperties(I);if(!u)continue;const d=Object.keys(u),E=d.find(p=>p.startsWith("Related")),T=d.find(p=>p.startsWith("Relating"));if(!(E&&T))continue;u[E]=[...f].map(p=>new k.Handle(p)),u[T]=new k.Handle(l),await e.setData(n,u)}else{const u=await e.createIfcRel(n,o,l,[...f]);if(!u)continue;h.relID=u.expressID}}}}addEntitiesRelation(t,e,s,...n){const{type:r,inv:o}=s,a=this.relationMaps[t.uuid];if(!a||!this._ifcRels.includes(r))return;const l=Sn.get(r);if(!l)return;const{forRelated:h,forRelating:f}=l;if(!(h===o||f===o))return;let I=this._changeMap[t.uuid];I||(I=new Qt,this._changeMap[t.uuid]=I);const u=f===o?[e]:n,d=h===o?[e]:n;let E=I.get(r);E||(E=new Qt,E.onItemSet.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:u,relatedIDs:d})),E.onItemUpdated.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:u,relatedIDs:d})),I.set(r,E));for(const T of u){let p=E.get(T);p||(p={related:new Ie},E.set(T,p)),p.related.add(...d)}for(const T of u){let p=a.get(T);p||(p=new Map,a.set(T,p));const m=this.getAttributeIndex(f);if(m!==null){let F=p.get(m);F||(F=[],p.set(m,F)),F.push(...d)}}for(const T of d){let p=a.get(T);p||(p=new Map,a.set(T,p));const m=this.getAttributeIndex(h);if(m===null)continue;let F=p.get(m);F||(F=[],p.set(m,F)),F.push(...u)}}getEntityChildren(t,e,s=new Set){if(s.add(e),this.relationMaps[t.uuid]===void 0)throw new Error("The provided model has no indices. You have to generate them first.");const r=this.getEntityRelations(t,e,"IsDecomposedBy");if(r)for(const a of r)this.getEntityChildren(t,a,s);const o=this.getEntityRelations(t,e,"ContainsElements");if(o)for(const a of o)this.getEntityChildren(t,a,s);return s}};C(Ni,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let Bt=Ni;const Ns=class Ns extends mt{constructor(t){super(t);C(this,"onDisposed",new q);C(this,"onFragmentsLoaded",new q);C(this,"onFragmentsDisposed",new q);C(this,"list",new Qt);C(this,"groups",new Qt);C(this,"baseCoordinationModel","");C(this,"baseCoordinationMatrix",new b.Matrix4);C(this,"enabled",!0);C(this,"_loader",new Dn.Serializer);this.components.add(Ns.uuid,this)}get meshes(){const t=[];for(const[e,s]of this.list)t.push(s.mesh);return t}dispose(){for(const[t,e]of this.groups)e.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(t){const{uuid:e}=t,s=[];for(const n of t.items)s.push(n.id),this.list.delete(n.id);t.dispose(!0),this.groups.delete(t.uuid),this.groups.size===0&&(this.baseCoordinationModel="",this.baseCoordinationMatrix=new b.Matrix4),this.onFragmentsDisposed.trigger({groupID:e,fragmentIDs:s})}load(t,e){const n={...{coordinate:!0},...e},{coordinate:r,name:o,properties:a,relationsMap:l}=n,h=this._loader.import(t);e&&(h.isStreamed=e.isStreamed||!1),o&&(h.name=o);for(const f of h.items)f.group=h,this.list.set(f.id,f);return r&&this.coordinate([h]),this.groups.set(h.uuid,h),a&&h.setLocalProperties(a),l&&this.components.get(Bt).setRelationMap(h,l),this.onFragmentsLoaded.trigger(h),h}export(t){return this._loader.export(t)}getModelIdMap(t){const e={};for(const s in t){const n=this.list.get(s);if(!(n&&n.group))continue;const r=n.group;r.uuid in e||(e[r.uuid]=new Set);const o=t[s];for(const a of o)e[r.uuid].add(a)}return e}modelIdToFragmentIdMap(t){let e={};for(const s in t){const n=this.groups.get(s);if(!n)continue;const r=t[s],o=n.getFragmentMap(r);e={...e,...o}}return e}guidToFragmentIdMap(t){const e={};for(const[n,r]of this.groups){n in e||(e[n]=new Set);for(const o of t){const a=r.globalToExpressIDs.get(o);a&&e[n].add(a)}}return this.modelIdToFragmentIdMap(e)}fragmentIdMapToGuids(t){const e=[],s=this.getModelIdMap(t);for(const n in s){const r=this.groups.get(n);if(!r)continue;const o=s[n];for(const a of o)for(const[l,h]of r.globalToExpressIDs.entries())if(h===a){e.push(l);break}}return e}coordinate(t=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const s=t.pop();if(!s)return;this.baseCoordinationModel=s.uuid,this.baseCoordinationMatrix=s.coordinationMatrix.clone()}if(t.length)for(const s of t)s.coordinationMatrix.equals(this.baseCoordinationMatrix)||(s.position.set(0,0,0),s.rotation.set(0,0,0),s.scale.set(1,1,1),s.updateMatrix(),this.applyBaseCoordinateSystem(s,s.coordinationMatrix))}applyBaseCoordinateSystem(t,e){e&&t.applyMatrix4(e.clone().invert()),t.applyMatrix4(this.baseCoordinationMatrix)}clone(t,e){const s=t.cloneGroup(e);this.groups.set(s.uuid,s);for(const n of s.items)this.list.set(n.id,n);return s}};C(Ns,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let pt=Ns;var os=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yc(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}function as(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Eo={exports:{}};/*!
|
|
129
129
|
|
|
130
130
|
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
131
131
|
<http://stuartk.com/jszip>
|
|
@@ -136,13 +136,13 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js
|
|
|
136
136
|
JSZip uses the library pako released under the MIT license :
|
|
137
137
|
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
138
138
|
*/(function(c,i){(function(t){c.exports=t()})(function(){return function t(e,s,n){function r(l,h){if(!s[l]){if(!e[l]){var f=typeof as=="function"&&as;if(!h&&f)return f(l,!0);if(o)return o(l,!0);var I=new Error("Cannot find module '"+l+"'");throw I.code="MODULE_NOT_FOUND",I}var u=s[l]={exports:{}};e[l][0].call(u.exports,function(d){var E=e[l][1][d];return r(E||d)},u,u.exports,t,e,s,n)}return s[l].exports}for(var o=typeof as=="function"&&as,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(t,e,s){var n=t("./utils"),r=t("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode=function(a){for(var l,h,f,I,u,d,E,T=[],p=0,m=a.length,F=m,R=n.getTypeOf(a)!=="string";p<a.length;)F=m-p,f=R?(l=a[p++],h=p<m?a[p++]:0,p<m?a[p++]:0):(l=a.charCodeAt(p++),h=p<m?a.charCodeAt(p++):0,p<m?a.charCodeAt(p++):0),I=l>>2,u=(3&l)<<4|h>>4,d=1<F?(15&h)<<2|f>>6:64,E=2<F?63&f:64,T.push(o.charAt(I)+o.charAt(u)+o.charAt(d)+o.charAt(E));return T.join("")},s.decode=function(a){var l,h,f,I,u,d,E=0,T=0,p="data:";if(a.substr(0,p.length)===p)throw new Error("Invalid base64 input, it looks like a data url.");var m,F=3*(a=a.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(a.charAt(a.length-1)===o.charAt(64)&&F--,a.charAt(a.length-2)===o.charAt(64)&&F--,F%1!=0)throw new Error("Invalid base64 input, bad content length.");for(m=r.uint8array?new Uint8Array(0|F):new Array(0|F);E<a.length;)l=o.indexOf(a.charAt(E++))<<2|(I=o.indexOf(a.charAt(E++)))>>4,h=(15&I)<<4|(u=o.indexOf(a.charAt(E++)))>>2,f=(3&u)<<6|(d=o.indexOf(a.charAt(E++))),m[T++]=l,u!==64&&(m[T++]=h),d!==64&&(m[T++]=f);return m}},{"./support":30,"./utils":32}],2:[function(t,e,s){var n=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function l(h,f,I,u,d){this.compressedSize=h,this.uncompressedSize=f,this.crc32=I,this.compression=u,this.compressedContent=d}l.prototype={getContentWorker:function(){var h=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),f=this;return h.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(h,f,I){return h.pipe(new o).pipe(new a("uncompressedSize")).pipe(f.compressWorker(I)).pipe(new a("compressedSize")).withStreamInfo("compression",f)},e.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,s){var n=t("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},s.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,s){var n=t("./utils"),r=function(){for(var o,a=[],l=0;l<256;l++){o=l;for(var h=0;h<8;h++)o=1&o?3988292384^o>>>1:o>>>1;a[l]=o}return a}();e.exports=function(o,a){return o!==void 0&&o.length?n.getTypeOf(o)!=="string"?function(l,h,f,I){var u=r,d=I+f;l^=-1;for(var E=I;E<d;E++)l=l>>>8^u[255&(l^h[E])];return-1^l}(0|a,o,o.length,0):function(l,h,f,I){var u=r,d=I+f;l^=-1;for(var E=I;E<d;E++)l=l>>>8^u[255&(l^h.charCodeAt(E))];return-1^l}(0|a,o,o.length,0):0}},{"./utils":32}],5:[function(t,e,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(t,e,s){var n=null;n=typeof Promise<"u"?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,s){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",r=t("pako"),o=t("./utils"),a=t("./stream/GenericWorker"),l=n?"uint8array":"array";function h(f,I){a.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=I,this.meta={}}s.magic="\b\0",o.inherits(h,a),h.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(l,f.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(I){f.push({data:I,meta:f.meta})}},s.compressWorker=function(f){return new h("Deflate",f)},s.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,s){function n(u,d){var E,T="";for(E=0;E<d;E++)T+=String.fromCharCode(255&u),u>>>=8;return T}function r(u,d,E,T,p,m){var F,R,S=u.file,N=u.compression,L=m!==l.utf8encode,D=o.transformTo("string",m(S.name)),P=o.transformTo("string",l.utf8encode(S.name)),v=S.comment,G=o.transformTo("string",m(v)),O=o.transformTo("string",l.utf8encode(v)),w=P.length!==S.name.length,g=O.length!==v.length,U="",Q="",z="",et=S.dir,X=S.date,nt={crc32:0,compressedSize:0,uncompressedSize:0};d&&!E||(nt.crc32=u.crc32,nt.compressedSize=u.compressedSize,nt.uncompressedSize=u.uncompressedSize);var Y=0;d&&(Y|=8),L||!w&&!g||(Y|=2048);var B=0,rt=0;et&&(B|=16),p==="UNIX"?(rt=798,B|=function(tt,Ft){var Nt=tt;return tt||(Nt=Ft?16893:33204),(65535&Nt)<<16}(S.unixPermissions,et)):(rt=20,B|=function(tt){return 63&(tt||0)}(S.dosPermissions)),F=X.getUTCHours(),F<<=6,F|=X.getUTCMinutes(),F<<=5,F|=X.getUTCSeconds()/2,R=X.getUTCFullYear()-1980,R<<=4,R|=X.getUTCMonth()+1,R<<=5,R|=X.getUTCDate(),w&&(Q=n(1,1)+n(h(D),4)+P,U+="up"+n(Q.length,2)+Q),g&&(z=n(1,1)+n(h(G),4)+O,U+="uc"+n(z.length,2)+z);var it="";return it+=`
|
|
139
|
-
\0`,it+=n(Y,2),it+=N.magic,it+=n(F,2),it+=n(R,2),it+=n(nt.crc32,4),it+=n(nt.compressedSize,4),it+=n(nt.uncompressedSize,4),it+=n(D.length,2),it+=n(U.length,2),{fileRecord:f.LOCAL_FILE_HEADER+it+D+U,dirRecord:f.CENTRAL_FILE_HEADER+n(rt,2)+it+n(G.length,2)+"\0\0\0\0"+n(B,4)+n(T,4)+D+U+G}}var o=t("../utils"),a=t("../stream/GenericWorker"),l=t("../utf8"),h=t("../crc32"),f=t("../signature");function I(u,d,E,T){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=E,this.encodeFileName=T,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(I,a),I.prototype.push=function(u){var d=u.meta.percent||0,E=this.entriesCount,T=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,a.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:E?(d+100*(E-T-1))/E:100}}))},I.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var d=this.streamFiles&&!u.file.dir;if(d){var E=r(u,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:E.fileRecord,meta:{percent:0}})}else this.accumulate=!0},I.prototype.closedSource=function(u){this.accumulate=!1;var d=this.streamFiles&&!u.file.dir,E=r(u,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(E.dirRecord),d)this.push({data:function(T){return f.DATA_DESCRIPTOR+n(T.crc32,4)+n(T.compressedSize,4)+n(T.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:E.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},I.prototype.flush=function(){for(var u=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var E=this.bytesWritten-u,T=function(p,m,F,R,S){var N=o.transformTo("string",S(R));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(p,2)+n(p,2)+n(m,4)+n(F,4)+n(N.length,2)+N}(this.dirRecords.length,E,u,this.zipComment,this.encodeFileName);this.push({data:T,meta:{percent:100}})},I.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},I.prototype.registerPrevious=function(u){this._sources.push(u);var d=this;return u.on("data",function(E){d.processChunk(E)}),u.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),u.on("error",function(E){d.error(E)}),this},I.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},I.prototype.error=function(u){var d=this._sources;if(!a.prototype.error.call(this,u))return!1;for(var E=0;E<d.length;E++)try{d[E].error(u)}catch{}return!0},I.prototype.lock=function(){a.prototype.lock.call(this);for(var u=this._sources,d=0;d<u.length;d++)u[d].lock()},e.exports=I},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,s){var n=t("../compressions"),r=t("./ZipFileWorker");s.generateWorker=function(o,a,l){var h=new r(a.streamFiles,l,a.platform,a.encodeFileName),f=0;try{o.forEach(function(I,u){f++;var d=function(m,F){var R=m||F,S=n[R];if(!S)throw new Error(R+" is not a valid compression method !");return S}(u.options.compression,a.compression),E=u.options.compressionOptions||a.compressionOptions||{},T=u.dir,p=u.date;u._compressWorker(d,E).withStreamInfo("file",{name:I,dir:T,date:p,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(h)}),h.entriesCount=f}catch(I){h.error(I)}return h}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,s){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var r=new n;for(var o in this)typeof this[o]!="function"&&(r[o]=this[o]);return r}}(n.prototype=t("./object")).loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.10.1",n.loadAsync=function(r,o){return new n().loadAsync(r,o)},n.external=t("./external"),e.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,s){var n=t("./utils"),r=t("./external"),o=t("./utf8"),a=t("./zipEntries"),l=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function f(I){return new r.Promise(function(u,d){var E=I.decompressed.getContentWorker().pipe(new l);E.on("error",function(T){d(T)}).on("end",function(){E.streamInfo.crc32!==I.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}e.exports=function(I,u){var d=this;return u=n.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),h.isNode&&h.isStream(I)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",I,!0,u.optimizedBinaryString,u.base64).then(function(E){var T=new a(u);return T.load(E),T}).then(function(E){var T=[r.Promise.resolve(E)],p=E.files;if(u.checkCRC32)for(var m=0;m<p.length;m++)T.push(f(p[m]));return r.Promise.all(T)}).then(function(E){for(var T=E.shift(),p=T.files,m=0;m<p.length;m++){var F=p[m],R=F.fileNameStr,S=n.resolve(F.fileNameStr);d.file(S,F.decompressed,{binary:!0,optimizedBinaryString:!0,date:F.date,dir:F.dir,comment:F.fileCommentStr.length?F.fileCommentStr:null,unixPermissions:F.unixPermissions,dosPermissions:F.dosPermissions,createFolders:u.createFolders}),F.dir||(d.file(S).unsafeOriginalName=R)}return T.zipComment.length&&(d.comment=T.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,s){var n=t("../utils"),r=t("../stream/GenericWorker");function o(a,l){r.call(this,"Nodejs stream input adapter for "+a),this._upstreamEnded=!1,this._bindStream(l)}n.inherits(o,r),o.prototype._bindStream=function(a){var l=this;(this._stream=a).pause(),a.on("data",function(h){l.push({data:h,meta:{percent:0}})}).on("error",function(h){l.isPaused?this.generatedError=h:l.error(h)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,s){var n=t("readable-stream").Readable;function r(o,a,l){n.call(this,a),this._helper=o;var h=this;o.on("data",function(f,I){h.push(f)||h._helper.pause(),l&&l(I)}).on("error",function(f){h.emit("error",f)}).on("end",function(){h.push(null)})}t("../utils").inherits(r,n),r.prototype._read=function(){this._helper.resume()},e.exports=r},{"../utils":32,"readable-stream":16}],14:[function(t,e,s){e.exports={isNode:typeof Buffer<"u",newBufferFrom:function(n,r){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(n,r);if(typeof n=="number")throw new Error('The "data" argument must not be a number');return new Buffer(n,r)},allocBuffer:function(n){if(Buffer.alloc)return Buffer.alloc(n);var r=new Buffer(n);return r.fill(0),r},isBuffer:function(n){return Buffer.isBuffer(n)},isStream:function(n){return n&&typeof n.on=="function"&&typeof n.pause=="function"&&typeof n.resume=="function"}}},{}],15:[function(t,e,s){function n(S,N,L){var D,P=o.getTypeOf(N),v=o.extend(L||{},h);v.date=v.date||new Date,v.compression!==null&&(v.compression=v.compression.toUpperCase()),typeof v.unixPermissions=="string"&&(v.unixPermissions=parseInt(v.unixPermissions,8)),v.unixPermissions&&16384&v.unixPermissions&&(v.dir=!0),v.dosPermissions&&16&v.dosPermissions&&(v.dir=!0),v.dir&&(S=p(S)),v.createFolders&&(D=T(S))&&m.call(this,D,!0);var G=P==="string"&&v.binary===!1&&v.base64===!1;L&&L.binary!==void 0||(v.binary=!G),(N instanceof f&&N.uncompressedSize===0||v.dir||!N||N.length===0)&&(v.base64=!1,v.binary=!0,N="",v.compression="STORE",P="string");var O=null;O=N instanceof f||N instanceof a?N:d.isNode&&d.isStream(N)?new E(S,N):o.prepareContent(S,N,v.binary,v.optimizedBinaryString,v.base64);var w=new I(S,O,v);this.files[S]=w}var r=t("./utf8"),o=t("./utils"),a=t("./stream/GenericWorker"),l=t("./stream/StreamHelper"),h=t("./defaults"),f=t("./compressedObject"),I=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),E=t("./nodejs/NodejsStreamInputAdapter"),T=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var N=S.lastIndexOf("/");return 0<N?S.substring(0,N):""},p=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},m=function(S,N){return N=N!==void 0?N:h.createFolders,S=p(S),this.files[S]||n.call(this,S,null,{dir:!0,createFolders:N}),this.files[S]};function F(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var R={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var N,L,D;for(N in this.files)D=this.files[N],(L=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&S(L,D)},filter:function(S){var N=[];return this.forEach(function(L,D){S(L,D)&&N.push(D)}),N},file:function(S,N,L){if(arguments.length!==1)return S=this.root+S,n.call(this,S,N,L),this;if(F(S)){var D=S;return this.filter(function(v,G){return!G.dir&&D.test(v)})}var P=this.files[this.root+S];return P&&!P.dir?P:null},folder:function(S){if(!S)return this;if(F(S))return this.filter(function(P,v){return v.dir&&S.test(P)});var N=this.root+S,L=m.call(this,N),D=this.clone();return D.root=L.name,D},remove:function(S){S=this.root+S;var N=this.files[S];if(N||(S.slice(-1)!=="/"&&(S+="/"),N=this.files[S]),N&&!N.dir)delete this.files[S];else for(var L=this.filter(function(P,v){return v.name.slice(0,S.length)===S}),D=0;D<L.length;D++)delete this.files[L[D].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var N,L={};try{if((L=o.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");o.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var D=L.comment||this.comment||"";N=u.generateWorker(this,L,D)}catch(P){(N=new a("error")).error(P)}return new l(N,L.type||"string",L.mimeType)},generateAsync:function(S,N){return this.generateInternalStream(S).accumulate(N)},generateNodeStream:function(S,N){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(N)}};e.exports=R},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,s){e.exports=t("stream")},{stream:void 0}],17:[function(t,e,s){var n=t("./DataReader");function r(o){n.call(this,o);for(var a=0;a<this.data.length;a++)o[a]=255&o[a]}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data[this.zero+o]},r.prototype.lastIndexOfSignature=function(o){for(var a=o.charCodeAt(0),l=o.charCodeAt(1),h=o.charCodeAt(2),f=o.charCodeAt(3),I=this.length-4;0<=I;--I)if(this.data[I]===a&&this.data[I+1]===l&&this.data[I+2]===h&&this.data[I+3]===f)return I-this.zero;return-1},r.prototype.readAndCheckSignature=function(o){var a=o.charCodeAt(0),l=o.charCodeAt(1),h=o.charCodeAt(2),f=o.charCodeAt(3),I=this.readData(4);return a===I[0]&&l===I[1]&&h===I[2]&&f===I[3]},r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./DataReader":18}],18:[function(t,e,s){var n=t("../utils");function r(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var a,l=0;for(this.checkOffset(o),a=this.index+o-1;a>=this.index;a--)l=(l<<8)+this.byteAt(a);return this.index+=o,l},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},e.exports=r},{"../utils":32}],19:[function(t,e,s){var n=t("./Uint8ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,s){var n=t("./DataReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},r.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},r.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,e,s){var n=t("./ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,s){var n=t("../utils"),r=t("../support"),o=t("./ArrayReader"),a=t("./StringReader"),l=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(f){var I=n.getTypeOf(f);return n.checkSupport(I),I!=="string"||r.uint8array?I==="nodebuffer"?new l(f):r.uint8array?new h(n.transformTo("uint8array",f)):new o(n.transformTo("array",f)):new a(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,e,s){var n=t("./GenericWorker"),r=t("../utils");function o(a){n.call(this,"ConvertWorker to "+a),this.destType=a}r.inherits(o,n),o.prototype.processChunk=function(a){this.push({data:r.transformTo(this.destType,a.data),meta:a.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,s){var n=t("./GenericWorker"),r=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(a){this.streamInfo.crc32=r(a.data,this.streamInfo.crc32||0),this.push(a)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,s){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}n.inherits(o,r),o.prototype.processChunk=function(a){if(a){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+a.data.length}r.prototype.processChunk.call(this,a)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,s){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(h){l.dataIsReady=!0,l.data=h,l.max=h&&h.length||0,l.type=n.getTypeOf(h),l.isPaused||l._tickAndRepeat()},function(h){l.error(h)})}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,l);break;case"uint8array":a=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":a=this.data.slice(this.index,l)}return this.index=l,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,s){function n(r){this.name=r||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(r){this.emit("data",r)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(r){this.emit("error",r)}return!0},error:function(r){return!this.isFinished&&(this.isPaused?this.generatedError=r:(this.isFinished=!0,this.emit("error",r),this.previous&&this.previous.error(r),this.cleanUp()),!0)},on:function(r,o){return this._listeners[r].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(r,o){if(this._listeners[r])for(var a=0;a<this._listeners[r].length;a++)this._listeners[r][a].call(this,o)},pipe:function(r){return r.registerPrevious(this)},registerPrevious:function(r){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=r.streamInfo,this.mergeStreamInfo(),this.previous=r;var o=this;return r.on("data",function(a){o.processChunk(a)}),r.on("end",function(){o.end()}),r.on("error",function(a){o.error(a)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var r=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),r=!0),this.previous&&this.previous.resume(),!r},flush:function(){},processChunk:function(r){this.push(r)},withStreamInfo:function(r,o){return this.extraStreamInfo[r]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var r in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,r)&&(this.streamInfo[r]=this.extraStreamInfo[r])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var r="Worker "+this.name;return this.previous?this.previous+" -> "+r:r}},e.exports=n},{}],29:[function(t,e,s){var n=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),l=t("../support"),h=t("../external"),f=null;if(l.nodestream)try{f=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function I(d,E){return new h.Promise(function(T,p){var m=[],F=d._internalType,R=d._outputType,S=d._mimeType;d.on("data",function(N,L){m.push(N),E&&E(L)}).on("error",function(N){m=[],p(N)}).on("end",function(){try{var N=function(L,D,P){switch(L){case"blob":return n.newBlob(n.transformTo("arraybuffer",D),P);case"base64":return a.encode(D);default:return n.transformTo(L,D)}}(R,function(L,D){var P,v=0,G=null,O=0;for(P=0;P<D.length;P++)O+=D[P].length;switch(L){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(G=new Uint8Array(O),P=0;P<D.length;P++)G.set(D[P],v),v+=D[P].length;return G;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+L+"'")}}(F,m),S);T(N)}catch(L){p(L)}m=[]}).resume()})}function u(d,E,T){var p=E;switch(E){case"blob":case"arraybuffer":p="uint8array";break;case"base64":p="string"}try{this._internalType=p,this._outputType=E,this._mimeType=T,n.checkSupport(p),this._worker=d.pipe(new r(p)),d.lock()}catch(m){this._worker=new o("error"),this._worker.error(m)}}u.prototype={accumulate:function(d){return I(this,d)},on:function(d,E){var T=this;return d==="data"?this._worker.on(d,function(p){E.call(T,p.data,p.meta)}):this._worker.on(d,function(){n.delay(E,arguments,T)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(n.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},d)}},e.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,s){if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s.nodebuffer=typeof Buffer<"u",s.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")s.blob=!1;else{var n=new ArrayBuffer(0);try{s.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),s.blob=r.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!t("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,s){for(var n=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),a=t("./stream/GenericWorker"),l=new Array(256),h=0;h<256;h++)l[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;l[254]=l[254]=1;function f(){a.call(this,"utf-8 decode"),this.leftOver=null}function I(){a.call(this,"utf-8 encode")}s.utf8encode=function(u){return r.nodebuffer?o.newBufferFrom(u,"utf-8"):function(d){var E,T,p,m,F,R=d.length,S=0;for(m=0;m<R;m++)(64512&(T=d.charCodeAt(m)))==55296&&m+1<R&&(64512&(p=d.charCodeAt(m+1)))==56320&&(T=65536+(T-55296<<10)+(p-56320),m++),S+=T<128?1:T<2048?2:T<65536?3:4;for(E=r.uint8array?new Uint8Array(S):new Array(S),m=F=0;F<S;m++)(64512&(T=d.charCodeAt(m)))==55296&&m+1<R&&(64512&(p=d.charCodeAt(m+1)))==56320&&(T=65536+(T-55296<<10)+(p-56320),m++),T<128?E[F++]=T:(T<2048?E[F++]=192|T>>>6:(T<65536?E[F++]=224|T>>>12:(E[F++]=240|T>>>18,E[F++]=128|T>>>12&63),E[F++]=128|T>>>6&63),E[F++]=128|63&T);return E}(u)},s.utf8decode=function(u){return r.nodebuffer?n.transformTo("nodebuffer",u).toString("utf-8"):function(d){var E,T,p,m,F=d.length,R=new Array(2*F);for(E=T=0;E<F;)if((p=d[E++])<128)R[T++]=p;else if(4<(m=l[p]))R[T++]=65533,E+=m-1;else{for(p&=m===2?31:m===3?15:7;1<m&&E<F;)p=p<<6|63&d[E++],m--;1<m?R[T++]=65533:p<65536?R[T++]=p:(p-=65536,R[T++]=55296|p>>10&1023,R[T++]=56320|1023&p)}return R.length!==T&&(R.subarray?R=R.subarray(0,T):R.length=T),n.applyFromCharCode(R)}(u=n.transformTo(r.uint8array?"uint8array":"array",u))},n.inherits(f,a),f.prototype.processChunk=function(u){var d=n.transformTo(r.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var E=d;(d=new Uint8Array(E.length+this.leftOver.length)).set(this.leftOver,0),d.set(E,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var T=function(m,F){var R;for((F=F||m.length)>m.length&&(F=m.length),R=F-1;0<=R&&(192&m[R])==128;)R--;return R<0||R===0?F:R+l[m[R]]>F?R:F}(d),p=d;T!==d.length&&(r.uint8array?(p=d.subarray(0,T),this.leftOver=d.subarray(T,d.length)):(p=d.slice(0,T),this.leftOver=d.slice(T,d.length))),this.push({data:s.utf8decode(p),meta:u.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,n.inherits(I,a),I.prototype.processChunk=function(u){this.push({data:s.utf8encode(u.data),meta:u.meta})},s.Utf8EncodeWorker=I},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,s){var n=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),a=t("./external");function l(E){return E}function h(E,T){for(var p=0;p<E.length;++p)T[p]=255&E.charCodeAt(p);return T}t("setimmediate"),s.newBlob=function(E,T){s.checkSupport("blob");try{return new Blob([E],{type:T})}catch{try{var p=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return p.append(E),p.getBlob(T)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(E,T,p){var m=[],F=0,R=E.length;if(R<=p)return String.fromCharCode.apply(null,E);for(;F<R;)T==="array"||T==="nodebuffer"?m.push(String.fromCharCode.apply(null,E.slice(F,Math.min(F+p,R)))):m.push(String.fromCharCode.apply(null,E.subarray(F,Math.min(F+p,R)))),F+=p;return m.join("")},stringifyByChar:function(E){for(var T="",p=0;p<E.length;p++)T+=String.fromCharCode(E[p]);return T},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}}()}};function I(E){var T=65536,p=s.getTypeOf(E),m=!0;if(p==="uint8array"?m=f.applyCanBeUsed.uint8array:p==="nodebuffer"&&(m=f.applyCanBeUsed.nodebuffer),m)for(;1<T;)try{return f.stringifyByChunk(E,p,T)}catch{T=Math.floor(T/2)}return f.stringifyByChar(E)}function u(E,T){for(var p=0;p<E.length;p++)T[p]=E[p];return T}s.applyFromCharCode=I;var d={};d.string={string:l,array:function(E){return h(E,new Array(E.length))},arraybuffer:function(E){return d.string.uint8array(E).buffer},uint8array:function(E){return h(E,new Uint8Array(E.length))},nodebuffer:function(E){return h(E,o.allocBuffer(E.length))}},d.array={string:I,array:l,arraybuffer:function(E){return new Uint8Array(E).buffer},uint8array:function(E){return new Uint8Array(E)},nodebuffer:function(E){return o.newBufferFrom(E)}},d.arraybuffer={string:function(E){return I(new Uint8Array(E))},array:function(E){return u(new Uint8Array(E),new Array(E.byteLength))},arraybuffer:l,uint8array:function(E){return new Uint8Array(E)},nodebuffer:function(E){return o.newBufferFrom(new Uint8Array(E))}},d.uint8array={string:I,array:function(E){return u(E,new Array(E.length))},arraybuffer:function(E){return E.buffer},uint8array:l,nodebuffer:function(E){return o.newBufferFrom(E)}},d.nodebuffer={string:I,array:function(E){return u(E,new Array(E.length))},arraybuffer:function(E){return d.nodebuffer.uint8array(E).buffer},uint8array:function(E){return u(E,new Uint8Array(E.length))},nodebuffer:l},s.transformTo=function(E,T){if(T=T||"",!E)return T;s.checkSupport(E);var p=s.getTypeOf(T);return d[p][E](T)},s.resolve=function(E){for(var T=E.split("/"),p=[],m=0;m<T.length;m++){var F=T[m];F==="."||F===""&&m!==0&&m!==T.length-1||(F===".."?p.pop():p.push(F))}return p.join("/")},s.getTypeOf=function(E){return typeof E=="string"?"string":Object.prototype.toString.call(E)==="[object Array]"?"array":n.nodebuffer&&o.isBuffer(E)?"nodebuffer":n.uint8array&&E instanceof Uint8Array?"uint8array":n.arraybuffer&&E instanceof ArrayBuffer?"arraybuffer":void 0},s.checkSupport=function(E){if(!n[E.toLowerCase()])throw new Error(E+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(E){var T,p,m="";for(p=0;p<(E||"").length;p++)m+="\\x"+((T=E.charCodeAt(p))<16?"0":"")+T.toString(16).toUpperCase();return m},s.delay=function(E,T,p){setImmediate(function(){E.apply(p||null,T||[])})},s.inherits=function(E,T){function p(){}p.prototype=T.prototype,E.prototype=new p},s.extend=function(){var E,T,p={};for(E=0;E<arguments.length;E++)for(T in arguments[E])Object.prototype.hasOwnProperty.call(arguments[E],T)&&p[T]===void 0&&(p[T]=arguments[E][T]);return p},s.prepareContent=function(E,T,p,m,F){return a.Promise.resolve(T).then(function(R){return n.blob&&(R instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(R))!==-1)&&typeof FileReader<"u"?new a.Promise(function(S,N){var L=new FileReader;L.onload=function(D){S(D.target.result)},L.onerror=function(D){N(D.target.error)},L.readAsArrayBuffer(R)}):R}).then(function(R){var S=s.getTypeOf(R);return S?(S==="arraybuffer"?R=s.transformTo("uint8array",R):S==="string"&&(F?R=r.decode(R):p&&m!==!0&&(R=function(N){return h(N,n.uint8array?new Uint8Array(N.length):new Array(N.length))}(R))),R):a.Promise.reject(new Error("Can't read the data of '"+E+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,s){var n=t("./reader/readerFor"),r=t("./utils"),o=t("./signature"),a=t("./zipEntry"),l=t("./support");function h(f){this.files=[],this.loadOptions=f}h.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var I=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(I)+", expected "+r.pretty(f)+")")}},isSignature:function(f,I){var u=this.reader.index;this.reader.setIndex(f);var d=this.reader.readString(4)===I;return this.reader.setIndex(u),d},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),I=l.uint8array?"uint8array":"array",u=r.transformTo(I,f);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,I,u,d=this.zip64EndOfCentralSize-44;0<d;)f=this.reader.readInt(2),I=this.reader.readInt(4),u=this.reader.readData(I),this.zip64ExtensibleData[f]={id:f,length:I,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,I;for(f=0;f<this.files.length;f++)I=this.files[f],this.reader.setIndex(I.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),I.readLocalPart(this.reader),I.handleUTF8(),I.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(f=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var I=f;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var d=I-u;if(0<d)this.isSignature(I,o.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(f){this.reader=n(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,s){var n=t("./reader/readerFor"),r=t("./utils"),o=t("./compressedObject"),a=t("./crc32"),l=t("./utf8"),h=t("./compressions"),f=t("./support");function I(u,d){this.options=u,this.loadOptions=d}I.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(u){var d,E;if(u.skip(22),this.fileNameLength=u.readInt(2),E=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(E),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((d=function(T){for(var p in h)if(Object.prototype.hasOwnProperty.call(h,p)&&h[p].magic===T)return h[p];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,d,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var d=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(d),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var d,E,T,p=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<p;)d=u.readInt(2),E=u.readInt(2),T=u.readData(E),this.extraFields[d]={id:d,length:E,value:T};u.setIndex(p)},handleUTF8:function(){var u=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var E=r.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(E)}var T=this.findExtraFieldUnicodeComment();if(T!==null)this.fileCommentStr=T;else{var p=r.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(p)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var d=n(u.value);return d.readInt(1)!==1||a(this.fileName)!==d.readInt(4)?null:l.utf8decode(d.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var d=n(u.value);return d.readInt(1)!==1||a(this.fileComment)!==d.readInt(4)?null:l.utf8decode(d.readData(u.length-5))}return null}},e.exports=I},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,s){function n(d,E,T){this.name=d,this.dir=T.dir,this.date=T.date,this.comment=T.comment,this.unixPermissions=T.unixPermissions,this.dosPermissions=T.dosPermissions,this._data=E,this._dataBinary=T.binary,this.options={compression:T.compression,compressionOptions:T.compressionOptions}}var r=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),a=t("./utf8"),l=t("./compressedObject"),h=t("./stream/GenericWorker");n.prototype={internalStream:function(d){var E=null,T="string";try{if(!d)throw new Error("No output type specified.");var p=(T=d.toLowerCase())==="string"||T==="text";T!=="binarystring"&&T!=="text"||(T="string"),E=this._decompressWorker();var m=!this._dataBinary;m&&!p&&(E=E.pipe(new a.Utf8EncodeWorker)),!m&&p&&(E=E.pipe(new a.Utf8DecodeWorker))}catch(F){(E=new h("error")).error(F)}return new r(E,T,"")},async:function(d,E){return this.internalStream(d).accumulate(E)},nodeStream:function(d,E){return this.internalStream(d||"nodebuffer").toNodejsStream(E)},_compressWorker:function(d,E){if(this._data instanceof l&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var T=this._decompressWorker();return this._dataBinary||(T=T.pipe(new a.Utf8EncodeWorker)),l.createWorkerFrom(T,d,E)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],I=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<f.length;u++)n.prototype[f[u]]=I;e.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,s){(function(n){var r,o,a=n.MutationObserver||n.WebKitMutationObserver;if(a){var l=0,h=new a(d),f=n.document.createTextNode("");h.observe(f,{characterData:!0}),r=function(){f.data=l=++l%2}}else if(n.setImmediate||n.MessageChannel===void 0)r="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var E=n.document.createElement("script");E.onreadystatechange=function(){d(),E.onreadystatechange=null,E.parentNode.removeChild(E),E=null},n.document.documentElement.appendChild(E)}:function(){setTimeout(d,0)};else{var I=new n.MessageChannel;I.port1.onmessage=d,r=function(){I.port2.postMessage(0)}}var u=[];function d(){var E,T;o=!0;for(var p=u.length;p;){for(T=u,u=[],E=-1;++E<p;)T[E]();p=u.length}o=!1}e.exports=function(E){u.push(E)!==1||o||r()}}).call(this,typeof os<"u"?os:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,e,s){var n=t("immediate");function r(){}var o={},a=["REJECTED"],l=["FULFILLED"],h=["PENDING"];function f(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,p!==r&&E(this,p)}function I(p,m,F){this.promise=p,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}function u(p,m,F){n(function(){var R;try{R=m(F)}catch(S){return o.reject(p,S)}R===p?o.reject(p,new TypeError("Cannot resolve promise with itself")):o.resolve(p,R)})}function d(p){var m=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof m=="function")return function(){m.apply(p,arguments)}}function E(p,m){var F=!1;function R(L){F||(F=!0,o.reject(p,L))}function S(L){F||(F=!0,o.resolve(p,L))}var N=T(function(){m(S,R)});N.status==="error"&&R(N.value)}function T(p,m){var F={};try{F.value=p(m),F.status="success"}catch(R){F.status="error",F.value=R}return F}(e.exports=f).prototype.finally=function(p){if(typeof p!="function")return this;var m=this.constructor;return this.then(function(F){return m.resolve(p()).then(function(){return F})},function(F){return m.resolve(p()).then(function(){throw F})})},f.prototype.catch=function(p){return this.then(null,p)},f.prototype.then=function(p,m){if(typeof p!="function"&&this.state===l||typeof m!="function"&&this.state===a)return this;var F=new this.constructor(r);return this.state!==h?u(F,this.state===l?p:m,this.outcome):this.queue.push(new I(F,p,m)),F},I.prototype.callFulfilled=function(p){o.resolve(this.promise,p)},I.prototype.otherCallFulfilled=function(p){u(this.promise,this.onFulfilled,p)},I.prototype.callRejected=function(p){o.reject(this.promise,p)},I.prototype.otherCallRejected=function(p){u(this.promise,this.onRejected,p)},o.resolve=function(p,m){var F=T(d,m);if(F.status==="error")return o.reject(p,F.value);var R=F.value;if(R)E(p,R);else{p.state=l,p.outcome=m;for(var S=-1,N=p.queue.length;++S<N;)p.queue[S].callFulfilled(m)}return p},o.reject=function(p,m){p.state=a,p.outcome=m;for(var F=-1,R=p.queue.length;++F<R;)p.queue[F].callRejected(m);return p},f.resolve=function(p){return p instanceof this?p:o.resolve(new this(r),p)},f.reject=function(p){var m=new this(r);return o.reject(m,p)},f.all=function(p){var m=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=p.length,R=!1;if(!F)return this.resolve([]);for(var S=new Array(F),N=0,L=-1,D=new this(r);++L<F;)P(p[L],L);return D;function P(v,G){m.resolve(v).then(function(O){S[G]=O,++N!==F||R||(R=!0,o.resolve(D,S))},function(O){R||(R=!0,o.reject(D,O))})}},f.race=function(p){var m=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=p.length,R=!1;if(!F)return this.resolve([]);for(var S=-1,N=new this(r);++S<F;)L=p[S],m.resolve(L).then(function(D){R||(R=!0,o.resolve(N,D))},function(D){R||(R=!0,o.reject(N,D))});var L;return N}},{immediate:36}],38:[function(t,e,s){var n={};(0,t("./lib/utils/common").assign)(n,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,s){var n=t("./zlib/deflate"),r=t("./utils/common"),o=t("./utils/strings"),a=t("./zlib/messages"),l=t("./zlib/zstream"),h=Object.prototype.toString,f=0,I=-1,u=0,d=8;function E(p){if(!(this instanceof E))return new E(p);this.options=r.assign({level:I,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},p||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var F=n.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(F!==f)throw new Error(a[F]);if(m.header&&n.deflateSetHeader(this.strm,m.header),m.dictionary){var R;if(R=typeof m.dictionary=="string"?o.string2buf(m.dictionary):h.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(F=n.deflateSetDictionary(this.strm,R))!==f)throw new Error(a[F]);this._dict_set=!0}}function T(p,m){var F=new E(m);if(F.push(p,!0),F.err)throw F.msg||a[F.err];return F.result}E.prototype.push=function(p,m){var F,R,S=this.strm,N=this.options.chunkSize;if(this.ended)return!1;R=m===~~m?m:m===!0?4:0,typeof p=="string"?S.input=o.string2buf(p):h.call(p)==="[object ArrayBuffer]"?S.input=new Uint8Array(p):S.input=p,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new r.Buf8(N),S.next_out=0,S.avail_out=N),(F=n.deflate(S,R))!==1&&F!==f)return this.onEnd(F),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||R!==4&&R!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(r.shrinkBuf(S.output,S.next_out))):this.onData(r.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&F!==1);return R===4?(F=n.deflateEnd(this.strm),this.onEnd(F),this.ended=!0,F===f):R!==2||(this.onEnd(f),!(S.avail_out=0))},E.prototype.onData=function(p){this.chunks.push(p)},E.prototype.onEnd=function(p){p===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},s.Deflate=E,s.deflate=T,s.deflateRaw=function(p,m){return(m=m||{}).raw=!0,T(p,m)},s.gzip=function(p,m){return(m=m||{}).gzip=!0,T(p,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,s){var n=t("./zlib/inflate"),r=t("./utils/common"),o=t("./utils/strings"),a=t("./zlib/constants"),l=t("./zlib/messages"),h=t("./zlib/zstream"),f=t("./zlib/gzheader"),I=Object.prototype.toString;function u(E){if(!(this instanceof u))return new u(E);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},E||{});var T=this.options;T.raw&&0<=T.windowBits&&T.windowBits<16&&(T.windowBits=-T.windowBits,T.windowBits===0&&(T.windowBits=-15)),!(0<=T.windowBits&&T.windowBits<16)||E&&E.windowBits||(T.windowBits+=32),15<T.windowBits&&T.windowBits<48&&!(15&T.windowBits)&&(T.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var p=n.inflateInit2(this.strm,T.windowBits);if(p!==a.Z_OK)throw new Error(l[p]);this.header=new f,n.inflateGetHeader(this.strm,this.header)}function d(E,T){var p=new u(T);if(p.push(E,!0),p.err)throw p.msg||l[p.err];return p.result}u.prototype.push=function(E,T){var p,m,F,R,S,N,L=this.strm,D=this.options.chunkSize,P=this.options.dictionary,v=!1;if(this.ended)return!1;m=T===~~T?T:T===!0?a.Z_FINISH:a.Z_NO_FLUSH,typeof E=="string"?L.input=o.binstring2buf(E):I.call(E)==="[object ArrayBuffer]"?L.input=new Uint8Array(E):L.input=E,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new r.Buf8(D),L.next_out=0,L.avail_out=D),(p=n.inflate(L,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&P&&(N=typeof P=="string"?o.string2buf(P):I.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,p=n.inflateSetDictionary(this.strm,N)),p===a.Z_BUF_ERROR&&v===!0&&(p=a.Z_OK,v=!1),p!==a.Z_STREAM_END&&p!==a.Z_OK)return this.onEnd(p),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&p!==a.Z_STREAM_END&&(L.avail_in!==0||m!==a.Z_FINISH&&m!==a.Z_SYNC_FLUSH)||(this.options.to==="string"?(F=o.utf8border(L.output,L.next_out),R=L.next_out-F,S=o.buf2string(L.output,F),L.next_out=R,L.avail_out=D-R,R&&r.arraySet(L.output,L.output,F,R,0),this.onData(S)):this.onData(r.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(v=!0)}while((0<L.avail_in||L.avail_out===0)&&p!==a.Z_STREAM_END);return p===a.Z_STREAM_END&&(m=a.Z_FINISH),m===a.Z_FINISH?(p=n.inflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===a.Z_OK):m!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(L.avail_out=0))},u.prototype.onData=function(E){this.chunks.push(E)},u.prototype.onEnd=function(E){E===a.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=E,this.msg=this.strm.msg},s.Inflate=u,s.inflate=d,s.inflateRaw=function(E,T){return(T=T||{}).raw=!0,d(E,T)},s.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,s){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";s.assign=function(a){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var h=l.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var f in h)h.hasOwnProperty(f)&&(a[f]=h[f])}}return a},s.shrinkBuf=function(a,l){return a.length===l?a:a.subarray?a.subarray(0,l):(a.length=l,a)};var r={arraySet:function(a,l,h,f,I){if(l.subarray&&a.subarray)a.set(l.subarray(h,h+f),I);else for(var u=0;u<f;u++)a[I+u]=l[h+u]},flattenChunks:function(a){var l,h,f,I,u,d;for(l=f=0,h=a.length;l<h;l++)f+=a[l].length;for(d=new Uint8Array(f),l=I=0,h=a.length;l<h;l++)u=a[l],d.set(u,I),I+=u.length;return d}},o={arraySet:function(a,l,h,f,I){for(var u=0;u<f;u++)a[I+u]=l[h+u]},flattenChunks:function(a){return[].concat.apply([],a)}};s.setTyped=function(a){a?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,r)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,o))},s.setTyped(n)},{}],42:[function(t,e,s){var n=t("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var a=new n.Buf8(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function h(f,I){if(I<65537&&(f.subarray&&o||!f.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(f,I));for(var u="",d=0;d<I;d++)u+=String.fromCharCode(f[d]);return u}a[254]=a[254]=1,s.string2buf=function(f){var I,u,d,E,T,p=f.length,m=0;for(E=0;E<p;E++)(64512&(u=f.charCodeAt(E)))==55296&&E+1<p&&(64512&(d=f.charCodeAt(E+1)))==56320&&(u=65536+(u-55296<<10)+(d-56320),E++),m+=u<128?1:u<2048?2:u<65536?3:4;for(I=new n.Buf8(m),E=T=0;T<m;E++)(64512&(u=f.charCodeAt(E)))==55296&&E+1<p&&(64512&(d=f.charCodeAt(E+1)))==56320&&(u=65536+(u-55296<<10)+(d-56320),E++),u<128?I[T++]=u:(u<2048?I[T++]=192|u>>>6:(u<65536?I[T++]=224|u>>>12:(I[T++]=240|u>>>18,I[T++]=128|u>>>12&63),I[T++]=128|u>>>6&63),I[T++]=128|63&u);return I},s.buf2binstring=function(f){return h(f,f.length)},s.binstring2buf=function(f){for(var I=new n.Buf8(f.length),u=0,d=I.length;u<d;u++)I[u]=f.charCodeAt(u);return I},s.buf2string=function(f,I){var u,d,E,T,p=I||f.length,m=new Array(2*p);for(u=d=0;u<p;)if((E=f[u++])<128)m[d++]=E;else if(4<(T=a[E]))m[d++]=65533,u+=T-1;else{for(E&=T===2?31:T===3?15:7;1<T&&u<p;)E=E<<6|63&f[u++],T--;1<T?m[d++]=65533:E<65536?m[d++]=E:(E-=65536,m[d++]=55296|E>>10&1023,m[d++]=56320|1023&E)}return h(m,d)},s.utf8border=function(f,I){var u;for((I=I||f.length)>f.length&&(I=f.length),u=I-1;0<=u&&(192&f[u])==128;)u--;return u<0||u===0?I:u+a[f[u]]>I?u:I}},{"./common":41}],43:[function(t,e,s){e.exports=function(n,r,o,a){for(var l=65535&n|0,h=n>>>16&65535|0,f=0;o!==0;){for(o-=f=2e3<o?2e3:o;h=h+(l=l+r[a++]|0)|0,--f;);l%=65521,h%=65521}return l|h<<16|0}},{}],44:[function(t,e,s){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,s){var n=function(){for(var r,o=[],a=0;a<256;a++){r=a;for(var l=0;l<8;l++)r=1&r?3988292384^r>>>1:r>>>1;o[a]=r}return o}();e.exports=function(r,o,a,l){var h=n,f=l+a;r^=-1;for(var I=l;I<f;I++)r=r>>>8^h[255&(r^o[I])];return-1^r}},{}],46:[function(t,e,s){var n,r=t("../utils/common"),o=t("./trees"),a=t("./adler32"),l=t("./crc32"),h=t("./messages"),f=0,I=4,u=0,d=-2,E=-1,T=4,p=2,m=8,F=9,R=286,S=30,N=19,L=2*R+1,D=15,P=3,v=258,G=v+P+1,O=42,w=113,g=1,U=2,Q=3,z=4;function et(A,$){return A.msg=h[$],$}function X(A){return(A<<1)-(4<A?9:0)}function nt(A){for(var $=A.length;0<=--$;)A[$]=0}function Y(A){var $=A.state,H=$.pending;H>A.avail_out&&(H=A.avail_out),H!==0&&(r.arraySet(A.output,$.pending_buf,$.pending_out,H,A.next_out),A.next_out+=H,$.pending_out+=H,A.total_out+=H,A.avail_out-=H,$.pending-=H,$.pending===0&&($.pending_out=0))}function B(A,$){o._tr_flush_block(A,0<=A.block_start?A.block_start:-1,A.strstart-A.block_start,$),A.block_start=A.strstart,Y(A.strm)}function rt(A,$){A.pending_buf[A.pending++]=$}function it(A,$){A.pending_buf[A.pending++]=$>>>8&255,A.pending_buf[A.pending++]=255&$}function tt(A,$){var H,M,_=A.max_chain_length,x=A.strstart,Z=A.prev_length,j=A.nice_match,V=A.strstart>A.w_size-G?A.strstart-(A.w_size-G):0,K=A.window,st=A.w_mask,J=A.prev,at=A.strstart+v,Rt=K[x+Z-1],It=K[x+Z];A.prev_length>=A.good_match&&(_>>=2),j>A.lookahead&&(j=A.lookahead);do if(K[(H=$)+Z]===It&&K[H+Z-1]===Rt&&K[H]===K[x]&&K[++H]===K[x+1]){x+=2,H++;do;while(K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&x<at);if(M=v-(at-x),x=at-v,Z<M){if(A.match_start=$,j<=(Z=M))break;Rt=K[x+Z-1],It=K[x+Z]}}while(($=J[$&st])>V&&--_!=0);return Z<=A.lookahead?Z:A.lookahead}function Ft(A){var $,H,M,_,x,Z,j,V,K,st,J=A.w_size;do{if(_=A.window_size-A.lookahead-A.strstart,A.strstart>=J+(J-G)){for(r.arraySet(A.window,A.window,J,J,0),A.match_start-=J,A.strstart-=J,A.block_start-=J,$=H=A.hash_size;M=A.head[--$],A.head[$]=J<=M?M-J:0,--H;);for($=H=J;M=A.prev[--$],A.prev[$]=J<=M?M-J:0,--H;);_+=J}if(A.strm.avail_in===0)break;if(Z=A.strm,j=A.window,V=A.strstart+A.lookahead,K=_,st=void 0,st=Z.avail_in,K<st&&(st=K),H=st===0?0:(Z.avail_in-=st,r.arraySet(j,Z.input,Z.next_in,st,V),Z.state.wrap===1?Z.adler=a(Z.adler,j,st,V):Z.state.wrap===2&&(Z.adler=l(Z.adler,j,st,V)),Z.next_in+=st,Z.total_in+=st,st),A.lookahead+=H,A.lookahead+A.insert>=P)for(x=A.strstart-A.insert,A.ins_h=A.window[x],A.ins_h=(A.ins_h<<A.hash_shift^A.window[x+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[x+P-1])&A.hash_mask,A.prev[x&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=x,x++,A.insert--,!(A.lookahead+A.insert<P)););}while(A.lookahead<G&&A.strm.avail_in!==0)}function Nt(A,$){for(var H,M;;){if(A.lookahead<G){if(Ft(A),A.lookahead<G&&$===f)return g;if(A.lookahead===0)break}if(H=0,A.lookahead>=P&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),H!==0&&A.strstart-H<=A.w_size-G&&(A.match_length=tt(A,H)),A.match_length>=P)if(M=o._tr_tally(A,A.strstart-A.match_start,A.match_length-P),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=P){for(A.match_length--;A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart,--A.match_length!=0;);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else M=o._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(M&&(B(A,!1),A.strm.avail_out===0))return g}return A.insert=A.strstart<P-1?A.strstart:P-1,$===I?(B(A,!0),A.strm.avail_out===0?Q:z):A.last_lit&&(B(A,!1),A.strm.avail_out===0)?g:U}function ot(A,$){for(var H,M,_;;){if(A.lookahead<G){if(Ft(A),A.lookahead<G&&$===f)return g;if(A.lookahead===0)break}if(H=0,A.lookahead>=P&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=P-1,H!==0&&A.prev_length<A.max_lazy_match&&A.strstart-H<=A.w_size-G&&(A.match_length=tt(A,H),A.match_length<=5&&(A.strategy===1||A.match_length===P&&4096<A.strstart-A.match_start)&&(A.match_length=P-1)),A.prev_length>=P&&A.match_length<=A.prev_length){for(_=A.strstart+A.lookahead-P,M=o._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-P),A.lookahead-=A.prev_length-1,A.prev_length-=2;++A.strstart<=_&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),--A.prev_length!=0;);if(A.match_available=0,A.match_length=P-1,A.strstart++,M&&(B(A,!1),A.strm.avail_out===0))return g}else if(A.match_available){if((M=o._tr_tally(A,0,A.window[A.strstart-1]))&&B(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return g}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(M=o._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<P-1?A.strstart:P-1,$===I?(B(A,!0),A.strm.avail_out===0?Q:z):A.last_lit&&(B(A,!1),A.strm.avail_out===0)?g:U}function ft(A,$,H,M,_){this.good_length=A,this.max_lazy=$,this.nice_length=H,this.max_chain=M,this.func=_}function ut(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*L),this.dyn_dtree=new r.Buf16(2*(2*S+1)),this.bl_tree=new r.Buf16(2*(2*N+1)),nt(this.dyn_ltree),nt(this.dyn_dtree),nt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(D+1),this.heap=new r.Buf16(2*R+1),nt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*R+1),nt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ct(A){var $;return A&&A.state?(A.total_in=A.total_out=0,A.data_type=p,($=A.state).pending=0,$.pending_out=0,$.wrap<0&&($.wrap=-$.wrap),$.status=$.wrap?O:w,A.adler=$.wrap===2?0:1,$.last_flush=f,o._tr_init($),u):et(A,d)}function Gt(A){var $=Ct(A);return $===u&&function(H){H.window_size=2*H.w_size,nt(H.head),H.max_lazy_match=n[H.level].max_lazy,H.good_match=n[H.level].good_length,H.nice_match=n[H.level].nice_length,H.max_chain_length=n[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=P-1,H.match_available=0,H.ins_h=0}(A.state),$}function wt(A,$,H,M,_,x){if(!A)return d;var Z=1;if($===E&&($=6),M<0?(Z=0,M=-M):15<M&&(Z=2,M-=16),_<1||F<_||H!==m||M<8||15<M||$<0||9<$||x<0||T<x)return et(A,d);M===8&&(M=9);var j=new ut;return(A.state=j).strm=A,j.wrap=Z,j.gzhead=null,j.w_bits=M,j.w_size=1<<j.w_bits,j.w_mask=j.w_size-1,j.hash_bits=_+7,j.hash_size=1<<j.hash_bits,j.hash_mask=j.hash_size-1,j.hash_shift=~~((j.hash_bits+P-1)/P),j.window=new r.Buf8(2*j.w_size),j.head=new r.Buf16(j.hash_size),j.prev=new r.Buf16(j.w_size),j.lit_bufsize=1<<_+6,j.pending_buf_size=4*j.lit_bufsize,j.pending_buf=new r.Buf8(j.pending_buf_size),j.d_buf=1*j.lit_bufsize,j.l_buf=3*j.lit_bufsize,j.level=$,j.strategy=x,j.method=H,Gt(A)}n=[new ft(0,0,0,0,function(A,$){var H=65535;for(H>A.pending_buf_size-5&&(H=A.pending_buf_size-5);;){if(A.lookahead<=1){if(Ft(A),A.lookahead===0&&$===f)return g;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var M=A.block_start+H;if((A.strstart===0||A.strstart>=M)&&(A.lookahead=A.strstart-M,A.strstart=M,B(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-G&&(B(A,!1),A.strm.avail_out===0))return g}return A.insert=0,$===I?(B(A,!0),A.strm.avail_out===0?Q:z):(A.strstart>A.block_start&&(B(A,!1),A.strm.avail_out),g)}),new ft(4,4,8,4,Nt),new ft(4,5,16,8,Nt),new ft(4,6,32,32,Nt),new ft(4,4,16,16,ot),new ft(8,16,32,32,ot),new ft(8,16,128,128,ot),new ft(8,32,128,256,ot),new ft(32,128,258,1024,ot),new ft(32,258,258,4096,ot)],s.deflateInit=function(A,$){return wt(A,$,m,15,8,0)},s.deflateInit2=wt,s.deflateReset=Gt,s.deflateResetKeep=Ct,s.deflateSetHeader=function(A,$){return A&&A.state?A.state.wrap!==2?d:(A.state.gzhead=$,u):d},s.deflate=function(A,$){var H,M,_,x;if(!A||!A.state||5<$||$<0)return A?et(A,d):d;if(M=A.state,!A.output||!A.input&&A.avail_in!==0||M.status===666&&$!==I)return et(A,A.avail_out===0?-5:d);if(M.strm=A,H=M.last_flush,M.last_flush=$,M.status===O)if(M.wrap===2)A.adler=0,rt(M,31),rt(M,139),rt(M,8),M.gzhead?(rt(M,(M.gzhead.text?1:0)+(M.gzhead.hcrc?2:0)+(M.gzhead.extra?4:0)+(M.gzhead.name?8:0)+(M.gzhead.comment?16:0)),rt(M,255&M.gzhead.time),rt(M,M.gzhead.time>>8&255),rt(M,M.gzhead.time>>16&255),rt(M,M.gzhead.time>>24&255),rt(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),rt(M,255&M.gzhead.os),M.gzhead.extra&&M.gzhead.extra.length&&(rt(M,255&M.gzhead.extra.length),rt(M,M.gzhead.extra.length>>8&255)),M.gzhead.hcrc&&(A.adler=l(A.adler,M.pending_buf,M.pending,0)),M.gzindex=0,M.status=69):(rt(M,0),rt(M,0),rt(M,0),rt(M,0),rt(M,0),rt(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),rt(M,3),M.status=w);else{var Z=m+(M.w_bits-8<<4)<<8;Z|=(2<=M.strategy||M.level<2?0:M.level<6?1:M.level===6?2:3)<<6,M.strstart!==0&&(Z|=32),Z+=31-Z%31,M.status=w,it(M,Z),M.strstart!==0&&(it(M,A.adler>>>16),it(M,65535&A.adler)),A.adler=1}if(M.status===69)if(M.gzhead.extra){for(_=M.pending;M.gzindex<(65535&M.gzhead.extra.length)&&(M.pending!==M.pending_buf_size||(M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),Y(A),_=M.pending,M.pending!==M.pending_buf_size));)rt(M,255&M.gzhead.extra[M.gzindex]),M.gzindex++;M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),M.gzindex===M.gzhead.extra.length&&(M.gzindex=0,M.status=73)}else M.status=73;if(M.status===73)if(M.gzhead.name){_=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),Y(A),_=M.pending,M.pending===M.pending_buf_size)){x=1;break}x=M.gzindex<M.gzhead.name.length?255&M.gzhead.name.charCodeAt(M.gzindex++):0,rt(M,x)}while(x!==0);M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),x===0&&(M.gzindex=0,M.status=91)}else M.status=91;if(M.status===91)if(M.gzhead.comment){_=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),Y(A),_=M.pending,M.pending===M.pending_buf_size)){x=1;break}x=M.gzindex<M.gzhead.comment.length?255&M.gzhead.comment.charCodeAt(M.gzindex++):0,rt(M,x)}while(x!==0);M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),x===0&&(M.status=103)}else M.status=103;if(M.status===103&&(M.gzhead.hcrc?(M.pending+2>M.pending_buf_size&&Y(A),M.pending+2<=M.pending_buf_size&&(rt(M,255&A.adler),rt(M,A.adler>>8&255),A.adler=0,M.status=w)):M.status=w),M.pending!==0){if(Y(A),A.avail_out===0)return M.last_flush=-1,u}else if(A.avail_in===0&&X($)<=X(H)&&$!==I)return et(A,-5);if(M.status===666&&A.avail_in!==0)return et(A,-5);if(A.avail_in!==0||M.lookahead!==0||$!==f&&M.status!==666){var j=M.strategy===2?function(V,K){for(var st;;){if(V.lookahead===0&&(Ft(V),V.lookahead===0)){if(K===f)return g;break}if(V.match_length=0,st=o._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,st&&(B(V,!1),V.strm.avail_out===0))return g}return V.insert=0,K===I?(B(V,!0),V.strm.avail_out===0?Q:z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?g:U}(M,$):M.strategy===3?function(V,K){for(var st,J,at,Rt,It=V.window;;){if(V.lookahead<=v){if(Ft(V),V.lookahead<=v&&K===f)return g;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=P&&0<V.strstart&&(J=It[at=V.strstart-1])===It[++at]&&J===It[++at]&&J===It[++at]){Rt=V.strstart+v;do;while(J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&at<Rt);V.match_length=v-(Rt-at),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=P?(st=o._tr_tally(V,1,V.match_length-P),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(st=o._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),st&&(B(V,!1),V.strm.avail_out===0))return g}return V.insert=0,K===I?(B(V,!0),V.strm.avail_out===0?Q:z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?g:U}(M,$):n[M.level].func(M,$);if(j!==Q&&j!==z||(M.status=666),j===g||j===Q)return A.avail_out===0&&(M.last_flush=-1),u;if(j===U&&($===1?o._tr_align(M):$!==5&&(o._tr_stored_block(M,0,0,!1),$===3&&(nt(M.head),M.lookahead===0&&(M.strstart=0,M.block_start=0,M.insert=0))),Y(A),A.avail_out===0))return M.last_flush=-1,u}return $!==I?u:M.wrap<=0?1:(M.wrap===2?(rt(M,255&A.adler),rt(M,A.adler>>8&255),rt(M,A.adler>>16&255),rt(M,A.adler>>24&255),rt(M,255&A.total_in),rt(M,A.total_in>>8&255),rt(M,A.total_in>>16&255),rt(M,A.total_in>>24&255)):(it(M,A.adler>>>16),it(M,65535&A.adler)),Y(A),0<M.wrap&&(M.wrap=-M.wrap),M.pending!==0?u:1)},s.deflateEnd=function(A){var $;return A&&A.state?($=A.state.status)!==O&&$!==69&&$!==73&&$!==91&&$!==103&&$!==w&&$!==666?et(A,d):(A.state=null,$===w?et(A,-3):u):d},s.deflateSetDictionary=function(A,$){var H,M,_,x,Z,j,V,K,st=$.length;if(!A||!A.state||(x=(H=A.state).wrap)===2||x===1&&H.status!==O||H.lookahead)return d;for(x===1&&(A.adler=a(A.adler,$,st,0)),H.wrap=0,st>=H.w_size&&(x===0&&(nt(H.head),H.strstart=0,H.block_start=0,H.insert=0),K=new r.Buf8(H.w_size),r.arraySet(K,$,st-H.w_size,H.w_size,0),$=K,st=H.w_size),Z=A.avail_in,j=A.next_in,V=A.input,A.avail_in=st,A.next_in=0,A.input=$,Ft(H);H.lookahead>=P;){for(M=H.strstart,_=H.lookahead-(P-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[M+P-1])&H.hash_mask,H.prev[M&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=M,M++,--_;);H.strstart=M,H.lookahead=P-1,Ft(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=P-1,H.match_available=0,A.next_in=j,A.input=V,A.avail_in=Z,H.wrap=x,u},s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,s){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,s){e.exports=function(n,r){var o,a,l,h,f,I,u,d,E,T,p,m,F,R,S,N,L,D,P,v,G,O,w,g,U;o=n.state,a=n.next_in,g=n.input,l=a+(n.avail_in-5),h=n.next_out,U=n.output,f=h-(r-n.avail_out),I=h+(n.avail_out-257),u=o.dmax,d=o.wsize,E=o.whave,T=o.wnext,p=o.window,m=o.hold,F=o.bits,R=o.lencode,S=o.distcode,N=(1<<o.lenbits)-1,L=(1<<o.distbits)-1;t:do{F<15&&(m+=g[a++]<<F,F+=8,m+=g[a++]<<F,F+=8),D=R[m&N];e:for(;;){if(m>>>=P=D>>>24,F-=P,(P=D>>>16&255)===0)U[h++]=65535&D;else{if(!(16&P)){if(!(64&P)){D=R[(65535&D)+(m&(1<<P)-1)];continue e}if(32&P){o.mode=12;break t}n.msg="invalid literal/length code",o.mode=30;break t}v=65535&D,(P&=15)&&(F<P&&(m+=g[a++]<<F,F+=8),v+=m&(1<<P)-1,m>>>=P,F-=P),F<15&&(m+=g[a++]<<F,F+=8,m+=g[a++]<<F,F+=8),D=S[m&L];i:for(;;){if(m>>>=P=D>>>24,F-=P,!(16&(P=D>>>16&255))){if(!(64&P)){D=S[(65535&D)+(m&(1<<P)-1)];continue i}n.msg="invalid distance code",o.mode=30;break t}if(G=65535&D,F<(P&=15)&&(m+=g[a++]<<F,(F+=8)<P&&(m+=g[a++]<<F,F+=8)),u<(G+=m&(1<<P)-1)){n.msg="invalid distance too far back",o.mode=30;break t}if(m>>>=P,F-=P,(P=h-f)<G){if(E<(P=G-P)&&o.sane){n.msg="invalid distance too far back",o.mode=30;break t}if(w=p,(O=0)===T){if(O+=d-P,P<v){for(v-=P;U[h++]=p[O++],--P;);O=h-G,w=U}}else if(T<P){if(O+=d+T-P,(P-=T)<v){for(v-=P;U[h++]=p[O++],--P;);if(O=0,T<v){for(v-=P=T;U[h++]=p[O++],--P;);O=h-G,w=U}}}else if(O+=T-P,P<v){for(v-=P;U[h++]=p[O++],--P;);O=h-G,w=U}for(;2<v;)U[h++]=w[O++],U[h++]=w[O++],U[h++]=w[O++],v-=3;v&&(U[h++]=w[O++],1<v&&(U[h++]=w[O++]))}else{for(O=h-G;U[h++]=U[O++],U[h++]=U[O++],U[h++]=U[O++],2<(v-=3););v&&(U[h++]=U[O++],1<v&&(U[h++]=U[O++]))}break}}break}}while(a<l&&h<I);a-=v=F>>3,m&=(1<<(F-=v<<3))-1,n.next_in=a,n.next_out=h,n.avail_in=a<l?l-a+5:5-(a-l),n.avail_out=h<I?I-h+257:257-(h-I),o.hold=m,o.bits=F}},{}],49:[function(t,e,s){var n=t("../utils/common"),r=t("./adler32"),o=t("./crc32"),a=t("./inffast"),l=t("./inftrees"),h=1,f=2,I=0,u=-2,d=1,E=852,T=592;function p(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function F(O){var w;return O&&O.state?(w=O.state,O.total_in=O.total_out=w.total=0,O.msg="",w.wrap&&(O.adler=1&w.wrap),w.mode=d,w.last=0,w.havedict=0,w.dmax=32768,w.head=null,w.hold=0,w.bits=0,w.lencode=w.lendyn=new n.Buf32(E),w.distcode=w.distdyn=new n.Buf32(T),w.sane=1,w.back=-1,I):u}function R(O){var w;return O&&O.state?((w=O.state).wsize=0,w.whave=0,w.wnext=0,F(O)):u}function S(O,w){var g,U;return O&&O.state?(U=O.state,w<0?(g=0,w=-w):(g=1+(w>>4),w<48&&(w&=15)),w&&(w<8||15<w)?u:(U.window!==null&&U.wbits!==w&&(U.window=null),U.wrap=g,U.wbits=w,R(O))):u}function N(O,w){var g,U;return O?(U=new m,(O.state=U).window=null,(g=S(O,w))!==I&&(O.state=null),g):u}var L,D,P=!0;function v(O){if(P){var w;for(L=new n.Buf32(512),D=new n.Buf32(32),w=0;w<144;)O.lens[w++]=8;for(;w<256;)O.lens[w++]=9;for(;w<280;)O.lens[w++]=7;for(;w<288;)O.lens[w++]=8;for(l(h,O.lens,0,288,L,0,O.work,{bits:9}),w=0;w<32;)O.lens[w++]=5;l(f,O.lens,0,32,D,0,O.work,{bits:5}),P=!1}O.lencode=L,O.lenbits=9,O.distcode=D,O.distbits=5}function G(O,w,g,U){var Q,z=O.state;return z.window===null&&(z.wsize=1<<z.wbits,z.wnext=0,z.whave=0,z.window=new n.Buf8(z.wsize)),U>=z.wsize?(n.arraySet(z.window,w,g-z.wsize,z.wsize,0),z.wnext=0,z.whave=z.wsize):(U<(Q=z.wsize-z.wnext)&&(Q=U),n.arraySet(z.window,w,g-U,Q,z.wnext),(U-=Q)?(n.arraySet(z.window,w,g-U,U,0),z.wnext=U,z.whave=z.wsize):(z.wnext+=Q,z.wnext===z.wsize&&(z.wnext=0),z.whave<z.wsize&&(z.whave+=Q))),0}s.inflateReset=R,s.inflateReset2=S,s.inflateResetKeep=F,s.inflateInit=function(O){return N(O,15)},s.inflateInit2=N,s.inflate=function(O,w){var g,U,Q,z,et,X,nt,Y,B,rt,it,tt,Ft,Nt,ot,ft,ut,Ct,Gt,wt,A,$,H,M,_=0,x=new n.Buf8(4),Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return u;(g=O.state).mode===12&&(g.mode=13),et=O.next_out,Q=O.output,nt=O.avail_out,z=O.next_in,U=O.input,X=O.avail_in,Y=g.hold,B=g.bits,rt=X,it=nt,$=I;t:for(;;)switch(g.mode){case d:if(g.wrap===0){g.mode=13;break}for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(2&g.wrap&&Y===35615){x[g.check=0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0),B=Y=0,g.mode=2;break}if(g.flags=0,g.head&&(g.head.done=!1),!(1&g.wrap)||(((255&Y)<<8)+(Y>>8))%31){O.msg="incorrect header check",g.mode=30;break}if((15&Y)!=8){O.msg="unknown compression method",g.mode=30;break}if(B-=4,A=8+(15&(Y>>>=4)),g.wbits===0)g.wbits=A;else if(A>g.wbits){O.msg="invalid window size",g.mode=30;break}g.dmax=1<<A,O.adler=g.check=1,g.mode=512&Y?10:12,B=Y=0;break;case 2:for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(g.flags=Y,(255&g.flags)!=8){O.msg="unknown compression method",g.mode=30;break}if(57344&g.flags){O.msg="unknown header flags set",g.mode=30;break}g.head&&(g.head.text=Y>>8&1),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0)),B=Y=0,g.mode=3;case 3:for(;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.head&&(g.head.time=Y),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,x[2]=Y>>>16&255,x[3]=Y>>>24&255,g.check=o(g.check,x,4,0)),B=Y=0,g.mode=4;case 4:for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.head&&(g.head.xflags=255&Y,g.head.os=Y>>8),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0)),B=Y=0,g.mode=5;case 5:if(1024&g.flags){for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.length=Y,g.head&&(g.head.extra_len=Y),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0)),B=Y=0}else g.head&&(g.head.extra=null);g.mode=6;case 6:if(1024&g.flags&&(X<(tt=g.length)&&(tt=X),tt&&(g.head&&(A=g.head.extra_len-g.length,g.head.extra||(g.head.extra=new Array(g.head.extra_len)),n.arraySet(g.head.extra,U,z,tt,A)),512&g.flags&&(g.check=o(g.check,U,tt,z)),X-=tt,z+=tt,g.length-=tt),g.length))break t;g.length=0,g.mode=7;case 7:if(2048&g.flags){if(X===0)break t;for(tt=0;A=U[z+tt++],g.head&&A&&g.length<65536&&(g.head.name+=String.fromCharCode(A)),A&&tt<X;);if(512&g.flags&&(g.check=o(g.check,U,tt,z)),X-=tt,z+=tt,A)break t}else g.head&&(g.head.name=null);g.length=0,g.mode=8;case 8:if(4096&g.flags){if(X===0)break t;for(tt=0;A=U[z+tt++],g.head&&A&&g.length<65536&&(g.head.comment+=String.fromCharCode(A)),A&&tt<X;);if(512&g.flags&&(g.check=o(g.check,U,tt,z)),X-=tt,z+=tt,A)break t}else g.head&&(g.head.comment=null);g.mode=9;case 9:if(512&g.flags){for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(Y!==(65535&g.check)){O.msg="header crc mismatch",g.mode=30;break}B=Y=0}g.head&&(g.head.hcrc=g.flags>>9&1,g.head.done=!0),O.adler=g.check=0,g.mode=12;break;case 10:for(;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}O.adler=g.check=p(Y),B=Y=0,g.mode=11;case 11:if(g.havedict===0)return O.next_out=et,O.avail_out=nt,O.next_in=z,O.avail_in=X,g.hold=Y,g.bits=B,2;O.adler=g.check=1,g.mode=12;case 12:if(w===5||w===6)break t;case 13:if(g.last){Y>>>=7&B,B-=7&B,g.mode=27;break}for(;B<3;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}switch(g.last=1&Y,B-=1,3&(Y>>>=1)){case 0:g.mode=14;break;case 1:if(v(g),g.mode=20,w!==6)break;Y>>>=2,B-=2;break t;case 2:g.mode=17;break;case 3:O.msg="invalid block type",g.mode=30}Y>>>=2,B-=2;break;case 14:for(Y>>>=7&B,B-=7&B;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if((65535&Y)!=(Y>>>16^65535)){O.msg="invalid stored block lengths",g.mode=30;break}if(g.length=65535&Y,B=Y=0,g.mode=15,w===6)break t;case 15:g.mode=16;case 16:if(tt=g.length){if(X<tt&&(tt=X),nt<tt&&(tt=nt),tt===0)break t;n.arraySet(Q,U,z,tt,et),X-=tt,z+=tt,nt-=tt,et+=tt,g.length-=tt;break}g.mode=12;break;case 17:for(;B<14;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(g.nlen=257+(31&Y),Y>>>=5,B-=5,g.ndist=1+(31&Y),Y>>>=5,B-=5,g.ncode=4+(15&Y),Y>>>=4,B-=4,286<g.nlen||30<g.ndist){O.msg="too many length or distance symbols",g.mode=30;break}g.have=0,g.mode=18;case 18:for(;g.have<g.ncode;){for(;B<3;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.lens[Z[g.have++]]=7&Y,Y>>>=3,B-=3}for(;g.have<19;)g.lens[Z[g.have++]]=0;if(g.lencode=g.lendyn,g.lenbits=7,H={bits:g.lenbits},$=l(0,g.lens,0,19,g.lencode,0,g.work,H),g.lenbits=H.bits,$){O.msg="invalid code lengths set",g.mode=30;break}g.have=0,g.mode=19;case 19:for(;g.have<g.nlen+g.ndist;){for(;ft=(_=g.lencode[Y&(1<<g.lenbits)-1])>>>16&255,ut=65535&_,!((ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(ut<16)Y>>>=ot,B-=ot,g.lens[g.have++]=ut;else{if(ut===16){for(M=ot+2;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(Y>>>=ot,B-=ot,g.have===0){O.msg="invalid bit length repeat",g.mode=30;break}A=g.lens[g.have-1],tt=3+(3&Y),Y>>>=2,B-=2}else if(ut===17){for(M=ot+3;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}B-=ot,A=0,tt=3+(7&(Y>>>=ot)),Y>>>=3,B-=3}else{for(M=ot+7;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}B-=ot,A=0,tt=11+(127&(Y>>>=ot)),Y>>>=7,B-=7}if(g.have+tt>g.nlen+g.ndist){O.msg="invalid bit length repeat",g.mode=30;break}for(;tt--;)g.lens[g.have++]=A}}if(g.mode===30)break;if(g.lens[256]===0){O.msg="invalid code -- missing end-of-block",g.mode=30;break}if(g.lenbits=9,H={bits:g.lenbits},$=l(h,g.lens,0,g.nlen,g.lencode,0,g.work,H),g.lenbits=H.bits,$){O.msg="invalid literal/lengths set",g.mode=30;break}if(g.distbits=6,g.distcode=g.distdyn,H={bits:g.distbits},$=l(f,g.lens,g.nlen,g.ndist,g.distcode,0,g.work,H),g.distbits=H.bits,$){O.msg="invalid distances set",g.mode=30;break}if(g.mode=20,w===6)break t;case 20:g.mode=21;case 21:if(6<=X&&258<=nt){O.next_out=et,O.avail_out=nt,O.next_in=z,O.avail_in=X,g.hold=Y,g.bits=B,a(O,it),et=O.next_out,Q=O.output,nt=O.avail_out,z=O.next_in,U=O.input,X=O.avail_in,Y=g.hold,B=g.bits,g.mode===12&&(g.back=-1);break}for(g.back=0;ft=(_=g.lencode[Y&(1<<g.lenbits)-1])>>>16&255,ut=65535&_,!((ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(ft&&!(240&ft)){for(Ct=ot,Gt=ft,wt=ut;ft=(_=g.lencode[wt+((Y&(1<<Ct+Gt)-1)>>Ct)])>>>16&255,ut=65535&_,!(Ct+(ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}Y>>>=Ct,B-=Ct,g.back+=Ct}if(Y>>>=ot,B-=ot,g.back+=ot,g.length=ut,ft===0){g.mode=26;break}if(32&ft){g.back=-1,g.mode=12;break}if(64&ft){O.msg="invalid literal/length code",g.mode=30;break}g.extra=15&ft,g.mode=22;case 22:if(g.extra){for(M=g.extra;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.length+=Y&(1<<g.extra)-1,Y>>>=g.extra,B-=g.extra,g.back+=g.extra}g.was=g.length,g.mode=23;case 23:for(;ft=(_=g.distcode[Y&(1<<g.distbits)-1])>>>16&255,ut=65535&_,!((ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(!(240&ft)){for(Ct=ot,Gt=ft,wt=ut;ft=(_=g.distcode[wt+((Y&(1<<Ct+Gt)-1)>>Ct)])>>>16&255,ut=65535&_,!(Ct+(ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}Y>>>=Ct,B-=Ct,g.back+=Ct}if(Y>>>=ot,B-=ot,g.back+=ot,64&ft){O.msg="invalid distance code",g.mode=30;break}g.offset=ut,g.extra=15&ft,g.mode=24;case 24:if(g.extra){for(M=g.extra;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.offset+=Y&(1<<g.extra)-1,Y>>>=g.extra,B-=g.extra,g.back+=g.extra}if(g.offset>g.dmax){O.msg="invalid distance too far back",g.mode=30;break}g.mode=25;case 25:if(nt===0)break t;if(tt=it-nt,g.offset>tt){if((tt=g.offset-tt)>g.whave&&g.sane){O.msg="invalid distance too far back",g.mode=30;break}Ft=tt>g.wnext?(tt-=g.wnext,g.wsize-tt):g.wnext-tt,tt>g.length&&(tt=g.length),Nt=g.window}else Nt=Q,Ft=et-g.offset,tt=g.length;for(nt<tt&&(tt=nt),nt-=tt,g.length-=tt;Q[et++]=Nt[Ft++],--tt;);g.length===0&&(g.mode=21);break;case 26:if(nt===0)break t;Q[et++]=g.length,nt--,g.mode=21;break;case 27:if(g.wrap){for(;B<32;){if(X===0)break t;X--,Y|=U[z++]<<B,B+=8}if(it-=nt,O.total_out+=it,g.total+=it,it&&(O.adler=g.check=g.flags?o(g.check,Q,it,et-it):r(g.check,Q,it,et-it)),it=nt,(g.flags?Y:p(Y))!==g.check){O.msg="incorrect data check",g.mode=30;break}B=Y=0}g.mode=28;case 28:if(g.wrap&&g.flags){for(;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(Y!==(4294967295&g.total)){O.msg="incorrect length check",g.mode=30;break}B=Y=0}g.mode=29;case 29:$=1;break t;case 30:$=-3;break t;case 31:return-4;case 32:default:return u}return O.next_out=et,O.avail_out=nt,O.next_in=z,O.avail_in=X,g.hold=Y,g.bits=B,(g.wsize||it!==O.avail_out&&g.mode<30&&(g.mode<27||w!==4))&&G(O,O.output,O.next_out,it-O.avail_out)?(g.mode=31,-4):(rt-=O.avail_in,it-=O.avail_out,O.total_in+=rt,O.total_out+=it,g.total+=it,g.wrap&&it&&(O.adler=g.check=g.flags?o(g.check,Q,it,O.next_out-it):r(g.check,Q,it,O.next_out-it)),O.data_type=g.bits+(g.last?64:0)+(g.mode===12?128:0)+(g.mode===20||g.mode===15?256:0),(rt==0&&it===0||w===4)&&$===I&&($=-5),$)},s.inflateEnd=function(O){if(!O||!O.state)return u;var w=O.state;return w.window&&(w.window=null),O.state=null,I},s.inflateGetHeader=function(O,w){var g;return O&&O.state&&2&(g=O.state).wrap?((g.head=w).done=!1,I):u},s.inflateSetDictionary=function(O,w){var g,U=w.length;return O&&O.state?(g=O.state).wrap!==0&&g.mode!==11?u:g.mode===11&&r(1,w,U,0)!==g.check?-3:G(O,w,U,U)?(g.mode=31,-4):(g.havedict=1,I):u},s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,s){var n=t("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(h,f,I,u,d,E,T,p){var m,F,R,S,N,L,D,P,v,G=p.bits,O=0,w=0,g=0,U=0,Q=0,z=0,et=0,X=0,nt=0,Y=0,B=null,rt=0,it=new n.Buf16(16),tt=new n.Buf16(16),Ft=null,Nt=0;for(O=0;O<=15;O++)it[O]=0;for(w=0;w<u;w++)it[f[I+w]]++;for(Q=G,U=15;1<=U&&it[U]===0;U--);if(U<Q&&(Q=U),U===0)return d[E++]=20971520,d[E++]=20971520,p.bits=1,0;for(g=1;g<U&&it[g]===0;g++);for(Q<g&&(Q=g),O=X=1;O<=15;O++)if(X<<=1,(X-=it[O])<0)return-1;if(0<X&&(h===0||U!==1))return-1;for(tt[1]=0,O=1;O<15;O++)tt[O+1]=tt[O]+it[O];for(w=0;w<u;w++)f[I+w]!==0&&(T[tt[f[I+w]]++]=w);if(L=h===0?(B=Ft=T,19):h===1?(B=r,rt-=257,Ft=o,Nt-=257,256):(B=a,Ft=l,-1),O=g,N=E,et=w=Y=0,R=-1,S=(nt=1<<(z=Q))-1,h===1&&852<nt||h===2&&592<nt)return 1;for(;;){for(D=O-et,v=T[w]<L?(P=0,T[w]):T[w]>L?(P=Ft[Nt+T[w]],B[rt+T[w]]):(P=96,0),m=1<<O-et,g=F=1<<z;d[N+(Y>>et)+(F-=m)]=D<<24|P<<16|v|0,F!==0;);for(m=1<<O-1;Y&m;)m>>=1;if(m!==0?(Y&=m-1,Y+=m):Y=0,w++,--it[O]==0){if(O===U)break;O=f[I+T[w]]}if(Q<O&&(Y&S)!==R){for(et===0&&(et=Q),N+=g,X=1<<(z=O-et);z+et<U&&!((X-=it[z+et])<=0);)z++,X<<=1;if(nt+=1<<z,h===1&&852<nt||h===2&&592<nt)return 1;d[R=Y&S]=Q<<24|z<<16|N-E|0}}return Y!==0&&(d[N+Y]=O-et<<24|64<<16|0),p.bits=Q,0}},{"../utils/common":41}],51:[function(t,e,s){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,s){var n=t("../utils/common"),r=0,o=1;function a(_){for(var x=_.length;0<=--x;)_[x]=0}var l=0,h=29,f=256,I=f+1+h,u=30,d=19,E=2*I+1,T=15,p=16,m=7,F=256,R=16,S=17,N=18,L=[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],D=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=new Array(2*(I+2));a(G);var O=new Array(2*u);a(O);var w=new Array(512);a(w);var g=new Array(256);a(g);var U=new Array(h);a(U);var Q,z,et,X=new Array(u);function nt(_,x,Z,j,V){this.static_tree=_,this.extra_bits=x,this.extra_base=Z,this.elems=j,this.max_length=V,this.has_stree=_&&_.length}function Y(_,x){this.dyn_tree=_,this.max_code=0,this.stat_desc=x}function B(_){return _<256?w[_]:w[256+(_>>>7)]}function rt(_,x){_.pending_buf[_.pending++]=255&x,_.pending_buf[_.pending++]=x>>>8&255}function it(_,x,Z){_.bi_valid>p-Z?(_.bi_buf|=x<<_.bi_valid&65535,rt(_,_.bi_buf),_.bi_buf=x>>p-_.bi_valid,_.bi_valid+=Z-p):(_.bi_buf|=x<<_.bi_valid&65535,_.bi_valid+=Z)}function tt(_,x,Z){it(_,Z[2*x],Z[2*x+1])}function Ft(_,x){for(var Z=0;Z|=1&_,_>>>=1,Z<<=1,0<--x;);return Z>>>1}function Nt(_,x,Z){var j,V,K=new Array(T+1),st=0;for(j=1;j<=T;j++)K[j]=st=st+Z[j-1]<<1;for(V=0;V<=x;V++){var J=_[2*V+1];J!==0&&(_[2*V]=Ft(K[J]++,J))}}function ot(_){var x;for(x=0;x<I;x++)_.dyn_ltree[2*x]=0;for(x=0;x<u;x++)_.dyn_dtree[2*x]=0;for(x=0;x<d;x++)_.bl_tree[2*x]=0;_.dyn_ltree[2*F]=1,_.opt_len=_.static_len=0,_.last_lit=_.matches=0}function ft(_){8<_.bi_valid?rt(_,_.bi_buf):0<_.bi_valid&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0}function ut(_,x,Z,j){var V=2*x,K=2*Z;return _[V]<_[K]||_[V]===_[K]&&j[x]<=j[Z]}function Ct(_,x,Z){for(var j=_.heap[Z],V=Z<<1;V<=_.heap_len&&(V<_.heap_len&&ut(x,_.heap[V+1],_.heap[V],_.depth)&&V++,!ut(x,j,_.heap[V],_.depth));)_.heap[Z]=_.heap[V],Z=V,V<<=1;_.heap[Z]=j}function Gt(_,x,Z){var j,V,K,st,J=0;if(_.last_lit!==0)for(;j=_.pending_buf[_.d_buf+2*J]<<8|_.pending_buf[_.d_buf+2*J+1],V=_.pending_buf[_.l_buf+J],J++,j===0?tt(_,V,x):(tt(_,(K=g[V])+f+1,x),(st=L[K])!==0&&it(_,V-=U[K],st),tt(_,K=B(--j),Z),(st=D[K])!==0&&it(_,j-=X[K],st)),J<_.last_lit;);tt(_,F,x)}function wt(_,x){var Z,j,V,K=x.dyn_tree,st=x.stat_desc.static_tree,J=x.stat_desc.has_stree,at=x.stat_desc.elems,Rt=-1;for(_.heap_len=0,_.heap_max=E,Z=0;Z<at;Z++)K[2*Z]!==0?(_.heap[++_.heap_len]=Rt=Z,_.depth[Z]=0):K[2*Z+1]=0;for(;_.heap_len<2;)K[2*(V=_.heap[++_.heap_len]=Rt<2?++Rt:0)]=1,_.depth[V]=0,_.opt_len--,J&&(_.static_len-=st[2*V+1]);for(x.max_code=Rt,Z=_.heap_len>>1;1<=Z;Z--)Ct(_,K,Z);for(V=at;Z=_.heap[1],_.heap[1]=_.heap[_.heap_len--],Ct(_,K,1),j=_.heap[1],_.heap[--_.heap_max]=Z,_.heap[--_.heap_max]=j,K[2*V]=K[2*Z]+K[2*j],_.depth[V]=(_.depth[Z]>=_.depth[j]?_.depth[Z]:_.depth[j])+1,K[2*Z+1]=K[2*j+1]=V,_.heap[1]=V++,Ct(_,K,1),2<=_.heap_len;);_.heap[--_.heap_max]=_.heap[1],function(It,zt){var ii,ne,si,yt,vi,Hs,he=zt.dyn_tree,Hn=zt.max_code,vo=zt.stat_desc.static_tree,Uo=zt.stat_desc.has_stree,xo=zt.stat_desc.extra_bits,Wn=zt.stat_desc.extra_base,ni=zt.stat_desc.max_length,Ui=0;for(yt=0;yt<=T;yt++)It.bl_count[yt]=0;for(he[2*It.heap[It.heap_max]+1]=0,ii=It.heap_max+1;ii<E;ii++)ni<(yt=he[2*he[2*(ne=It.heap[ii])+1]+1]+1)&&(yt=ni,Ui++),he[2*ne+1]=yt,Hn<ne||(It.bl_count[yt]++,vi=0,Wn<=ne&&(vi=xo[ne-Wn]),Hs=he[2*ne],It.opt_len+=Hs*(yt+vi),Uo&&(It.static_len+=Hs*(vo[2*ne+1]+vi)));if(Ui!==0){do{for(yt=ni-1;It.bl_count[yt]===0;)yt--;It.bl_count[yt]--,It.bl_count[yt+1]+=2,It.bl_count[ni]--,Ui-=2}while(0<Ui);for(yt=ni;yt!==0;yt--)for(ne=It.bl_count[yt];ne!==0;)Hn<(si=It.heap[--ii])||(he[2*si+1]!==yt&&(It.opt_len+=(yt-he[2*si+1])*he[2*si],he[2*si+1]=yt),ne--)}}(_,x),Nt(K,Rt,_.bl_count)}function A(_,x,Z){var j,V,K=-1,st=x[1],J=0,at=7,Rt=4;for(st===0&&(at=138,Rt=3),x[2*(Z+1)+1]=65535,j=0;j<=Z;j++)V=st,st=x[2*(j+1)+1],++J<at&&V===st||(J<Rt?_.bl_tree[2*V]+=J:V!==0?(V!==K&&_.bl_tree[2*V]++,_.bl_tree[2*R]++):J<=10?_.bl_tree[2*S]++:_.bl_tree[2*N]++,K=V,Rt=(J=0)===st?(at=138,3):V===st?(at=6,3):(at=7,4))}function $(_,x,Z){var j,V,K=-1,st=x[1],J=0,at=7,Rt=4;for(st===0&&(at=138,Rt=3),j=0;j<=Z;j++)if(V=st,st=x[2*(j+1)+1],!(++J<at&&V===st)){if(J<Rt)for(;tt(_,V,_.bl_tree),--J!=0;);else V!==0?(V!==K&&(tt(_,V,_.bl_tree),J--),tt(_,R,_.bl_tree),it(_,J-3,2)):J<=10?(tt(_,S,_.bl_tree),it(_,J-3,3)):(tt(_,N,_.bl_tree),it(_,J-11,7));K=V,Rt=(J=0)===st?(at=138,3):V===st?(at=6,3):(at=7,4)}}a(X);var H=!1;function M(_,x,Z,j){it(_,(l<<1)+(j?1:0),3),function(V,K,st,J){ft(V),rt(V,st),rt(V,~st),n.arraySet(V.pending_buf,V.window,K,st,V.pending),V.pending+=st}(_,x,Z)}s._tr_init=function(_){H||(function(){var x,Z,j,V,K,st=new Array(T+1);for(V=j=0;V<h-1;V++)for(U[V]=j,x=0;x<1<<L[V];x++)g[j++]=V;for(g[j-1]=V,V=K=0;V<16;V++)for(X[V]=K,x=0;x<1<<D[V];x++)w[K++]=V;for(K>>=7;V<u;V++)for(X[V]=K<<7,x=0;x<1<<D[V]-7;x++)w[256+K++]=V;for(Z=0;Z<=T;Z++)st[Z]=0;for(x=0;x<=143;)G[2*x+1]=8,x++,st[8]++;for(;x<=255;)G[2*x+1]=9,x++,st[9]++;for(;x<=279;)G[2*x+1]=7,x++,st[7]++;for(;x<=287;)G[2*x+1]=8,x++,st[8]++;for(Nt(G,I+1,st),x=0;x<u;x++)O[2*x+1]=5,O[2*x]=Ft(x,5);Q=new nt(G,L,f+1,I,T),z=new nt(O,D,0,u,T),et=new nt(new Array(0),P,0,d,m)}(),H=!0),_.l_desc=new Y(_.dyn_ltree,Q),_.d_desc=new Y(_.dyn_dtree,z),_.bl_desc=new Y(_.bl_tree,et),_.bi_buf=0,_.bi_valid=0,ot(_)},s._tr_stored_block=M,s._tr_flush_block=function(_,x,Z,j){var V,K,st=0;0<_.level?(_.strm.data_type===2&&(_.strm.data_type=function(J){var at,Rt=4093624447;for(at=0;at<=31;at++,Rt>>>=1)if(1&Rt&&J.dyn_ltree[2*at]!==0)return r;if(J.dyn_ltree[18]!==0||J.dyn_ltree[20]!==0||J.dyn_ltree[26]!==0)return o;for(at=32;at<f;at++)if(J.dyn_ltree[2*at]!==0)return o;return r}(_)),wt(_,_.l_desc),wt(_,_.d_desc),st=function(J){var at;for(A(J,J.dyn_ltree,J.l_desc.max_code),A(J,J.dyn_dtree,J.d_desc.max_code),wt(J,J.bl_desc),at=d-1;3<=at&&J.bl_tree[2*v[at]+1]===0;at--);return J.opt_len+=3*(at+1)+5+5+4,at}(_),V=_.opt_len+3+7>>>3,(K=_.static_len+3+7>>>3)<=V&&(V=K)):V=K=Z+5,Z+4<=V&&x!==-1?M(_,x,Z,j):_.strategy===4||K===V?(it(_,2+(j?1:0),3),Gt(_,G,O)):(it(_,4+(j?1:0),3),function(J,at,Rt,It){var zt;for(it(J,at-257,5),it(J,Rt-1,5),it(J,It-4,4),zt=0;zt<It;zt++)it(J,J.bl_tree[2*v[zt]+1],3);$(J,J.dyn_ltree,at-1),$(J,J.dyn_dtree,Rt-1)}(_,_.l_desc.max_code+1,_.d_desc.max_code+1,st+1),Gt(_,_.dyn_ltree,_.dyn_dtree)),ot(_),j&&ft(_)},s._tr_tally=function(_,x,Z){return _.pending_buf[_.d_buf+2*_.last_lit]=x>>>8&255,_.pending_buf[_.d_buf+2*_.last_lit+1]=255&x,_.pending_buf[_.l_buf+_.last_lit]=255&Z,_.last_lit++,x===0?_.dyn_ltree[2*Z]++:(_.matches++,x--,_.dyn_ltree[2*(g[Z]+f+1)]++,_.dyn_dtree[2*B(x)]++),_.last_lit===_.lit_bufsize-1},s._tr_align=function(_){it(_,2,3),tt(_,F,G),function(x){x.bi_valid===16?(rt(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)}(_)}},{"../utils/common":41}],53:[function(t,e,s){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,s){(function(n){(function(r,o){if(!r.setImmediate){var a,l,h,f,I=1,u={},d=!1,E=r.document,T=Object.getPrototypeOf&&Object.getPrototypeOf(r);T=T&&T.setTimeout?T:r,a={}.toString.call(r.process)==="[object process]"?function(R){process.nextTick(function(){m(R)})}:function(){if(r.postMessage&&!r.importScripts){var R=!0,S=r.onmessage;return r.onmessage=function(){R=!1},r.postMessage("","*"),r.onmessage=S,R}}()?(f="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",F,!1):r.attachEvent("onmessage",F),function(R){r.postMessage(f+R,"*")}):r.MessageChannel?((h=new MessageChannel).port1.onmessage=function(R){m(R.data)},function(R){h.port2.postMessage(R)}):E&&"onreadystatechange"in E.createElement("script")?(l=E.documentElement,function(R){var S=E.createElement("script");S.onreadystatechange=function(){m(R),S.onreadystatechange=null,l.removeChild(S),S=null},l.appendChild(S)}):function(R){setTimeout(m,0,R)},T.setImmediate=function(R){typeof R!="function"&&(R=new Function(""+R));for(var S=new Array(arguments.length-1),N=0;N<S.length;N++)S[N]=arguments[N+1];var L={callback:R,args:S};return u[I]=L,a(I),I++},T.clearImmediate=p}function p(R){delete u[R]}function m(R){if(d)setTimeout(m,0,R);else{var S=u[R];if(S){d=!0;try{(function(N){var L=N.callback,D=N.args;switch(D.length){case 0:L();break;case 1:L(D[0]);break;case 2:L(D[0],D[1]);break;case 3:L(D[0],D[1],D[2]);break;default:L.apply(o,D)}})(S)}finally{p(R),d=!1}}}}function F(R){R.source===r&&typeof R.data=="string"&&R.data.indexOf(f)===0&&m(+R.data.slice(f.length))}})(typeof self>"u"?n===void 0?this:n:self)}).call(this,typeof os<"u"?os:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Eo);var yc=Eo.exports;const Lr=Nc(yc);var Yn={},ks={};(function(c){const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",e="["+i+"]["+t+"]*",s=new RegExp("^"+e+"$"),n=function(o,a){const l=[];let h=a.exec(o);for(;h;){const f=[];f.startIndex=a.lastIndex-h[0].length;const I=h.length;for(let u=0;u<I;u++)f.push(h[u]);l.push(f),h=a.exec(o)}return l},r=function(o){const a=s.exec(o);return!(a===null||typeof a>"u")};c.isExist=function(o){return typeof o<"u"},c.isEmptyObject=function(o){return Object.keys(o).length===0},c.merge=function(o,a,l){if(a){const h=Object.keys(a),f=h.length;for(let I=0;I<f;I++)l==="strict"?o[h[I]]=[a[h[I]]]:o[h[I]]=a[h[I]]}},c.getValue=function(o){return c.isExist(o)?o:""},c.isName=r,c.getAllMatches=n,c.nameRegexp=e})(ks);const Gn=ks,Lc={allowBooleanAttributes:!1,unpairedTags:[]};Yn.validate=function(c,i){i=Object.assign({},Lc,i);const t=[];let e=!1,s=!1;c[0]==="\uFEFF"&&(c=c.substr(1));for(let n=0;n<c.length;n++)if(c[n]==="<"&&c[n+1]==="?"){if(n+=2,n=_r(c,n),n.err)return n}else if(c[n]==="<"){let r=n;if(n++,c[n]==="!"){n=Mr(c,n);continue}else{let o=!1;c[n]==="/"&&(o=!0,n++);let a="";for(;n<c.length&&c[n]!==">"&&c[n]!==" "&&c[n]!==" "&&c[n]!==`
|
|
140
|
-
`&&c[n]!=="\r";n++)a+=c[n];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),n--),!
|
|
141
|
-
`||c==="\r"}function _r(c,i){const t=i;for(;i<c.length;i++)if(c[i]=="?"||c[i]==" "){const e=c.substr(t,i-t);if(i>5&&e==="xml")return Pt("InvalidXml","XML declaration allowed only at the start of the document.",vt(c,i));if(c[i]=="?"&&c[i+1]==">"){i++;break}else continue}return i}function Mr(c,i){if(c.length>i+5&&c[i+1]==="-"&&c[i+2]==="-"){for(i+=3;i<c.length;i++)if(c[i]==="-"&&c[i+1]==="-"&&c[i+2]===">"){i+=2;break}}else if(c.length>i+8&&c[i+1]==="D"&&c[i+2]==="O"&&c[i+3]==="C"&&c[i+4]==="T"&&c[i+5]==="Y"&&c[i+6]==="P"&&c[i+7]==="E"){let t=1;for(i+=8;i<c.length;i++)if(c[i]==="<")t++;else if(c[i]===">"&&(t--,t===0))break}else if(c.length>i+9&&c[i+1]==="["&&c[i+2]==="C"&&c[i+3]==="D"&&c[i+4]==="A"&&c[i+5]==="T"&&c[i+6]==="A"&&c[i+7]==="["){for(i+=8;i<c.length;i++)if(c[i]==="]"&&c[i+1]==="]"&&c[i+2]===">"){i+=2;break}}return i}const
|
|
142
|
-
`);const i=new mi("!xml");let t=i,e="",s="";for(let n=0;n<c.length;n++)if(c[n]==="<")if(c[n+1]==="/"){const o=De(c,">",n,"Closing Tag is not closed.");let a=c.substring(n+2,o).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(e=this.saveTextToParentTag(e,t,s));const l=s.substring(s.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);let h=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(h=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=s.lastIndexOf("."),s=s.substring(0,h),t=this.tagsNodeStack.pop(),e="",n=o}else if(c[n+1]==="?"){let o=On(c,n,!1,"?>");if(!o)throw new Error("Pi Tag is not closed.");if(e=this.saveTextToParentTag(e,t,s),!(this.options.ignoreDeclaration&&o.tagName==="?xml"||this.options.ignorePiTags)){const a=new mi(o.tagName);a.add(this.options.textNodeName,""),o.tagName!==o.tagExp&&o.attrExpPresent&&(a[":@"]=this.buildAttributesMap(o.tagExp,s,o.tagName)),this.addChild(t,a,s)}n=o.closeIndex+1}else if(c.substr(n+1,3)==="!--"){const o=De(c,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){const a=c.substring(n+4,o-2);e=this.saveTextToParentTag(e,t,s),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}n=o}else if(c.substr(n+1,2)==="!D"){const o=
|
|
143
|
-
`;function
|
|
139
|
+
\0`,it+=n(Y,2),it+=N.magic,it+=n(F,2),it+=n(R,2),it+=n(nt.crc32,4),it+=n(nt.compressedSize,4),it+=n(nt.uncompressedSize,4),it+=n(D.length,2),it+=n(U.length,2),{fileRecord:f.LOCAL_FILE_HEADER+it+D+U,dirRecord:f.CENTRAL_FILE_HEADER+n(rt,2)+it+n(G.length,2)+"\0\0\0\0"+n(B,4)+n(T,4)+D+U+G}}var o=t("../utils"),a=t("../stream/GenericWorker"),l=t("../utf8"),h=t("../crc32"),f=t("../signature");function I(u,d,E,T){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=E,this.encodeFileName=T,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(I,a),I.prototype.push=function(u){var d=u.meta.percent||0,E=this.entriesCount,T=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,a.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:E?(d+100*(E-T-1))/E:100}}))},I.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var d=this.streamFiles&&!u.file.dir;if(d){var E=r(u,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:E.fileRecord,meta:{percent:0}})}else this.accumulate=!0},I.prototype.closedSource=function(u){this.accumulate=!1;var d=this.streamFiles&&!u.file.dir,E=r(u,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(E.dirRecord),d)this.push({data:function(T){return f.DATA_DESCRIPTOR+n(T.crc32,4)+n(T.compressedSize,4)+n(T.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:E.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},I.prototype.flush=function(){for(var u=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var E=this.bytesWritten-u,T=function(p,m,F,R,S){var N=o.transformTo("string",S(R));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(p,2)+n(p,2)+n(m,4)+n(F,4)+n(N.length,2)+N}(this.dirRecords.length,E,u,this.zipComment,this.encodeFileName);this.push({data:T,meta:{percent:100}})},I.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},I.prototype.registerPrevious=function(u){this._sources.push(u);var d=this;return u.on("data",function(E){d.processChunk(E)}),u.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),u.on("error",function(E){d.error(E)}),this},I.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},I.prototype.error=function(u){var d=this._sources;if(!a.prototype.error.call(this,u))return!1;for(var E=0;E<d.length;E++)try{d[E].error(u)}catch{}return!0},I.prototype.lock=function(){a.prototype.lock.call(this);for(var u=this._sources,d=0;d<u.length;d++)u[d].lock()},e.exports=I},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,s){var n=t("../compressions"),r=t("./ZipFileWorker");s.generateWorker=function(o,a,l){var h=new r(a.streamFiles,l,a.platform,a.encodeFileName),f=0;try{o.forEach(function(I,u){f++;var d=function(m,F){var R=m||F,S=n[R];if(!S)throw new Error(R+" is not a valid compression method !");return S}(u.options.compression,a.compression),E=u.options.compressionOptions||a.compressionOptions||{},T=u.dir,p=u.date;u._compressWorker(d,E).withStreamInfo("file",{name:I,dir:T,date:p,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(h)}),h.entriesCount=f}catch(I){h.error(I)}return h}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,s){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var r=new n;for(var o in this)typeof this[o]!="function"&&(r[o]=this[o]);return r}}(n.prototype=t("./object")).loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.10.1",n.loadAsync=function(r,o){return new n().loadAsync(r,o)},n.external=t("./external"),e.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,s){var n=t("./utils"),r=t("./external"),o=t("./utf8"),a=t("./zipEntries"),l=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function f(I){return new r.Promise(function(u,d){var E=I.decompressed.getContentWorker().pipe(new l);E.on("error",function(T){d(T)}).on("end",function(){E.streamInfo.crc32!==I.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}e.exports=function(I,u){var d=this;return u=n.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),h.isNode&&h.isStream(I)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",I,!0,u.optimizedBinaryString,u.base64).then(function(E){var T=new a(u);return T.load(E),T}).then(function(E){var T=[r.Promise.resolve(E)],p=E.files;if(u.checkCRC32)for(var m=0;m<p.length;m++)T.push(f(p[m]));return r.Promise.all(T)}).then(function(E){for(var T=E.shift(),p=T.files,m=0;m<p.length;m++){var F=p[m],R=F.fileNameStr,S=n.resolve(F.fileNameStr);d.file(S,F.decompressed,{binary:!0,optimizedBinaryString:!0,date:F.date,dir:F.dir,comment:F.fileCommentStr.length?F.fileCommentStr:null,unixPermissions:F.unixPermissions,dosPermissions:F.dosPermissions,createFolders:u.createFolders}),F.dir||(d.file(S).unsafeOriginalName=R)}return T.zipComment.length&&(d.comment=T.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,s){var n=t("../utils"),r=t("../stream/GenericWorker");function o(a,l){r.call(this,"Nodejs stream input adapter for "+a),this._upstreamEnded=!1,this._bindStream(l)}n.inherits(o,r),o.prototype._bindStream=function(a){var l=this;(this._stream=a).pause(),a.on("data",function(h){l.push({data:h,meta:{percent:0}})}).on("error",function(h){l.isPaused?this.generatedError=h:l.error(h)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,s){var n=t("readable-stream").Readable;function r(o,a,l){n.call(this,a),this._helper=o;var h=this;o.on("data",function(f,I){h.push(f)||h._helper.pause(),l&&l(I)}).on("error",function(f){h.emit("error",f)}).on("end",function(){h.push(null)})}t("../utils").inherits(r,n),r.prototype._read=function(){this._helper.resume()},e.exports=r},{"../utils":32,"readable-stream":16}],14:[function(t,e,s){e.exports={isNode:typeof Buffer<"u",newBufferFrom:function(n,r){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(n,r);if(typeof n=="number")throw new Error('The "data" argument must not be a number');return new Buffer(n,r)},allocBuffer:function(n){if(Buffer.alloc)return Buffer.alloc(n);var r=new Buffer(n);return r.fill(0),r},isBuffer:function(n){return Buffer.isBuffer(n)},isStream:function(n){return n&&typeof n.on=="function"&&typeof n.pause=="function"&&typeof n.resume=="function"}}},{}],15:[function(t,e,s){function n(S,N,L){var D,P=o.getTypeOf(N),v=o.extend(L||{},h);v.date=v.date||new Date,v.compression!==null&&(v.compression=v.compression.toUpperCase()),typeof v.unixPermissions=="string"&&(v.unixPermissions=parseInt(v.unixPermissions,8)),v.unixPermissions&&16384&v.unixPermissions&&(v.dir=!0),v.dosPermissions&&16&v.dosPermissions&&(v.dir=!0),v.dir&&(S=p(S)),v.createFolders&&(D=T(S))&&m.call(this,D,!0);var G=P==="string"&&v.binary===!1&&v.base64===!1;L&&L.binary!==void 0||(v.binary=!G),(N instanceof f&&N.uncompressedSize===0||v.dir||!N||N.length===0)&&(v.base64=!1,v.binary=!0,N="",v.compression="STORE",P="string");var O=null;O=N instanceof f||N instanceof a?N:d.isNode&&d.isStream(N)?new E(S,N):o.prepareContent(S,N,v.binary,v.optimizedBinaryString,v.base64);var w=new I(S,O,v);this.files[S]=w}var r=t("./utf8"),o=t("./utils"),a=t("./stream/GenericWorker"),l=t("./stream/StreamHelper"),h=t("./defaults"),f=t("./compressedObject"),I=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),E=t("./nodejs/NodejsStreamInputAdapter"),T=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var N=S.lastIndexOf("/");return 0<N?S.substring(0,N):""},p=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},m=function(S,N){return N=N!==void 0?N:h.createFolders,S=p(S),this.files[S]||n.call(this,S,null,{dir:!0,createFolders:N}),this.files[S]};function F(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var R={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var N,L,D;for(N in this.files)D=this.files[N],(L=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&S(L,D)},filter:function(S){var N=[];return this.forEach(function(L,D){S(L,D)&&N.push(D)}),N},file:function(S,N,L){if(arguments.length!==1)return S=this.root+S,n.call(this,S,N,L),this;if(F(S)){var D=S;return this.filter(function(v,G){return!G.dir&&D.test(v)})}var P=this.files[this.root+S];return P&&!P.dir?P:null},folder:function(S){if(!S)return this;if(F(S))return this.filter(function(P,v){return v.dir&&S.test(P)});var N=this.root+S,L=m.call(this,N),D=this.clone();return D.root=L.name,D},remove:function(S){S=this.root+S;var N=this.files[S];if(N||(S.slice(-1)!=="/"&&(S+="/"),N=this.files[S]),N&&!N.dir)delete this.files[S];else for(var L=this.filter(function(P,v){return v.name.slice(0,S.length)===S}),D=0;D<L.length;D++)delete this.files[L[D].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var N,L={};try{if((L=o.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");o.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var D=L.comment||this.comment||"";N=u.generateWorker(this,L,D)}catch(P){(N=new a("error")).error(P)}return new l(N,L.type||"string",L.mimeType)},generateAsync:function(S,N){return this.generateInternalStream(S).accumulate(N)},generateNodeStream:function(S,N){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(N)}};e.exports=R},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,s){e.exports=t("stream")},{stream:void 0}],17:[function(t,e,s){var n=t("./DataReader");function r(o){n.call(this,o);for(var a=0;a<this.data.length;a++)o[a]=255&o[a]}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data[this.zero+o]},r.prototype.lastIndexOfSignature=function(o){for(var a=o.charCodeAt(0),l=o.charCodeAt(1),h=o.charCodeAt(2),f=o.charCodeAt(3),I=this.length-4;0<=I;--I)if(this.data[I]===a&&this.data[I+1]===l&&this.data[I+2]===h&&this.data[I+3]===f)return I-this.zero;return-1},r.prototype.readAndCheckSignature=function(o){var a=o.charCodeAt(0),l=o.charCodeAt(1),h=o.charCodeAt(2),f=o.charCodeAt(3),I=this.readData(4);return a===I[0]&&l===I[1]&&h===I[2]&&f===I[3]},r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./DataReader":18}],18:[function(t,e,s){var n=t("../utils");function r(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var a,l=0;for(this.checkOffset(o),a=this.index+o-1;a>=this.index;a--)l=(l<<8)+this.byteAt(a);return this.index+=o,l},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},e.exports=r},{"../utils":32}],19:[function(t,e,s){var n=t("./Uint8ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,s){var n=t("./DataReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},r.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},r.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,e,s){var n=t("./ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},e.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,s){var n=t("../utils"),r=t("../support"),o=t("./ArrayReader"),a=t("./StringReader"),l=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(f){var I=n.getTypeOf(f);return n.checkSupport(I),I!=="string"||r.uint8array?I==="nodebuffer"?new l(f):r.uint8array?new h(n.transformTo("uint8array",f)):new o(n.transformTo("array",f)):new a(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,e,s){var n=t("./GenericWorker"),r=t("../utils");function o(a){n.call(this,"ConvertWorker to "+a),this.destType=a}r.inherits(o,n),o.prototype.processChunk=function(a){this.push({data:r.transformTo(this.destType,a.data),meta:a.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,s){var n=t("./GenericWorker"),r=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(a){this.streamInfo.crc32=r(a.data,this.streamInfo.crc32||0),this.push(a)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,s){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}n.inherits(o,r),o.prototype.processChunk=function(a){if(a){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+a.data.length}r.prototype.processChunk.call(this,a)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,s){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(h){l.dataIsReady=!0,l.data=h,l.max=h&&h.length||0,l.type=n.getTypeOf(h),l.isPaused||l._tickAndRepeat()},function(h){l.error(h)})}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,l);break;case"uint8array":a=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":a=this.data.slice(this.index,l)}return this.index=l,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,s){function n(r){this.name=r||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(r){this.emit("data",r)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(r){this.emit("error",r)}return!0},error:function(r){return!this.isFinished&&(this.isPaused?this.generatedError=r:(this.isFinished=!0,this.emit("error",r),this.previous&&this.previous.error(r),this.cleanUp()),!0)},on:function(r,o){return this._listeners[r].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(r,o){if(this._listeners[r])for(var a=0;a<this._listeners[r].length;a++)this._listeners[r][a].call(this,o)},pipe:function(r){return r.registerPrevious(this)},registerPrevious:function(r){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=r.streamInfo,this.mergeStreamInfo(),this.previous=r;var o=this;return r.on("data",function(a){o.processChunk(a)}),r.on("end",function(){o.end()}),r.on("error",function(a){o.error(a)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var r=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),r=!0),this.previous&&this.previous.resume(),!r},flush:function(){},processChunk:function(r){this.push(r)},withStreamInfo:function(r,o){return this.extraStreamInfo[r]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var r in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,r)&&(this.streamInfo[r]=this.extraStreamInfo[r])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var r="Worker "+this.name;return this.previous?this.previous+" -> "+r:r}},e.exports=n},{}],29:[function(t,e,s){var n=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),l=t("../support"),h=t("../external"),f=null;if(l.nodestream)try{f=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function I(d,E){return new h.Promise(function(T,p){var m=[],F=d._internalType,R=d._outputType,S=d._mimeType;d.on("data",function(N,L){m.push(N),E&&E(L)}).on("error",function(N){m=[],p(N)}).on("end",function(){try{var N=function(L,D,P){switch(L){case"blob":return n.newBlob(n.transformTo("arraybuffer",D),P);case"base64":return a.encode(D);default:return n.transformTo(L,D)}}(R,function(L,D){var P,v=0,G=null,O=0;for(P=0;P<D.length;P++)O+=D[P].length;switch(L){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(G=new Uint8Array(O),P=0;P<D.length;P++)G.set(D[P],v),v+=D[P].length;return G;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+L+"'")}}(F,m),S);T(N)}catch(L){p(L)}m=[]}).resume()})}function u(d,E,T){var p=E;switch(E){case"blob":case"arraybuffer":p="uint8array";break;case"base64":p="string"}try{this._internalType=p,this._outputType=E,this._mimeType=T,n.checkSupport(p),this._worker=d.pipe(new r(p)),d.lock()}catch(m){this._worker=new o("error"),this._worker.error(m)}}u.prototype={accumulate:function(d){return I(this,d)},on:function(d,E){var T=this;return d==="data"?this._worker.on(d,function(p){E.call(T,p.data,p.meta)}):this._worker.on(d,function(){n.delay(E,arguments,T)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(n.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},d)}},e.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,s){if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s.nodebuffer=typeof Buffer<"u",s.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")s.blob=!1;else{var n=new ArrayBuffer(0);try{s.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),s.blob=r.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!t("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,s){for(var n=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),a=t("./stream/GenericWorker"),l=new Array(256),h=0;h<256;h++)l[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;l[254]=l[254]=1;function f(){a.call(this,"utf-8 decode"),this.leftOver=null}function I(){a.call(this,"utf-8 encode")}s.utf8encode=function(u){return r.nodebuffer?o.newBufferFrom(u,"utf-8"):function(d){var E,T,p,m,F,R=d.length,S=0;for(m=0;m<R;m++)(64512&(T=d.charCodeAt(m)))==55296&&m+1<R&&(64512&(p=d.charCodeAt(m+1)))==56320&&(T=65536+(T-55296<<10)+(p-56320),m++),S+=T<128?1:T<2048?2:T<65536?3:4;for(E=r.uint8array?new Uint8Array(S):new Array(S),m=F=0;F<S;m++)(64512&(T=d.charCodeAt(m)))==55296&&m+1<R&&(64512&(p=d.charCodeAt(m+1)))==56320&&(T=65536+(T-55296<<10)+(p-56320),m++),T<128?E[F++]=T:(T<2048?E[F++]=192|T>>>6:(T<65536?E[F++]=224|T>>>12:(E[F++]=240|T>>>18,E[F++]=128|T>>>12&63),E[F++]=128|T>>>6&63),E[F++]=128|63&T);return E}(u)},s.utf8decode=function(u){return r.nodebuffer?n.transformTo("nodebuffer",u).toString("utf-8"):function(d){var E,T,p,m,F=d.length,R=new Array(2*F);for(E=T=0;E<F;)if((p=d[E++])<128)R[T++]=p;else if(4<(m=l[p]))R[T++]=65533,E+=m-1;else{for(p&=m===2?31:m===3?15:7;1<m&&E<F;)p=p<<6|63&d[E++],m--;1<m?R[T++]=65533:p<65536?R[T++]=p:(p-=65536,R[T++]=55296|p>>10&1023,R[T++]=56320|1023&p)}return R.length!==T&&(R.subarray?R=R.subarray(0,T):R.length=T),n.applyFromCharCode(R)}(u=n.transformTo(r.uint8array?"uint8array":"array",u))},n.inherits(f,a),f.prototype.processChunk=function(u){var d=n.transformTo(r.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var E=d;(d=new Uint8Array(E.length+this.leftOver.length)).set(this.leftOver,0),d.set(E,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var T=function(m,F){var R;for((F=F||m.length)>m.length&&(F=m.length),R=F-1;0<=R&&(192&m[R])==128;)R--;return R<0||R===0?F:R+l[m[R]]>F?R:F}(d),p=d;T!==d.length&&(r.uint8array?(p=d.subarray(0,T),this.leftOver=d.subarray(T,d.length)):(p=d.slice(0,T),this.leftOver=d.slice(T,d.length))),this.push({data:s.utf8decode(p),meta:u.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,n.inherits(I,a),I.prototype.processChunk=function(u){this.push({data:s.utf8encode(u.data),meta:u.meta})},s.Utf8EncodeWorker=I},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,s){var n=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),a=t("./external");function l(E){return E}function h(E,T){for(var p=0;p<E.length;++p)T[p]=255&E.charCodeAt(p);return T}t("setimmediate"),s.newBlob=function(E,T){s.checkSupport("blob");try{return new Blob([E],{type:T})}catch{try{var p=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return p.append(E),p.getBlob(T)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(E,T,p){var m=[],F=0,R=E.length;if(R<=p)return String.fromCharCode.apply(null,E);for(;F<R;)T==="array"||T==="nodebuffer"?m.push(String.fromCharCode.apply(null,E.slice(F,Math.min(F+p,R)))):m.push(String.fromCharCode.apply(null,E.subarray(F,Math.min(F+p,R)))),F+=p;return m.join("")},stringifyByChar:function(E){for(var T="",p=0;p<E.length;p++)T+=String.fromCharCode(E[p]);return T},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}}()}};function I(E){var T=65536,p=s.getTypeOf(E),m=!0;if(p==="uint8array"?m=f.applyCanBeUsed.uint8array:p==="nodebuffer"&&(m=f.applyCanBeUsed.nodebuffer),m)for(;1<T;)try{return f.stringifyByChunk(E,p,T)}catch{T=Math.floor(T/2)}return f.stringifyByChar(E)}function u(E,T){for(var p=0;p<E.length;p++)T[p]=E[p];return T}s.applyFromCharCode=I;var d={};d.string={string:l,array:function(E){return h(E,new Array(E.length))},arraybuffer:function(E){return d.string.uint8array(E).buffer},uint8array:function(E){return h(E,new Uint8Array(E.length))},nodebuffer:function(E){return h(E,o.allocBuffer(E.length))}},d.array={string:I,array:l,arraybuffer:function(E){return new Uint8Array(E).buffer},uint8array:function(E){return new Uint8Array(E)},nodebuffer:function(E){return o.newBufferFrom(E)}},d.arraybuffer={string:function(E){return I(new Uint8Array(E))},array:function(E){return u(new Uint8Array(E),new Array(E.byteLength))},arraybuffer:l,uint8array:function(E){return new Uint8Array(E)},nodebuffer:function(E){return o.newBufferFrom(new Uint8Array(E))}},d.uint8array={string:I,array:function(E){return u(E,new Array(E.length))},arraybuffer:function(E){return E.buffer},uint8array:l,nodebuffer:function(E){return o.newBufferFrom(E)}},d.nodebuffer={string:I,array:function(E){return u(E,new Array(E.length))},arraybuffer:function(E){return d.nodebuffer.uint8array(E).buffer},uint8array:function(E){return u(E,new Uint8Array(E.length))},nodebuffer:l},s.transformTo=function(E,T){if(T=T||"",!E)return T;s.checkSupport(E);var p=s.getTypeOf(T);return d[p][E](T)},s.resolve=function(E){for(var T=E.split("/"),p=[],m=0;m<T.length;m++){var F=T[m];F==="."||F===""&&m!==0&&m!==T.length-1||(F===".."?p.pop():p.push(F))}return p.join("/")},s.getTypeOf=function(E){return typeof E=="string"?"string":Object.prototype.toString.call(E)==="[object Array]"?"array":n.nodebuffer&&o.isBuffer(E)?"nodebuffer":n.uint8array&&E instanceof Uint8Array?"uint8array":n.arraybuffer&&E instanceof ArrayBuffer?"arraybuffer":void 0},s.checkSupport=function(E){if(!n[E.toLowerCase()])throw new Error(E+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(E){var T,p,m="";for(p=0;p<(E||"").length;p++)m+="\\x"+((T=E.charCodeAt(p))<16?"0":"")+T.toString(16).toUpperCase();return m},s.delay=function(E,T,p){setImmediate(function(){E.apply(p||null,T||[])})},s.inherits=function(E,T){function p(){}p.prototype=T.prototype,E.prototype=new p},s.extend=function(){var E,T,p={};for(E=0;E<arguments.length;E++)for(T in arguments[E])Object.prototype.hasOwnProperty.call(arguments[E],T)&&p[T]===void 0&&(p[T]=arguments[E][T]);return p},s.prepareContent=function(E,T,p,m,F){return a.Promise.resolve(T).then(function(R){return n.blob&&(R instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(R))!==-1)&&typeof FileReader<"u"?new a.Promise(function(S,N){var L=new FileReader;L.onload=function(D){S(D.target.result)},L.onerror=function(D){N(D.target.error)},L.readAsArrayBuffer(R)}):R}).then(function(R){var S=s.getTypeOf(R);return S?(S==="arraybuffer"?R=s.transformTo("uint8array",R):S==="string"&&(F?R=r.decode(R):p&&m!==!0&&(R=function(N){return h(N,n.uint8array?new Uint8Array(N.length):new Array(N.length))}(R))),R):a.Promise.reject(new Error("Can't read the data of '"+E+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,s){var n=t("./reader/readerFor"),r=t("./utils"),o=t("./signature"),a=t("./zipEntry"),l=t("./support");function h(f){this.files=[],this.loadOptions=f}h.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var I=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(I)+", expected "+r.pretty(f)+")")}},isSignature:function(f,I){var u=this.reader.index;this.reader.setIndex(f);var d=this.reader.readString(4)===I;return this.reader.setIndex(u),d},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),I=l.uint8array?"uint8array":"array",u=r.transformTo(I,f);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,I,u,d=this.zip64EndOfCentralSize-44;0<d;)f=this.reader.readInt(2),I=this.reader.readInt(4),u=this.reader.readData(I),this.zip64ExtensibleData[f]={id:f,length:I,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,I;for(f=0;f<this.files.length;f++)I=this.files[f],this.reader.setIndex(I.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),I.readLocalPart(this.reader),I.handleUTF8(),I.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(f=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var I=f;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var d=I-u;if(0<d)this.isSignature(I,o.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(f){this.reader=n(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,s){var n=t("./reader/readerFor"),r=t("./utils"),o=t("./compressedObject"),a=t("./crc32"),l=t("./utf8"),h=t("./compressions"),f=t("./support");function I(u,d){this.options=u,this.loadOptions=d}I.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(u){var d,E;if(u.skip(22),this.fileNameLength=u.readInt(2),E=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(E),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((d=function(T){for(var p in h)if(Object.prototype.hasOwnProperty.call(h,p)&&h[p].magic===T)return h[p];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,d,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var d=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(d),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var d,E,T,p=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<p;)d=u.readInt(2),E=u.readInt(2),T=u.readData(E),this.extraFields[d]={id:d,length:E,value:T};u.setIndex(p)},handleUTF8:function(){var u=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var E=r.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(E)}var T=this.findExtraFieldUnicodeComment();if(T!==null)this.fileCommentStr=T;else{var p=r.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(p)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var d=n(u.value);return d.readInt(1)!==1||a(this.fileName)!==d.readInt(4)?null:l.utf8decode(d.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var d=n(u.value);return d.readInt(1)!==1||a(this.fileComment)!==d.readInt(4)?null:l.utf8decode(d.readData(u.length-5))}return null}},e.exports=I},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,s){function n(d,E,T){this.name=d,this.dir=T.dir,this.date=T.date,this.comment=T.comment,this.unixPermissions=T.unixPermissions,this.dosPermissions=T.dosPermissions,this._data=E,this._dataBinary=T.binary,this.options={compression:T.compression,compressionOptions:T.compressionOptions}}var r=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),a=t("./utf8"),l=t("./compressedObject"),h=t("./stream/GenericWorker");n.prototype={internalStream:function(d){var E=null,T="string";try{if(!d)throw new Error("No output type specified.");var p=(T=d.toLowerCase())==="string"||T==="text";T!=="binarystring"&&T!=="text"||(T="string"),E=this._decompressWorker();var m=!this._dataBinary;m&&!p&&(E=E.pipe(new a.Utf8EncodeWorker)),!m&&p&&(E=E.pipe(new a.Utf8DecodeWorker))}catch(F){(E=new h("error")).error(F)}return new r(E,T,"")},async:function(d,E){return this.internalStream(d).accumulate(E)},nodeStream:function(d,E){return this.internalStream(d||"nodebuffer").toNodejsStream(E)},_compressWorker:function(d,E){if(this._data instanceof l&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var T=this._decompressWorker();return this._dataBinary||(T=T.pipe(new a.Utf8EncodeWorker)),l.createWorkerFrom(T,d,E)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],I=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<f.length;u++)n.prototype[f[u]]=I;e.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,s){(function(n){var r,o,a=n.MutationObserver||n.WebKitMutationObserver;if(a){var l=0,h=new a(d),f=n.document.createTextNode("");h.observe(f,{characterData:!0}),r=function(){f.data=l=++l%2}}else if(n.setImmediate||n.MessageChannel===void 0)r="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var E=n.document.createElement("script");E.onreadystatechange=function(){d(),E.onreadystatechange=null,E.parentNode.removeChild(E),E=null},n.document.documentElement.appendChild(E)}:function(){setTimeout(d,0)};else{var I=new n.MessageChannel;I.port1.onmessage=d,r=function(){I.port2.postMessage(0)}}var u=[];function d(){var E,T;o=!0;for(var p=u.length;p;){for(T=u,u=[],E=-1;++E<p;)T[E]();p=u.length}o=!1}e.exports=function(E){u.push(E)!==1||o||r()}}).call(this,typeof os<"u"?os:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,e,s){var n=t("immediate");function r(){}var o={},a=["REJECTED"],l=["FULFILLED"],h=["PENDING"];function f(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,p!==r&&E(this,p)}function I(p,m,F){this.promise=p,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}function u(p,m,F){n(function(){var R;try{R=m(F)}catch(S){return o.reject(p,S)}R===p?o.reject(p,new TypeError("Cannot resolve promise with itself")):o.resolve(p,R)})}function d(p){var m=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof m=="function")return function(){m.apply(p,arguments)}}function E(p,m){var F=!1;function R(L){F||(F=!0,o.reject(p,L))}function S(L){F||(F=!0,o.resolve(p,L))}var N=T(function(){m(S,R)});N.status==="error"&&R(N.value)}function T(p,m){var F={};try{F.value=p(m),F.status="success"}catch(R){F.status="error",F.value=R}return F}(e.exports=f).prototype.finally=function(p){if(typeof p!="function")return this;var m=this.constructor;return this.then(function(F){return m.resolve(p()).then(function(){return F})},function(F){return m.resolve(p()).then(function(){throw F})})},f.prototype.catch=function(p){return this.then(null,p)},f.prototype.then=function(p,m){if(typeof p!="function"&&this.state===l||typeof m!="function"&&this.state===a)return this;var F=new this.constructor(r);return this.state!==h?u(F,this.state===l?p:m,this.outcome):this.queue.push(new I(F,p,m)),F},I.prototype.callFulfilled=function(p){o.resolve(this.promise,p)},I.prototype.otherCallFulfilled=function(p){u(this.promise,this.onFulfilled,p)},I.prototype.callRejected=function(p){o.reject(this.promise,p)},I.prototype.otherCallRejected=function(p){u(this.promise,this.onRejected,p)},o.resolve=function(p,m){var F=T(d,m);if(F.status==="error")return o.reject(p,F.value);var R=F.value;if(R)E(p,R);else{p.state=l,p.outcome=m;for(var S=-1,N=p.queue.length;++S<N;)p.queue[S].callFulfilled(m)}return p},o.reject=function(p,m){p.state=a,p.outcome=m;for(var F=-1,R=p.queue.length;++F<R;)p.queue[F].callRejected(m);return p},f.resolve=function(p){return p instanceof this?p:o.resolve(new this(r),p)},f.reject=function(p){var m=new this(r);return o.reject(m,p)},f.all=function(p){var m=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=p.length,R=!1;if(!F)return this.resolve([]);for(var S=new Array(F),N=0,L=-1,D=new this(r);++L<F;)P(p[L],L);return D;function P(v,G){m.resolve(v).then(function(O){S[G]=O,++N!==F||R||(R=!0,o.resolve(D,S))},function(O){R||(R=!0,o.reject(D,O))})}},f.race=function(p){var m=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=p.length,R=!1;if(!F)return this.resolve([]);for(var S=-1,N=new this(r);++S<F;)L=p[S],m.resolve(L).then(function(D){R||(R=!0,o.resolve(N,D))},function(D){R||(R=!0,o.reject(N,D))});var L;return N}},{immediate:36}],38:[function(t,e,s){var n={};(0,t("./lib/utils/common").assign)(n,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,s){var n=t("./zlib/deflate"),r=t("./utils/common"),o=t("./utils/strings"),a=t("./zlib/messages"),l=t("./zlib/zstream"),h=Object.prototype.toString,f=0,I=-1,u=0,d=8;function E(p){if(!(this instanceof E))return new E(p);this.options=r.assign({level:I,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},p||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var F=n.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(F!==f)throw new Error(a[F]);if(m.header&&n.deflateSetHeader(this.strm,m.header),m.dictionary){var R;if(R=typeof m.dictionary=="string"?o.string2buf(m.dictionary):h.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(F=n.deflateSetDictionary(this.strm,R))!==f)throw new Error(a[F]);this._dict_set=!0}}function T(p,m){var F=new E(m);if(F.push(p,!0),F.err)throw F.msg||a[F.err];return F.result}E.prototype.push=function(p,m){var F,R,S=this.strm,N=this.options.chunkSize;if(this.ended)return!1;R=m===~~m?m:m===!0?4:0,typeof p=="string"?S.input=o.string2buf(p):h.call(p)==="[object ArrayBuffer]"?S.input=new Uint8Array(p):S.input=p,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new r.Buf8(N),S.next_out=0,S.avail_out=N),(F=n.deflate(S,R))!==1&&F!==f)return this.onEnd(F),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||R!==4&&R!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(r.shrinkBuf(S.output,S.next_out))):this.onData(r.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&F!==1);return R===4?(F=n.deflateEnd(this.strm),this.onEnd(F),this.ended=!0,F===f):R!==2||(this.onEnd(f),!(S.avail_out=0))},E.prototype.onData=function(p){this.chunks.push(p)},E.prototype.onEnd=function(p){p===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},s.Deflate=E,s.deflate=T,s.deflateRaw=function(p,m){return(m=m||{}).raw=!0,T(p,m)},s.gzip=function(p,m){return(m=m||{}).gzip=!0,T(p,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,s){var n=t("./zlib/inflate"),r=t("./utils/common"),o=t("./utils/strings"),a=t("./zlib/constants"),l=t("./zlib/messages"),h=t("./zlib/zstream"),f=t("./zlib/gzheader"),I=Object.prototype.toString;function u(E){if(!(this instanceof u))return new u(E);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},E||{});var T=this.options;T.raw&&0<=T.windowBits&&T.windowBits<16&&(T.windowBits=-T.windowBits,T.windowBits===0&&(T.windowBits=-15)),!(0<=T.windowBits&&T.windowBits<16)||E&&E.windowBits||(T.windowBits+=32),15<T.windowBits&&T.windowBits<48&&!(15&T.windowBits)&&(T.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var p=n.inflateInit2(this.strm,T.windowBits);if(p!==a.Z_OK)throw new Error(l[p]);this.header=new f,n.inflateGetHeader(this.strm,this.header)}function d(E,T){var p=new u(T);if(p.push(E,!0),p.err)throw p.msg||l[p.err];return p.result}u.prototype.push=function(E,T){var p,m,F,R,S,N,L=this.strm,D=this.options.chunkSize,P=this.options.dictionary,v=!1;if(this.ended)return!1;m=T===~~T?T:T===!0?a.Z_FINISH:a.Z_NO_FLUSH,typeof E=="string"?L.input=o.binstring2buf(E):I.call(E)==="[object ArrayBuffer]"?L.input=new Uint8Array(E):L.input=E,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new r.Buf8(D),L.next_out=0,L.avail_out=D),(p=n.inflate(L,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&P&&(N=typeof P=="string"?o.string2buf(P):I.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,p=n.inflateSetDictionary(this.strm,N)),p===a.Z_BUF_ERROR&&v===!0&&(p=a.Z_OK,v=!1),p!==a.Z_STREAM_END&&p!==a.Z_OK)return this.onEnd(p),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&p!==a.Z_STREAM_END&&(L.avail_in!==0||m!==a.Z_FINISH&&m!==a.Z_SYNC_FLUSH)||(this.options.to==="string"?(F=o.utf8border(L.output,L.next_out),R=L.next_out-F,S=o.buf2string(L.output,F),L.next_out=R,L.avail_out=D-R,R&&r.arraySet(L.output,L.output,F,R,0),this.onData(S)):this.onData(r.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(v=!0)}while((0<L.avail_in||L.avail_out===0)&&p!==a.Z_STREAM_END);return p===a.Z_STREAM_END&&(m=a.Z_FINISH),m===a.Z_FINISH?(p=n.inflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===a.Z_OK):m!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(L.avail_out=0))},u.prototype.onData=function(E){this.chunks.push(E)},u.prototype.onEnd=function(E){E===a.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=E,this.msg=this.strm.msg},s.Inflate=u,s.inflate=d,s.inflateRaw=function(E,T){return(T=T||{}).raw=!0,d(E,T)},s.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,s){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";s.assign=function(a){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var h=l.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var f in h)h.hasOwnProperty(f)&&(a[f]=h[f])}}return a},s.shrinkBuf=function(a,l){return a.length===l?a:a.subarray?a.subarray(0,l):(a.length=l,a)};var r={arraySet:function(a,l,h,f,I){if(l.subarray&&a.subarray)a.set(l.subarray(h,h+f),I);else for(var u=0;u<f;u++)a[I+u]=l[h+u]},flattenChunks:function(a){var l,h,f,I,u,d;for(l=f=0,h=a.length;l<h;l++)f+=a[l].length;for(d=new Uint8Array(f),l=I=0,h=a.length;l<h;l++)u=a[l],d.set(u,I),I+=u.length;return d}},o={arraySet:function(a,l,h,f,I){for(var u=0;u<f;u++)a[I+u]=l[h+u]},flattenChunks:function(a){return[].concat.apply([],a)}};s.setTyped=function(a){a?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,r)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,o))},s.setTyped(n)},{}],42:[function(t,e,s){var n=t("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var a=new n.Buf8(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function h(f,I){if(I<65537&&(f.subarray&&o||!f.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(f,I));for(var u="",d=0;d<I;d++)u+=String.fromCharCode(f[d]);return u}a[254]=a[254]=1,s.string2buf=function(f){var I,u,d,E,T,p=f.length,m=0;for(E=0;E<p;E++)(64512&(u=f.charCodeAt(E)))==55296&&E+1<p&&(64512&(d=f.charCodeAt(E+1)))==56320&&(u=65536+(u-55296<<10)+(d-56320),E++),m+=u<128?1:u<2048?2:u<65536?3:4;for(I=new n.Buf8(m),E=T=0;T<m;E++)(64512&(u=f.charCodeAt(E)))==55296&&E+1<p&&(64512&(d=f.charCodeAt(E+1)))==56320&&(u=65536+(u-55296<<10)+(d-56320),E++),u<128?I[T++]=u:(u<2048?I[T++]=192|u>>>6:(u<65536?I[T++]=224|u>>>12:(I[T++]=240|u>>>18,I[T++]=128|u>>>12&63),I[T++]=128|u>>>6&63),I[T++]=128|63&u);return I},s.buf2binstring=function(f){return h(f,f.length)},s.binstring2buf=function(f){for(var I=new n.Buf8(f.length),u=0,d=I.length;u<d;u++)I[u]=f.charCodeAt(u);return I},s.buf2string=function(f,I){var u,d,E,T,p=I||f.length,m=new Array(2*p);for(u=d=0;u<p;)if((E=f[u++])<128)m[d++]=E;else if(4<(T=a[E]))m[d++]=65533,u+=T-1;else{for(E&=T===2?31:T===3?15:7;1<T&&u<p;)E=E<<6|63&f[u++],T--;1<T?m[d++]=65533:E<65536?m[d++]=E:(E-=65536,m[d++]=55296|E>>10&1023,m[d++]=56320|1023&E)}return h(m,d)},s.utf8border=function(f,I){var u;for((I=I||f.length)>f.length&&(I=f.length),u=I-1;0<=u&&(192&f[u])==128;)u--;return u<0||u===0?I:u+a[f[u]]>I?u:I}},{"./common":41}],43:[function(t,e,s){e.exports=function(n,r,o,a){for(var l=65535&n|0,h=n>>>16&65535|0,f=0;o!==0;){for(o-=f=2e3<o?2e3:o;h=h+(l=l+r[a++]|0)|0,--f;);l%=65521,h%=65521}return l|h<<16|0}},{}],44:[function(t,e,s){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,s){var n=function(){for(var r,o=[],a=0;a<256;a++){r=a;for(var l=0;l<8;l++)r=1&r?3988292384^r>>>1:r>>>1;o[a]=r}return o}();e.exports=function(r,o,a,l){var h=n,f=l+a;r^=-1;for(var I=l;I<f;I++)r=r>>>8^h[255&(r^o[I])];return-1^r}},{}],46:[function(t,e,s){var n,r=t("../utils/common"),o=t("./trees"),a=t("./adler32"),l=t("./crc32"),h=t("./messages"),f=0,I=4,u=0,d=-2,E=-1,T=4,p=2,m=8,F=9,R=286,S=30,N=19,L=2*R+1,D=15,P=3,v=258,G=v+P+1,O=42,w=113,g=1,U=2,Q=3,z=4;function et(A,$){return A.msg=h[$],$}function X(A){return(A<<1)-(4<A?9:0)}function nt(A){for(var $=A.length;0<=--$;)A[$]=0}function Y(A){var $=A.state,H=$.pending;H>A.avail_out&&(H=A.avail_out),H!==0&&(r.arraySet(A.output,$.pending_buf,$.pending_out,H,A.next_out),A.next_out+=H,$.pending_out+=H,A.total_out+=H,A.avail_out-=H,$.pending-=H,$.pending===0&&($.pending_out=0))}function B(A,$){o._tr_flush_block(A,0<=A.block_start?A.block_start:-1,A.strstart-A.block_start,$),A.block_start=A.strstart,Y(A.strm)}function rt(A,$){A.pending_buf[A.pending++]=$}function it(A,$){A.pending_buf[A.pending++]=$>>>8&255,A.pending_buf[A.pending++]=255&$}function tt(A,$){var H,M,_=A.max_chain_length,x=A.strstart,Z=A.prev_length,j=A.nice_match,V=A.strstart>A.w_size-G?A.strstart-(A.w_size-G):0,K=A.window,st=A.w_mask,J=A.prev,at=A.strstart+v,Rt=K[x+Z-1],It=K[x+Z];A.prev_length>=A.good_match&&(_>>=2),j>A.lookahead&&(j=A.lookahead);do if(K[(H=$)+Z]===It&&K[H+Z-1]===Rt&&K[H]===K[x]&&K[++H]===K[x+1]){x+=2,H++;do;while(K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&K[++x]===K[++H]&&x<at);if(M=v-(at-x),x=at-v,Z<M){if(A.match_start=$,j<=(Z=M))break;Rt=K[x+Z-1],It=K[x+Z]}}while(($=J[$&st])>V&&--_!=0);return Z<=A.lookahead?Z:A.lookahead}function Ft(A){var $,H,M,_,x,Z,j,V,K,st,J=A.w_size;do{if(_=A.window_size-A.lookahead-A.strstart,A.strstart>=J+(J-G)){for(r.arraySet(A.window,A.window,J,J,0),A.match_start-=J,A.strstart-=J,A.block_start-=J,$=H=A.hash_size;M=A.head[--$],A.head[$]=J<=M?M-J:0,--H;);for($=H=J;M=A.prev[--$],A.prev[$]=J<=M?M-J:0,--H;);_+=J}if(A.strm.avail_in===0)break;if(Z=A.strm,j=A.window,V=A.strstart+A.lookahead,K=_,st=void 0,st=Z.avail_in,K<st&&(st=K),H=st===0?0:(Z.avail_in-=st,r.arraySet(j,Z.input,Z.next_in,st,V),Z.state.wrap===1?Z.adler=a(Z.adler,j,st,V):Z.state.wrap===2&&(Z.adler=l(Z.adler,j,st,V)),Z.next_in+=st,Z.total_in+=st,st),A.lookahead+=H,A.lookahead+A.insert>=P)for(x=A.strstart-A.insert,A.ins_h=A.window[x],A.ins_h=(A.ins_h<<A.hash_shift^A.window[x+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[x+P-1])&A.hash_mask,A.prev[x&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=x,x++,A.insert--,!(A.lookahead+A.insert<P)););}while(A.lookahead<G&&A.strm.avail_in!==0)}function Nt(A,$){for(var H,M;;){if(A.lookahead<G){if(Ft(A),A.lookahead<G&&$===f)return g;if(A.lookahead===0)break}if(H=0,A.lookahead>=P&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),H!==0&&A.strstart-H<=A.w_size-G&&(A.match_length=tt(A,H)),A.match_length>=P)if(M=o._tr_tally(A,A.strstart-A.match_start,A.match_length-P),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=P){for(A.match_length--;A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart,--A.match_length!=0;);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else M=o._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(M&&(B(A,!1),A.strm.avail_out===0))return g}return A.insert=A.strstart<P-1?A.strstart:P-1,$===I?(B(A,!0),A.strm.avail_out===0?Q:z):A.last_lit&&(B(A,!1),A.strm.avail_out===0)?g:U}function ot(A,$){for(var H,M,_;;){if(A.lookahead<G){if(Ft(A),A.lookahead<G&&$===f)return g;if(A.lookahead===0)break}if(H=0,A.lookahead>=P&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=P-1,H!==0&&A.prev_length<A.max_lazy_match&&A.strstart-H<=A.w_size-G&&(A.match_length=tt(A,H),A.match_length<=5&&(A.strategy===1||A.match_length===P&&4096<A.strstart-A.match_start)&&(A.match_length=P-1)),A.prev_length>=P&&A.match_length<=A.prev_length){for(_=A.strstart+A.lookahead-P,M=o._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-P),A.lookahead-=A.prev_length-1,A.prev_length-=2;++A.strstart<=_&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,H=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),--A.prev_length!=0;);if(A.match_available=0,A.match_length=P-1,A.strstart++,M&&(B(A,!1),A.strm.avail_out===0))return g}else if(A.match_available){if((M=o._tr_tally(A,0,A.window[A.strstart-1]))&&B(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return g}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(M=o._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<P-1?A.strstart:P-1,$===I?(B(A,!0),A.strm.avail_out===0?Q:z):A.last_lit&&(B(A,!1),A.strm.avail_out===0)?g:U}function ft(A,$,H,M,_){this.good_length=A,this.max_lazy=$,this.nice_length=H,this.max_chain=M,this.func=_}function ut(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*L),this.dyn_dtree=new r.Buf16(2*(2*S+1)),this.bl_tree=new r.Buf16(2*(2*N+1)),nt(this.dyn_ltree),nt(this.dyn_dtree),nt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(D+1),this.heap=new r.Buf16(2*R+1),nt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*R+1),nt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ct(A){var $;return A&&A.state?(A.total_in=A.total_out=0,A.data_type=p,($=A.state).pending=0,$.pending_out=0,$.wrap<0&&($.wrap=-$.wrap),$.status=$.wrap?O:w,A.adler=$.wrap===2?0:1,$.last_flush=f,o._tr_init($),u):et(A,d)}function Gt(A){var $=Ct(A);return $===u&&function(H){H.window_size=2*H.w_size,nt(H.head),H.max_lazy_match=n[H.level].max_lazy,H.good_match=n[H.level].good_length,H.nice_match=n[H.level].nice_length,H.max_chain_length=n[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=P-1,H.match_available=0,H.ins_h=0}(A.state),$}function wt(A,$,H,M,_,x){if(!A)return d;var Z=1;if($===E&&($=6),M<0?(Z=0,M=-M):15<M&&(Z=2,M-=16),_<1||F<_||H!==m||M<8||15<M||$<0||9<$||x<0||T<x)return et(A,d);M===8&&(M=9);var j=new ut;return(A.state=j).strm=A,j.wrap=Z,j.gzhead=null,j.w_bits=M,j.w_size=1<<j.w_bits,j.w_mask=j.w_size-1,j.hash_bits=_+7,j.hash_size=1<<j.hash_bits,j.hash_mask=j.hash_size-1,j.hash_shift=~~((j.hash_bits+P-1)/P),j.window=new r.Buf8(2*j.w_size),j.head=new r.Buf16(j.hash_size),j.prev=new r.Buf16(j.w_size),j.lit_bufsize=1<<_+6,j.pending_buf_size=4*j.lit_bufsize,j.pending_buf=new r.Buf8(j.pending_buf_size),j.d_buf=1*j.lit_bufsize,j.l_buf=3*j.lit_bufsize,j.level=$,j.strategy=x,j.method=H,Gt(A)}n=[new ft(0,0,0,0,function(A,$){var H=65535;for(H>A.pending_buf_size-5&&(H=A.pending_buf_size-5);;){if(A.lookahead<=1){if(Ft(A),A.lookahead===0&&$===f)return g;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var M=A.block_start+H;if((A.strstart===0||A.strstart>=M)&&(A.lookahead=A.strstart-M,A.strstart=M,B(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-G&&(B(A,!1),A.strm.avail_out===0))return g}return A.insert=0,$===I?(B(A,!0),A.strm.avail_out===0?Q:z):(A.strstart>A.block_start&&(B(A,!1),A.strm.avail_out),g)}),new ft(4,4,8,4,Nt),new ft(4,5,16,8,Nt),new ft(4,6,32,32,Nt),new ft(4,4,16,16,ot),new ft(8,16,32,32,ot),new ft(8,16,128,128,ot),new ft(8,32,128,256,ot),new ft(32,128,258,1024,ot),new ft(32,258,258,4096,ot)],s.deflateInit=function(A,$){return wt(A,$,m,15,8,0)},s.deflateInit2=wt,s.deflateReset=Gt,s.deflateResetKeep=Ct,s.deflateSetHeader=function(A,$){return A&&A.state?A.state.wrap!==2?d:(A.state.gzhead=$,u):d},s.deflate=function(A,$){var H,M,_,x;if(!A||!A.state||5<$||$<0)return A?et(A,d):d;if(M=A.state,!A.output||!A.input&&A.avail_in!==0||M.status===666&&$!==I)return et(A,A.avail_out===0?-5:d);if(M.strm=A,H=M.last_flush,M.last_flush=$,M.status===O)if(M.wrap===2)A.adler=0,rt(M,31),rt(M,139),rt(M,8),M.gzhead?(rt(M,(M.gzhead.text?1:0)+(M.gzhead.hcrc?2:0)+(M.gzhead.extra?4:0)+(M.gzhead.name?8:0)+(M.gzhead.comment?16:0)),rt(M,255&M.gzhead.time),rt(M,M.gzhead.time>>8&255),rt(M,M.gzhead.time>>16&255),rt(M,M.gzhead.time>>24&255),rt(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),rt(M,255&M.gzhead.os),M.gzhead.extra&&M.gzhead.extra.length&&(rt(M,255&M.gzhead.extra.length),rt(M,M.gzhead.extra.length>>8&255)),M.gzhead.hcrc&&(A.adler=l(A.adler,M.pending_buf,M.pending,0)),M.gzindex=0,M.status=69):(rt(M,0),rt(M,0),rt(M,0),rt(M,0),rt(M,0),rt(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),rt(M,3),M.status=w);else{var Z=m+(M.w_bits-8<<4)<<8;Z|=(2<=M.strategy||M.level<2?0:M.level<6?1:M.level===6?2:3)<<6,M.strstart!==0&&(Z|=32),Z+=31-Z%31,M.status=w,it(M,Z),M.strstart!==0&&(it(M,A.adler>>>16),it(M,65535&A.adler)),A.adler=1}if(M.status===69)if(M.gzhead.extra){for(_=M.pending;M.gzindex<(65535&M.gzhead.extra.length)&&(M.pending!==M.pending_buf_size||(M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),Y(A),_=M.pending,M.pending!==M.pending_buf_size));)rt(M,255&M.gzhead.extra[M.gzindex]),M.gzindex++;M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),M.gzindex===M.gzhead.extra.length&&(M.gzindex=0,M.status=73)}else M.status=73;if(M.status===73)if(M.gzhead.name){_=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),Y(A),_=M.pending,M.pending===M.pending_buf_size)){x=1;break}x=M.gzindex<M.gzhead.name.length?255&M.gzhead.name.charCodeAt(M.gzindex++):0,rt(M,x)}while(x!==0);M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),x===0&&(M.gzindex=0,M.status=91)}else M.status=91;if(M.status===91)if(M.gzhead.comment){_=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),Y(A),_=M.pending,M.pending===M.pending_buf_size)){x=1;break}x=M.gzindex<M.gzhead.comment.length?255&M.gzhead.comment.charCodeAt(M.gzindex++):0,rt(M,x)}while(x!==0);M.gzhead.hcrc&&M.pending>_&&(A.adler=l(A.adler,M.pending_buf,M.pending-_,_)),x===0&&(M.status=103)}else M.status=103;if(M.status===103&&(M.gzhead.hcrc?(M.pending+2>M.pending_buf_size&&Y(A),M.pending+2<=M.pending_buf_size&&(rt(M,255&A.adler),rt(M,A.adler>>8&255),A.adler=0,M.status=w)):M.status=w),M.pending!==0){if(Y(A),A.avail_out===0)return M.last_flush=-1,u}else if(A.avail_in===0&&X($)<=X(H)&&$!==I)return et(A,-5);if(M.status===666&&A.avail_in!==0)return et(A,-5);if(A.avail_in!==0||M.lookahead!==0||$!==f&&M.status!==666){var j=M.strategy===2?function(V,K){for(var st;;){if(V.lookahead===0&&(Ft(V),V.lookahead===0)){if(K===f)return g;break}if(V.match_length=0,st=o._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,st&&(B(V,!1),V.strm.avail_out===0))return g}return V.insert=0,K===I?(B(V,!0),V.strm.avail_out===0?Q:z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?g:U}(M,$):M.strategy===3?function(V,K){for(var st,J,at,Rt,It=V.window;;){if(V.lookahead<=v){if(Ft(V),V.lookahead<=v&&K===f)return g;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=P&&0<V.strstart&&(J=It[at=V.strstart-1])===It[++at]&&J===It[++at]&&J===It[++at]){Rt=V.strstart+v;do;while(J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&J===It[++at]&&at<Rt);V.match_length=v-(Rt-at),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=P?(st=o._tr_tally(V,1,V.match_length-P),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(st=o._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),st&&(B(V,!1),V.strm.avail_out===0))return g}return V.insert=0,K===I?(B(V,!0),V.strm.avail_out===0?Q:z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?g:U}(M,$):n[M.level].func(M,$);if(j!==Q&&j!==z||(M.status=666),j===g||j===Q)return A.avail_out===0&&(M.last_flush=-1),u;if(j===U&&($===1?o._tr_align(M):$!==5&&(o._tr_stored_block(M,0,0,!1),$===3&&(nt(M.head),M.lookahead===0&&(M.strstart=0,M.block_start=0,M.insert=0))),Y(A),A.avail_out===0))return M.last_flush=-1,u}return $!==I?u:M.wrap<=0?1:(M.wrap===2?(rt(M,255&A.adler),rt(M,A.adler>>8&255),rt(M,A.adler>>16&255),rt(M,A.adler>>24&255),rt(M,255&A.total_in),rt(M,A.total_in>>8&255),rt(M,A.total_in>>16&255),rt(M,A.total_in>>24&255)):(it(M,A.adler>>>16),it(M,65535&A.adler)),Y(A),0<M.wrap&&(M.wrap=-M.wrap),M.pending!==0?u:1)},s.deflateEnd=function(A){var $;return A&&A.state?($=A.state.status)!==O&&$!==69&&$!==73&&$!==91&&$!==103&&$!==w&&$!==666?et(A,d):(A.state=null,$===w?et(A,-3):u):d},s.deflateSetDictionary=function(A,$){var H,M,_,x,Z,j,V,K,st=$.length;if(!A||!A.state||(x=(H=A.state).wrap)===2||x===1&&H.status!==O||H.lookahead)return d;for(x===1&&(A.adler=a(A.adler,$,st,0)),H.wrap=0,st>=H.w_size&&(x===0&&(nt(H.head),H.strstart=0,H.block_start=0,H.insert=0),K=new r.Buf8(H.w_size),r.arraySet(K,$,st-H.w_size,H.w_size,0),$=K,st=H.w_size),Z=A.avail_in,j=A.next_in,V=A.input,A.avail_in=st,A.next_in=0,A.input=$,Ft(H);H.lookahead>=P;){for(M=H.strstart,_=H.lookahead-(P-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[M+P-1])&H.hash_mask,H.prev[M&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=M,M++,--_;);H.strstart=M,H.lookahead=P-1,Ft(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=P-1,H.match_available=0,A.next_in=j,A.input=V,A.avail_in=Z,H.wrap=x,u},s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,s){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,s){e.exports=function(n,r){var o,a,l,h,f,I,u,d,E,T,p,m,F,R,S,N,L,D,P,v,G,O,w,g,U;o=n.state,a=n.next_in,g=n.input,l=a+(n.avail_in-5),h=n.next_out,U=n.output,f=h-(r-n.avail_out),I=h+(n.avail_out-257),u=o.dmax,d=o.wsize,E=o.whave,T=o.wnext,p=o.window,m=o.hold,F=o.bits,R=o.lencode,S=o.distcode,N=(1<<o.lenbits)-1,L=(1<<o.distbits)-1;t:do{F<15&&(m+=g[a++]<<F,F+=8,m+=g[a++]<<F,F+=8),D=R[m&N];e:for(;;){if(m>>>=P=D>>>24,F-=P,(P=D>>>16&255)===0)U[h++]=65535&D;else{if(!(16&P)){if(!(64&P)){D=R[(65535&D)+(m&(1<<P)-1)];continue e}if(32&P){o.mode=12;break t}n.msg="invalid literal/length code",o.mode=30;break t}v=65535&D,(P&=15)&&(F<P&&(m+=g[a++]<<F,F+=8),v+=m&(1<<P)-1,m>>>=P,F-=P),F<15&&(m+=g[a++]<<F,F+=8,m+=g[a++]<<F,F+=8),D=S[m&L];i:for(;;){if(m>>>=P=D>>>24,F-=P,!(16&(P=D>>>16&255))){if(!(64&P)){D=S[(65535&D)+(m&(1<<P)-1)];continue i}n.msg="invalid distance code",o.mode=30;break t}if(G=65535&D,F<(P&=15)&&(m+=g[a++]<<F,(F+=8)<P&&(m+=g[a++]<<F,F+=8)),u<(G+=m&(1<<P)-1)){n.msg="invalid distance too far back",o.mode=30;break t}if(m>>>=P,F-=P,(P=h-f)<G){if(E<(P=G-P)&&o.sane){n.msg="invalid distance too far back",o.mode=30;break t}if(w=p,(O=0)===T){if(O+=d-P,P<v){for(v-=P;U[h++]=p[O++],--P;);O=h-G,w=U}}else if(T<P){if(O+=d+T-P,(P-=T)<v){for(v-=P;U[h++]=p[O++],--P;);if(O=0,T<v){for(v-=P=T;U[h++]=p[O++],--P;);O=h-G,w=U}}}else if(O+=T-P,P<v){for(v-=P;U[h++]=p[O++],--P;);O=h-G,w=U}for(;2<v;)U[h++]=w[O++],U[h++]=w[O++],U[h++]=w[O++],v-=3;v&&(U[h++]=w[O++],1<v&&(U[h++]=w[O++]))}else{for(O=h-G;U[h++]=U[O++],U[h++]=U[O++],U[h++]=U[O++],2<(v-=3););v&&(U[h++]=U[O++],1<v&&(U[h++]=U[O++]))}break}}break}}while(a<l&&h<I);a-=v=F>>3,m&=(1<<(F-=v<<3))-1,n.next_in=a,n.next_out=h,n.avail_in=a<l?l-a+5:5-(a-l),n.avail_out=h<I?I-h+257:257-(h-I),o.hold=m,o.bits=F}},{}],49:[function(t,e,s){var n=t("../utils/common"),r=t("./adler32"),o=t("./crc32"),a=t("./inffast"),l=t("./inftrees"),h=1,f=2,I=0,u=-2,d=1,E=852,T=592;function p(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function F(O){var w;return O&&O.state?(w=O.state,O.total_in=O.total_out=w.total=0,O.msg="",w.wrap&&(O.adler=1&w.wrap),w.mode=d,w.last=0,w.havedict=0,w.dmax=32768,w.head=null,w.hold=0,w.bits=0,w.lencode=w.lendyn=new n.Buf32(E),w.distcode=w.distdyn=new n.Buf32(T),w.sane=1,w.back=-1,I):u}function R(O){var w;return O&&O.state?((w=O.state).wsize=0,w.whave=0,w.wnext=0,F(O)):u}function S(O,w){var g,U;return O&&O.state?(U=O.state,w<0?(g=0,w=-w):(g=1+(w>>4),w<48&&(w&=15)),w&&(w<8||15<w)?u:(U.window!==null&&U.wbits!==w&&(U.window=null),U.wrap=g,U.wbits=w,R(O))):u}function N(O,w){var g,U;return O?(U=new m,(O.state=U).window=null,(g=S(O,w))!==I&&(O.state=null),g):u}var L,D,P=!0;function v(O){if(P){var w;for(L=new n.Buf32(512),D=new n.Buf32(32),w=0;w<144;)O.lens[w++]=8;for(;w<256;)O.lens[w++]=9;for(;w<280;)O.lens[w++]=7;for(;w<288;)O.lens[w++]=8;for(l(h,O.lens,0,288,L,0,O.work,{bits:9}),w=0;w<32;)O.lens[w++]=5;l(f,O.lens,0,32,D,0,O.work,{bits:5}),P=!1}O.lencode=L,O.lenbits=9,O.distcode=D,O.distbits=5}function G(O,w,g,U){var Q,z=O.state;return z.window===null&&(z.wsize=1<<z.wbits,z.wnext=0,z.whave=0,z.window=new n.Buf8(z.wsize)),U>=z.wsize?(n.arraySet(z.window,w,g-z.wsize,z.wsize,0),z.wnext=0,z.whave=z.wsize):(U<(Q=z.wsize-z.wnext)&&(Q=U),n.arraySet(z.window,w,g-U,Q,z.wnext),(U-=Q)?(n.arraySet(z.window,w,g-U,U,0),z.wnext=U,z.whave=z.wsize):(z.wnext+=Q,z.wnext===z.wsize&&(z.wnext=0),z.whave<z.wsize&&(z.whave+=Q))),0}s.inflateReset=R,s.inflateReset2=S,s.inflateResetKeep=F,s.inflateInit=function(O){return N(O,15)},s.inflateInit2=N,s.inflate=function(O,w){var g,U,Q,z,et,X,nt,Y,B,rt,it,tt,Ft,Nt,ot,ft,ut,Ct,Gt,wt,A,$,H,M,_=0,x=new n.Buf8(4),Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return u;(g=O.state).mode===12&&(g.mode=13),et=O.next_out,Q=O.output,nt=O.avail_out,z=O.next_in,U=O.input,X=O.avail_in,Y=g.hold,B=g.bits,rt=X,it=nt,$=I;t:for(;;)switch(g.mode){case d:if(g.wrap===0){g.mode=13;break}for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(2&g.wrap&&Y===35615){x[g.check=0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0),B=Y=0,g.mode=2;break}if(g.flags=0,g.head&&(g.head.done=!1),!(1&g.wrap)||(((255&Y)<<8)+(Y>>8))%31){O.msg="incorrect header check",g.mode=30;break}if((15&Y)!=8){O.msg="unknown compression method",g.mode=30;break}if(B-=4,A=8+(15&(Y>>>=4)),g.wbits===0)g.wbits=A;else if(A>g.wbits){O.msg="invalid window size",g.mode=30;break}g.dmax=1<<A,O.adler=g.check=1,g.mode=512&Y?10:12,B=Y=0;break;case 2:for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(g.flags=Y,(255&g.flags)!=8){O.msg="unknown compression method",g.mode=30;break}if(57344&g.flags){O.msg="unknown header flags set",g.mode=30;break}g.head&&(g.head.text=Y>>8&1),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0)),B=Y=0,g.mode=3;case 3:for(;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.head&&(g.head.time=Y),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,x[2]=Y>>>16&255,x[3]=Y>>>24&255,g.check=o(g.check,x,4,0)),B=Y=0,g.mode=4;case 4:for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.head&&(g.head.xflags=255&Y,g.head.os=Y>>8),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0)),B=Y=0,g.mode=5;case 5:if(1024&g.flags){for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.length=Y,g.head&&(g.head.extra_len=Y),512&g.flags&&(x[0]=255&Y,x[1]=Y>>>8&255,g.check=o(g.check,x,2,0)),B=Y=0}else g.head&&(g.head.extra=null);g.mode=6;case 6:if(1024&g.flags&&(X<(tt=g.length)&&(tt=X),tt&&(g.head&&(A=g.head.extra_len-g.length,g.head.extra||(g.head.extra=new Array(g.head.extra_len)),n.arraySet(g.head.extra,U,z,tt,A)),512&g.flags&&(g.check=o(g.check,U,tt,z)),X-=tt,z+=tt,g.length-=tt),g.length))break t;g.length=0,g.mode=7;case 7:if(2048&g.flags){if(X===0)break t;for(tt=0;A=U[z+tt++],g.head&&A&&g.length<65536&&(g.head.name+=String.fromCharCode(A)),A&&tt<X;);if(512&g.flags&&(g.check=o(g.check,U,tt,z)),X-=tt,z+=tt,A)break t}else g.head&&(g.head.name=null);g.length=0,g.mode=8;case 8:if(4096&g.flags){if(X===0)break t;for(tt=0;A=U[z+tt++],g.head&&A&&g.length<65536&&(g.head.comment+=String.fromCharCode(A)),A&&tt<X;);if(512&g.flags&&(g.check=o(g.check,U,tt,z)),X-=tt,z+=tt,A)break t}else g.head&&(g.head.comment=null);g.mode=9;case 9:if(512&g.flags){for(;B<16;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(Y!==(65535&g.check)){O.msg="header crc mismatch",g.mode=30;break}B=Y=0}g.head&&(g.head.hcrc=g.flags>>9&1,g.head.done=!0),O.adler=g.check=0,g.mode=12;break;case 10:for(;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}O.adler=g.check=p(Y),B=Y=0,g.mode=11;case 11:if(g.havedict===0)return O.next_out=et,O.avail_out=nt,O.next_in=z,O.avail_in=X,g.hold=Y,g.bits=B,2;O.adler=g.check=1,g.mode=12;case 12:if(w===5||w===6)break t;case 13:if(g.last){Y>>>=7&B,B-=7&B,g.mode=27;break}for(;B<3;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}switch(g.last=1&Y,B-=1,3&(Y>>>=1)){case 0:g.mode=14;break;case 1:if(v(g),g.mode=20,w!==6)break;Y>>>=2,B-=2;break t;case 2:g.mode=17;break;case 3:O.msg="invalid block type",g.mode=30}Y>>>=2,B-=2;break;case 14:for(Y>>>=7&B,B-=7&B;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if((65535&Y)!=(Y>>>16^65535)){O.msg="invalid stored block lengths",g.mode=30;break}if(g.length=65535&Y,B=Y=0,g.mode=15,w===6)break t;case 15:g.mode=16;case 16:if(tt=g.length){if(X<tt&&(tt=X),nt<tt&&(tt=nt),tt===0)break t;n.arraySet(Q,U,z,tt,et),X-=tt,z+=tt,nt-=tt,et+=tt,g.length-=tt;break}g.mode=12;break;case 17:for(;B<14;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(g.nlen=257+(31&Y),Y>>>=5,B-=5,g.ndist=1+(31&Y),Y>>>=5,B-=5,g.ncode=4+(15&Y),Y>>>=4,B-=4,286<g.nlen||30<g.ndist){O.msg="too many length or distance symbols",g.mode=30;break}g.have=0,g.mode=18;case 18:for(;g.have<g.ncode;){for(;B<3;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.lens[Z[g.have++]]=7&Y,Y>>>=3,B-=3}for(;g.have<19;)g.lens[Z[g.have++]]=0;if(g.lencode=g.lendyn,g.lenbits=7,H={bits:g.lenbits},$=l(0,g.lens,0,19,g.lencode,0,g.work,H),g.lenbits=H.bits,$){O.msg="invalid code lengths set",g.mode=30;break}g.have=0,g.mode=19;case 19:for(;g.have<g.nlen+g.ndist;){for(;ft=(_=g.lencode[Y&(1<<g.lenbits)-1])>>>16&255,ut=65535&_,!((ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(ut<16)Y>>>=ot,B-=ot,g.lens[g.have++]=ut;else{if(ut===16){for(M=ot+2;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(Y>>>=ot,B-=ot,g.have===0){O.msg="invalid bit length repeat",g.mode=30;break}A=g.lens[g.have-1],tt=3+(3&Y),Y>>>=2,B-=2}else if(ut===17){for(M=ot+3;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}B-=ot,A=0,tt=3+(7&(Y>>>=ot)),Y>>>=3,B-=3}else{for(M=ot+7;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}B-=ot,A=0,tt=11+(127&(Y>>>=ot)),Y>>>=7,B-=7}if(g.have+tt>g.nlen+g.ndist){O.msg="invalid bit length repeat",g.mode=30;break}for(;tt--;)g.lens[g.have++]=A}}if(g.mode===30)break;if(g.lens[256]===0){O.msg="invalid code -- missing end-of-block",g.mode=30;break}if(g.lenbits=9,H={bits:g.lenbits},$=l(h,g.lens,0,g.nlen,g.lencode,0,g.work,H),g.lenbits=H.bits,$){O.msg="invalid literal/lengths set",g.mode=30;break}if(g.distbits=6,g.distcode=g.distdyn,H={bits:g.distbits},$=l(f,g.lens,g.nlen,g.ndist,g.distcode,0,g.work,H),g.distbits=H.bits,$){O.msg="invalid distances set",g.mode=30;break}if(g.mode=20,w===6)break t;case 20:g.mode=21;case 21:if(6<=X&&258<=nt){O.next_out=et,O.avail_out=nt,O.next_in=z,O.avail_in=X,g.hold=Y,g.bits=B,a(O,it),et=O.next_out,Q=O.output,nt=O.avail_out,z=O.next_in,U=O.input,X=O.avail_in,Y=g.hold,B=g.bits,g.mode===12&&(g.back=-1);break}for(g.back=0;ft=(_=g.lencode[Y&(1<<g.lenbits)-1])>>>16&255,ut=65535&_,!((ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(ft&&!(240&ft)){for(Ct=ot,Gt=ft,wt=ut;ft=(_=g.lencode[wt+((Y&(1<<Ct+Gt)-1)>>Ct)])>>>16&255,ut=65535&_,!(Ct+(ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}Y>>>=Ct,B-=Ct,g.back+=Ct}if(Y>>>=ot,B-=ot,g.back+=ot,g.length=ut,ft===0){g.mode=26;break}if(32&ft){g.back=-1,g.mode=12;break}if(64&ft){O.msg="invalid literal/length code",g.mode=30;break}g.extra=15&ft,g.mode=22;case 22:if(g.extra){for(M=g.extra;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.length+=Y&(1<<g.extra)-1,Y>>>=g.extra,B-=g.extra,g.back+=g.extra}g.was=g.length,g.mode=23;case 23:for(;ft=(_=g.distcode[Y&(1<<g.distbits)-1])>>>16&255,ut=65535&_,!((ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(!(240&ft)){for(Ct=ot,Gt=ft,wt=ut;ft=(_=g.distcode[wt+((Y&(1<<Ct+Gt)-1)>>Ct)])>>>16&255,ut=65535&_,!(Ct+(ot=_>>>24)<=B);){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}Y>>>=Ct,B-=Ct,g.back+=Ct}if(Y>>>=ot,B-=ot,g.back+=ot,64&ft){O.msg="invalid distance code",g.mode=30;break}g.offset=ut,g.extra=15&ft,g.mode=24;case 24:if(g.extra){for(M=g.extra;B<M;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}g.offset+=Y&(1<<g.extra)-1,Y>>>=g.extra,B-=g.extra,g.back+=g.extra}if(g.offset>g.dmax){O.msg="invalid distance too far back",g.mode=30;break}g.mode=25;case 25:if(nt===0)break t;if(tt=it-nt,g.offset>tt){if((tt=g.offset-tt)>g.whave&&g.sane){O.msg="invalid distance too far back",g.mode=30;break}Ft=tt>g.wnext?(tt-=g.wnext,g.wsize-tt):g.wnext-tt,tt>g.length&&(tt=g.length),Nt=g.window}else Nt=Q,Ft=et-g.offset,tt=g.length;for(nt<tt&&(tt=nt),nt-=tt,g.length-=tt;Q[et++]=Nt[Ft++],--tt;);g.length===0&&(g.mode=21);break;case 26:if(nt===0)break t;Q[et++]=g.length,nt--,g.mode=21;break;case 27:if(g.wrap){for(;B<32;){if(X===0)break t;X--,Y|=U[z++]<<B,B+=8}if(it-=nt,O.total_out+=it,g.total+=it,it&&(O.adler=g.check=g.flags?o(g.check,Q,it,et-it):r(g.check,Q,it,et-it)),it=nt,(g.flags?Y:p(Y))!==g.check){O.msg="incorrect data check",g.mode=30;break}B=Y=0}g.mode=28;case 28:if(g.wrap&&g.flags){for(;B<32;){if(X===0)break t;X--,Y+=U[z++]<<B,B+=8}if(Y!==(4294967295&g.total)){O.msg="incorrect length check",g.mode=30;break}B=Y=0}g.mode=29;case 29:$=1;break t;case 30:$=-3;break t;case 31:return-4;case 32:default:return u}return O.next_out=et,O.avail_out=nt,O.next_in=z,O.avail_in=X,g.hold=Y,g.bits=B,(g.wsize||it!==O.avail_out&&g.mode<30&&(g.mode<27||w!==4))&&G(O,O.output,O.next_out,it-O.avail_out)?(g.mode=31,-4):(rt-=O.avail_in,it-=O.avail_out,O.total_in+=rt,O.total_out+=it,g.total+=it,g.wrap&&it&&(O.adler=g.check=g.flags?o(g.check,Q,it,O.next_out-it):r(g.check,Q,it,O.next_out-it)),O.data_type=g.bits+(g.last?64:0)+(g.mode===12?128:0)+(g.mode===20||g.mode===15?256:0),(rt==0&&it===0||w===4)&&$===I&&($=-5),$)},s.inflateEnd=function(O){if(!O||!O.state)return u;var w=O.state;return w.window&&(w.window=null),O.state=null,I},s.inflateGetHeader=function(O,w){var g;return O&&O.state&&2&(g=O.state).wrap?((g.head=w).done=!1,I):u},s.inflateSetDictionary=function(O,w){var g,U=w.length;return O&&O.state?(g=O.state).wrap!==0&&g.mode!==11?u:g.mode===11&&r(1,w,U,0)!==g.check?-3:G(O,w,U,U)?(g.mode=31,-4):(g.havedict=1,I):u},s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,s){var n=t("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(h,f,I,u,d,E,T,p){var m,F,R,S,N,L,D,P,v,G=p.bits,O=0,w=0,g=0,U=0,Q=0,z=0,et=0,X=0,nt=0,Y=0,B=null,rt=0,it=new n.Buf16(16),tt=new n.Buf16(16),Ft=null,Nt=0;for(O=0;O<=15;O++)it[O]=0;for(w=0;w<u;w++)it[f[I+w]]++;for(Q=G,U=15;1<=U&&it[U]===0;U--);if(U<Q&&(Q=U),U===0)return d[E++]=20971520,d[E++]=20971520,p.bits=1,0;for(g=1;g<U&&it[g]===0;g++);for(Q<g&&(Q=g),O=X=1;O<=15;O++)if(X<<=1,(X-=it[O])<0)return-1;if(0<X&&(h===0||U!==1))return-1;for(tt[1]=0,O=1;O<15;O++)tt[O+1]=tt[O]+it[O];for(w=0;w<u;w++)f[I+w]!==0&&(T[tt[f[I+w]]++]=w);if(L=h===0?(B=Ft=T,19):h===1?(B=r,rt-=257,Ft=o,Nt-=257,256):(B=a,Ft=l,-1),O=g,N=E,et=w=Y=0,R=-1,S=(nt=1<<(z=Q))-1,h===1&&852<nt||h===2&&592<nt)return 1;for(;;){for(D=O-et,v=T[w]<L?(P=0,T[w]):T[w]>L?(P=Ft[Nt+T[w]],B[rt+T[w]]):(P=96,0),m=1<<O-et,g=F=1<<z;d[N+(Y>>et)+(F-=m)]=D<<24|P<<16|v|0,F!==0;);for(m=1<<O-1;Y&m;)m>>=1;if(m!==0?(Y&=m-1,Y+=m):Y=0,w++,--it[O]==0){if(O===U)break;O=f[I+T[w]]}if(Q<O&&(Y&S)!==R){for(et===0&&(et=Q),N+=g,X=1<<(z=O-et);z+et<U&&!((X-=it[z+et])<=0);)z++,X<<=1;if(nt+=1<<z,h===1&&852<nt||h===2&&592<nt)return 1;d[R=Y&S]=Q<<24|z<<16|N-E|0}}return Y!==0&&(d[N+Y]=O-et<<24|64<<16|0),p.bits=Q,0}},{"../utils/common":41}],51:[function(t,e,s){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,s){var n=t("../utils/common"),r=0,o=1;function a(_){for(var x=_.length;0<=--x;)_[x]=0}var l=0,h=29,f=256,I=f+1+h,u=30,d=19,E=2*I+1,T=15,p=16,m=7,F=256,R=16,S=17,N=18,L=[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],D=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=new Array(2*(I+2));a(G);var O=new Array(2*u);a(O);var w=new Array(512);a(w);var g=new Array(256);a(g);var U=new Array(h);a(U);var Q,z,et,X=new Array(u);function nt(_,x,Z,j,V){this.static_tree=_,this.extra_bits=x,this.extra_base=Z,this.elems=j,this.max_length=V,this.has_stree=_&&_.length}function Y(_,x){this.dyn_tree=_,this.max_code=0,this.stat_desc=x}function B(_){return _<256?w[_]:w[256+(_>>>7)]}function rt(_,x){_.pending_buf[_.pending++]=255&x,_.pending_buf[_.pending++]=x>>>8&255}function it(_,x,Z){_.bi_valid>p-Z?(_.bi_buf|=x<<_.bi_valid&65535,rt(_,_.bi_buf),_.bi_buf=x>>p-_.bi_valid,_.bi_valid+=Z-p):(_.bi_buf|=x<<_.bi_valid&65535,_.bi_valid+=Z)}function tt(_,x,Z){it(_,Z[2*x],Z[2*x+1])}function Ft(_,x){for(var Z=0;Z|=1&_,_>>>=1,Z<<=1,0<--x;);return Z>>>1}function Nt(_,x,Z){var j,V,K=new Array(T+1),st=0;for(j=1;j<=T;j++)K[j]=st=st+Z[j-1]<<1;for(V=0;V<=x;V++){var J=_[2*V+1];J!==0&&(_[2*V]=Ft(K[J]++,J))}}function ot(_){var x;for(x=0;x<I;x++)_.dyn_ltree[2*x]=0;for(x=0;x<u;x++)_.dyn_dtree[2*x]=0;for(x=0;x<d;x++)_.bl_tree[2*x]=0;_.dyn_ltree[2*F]=1,_.opt_len=_.static_len=0,_.last_lit=_.matches=0}function ft(_){8<_.bi_valid?rt(_,_.bi_buf):0<_.bi_valid&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0}function ut(_,x,Z,j){var V=2*x,K=2*Z;return _[V]<_[K]||_[V]===_[K]&&j[x]<=j[Z]}function Ct(_,x,Z){for(var j=_.heap[Z],V=Z<<1;V<=_.heap_len&&(V<_.heap_len&&ut(x,_.heap[V+1],_.heap[V],_.depth)&&V++,!ut(x,j,_.heap[V],_.depth));)_.heap[Z]=_.heap[V],Z=V,V<<=1;_.heap[Z]=j}function Gt(_,x,Z){var j,V,K,st,J=0;if(_.last_lit!==0)for(;j=_.pending_buf[_.d_buf+2*J]<<8|_.pending_buf[_.d_buf+2*J+1],V=_.pending_buf[_.l_buf+J],J++,j===0?tt(_,V,x):(tt(_,(K=g[V])+f+1,x),(st=L[K])!==0&&it(_,V-=U[K],st),tt(_,K=B(--j),Z),(st=D[K])!==0&&it(_,j-=X[K],st)),J<_.last_lit;);tt(_,F,x)}function wt(_,x){var Z,j,V,K=x.dyn_tree,st=x.stat_desc.static_tree,J=x.stat_desc.has_stree,at=x.stat_desc.elems,Rt=-1;for(_.heap_len=0,_.heap_max=E,Z=0;Z<at;Z++)K[2*Z]!==0?(_.heap[++_.heap_len]=Rt=Z,_.depth[Z]=0):K[2*Z+1]=0;for(;_.heap_len<2;)K[2*(V=_.heap[++_.heap_len]=Rt<2?++Rt:0)]=1,_.depth[V]=0,_.opt_len--,J&&(_.static_len-=st[2*V+1]);for(x.max_code=Rt,Z=_.heap_len>>1;1<=Z;Z--)Ct(_,K,Z);for(V=at;Z=_.heap[1],_.heap[1]=_.heap[_.heap_len--],Ct(_,K,1),j=_.heap[1],_.heap[--_.heap_max]=Z,_.heap[--_.heap_max]=j,K[2*V]=K[2*Z]+K[2*j],_.depth[V]=(_.depth[Z]>=_.depth[j]?_.depth[Z]:_.depth[j])+1,K[2*Z+1]=K[2*j+1]=V,_.heap[1]=V++,Ct(_,K,1),2<=_.heap_len;);_.heap[--_.heap_max]=_.heap[1],function(It,zt){var ii,ne,si,yt,vi,Hs,he=zt.dyn_tree,Hn=zt.max_code,vo=zt.stat_desc.static_tree,Uo=zt.stat_desc.has_stree,xo=zt.stat_desc.extra_bits,Wn=zt.stat_desc.extra_base,ni=zt.stat_desc.max_length,Ui=0;for(yt=0;yt<=T;yt++)It.bl_count[yt]=0;for(he[2*It.heap[It.heap_max]+1]=0,ii=It.heap_max+1;ii<E;ii++)ni<(yt=he[2*he[2*(ne=It.heap[ii])+1]+1]+1)&&(yt=ni,Ui++),he[2*ne+1]=yt,Hn<ne||(It.bl_count[yt]++,vi=0,Wn<=ne&&(vi=xo[ne-Wn]),Hs=he[2*ne],It.opt_len+=Hs*(yt+vi),Uo&&(It.static_len+=Hs*(vo[2*ne+1]+vi)));if(Ui!==0){do{for(yt=ni-1;It.bl_count[yt]===0;)yt--;It.bl_count[yt]--,It.bl_count[yt+1]+=2,It.bl_count[ni]--,Ui-=2}while(0<Ui);for(yt=ni;yt!==0;yt--)for(ne=It.bl_count[yt];ne!==0;)Hn<(si=It.heap[--ii])||(he[2*si+1]!==yt&&(It.opt_len+=(yt-he[2*si+1])*he[2*si],he[2*si+1]=yt),ne--)}}(_,x),Nt(K,Rt,_.bl_count)}function A(_,x,Z){var j,V,K=-1,st=x[1],J=0,at=7,Rt=4;for(st===0&&(at=138,Rt=3),x[2*(Z+1)+1]=65535,j=0;j<=Z;j++)V=st,st=x[2*(j+1)+1],++J<at&&V===st||(J<Rt?_.bl_tree[2*V]+=J:V!==0?(V!==K&&_.bl_tree[2*V]++,_.bl_tree[2*R]++):J<=10?_.bl_tree[2*S]++:_.bl_tree[2*N]++,K=V,Rt=(J=0)===st?(at=138,3):V===st?(at=6,3):(at=7,4))}function $(_,x,Z){var j,V,K=-1,st=x[1],J=0,at=7,Rt=4;for(st===0&&(at=138,Rt=3),j=0;j<=Z;j++)if(V=st,st=x[2*(j+1)+1],!(++J<at&&V===st)){if(J<Rt)for(;tt(_,V,_.bl_tree),--J!=0;);else V!==0?(V!==K&&(tt(_,V,_.bl_tree),J--),tt(_,R,_.bl_tree),it(_,J-3,2)):J<=10?(tt(_,S,_.bl_tree),it(_,J-3,3)):(tt(_,N,_.bl_tree),it(_,J-11,7));K=V,Rt=(J=0)===st?(at=138,3):V===st?(at=6,3):(at=7,4)}}a(X);var H=!1;function M(_,x,Z,j){it(_,(l<<1)+(j?1:0),3),function(V,K,st,J){ft(V),rt(V,st),rt(V,~st),n.arraySet(V.pending_buf,V.window,K,st,V.pending),V.pending+=st}(_,x,Z)}s._tr_init=function(_){H||(function(){var x,Z,j,V,K,st=new Array(T+1);for(V=j=0;V<h-1;V++)for(U[V]=j,x=0;x<1<<L[V];x++)g[j++]=V;for(g[j-1]=V,V=K=0;V<16;V++)for(X[V]=K,x=0;x<1<<D[V];x++)w[K++]=V;for(K>>=7;V<u;V++)for(X[V]=K<<7,x=0;x<1<<D[V]-7;x++)w[256+K++]=V;for(Z=0;Z<=T;Z++)st[Z]=0;for(x=0;x<=143;)G[2*x+1]=8,x++,st[8]++;for(;x<=255;)G[2*x+1]=9,x++,st[9]++;for(;x<=279;)G[2*x+1]=7,x++,st[7]++;for(;x<=287;)G[2*x+1]=8,x++,st[8]++;for(Nt(G,I+1,st),x=0;x<u;x++)O[2*x+1]=5,O[2*x]=Ft(x,5);Q=new nt(G,L,f+1,I,T),z=new nt(O,D,0,u,T),et=new nt(new Array(0),P,0,d,m)}(),H=!0),_.l_desc=new Y(_.dyn_ltree,Q),_.d_desc=new Y(_.dyn_dtree,z),_.bl_desc=new Y(_.bl_tree,et),_.bi_buf=0,_.bi_valid=0,ot(_)},s._tr_stored_block=M,s._tr_flush_block=function(_,x,Z,j){var V,K,st=0;0<_.level?(_.strm.data_type===2&&(_.strm.data_type=function(J){var at,Rt=4093624447;for(at=0;at<=31;at++,Rt>>>=1)if(1&Rt&&J.dyn_ltree[2*at]!==0)return r;if(J.dyn_ltree[18]!==0||J.dyn_ltree[20]!==0||J.dyn_ltree[26]!==0)return o;for(at=32;at<f;at++)if(J.dyn_ltree[2*at]!==0)return o;return r}(_)),wt(_,_.l_desc),wt(_,_.d_desc),st=function(J){var at;for(A(J,J.dyn_ltree,J.l_desc.max_code),A(J,J.dyn_dtree,J.d_desc.max_code),wt(J,J.bl_desc),at=d-1;3<=at&&J.bl_tree[2*v[at]+1]===0;at--);return J.opt_len+=3*(at+1)+5+5+4,at}(_),V=_.opt_len+3+7>>>3,(K=_.static_len+3+7>>>3)<=V&&(V=K)):V=K=Z+5,Z+4<=V&&x!==-1?M(_,x,Z,j):_.strategy===4||K===V?(it(_,2+(j?1:0),3),Gt(_,G,O)):(it(_,4+(j?1:0),3),function(J,at,Rt,It){var zt;for(it(J,at-257,5),it(J,Rt-1,5),it(J,It-4,4),zt=0;zt<It;zt++)it(J,J.bl_tree[2*v[zt]+1],3);$(J,J.dyn_ltree,at-1),$(J,J.dyn_dtree,Rt-1)}(_,_.l_desc.max_code+1,_.d_desc.max_code+1,st+1),Gt(_,_.dyn_ltree,_.dyn_dtree)),ot(_),j&&ft(_)},s._tr_tally=function(_,x,Z){return _.pending_buf[_.d_buf+2*_.last_lit]=x>>>8&255,_.pending_buf[_.d_buf+2*_.last_lit+1]=255&x,_.pending_buf[_.l_buf+_.last_lit]=255&Z,_.last_lit++,x===0?_.dyn_ltree[2*Z]++:(_.matches++,x--,_.dyn_ltree[2*(g[Z]+f+1)]++,_.dyn_dtree[2*B(x)]++),_.last_lit===_.lit_bufsize-1},s._tr_align=function(_){it(_,2,3),tt(_,F,G),function(x){x.bi_valid===16?(rt(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)}(_)}},{"../utils/common":41}],53:[function(t,e,s){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,s){(function(n){(function(r,o){if(!r.setImmediate){var a,l,h,f,I=1,u={},d=!1,E=r.document,T=Object.getPrototypeOf&&Object.getPrototypeOf(r);T=T&&T.setTimeout?T:r,a={}.toString.call(r.process)==="[object process]"?function(R){process.nextTick(function(){m(R)})}:function(){if(r.postMessage&&!r.importScripts){var R=!0,S=r.onmessage;return r.onmessage=function(){R=!1},r.postMessage("","*"),r.onmessage=S,R}}()?(f="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",F,!1):r.attachEvent("onmessage",F),function(R){r.postMessage(f+R,"*")}):r.MessageChannel?((h=new MessageChannel).port1.onmessage=function(R){m(R.data)},function(R){h.port2.postMessage(R)}):E&&"onreadystatechange"in E.createElement("script")?(l=E.documentElement,function(R){var S=E.createElement("script");S.onreadystatechange=function(){m(R),S.onreadystatechange=null,l.removeChild(S),S=null},l.appendChild(S)}):function(R){setTimeout(m,0,R)},T.setImmediate=function(R){typeof R!="function"&&(R=new Function(""+R));for(var S=new Array(arguments.length-1),N=0;N<S.length;N++)S[N]=arguments[N+1];var L={callback:R,args:S};return u[I]=L,a(I),I++},T.clearImmediate=p}function p(R){delete u[R]}function m(R){if(d)setTimeout(m,0,R);else{var S=u[R];if(S){d=!0;try{(function(N){var L=N.callback,D=N.args;switch(D.length){case 0:L();break;case 1:L(D[0]);break;case 2:L(D[0],D[1]);break;case 3:L(D[0],D[1],D[2]);break;default:L.apply(o,D)}})(S)}finally{p(R),d=!1}}}}function F(R){R.source===r&&typeof R.data=="string"&&R.data.indexOf(f)===0&&m(+R.data.slice(f.length))}})(typeof self>"u"?n===void 0?this:n:self)}).call(this,typeof os<"u"?os:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Eo);var Lc=Eo.exports;const Lr=yc(Lc);var Yn={},ks={};(function(c){const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",e="["+i+"]["+t+"]*",s=new RegExp("^"+e+"$"),n=function(o,a){const l=[];let h=a.exec(o);for(;h;){const f=[];f.startIndex=a.lastIndex-h[0].length;const I=h.length;for(let u=0;u<I;u++)f.push(h[u]);l.push(f),h=a.exec(o)}return l},r=function(o){const a=s.exec(o);return!(a===null||typeof a>"u")};c.isExist=function(o){return typeof o<"u"},c.isEmptyObject=function(o){return Object.keys(o).length===0},c.merge=function(o,a,l){if(a){const h=Object.keys(a),f=h.length;for(let I=0;I<f;I++)l==="strict"?o[h[I]]=[a[h[I]]]:o[h[I]]=a[h[I]]}},c.getValue=function(o){return c.isExist(o)?o:""},c.isName=r,c.getAllMatches=n,c.nameRegexp=e})(ks);const Gn=ks,Pc={allowBooleanAttributes:!1,unpairedTags:[]};Yn.validate=function(c,i){i=Object.assign({},Pc,i);const t=[];let e=!1,s=!1;c[0]==="\uFEFF"&&(c=c.substr(1));for(let n=0;n<c.length;n++)if(c[n]==="<"&&c[n+1]==="?"){if(n+=2,n=_r(c,n),n.err)return n}else if(c[n]==="<"){let r=n;if(n++,c[n]==="!"){n=Mr(c,n);continue}else{let o=!1;c[n]==="/"&&(o=!0,n++);let a="";for(;n<c.length&&c[n]!==">"&&c[n]!==" "&&c[n]!==" "&&c[n]!==`
|
|
140
|
+
`&&c[n]!=="\r";n++)a+=c[n];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),n--),!xc(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",Pt("InvalidTag",f,vt(c,n))}const l=wc(c,n);if(l===!1)return Pt("InvalidAttr","Attributes for '"+a+"' have open quote.",vt(c,n));let h=l.value;if(n=l.index,h[h.length-1]==="/"){const f=n-h.length;h=h.substring(0,h.length-1);const I=wr(h,i);if(I===!0)e=!0;else return Pt(I.err.code,I.err.msg,vt(c,f+I.err.line))}else if(o)if(l.tagClosed){if(h.trim().length>0)return Pt("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",vt(c,r));if(t.length===0)return Pt("InvalidTag","Closing tag '"+a+"' has not been opened.",vt(c,r));{const f=t.pop();if(a!==f.tagName){let I=vt(c,f.tagStartPos);return Pt("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+I.line+", col "+I.col+") instead of closing tag '"+a+"'.",vt(c,r))}t.length==0&&(s=!0)}}else return Pt("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",vt(c,n));else{const f=wr(h,i);if(f!==!0)return Pt(f.err.code,f.err.msg,vt(c,n-h.length+f.err.line));if(s===!0)return Pt("InvalidXml","Multiple possible root nodes found.",vt(c,n));i.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),e=!0}for(n++;n<c.length;n++)if(c[n]==="<")if(c[n+1]==="!"){n++,n=Mr(c,n);continue}else if(c[n+1]==="?"){if(n=_r(c,++n),n.err)return n}else break;else if(c[n]==="&"){const f=vc(c,n);if(f==-1)return Pt("InvalidChar","char '&' is not expected.",vt(c,n));n=f}else if(s===!0&&!Pr(c[n]))return Pt("InvalidXml","Extra text at the end",vt(c,n));c[n]==="<"&&n--}}else{if(Pr(c[n]))continue;return Pt("InvalidChar","char '"+c[n]+"' is not expected.",vt(c,n))}if(e){if(t.length==1)return Pt("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",vt(c,t[0].tagStartPos));if(t.length>0)return Pt("InvalidXml","Invalid '"+JSON.stringify(t.map(n=>n.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Pt("InvalidXml","Start tag expected.",1);return!0};function Pr(c){return c===" "||c===" "||c===`
|
|
141
|
+
`||c==="\r"}function _r(c,i){const t=i;for(;i<c.length;i++)if(c[i]=="?"||c[i]==" "){const e=c.substr(t,i-t);if(i>5&&e==="xml")return Pt("InvalidXml","XML declaration allowed only at the start of the document.",vt(c,i));if(c[i]=="?"&&c[i+1]==">"){i++;break}else continue}return i}function Mr(c,i){if(c.length>i+5&&c[i+1]==="-"&&c[i+2]==="-"){for(i+=3;i<c.length;i++)if(c[i]==="-"&&c[i+1]==="-"&&c[i+2]===">"){i+=2;break}}else if(c.length>i+8&&c[i+1]==="D"&&c[i+2]==="O"&&c[i+3]==="C"&&c[i+4]==="T"&&c[i+5]==="Y"&&c[i+6]==="P"&&c[i+7]==="E"){let t=1;for(i+=8;i<c.length;i++)if(c[i]==="<")t++;else if(c[i]===">"&&(t--,t===0))break}else if(c.length>i+9&&c[i+1]==="["&&c[i+2]==="C"&&c[i+3]==="D"&&c[i+4]==="A"&&c[i+5]==="T"&&c[i+6]==="A"&&c[i+7]==="["){for(i+=8;i<c.length;i++)if(c[i]==="]"&&c[i+1]==="]"&&c[i+2]===">"){i+=2;break}}return i}const _c='"',Mc="'";function wc(c,i){let t="",e="",s=!1;for(;i<c.length;i++){if(c[i]===_c||c[i]===Mc)e===""?e=c[i]:e!==c[i]||(e="");else if(c[i]===">"&&e===""){s=!0;break}t+=c[i]}return e!==""?!1:{value:t,index:i,tagClosed:s}}const Dc=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function wr(c,i){const t=Gn.getAllMatches(c,Dc),e={};for(let s=0;s<t.length;s++){if(t[s][1].length===0)return Pt("InvalidAttr","Attribute '"+t[s][2]+"' has no space in starting.",Ti(t[s]));if(t[s][3]!==void 0&&t[s][4]===void 0)return Pt("InvalidAttr","Attribute '"+t[s][2]+"' is without value.",Ti(t[s]));if(t[s][3]===void 0&&!i.allowBooleanAttributes)return Pt("InvalidAttr","boolean attribute '"+t[s][2]+"' is not allowed.",Ti(t[s]));const n=t[s][2];if(!Uc(n))return Pt("InvalidAttr","Attribute '"+n+"' is an invalid name.",Ti(t[s]));if(!e.hasOwnProperty(n))e[n]=1;else return Pt("InvalidAttr","Attribute '"+n+"' is repeated.",Ti(t[s]))}return!0}function bc(c,i){let t=/\d/;for(c[i]==="x"&&(i++,t=/[\da-fA-F]/);i<c.length;i++){if(c[i]===";")return i;if(!c[i].match(t))break}return-1}function vc(c,i){if(i++,c[i]===";")return-1;if(c[i]==="#")return i++,bc(c,i);let t=0;for(;i<c.length;i++,t++)if(!(c[i].match(/\w/)&&t<20)){if(c[i]===";")break;return-1}return i}function Pt(c,i,t){return{err:{code:c,msg:i,line:t.line||t,col:t.col}}}function Uc(c){return Gn.isName(c)}function xc(c){return Gn.isName(c)}function vt(c,i){const t=c.substring(0,i).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function Ti(c){return c.startIndex+c[1].length}var zn={};const po={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(c,i){return i},attributeValueProcessor:function(c,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(c,i,t){return c}},Bc=function(c){return Object.assign({},po,c)};zn.buildOptions=Bc;zn.defaultOptions=po;class Vc{constructor(i){this.tagname=i,this.child=[],this[":@"]={}}add(i,t){i==="__proto__"&&(i="#__proto__"),this.child.push({[i]:t})}addChild(i){i.tagname==="__proto__"&&(i.tagname="#__proto__"),i[":@"]&&Object.keys(i[":@"]).length>0?this.child.push({[i.tagname]:i.child,":@":i[":@"]}):this.child.push({[i.tagname]:i.child})}}var Yc=Vc;const Gc=ks;function zc(c,i){const t={};if(c[i+3]==="O"&&c[i+4]==="C"&&c[i+5]==="T"&&c[i+6]==="Y"&&c[i+7]==="P"&&c[i+8]==="E"){i=i+9;let e=1,s=!1,n=!1,r="";for(;i<c.length;i++)if(c[i]==="<"&&!n){if(s&&Wc(c,i))i+=7,[entityName,val,i]=kc(c,i+1),val.indexOf("&")===-1&&(t[jc(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(s&&Xc(c,i))i+=8;else if(s&&$c(c,i))i+=8;else if(s&&Zc(c,i))i+=9;else if(Hc)n=!0;else throw new Error("Invalid DOCTYPE");e++,r=""}else if(c[i]===">"){if(n?c[i-1]==="-"&&c[i-2]==="-"&&(n=!1,e--):e--,e===0)break}else c[i]==="["?s=!0:r+=c[i];if(e!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i}}function kc(c,i){let t="";for(;i<c.length&&c[i]!=="'"&&c[i]!=='"';i++)t+=c[i];if(t=t.trim(),t.indexOf(" ")!==-1)throw new Error("External entites are not supported");const e=c[i++];let s="";for(;i<c.length&&c[i]!==e;i++)s+=c[i];return[t,s,i]}function Hc(c,i){return c[i+1]==="!"&&c[i+2]==="-"&&c[i+3]==="-"}function Wc(c,i){return c[i+1]==="!"&&c[i+2]==="E"&&c[i+3]==="N"&&c[i+4]==="T"&&c[i+5]==="I"&&c[i+6]==="T"&&c[i+7]==="Y"}function Xc(c,i){return c[i+1]==="!"&&c[i+2]==="E"&&c[i+3]==="L"&&c[i+4]==="E"&&c[i+5]==="M"&&c[i+6]==="E"&&c[i+7]==="N"&&c[i+8]==="T"}function $c(c,i){return c[i+1]==="!"&&c[i+2]==="A"&&c[i+3]==="T"&&c[i+4]==="T"&&c[i+5]==="L"&&c[i+6]==="I"&&c[i+7]==="S"&&c[i+8]==="T"}function Zc(c,i){return c[i+1]==="!"&&c[i+2]==="N"&&c[i+3]==="O"&&c[i+4]==="T"&&c[i+5]==="A"&&c[i+6]==="T"&&c[i+7]==="I"&&c[i+8]==="O"&&c[i+9]==="N"}function jc(c){if(Gc.isName(c))return c;throw new Error(`Invalid entity name ${c}`)}var qc=zc;const Qc=/^[-+]?0x[a-fA-F0-9]+$/,Kc=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Jc={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function tl(c,i={}){if(i=Object.assign({},Jc,i),!c||typeof c!="string")return c;let t=c.trim();if(i.skipLike!==void 0&&i.skipLike.test(t))return c;if(i.hex&&Qc.test(t))return Number.parseInt(t,16);{const e=Kc.exec(t);if(e){const s=e[1],n=e[2];let r=el(e[3]);const o=e[4]||e[6];if(!i.leadingZeros&&n.length>0&&s&&t[2]!==".")return c;if(!i.leadingZeros&&n.length>0&&!s&&t[1]!==".")return c;{const a=Number(t),l=""+a;return l.search(/[eE]/)!==-1||o?i.eNotation?a:c:t.indexOf(".")!==-1?l==="0"&&r===""||l===r||s&&l==="-"+r?a:c:n?r===l||s+r===l?a:c:t===l||t===s+l?a:c}}else return c}}function el(c){return c&&c.indexOf(".")!==-1&&(c=c.replace(/0+$/,""),c==="."?c="0":c[0]==="."?c="0"+c:c[c.length-1]==="."&&(c=c.substr(0,c.length-1))),c}var il=tl;const Co=ks,mi=Yc,sl=qc,nl=il;let rl=class{constructor(i){this.options=i,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=ol,this.parseXml=ul,this.parseTextData=al,this.resolveNameSpace=cl,this.buildAttributesMap=hl,this.isItStopNode=El,this.replaceEntitiesValue=Il,this.readStopNodeData=Cl,this.saveTextToParentTag=dl,this.addChild=fl}};function ol(c){const i=Object.keys(c);for(let t=0;t<i.length;t++){const e=i[t];this.lastEntities[e]={regex:new RegExp("&"+e+";","g"),val:c[e]}}}function al(c,i,t,e,s,n,r){if(c!==void 0&&(this.options.trimValues&&!e&&(c=c.trim()),c.length>0)){r||(c=this.replaceEntitiesValue(c));const o=this.options.tagValueProcessor(i,c,t,s,n);return o==null?c:typeof o!=typeof c||o!==c?o:this.options.trimValues?Nn(c,this.options.parseTagValue,this.options.numberParseOptions):c.trim()===c?Nn(c,this.options.parseTagValue,this.options.numberParseOptions):c}}function cl(c){if(this.options.removeNSPrefix){const i=c.split(":"),t=c.charAt(0)==="/"?"/":"";if(i[0]==="xmlns")return"";i.length===2&&(c=t+i[1])}return c}const ll=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function hl(c,i,t){if(!this.options.ignoreAttributes&&typeof c=="string"){const e=Co.getAllMatches(c,ll),s=e.length,n={};for(let r=0;r<s;r++){const o=this.resolveNameSpace(e[r][1]);let a=e[r][4],l=this.options.attributeNamePrefix+o;if(o.length)if(this.options.transformAttributeName&&(l=this.options.transformAttributeName(l)),l==="__proto__"&&(l="#__proto__"),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);const h=this.options.attributeValueProcessor(o,a,i);h==null?n[l]=a:typeof h!=typeof a||h!==a?n[l]=h:n[l]=Nn(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(n[l]=!0)}if(!Object.keys(n).length)return;if(this.options.attributesGroupName){const r={};return r[this.options.attributesGroupName]=n,r}return n}}const ul=function(c){c=c.replace(/\r\n?/g,`
|
|
142
|
+
`);const i=new mi("!xml");let t=i,e="",s="";for(let n=0;n<c.length;n++)if(c[n]==="<")if(c[n+1]==="/"){const o=De(c,">",n,"Closing Tag is not closed.");let a=c.substring(n+2,o).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(e=this.saveTextToParentTag(e,t,s));const l=s.substring(s.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);let h=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(h=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=s.lastIndexOf("."),s=s.substring(0,h),t=this.tagsNodeStack.pop(),e="",n=o}else if(c[n+1]==="?"){let o=On(c,n,!1,"?>");if(!o)throw new Error("Pi Tag is not closed.");if(e=this.saveTextToParentTag(e,t,s),!(this.options.ignoreDeclaration&&o.tagName==="?xml"||this.options.ignorePiTags)){const a=new mi(o.tagName);a.add(this.options.textNodeName,""),o.tagName!==o.tagExp&&o.attrExpPresent&&(a[":@"]=this.buildAttributesMap(o.tagExp,s,o.tagName)),this.addChild(t,a,s)}n=o.closeIndex+1}else if(c.substr(n+1,3)==="!--"){const o=De(c,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){const a=c.substring(n+4,o-2);e=this.saveTextToParentTag(e,t,s),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}n=o}else if(c.substr(n+1,2)==="!D"){const o=sl(c,n);this.docTypeEntities=o.entities,n=o.i}else if(c.substr(n+1,2)==="!["){const o=De(c,"]]>",n,"CDATA is not closed.")-2,a=c.substring(n+9,o);e=this.saveTextToParentTag(e,t,s);let l=this.parseTextData(a,t.tagname,s,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):t.add(this.options.textNodeName,l),n=o+2}else{let o=On(c,n,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let h=o.tagExp,f=o.attrExpPresent,I=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&e&&t.tagname!=="!xml"&&(e=this.saveTextToParentTag(e,t,s,!1));const u=t;if(u&&this.options.unpairedTags.indexOf(u.tagname)!==-1&&(t=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==i.tagname&&(s+=s?"."+a:a),this.isItStopNode(this.options.stopNodes,s,a)){let d="";if(h.length>0&&h.lastIndexOf("/")===h.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),h=a):h=h.substr(0,h.length-1),n=o.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)n=o.closeIndex;else{const T=this.readStopNodeData(c,l,I+1);if(!T)throw new Error(`Unexpected end of ${l}`);n=T.i,d=T.tagContent}const E=new mi(a);a!==h&&f&&(E[":@"]=this.buildAttributesMap(h,s,a)),d&&(d=this.parseTextData(d,a,s,!0,f,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),E.add(this.options.textNodeName,d),this.addChild(t,E,s)}else{if(h.length>0&&h.lastIndexOf("/")===h.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),h=a):h=h.substr(0,h.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const d=new mi(a);a!==h&&f&&(d[":@"]=this.buildAttributesMap(h,s,a)),this.addChild(t,d,s),s=s.substr(0,s.lastIndexOf("."))}else{const d=new mi(a);this.tagsNodeStack.push(t),a!==h&&f&&(d[":@"]=this.buildAttributesMap(h,s,a)),this.addChild(t,d,s),t=d}e="",n=I}}else e+=c[n];return i.child};function fl(c,i,t){const e=this.options.updateTag(i.tagname,t,i[":@"]);e===!1||(typeof e=="string"&&(i.tagname=e),c.addChild(i))}const Il=function(c){if(this.options.processEntities){for(let i in this.docTypeEntities){const t=this.docTypeEntities[i];c=c.replace(t.regx,t.val)}for(let i in this.lastEntities){const t=this.lastEntities[i];c=c.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let i in this.htmlEntities){const t=this.htmlEntities[i];c=c.replace(t.regex,t.val)}c=c.replace(this.ampEntity.regex,this.ampEntity.val)}return c};function dl(c,i,t,e){return c&&(e===void 0&&(e=Object.keys(i.child).length===0),c=this.parseTextData(c,i.tagname,t,!1,i[":@"]?Object.keys(i[":@"]).length!==0:!1,e),c!==void 0&&c!==""&&i.add(this.options.textNodeName,c),c=""),c}function El(c,i,t){const e="*."+t;for(const s in c){const n=c[s];if(e===n||i===n)return!0}return!1}function pl(c,i,t=">"){let e,s="";for(let n=i;n<c.length;n++){let r=c[n];if(e)r===e&&(e="");else if(r==='"'||r==="'")e=r;else if(r===t[0])if(t[1]){if(c[n+1]===t[1])return{data:s,index:n}}else return{data:s,index:n};else r===" "&&(r=" ");s+=r}}function De(c,i,t,e){const s=c.indexOf(i,t);if(s===-1)throw new Error(e);return s+i.length-1}function On(c,i,t,e=">"){const s=pl(c,i+1,e);if(!s)return;let n=s.data;const r=s.index,o=n.search(/\s/);let a=n,l=!0;o!==-1&&(a=n.substring(0,o),n=n.substring(o+1).trimStart());const h=a;if(t){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1),l=a!==s.data.substr(f+1))}return{tagName:a,tagExp:n,closeIndex:r,attrExpPresent:l,rawTagName:h}}function Cl(c,i,t){const e=t;let s=1;for(;t<c.length;t++)if(c[t]==="<")if(c[t+1]==="/"){const n=De(c,">",t,`${i} is not closed`);if(c.substring(t+2,n).trim()===i&&(s--,s===0))return{tagContent:c.substring(e,t),i:n};t=n}else if(c[t+1]==="?")t=De(c,"?>",t+1,"StopNode is not closed.");else if(c.substr(t+1,3)==="!--")t=De(c,"-->",t+3,"StopNode is not closed.");else if(c.substr(t+1,2)==="![")t=De(c,"]]>",t,"StopNode is not closed.")-2;else{const n=On(c,t,">");n&&((n&&n.tagName)===i&&n.tagExp[n.tagExp.length-1]!=="/"&&s++,t=n.closeIndex)}}function Nn(c,i,t){if(i&&typeof c=="string"){const e=c.trim();return e==="true"?!0:e==="false"?!1:nl(c,t)}else return Co.isExist(c)?c:""}var Tl=rl,To={};function ml(c,i){return mo(c,i)}function mo(c,i,t){let e;const s={};for(let n=0;n<c.length;n++){const r=c[n],o=Rl(r);let a="";if(t===void 0?a=o:a=t+"."+o,o===i.textNodeName)e===void 0?e=r[o]:e+=""+r[o];else{if(o===void 0)continue;if(r[o]){let l=mo(r[o],i,a);const h=Al(l,i);r[":@"]?gl(l,r[":@"],a,i):Object.keys(l).length===1&&l[i.textNodeName]!==void 0&&!i.alwaysCreateTextNode?l=l[i.textNodeName]:Object.keys(l).length===0&&(i.alwaysCreateTextNode?l[i.textNodeName]="":l=""),s[o]!==void 0&&s.hasOwnProperty(o)?(Array.isArray(s[o])||(s[o]=[s[o]]),s[o].push(l)):i.isArray(o,a,h)?s[o]=[l]:s[o]=l}}}return typeof e=="string"?e.length>0&&(s[i.textNodeName]=e):e!==void 0&&(s[i.textNodeName]=e),s}function Rl(c){const i=Object.keys(c);for(let t=0;t<i.length;t++){const e=i[t];if(e!==":@")return e}}function gl(c,i,t,e){if(i){const s=Object.keys(i),n=s.length;for(let r=0;r<n;r++){const o=s[r];e.isArray(o,t+"."+o,!0,!0)?c[o]=[i[o]]:c[o]=i[o]}}}function Al(c,i){const{textNodeName:t}=i,e=Object.keys(c).length;return!!(e===0||e===1&&(c[t]||typeof c[t]=="boolean"||c[t]===0))}To.prettify=ml;const{buildOptions:Fl}=zn,Sl=Tl,{prettify:Ol}=To,Nl=Yn;let yl=class{constructor(i){this.externalEntities={},this.options=Fl(i)}parse(i,t){if(typeof i!="string")if(i.toString)i=i.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const n=Nl.validate(i,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const e=new Sl(this.options);e.addExternalEntities(this.externalEntities);const s=e.parseXml(i);return this.options.preserveOrder||s===void 0?s:Ol(s,this.options)}addEntity(i,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(i.indexOf("&")!==-1||i.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[i]=t}};var Ll=yl;const Pl=`
|
|
143
|
+
`;function _l(c,i){let t="";return i.format&&i.indentBy.length>0&&(t=Pl),Ro(c,i,"",t)}function Ro(c,i,t,e){let s="",n=!1;for(let r=0;r<c.length;r++){const o=c[r],a=Ml(o);if(a===void 0)continue;let l="";if(t.length===0?l=a:l=`${t}.${a}`,a===i.textNodeName){let d=o[a];wl(l,i)||(d=i.tagValueProcessor(a,d),d=go(d,i)),n&&(s+=e),s+=d,n=!1;continue}else if(a===i.cdataPropName){n&&(s+=e),s+=`<![CDATA[${o[a][0][i.textNodeName]}]]>`,n=!1;continue}else if(a===i.commentPropName){s+=e+`<!--${o[a][0][i.textNodeName]}-->`,n=!0;continue}else if(a[0]==="?"){const d=Dr(o[":@"],i),E=a==="?xml"?"":e;let T=o[a][0][i.textNodeName];T=T.length!==0?" "+T:"",s+=E+`<${a}${T}${d}?>`,n=!0;continue}let h=e;h!==""&&(h+=i.indentBy);const f=Dr(o[":@"],i),I=e+`<${a}${f}`,u=Ro(o[a],i,l,h);i.unpairedTags.indexOf(a)!==-1?i.suppressUnpairedNode?s+=I+">":s+=I+"/>":(!u||u.length===0)&&i.suppressEmptyNode?s+=I+"/>":u&&u.endsWith(">")?s+=I+`>${u}${e}</${a}>`:(s+=I+">",u&&e!==""&&(u.includes("/>")||u.includes("</"))?s+=e+i.indentBy+u+e:s+=u,s+=`</${a}>`),n=!0}return s}function Ml(c){const i=Object.keys(c);for(let t=0;t<i.length;t++){const e=i[t];if(c.hasOwnProperty(e)&&e!==":@")return e}}function Dr(c,i){let t="";if(c&&!i.ignoreAttributes)for(let e in c){if(!c.hasOwnProperty(e))continue;let s=i.attributeValueProcessor(e,c[e]);s=go(s,i),s===!0&&i.suppressBooleanAttributes?t+=` ${e.substr(i.attributeNamePrefix.length)}`:t+=` ${e.substr(i.attributeNamePrefix.length)}="${s}"`}return t}function wl(c,i){c=c.substr(0,c.length-i.textNodeName.length-1);let t=c.substr(c.lastIndexOf(".")+1);for(let e in i.stopNodes)if(i.stopNodes[e]===c||i.stopNodes[e]==="*."+t)return!0;return!1}function go(c,i){if(c&&c.length>0&&i.processEntities)for(let t=0;t<i.entities.length;t++){const e=i.entities[t];c=c.replace(e.regex,e.val)}return c}var Dl=_l;const bl=Dl,vl={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(c,i){return i},attributeValueProcessor:function(c,i){return i},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Le(c){this.options=Object.assign({},vl,c),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Bl),this.processTextOrObjNode=Ul,this.options.format?(this.indentate=xl,this.tagEndChar=`>
|
|
144
144
|
`,this.newLine=`
|
|
145
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Le.prototype.build=function(c){return this.options.preserveOrder?
|
|
145
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Le.prototype.build=function(c){return this.options.preserveOrder?bl(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0).val)};Le.prototype.j2x=function(c,i){let t="",e="";for(let s in c)if(Object.prototype.hasOwnProperty.call(c,s))if(typeof c[s]>"u")this.isAttribute(s)&&(e+="");else if(c[s]===null)this.isAttribute(s)?e+="":s[0]==="?"?e+=this.indentate(i)+"<"+s+"?"+this.tagEndChar:e+=this.indentate(i)+"<"+s+"/"+this.tagEndChar;else if(c[s]instanceof Date)e+=this.buildTextValNode(c[s],s,"",i);else if(typeof c[s]!="object"){const n=this.isAttribute(s);if(n)t+=this.buildAttrPairStr(n,""+c[s]);else if(s===this.options.textNodeName){let r=this.options.tagValueProcessor(s,""+c[s]);e+=this.replaceEntitiesValue(r)}else e+=this.buildTextValNode(c[s],s,"",i)}else if(Array.isArray(c[s])){const n=c[s].length;let r="",o="";for(let a=0;a<n;a++){const l=c[s][a];if(!(typeof l>"u"))if(l===null)s[0]==="?"?e+=this.indentate(i)+"<"+s+"?"+this.tagEndChar:e+=this.indentate(i)+"<"+s+"/"+this.tagEndChar;else if(typeof l=="object")if(this.options.oneListGroup){const h=this.j2x(l,i+1);r+=h.val,this.options.attributesGroupName&&l.hasOwnProperty(this.options.attributesGroupName)&&(o+=h.attrStr)}else r+=this.processTextOrObjNode(l,s,i);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(s,l);h=this.replaceEntitiesValue(h),r+=h}else r+=this.buildTextValNode(l,s,"",i)}this.options.oneListGroup&&(r=this.buildObjectNode(r,s,o,i)),e+=r}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const n=Object.keys(c[s]),r=n.length;for(let o=0;o<r;o++)t+=this.buildAttrPairStr(n[o],""+c[s][n[o]])}else e+=this.processTextOrObjNode(c[s],s,i);return{attrStr:t,val:e}};Le.prototype.buildAttrPairStr=function(c,i){return i=this.options.attributeValueProcessor(c,""+i),i=this.replaceEntitiesValue(i),this.options.suppressBooleanAttributes&&i==="true"?" "+c:" "+c+'="'+i+'"'};function Ul(c,i,t){const e=this.j2x(c,t+1);return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],i,e.attrStr,t):this.buildObjectNode(e.val,i,e.attrStr,t)}Le.prototype.buildObjectNode=function(c,i,t,e){if(c==="")return i[0]==="?"?this.indentate(e)+"<"+i+t+"?"+this.tagEndChar:this.indentate(e)+"<"+i+t+this.closeTag(i)+this.tagEndChar;{let s="</"+i+this.tagEndChar,n="";return i[0]==="?"&&(n="?",s=""),(t||t==="")&&c.indexOf("<")===-1?this.indentate(e)+"<"+i+t+n+">"+c+s:this.options.commentPropName!==!1&&i===this.options.commentPropName&&n.length===0?this.indentate(e)+`<!--${c}-->`+this.newLine:this.indentate(e)+"<"+i+t+n+this.tagEndChar+c+this.indentate(e)+s}};Le.prototype.closeTag=function(c){let i="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(i="/"):this.options.suppressEmptyNode?i="/":i=`></${c}`,i};Le.prototype.buildTextValNode=function(c,i,t,e){if(this.options.cdataPropName!==!1&&i===this.options.cdataPropName)return this.indentate(e)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&i===this.options.commentPropName)return this.indentate(e)+`<!--${c}-->`+this.newLine;if(i[0]==="?")return this.indentate(e)+"<"+i+t+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(i,c);return s=this.replaceEntitiesValue(s),s===""?this.indentate(e)+"<"+i+t+this.closeTag(i)+this.tagEndChar:this.indentate(e)+"<"+i+t+">"+s+"</"+i+this.tagEndChar}};Le.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let i=0;i<this.options.entities.length;i++){const t=this.options.entities[i];c=c.replace(t.regex,t.val)}return c};function xl(c){return this.options.indentBy.repeat(c)}function Bl(c){return c.startsWith(this.options.attributeNamePrefix)&&c!==this.options.textNodeName?c.substr(this.attrPrefixLen):!1}var Vl=Le;const Yl=Yn,Gl=Ll,zl=Vl;var Ao={XMLParser:Gl,XMLValidator:Yl,XMLBuilder:zl};class Cs{constructor(i,t){C(this,"date",new Date);C(this,"author");C(this,"guid",Kt.create());C(this,"viewpoint");C(this,"modifiedAuthor");C(this,"modifiedDate");C(this,"topic");C(this,"_components");C(this,"_comment","");this._components=i,this._comment=t;const e=this._components.get(Mt);this.author=e.config.author}set comment(i){var e;const t=this._components.get(Mt);this._comment=i,this.modifiedDate=new Date,this.modifiedAuthor=t.config.author,(e=this.topic)==null||e.comments.set(this.guid,this)}get comment(){return this._comment}serialize(){let i=null;this.viewpoint&&(i=`<Viewpoint Guid="${this.viewpoint.guid}"/>`);let t=null;this.modifiedDate&&(t=`<ModifiedDate>${this.modifiedDate.toISOString()}</ModifiedDate>`);let e=null;return this.modifiedAuthor&&(e=`<ModifiedAuthor>${this.modifiedAuthor}</ModifiedAuthor>`),`
|
|
146
146
|
<Comment Guid="${this.guid}">
|
|
147
147
|
<Date>${this.date.toISOString()}</Date>
|
|
148
148
|
<Author>${this.author}</Author>
|
|
@@ -260,7 +260,7 @@ ${o}
|
|
|
260
260
|
</Visibility>
|
|
261
261
|
</Components>
|
|
262
262
|
${f}
|
|
263
|
-
</VisualizationInfo>`}}class zl extends ye{constructor(){super(...arguments);C(this,"_config",{overwriteColors:{value:!1,type:"Boolean"}})}get overwriteColors(){return this._config.overwriteColors.value}set overwriteColors(t){this._config.overwriteColors.value=t}}const yi=class yi extends mt{constructor(t){super(t);C(this,"enabled",!0);C(this,"list",new Qt);C(this,"isSetup",!1);C(this,"onSetup",new q);C(this,"config",new zl(this,this.components,"Viewpoints",yi.uuid));C(this,"onDisposed",new q);t.add(yi.uuid,this)}create(t,e){const s=new kn(this.components,t,{data:e});return e||this.list.set(s.guid,s),s}setup(){}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}};C(yi,"uuid","ee867824-a796-408d-8aa0-4e5962a83c66");let Zt=yi;class Lo extends ye{constructor(){super(...arguments);C(this,"_config",{visible:{value:!0,type:"Boolean"},lockRotation:{value:!0,type:"Boolean"},zoom:{type:"Number",interpolable:!0,value:.05,min:.001,max:5},frontOffset:{type:"Number",interpolable:!0,value:0,min:0,max:100},sizeX:{type:"Number",interpolable:!0,value:320,min:20,max:5e3},sizeY:{type:"Number",interpolable:!0,value:160,min:20,max:5e3},backgroundColor:{value:new b.Color,type:"Color"}})}get visible(){return this._config.visible.value}set visible(t){this._config.visible.value=t;const e=this._component.renderer.domElement.style;e.display=t?"block":"none"}get lockRotation(){return this._config.lockRotation.value}set lockRotation(t){this._config.lockRotation.value=t,this._component.lockRotation=t}get zoom(){return this._config.zoom.value}set zoom(t){this._config.zoom.value=t,this._component.zoom=t}get frontOffset(){return this._config.frontOffset.value}set frontOffset(t){this._config.frontOffset.value=t,this._component.frontOffset=t}get sizeX(){return this._config.sizeX.value}set sizeX(t){this._config.sizeX.value=t;const{sizeX:e,sizeY:s}=this._config,n=new b.Vector2(e.value,s.value);this._component.resize(n)}get sizeY(){return this._config.sizeY.value}set sizeY(t){this._config.sizeY.value=t;const{sizeX:e,sizeY:s}=this._config,n=new b.Vector2(e.value,s.value);this._component.resize(n)}get backgroundColor(){return this._config.backgroundColor.value}set backgroundColor(t){this._config.backgroundColor.value=t,this._component.backgroundColor=t}}class Po{constructor(i,t){C(this,"onDisposed",new q);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onResize",new q);C(this,"onSetup",new q);C(this,"frontOffset",0);C(this,"overrideMaterial",new b.MeshDepthMaterial);C(this,"backgroundColor",new b.Color(395274));C(this,"renderer");C(this,"enabled",!0);C(this,"world");C(this,"config");C(this,"isSetup",!1);C(this,"_defaultConfig",{visible:!0,lockRotation:!1,zoom:.05,frontOffset:0,sizeX:320,sizeY:160,backgroundColor:new b.Color(395274)});C(this,"_lockRotation",!0);C(this,"_size",new b.Vector2(320,160));C(this,"_camera");C(this,"_plane");C(this,"_tempVector1",new b.Vector3);C(this,"_tempVector2",new b.Vector3);C(this,"_tempTarget",new b.Vector3);C(this,"down",new b.Vector3(0,-1,0));C(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const i=[],t=this.world.renderer.three;for(const e of t.clippingPlanes)i.push(e);i.push(this._plane),this.renderer.clippingPlanes=i});if(this.world=i,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new b.WebGLRenderer,this.renderer.setSize(this._size.x,this._size.y);const e=1,s=this._size.x/this._size.y;this._camera=new b.OrthographicCamera(e*s/-2,e*s/2,e/2,e/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new b.Plane(this.down,200),this.updatePlanes(),this.config=new Lo(this,t,"MiniMap")}get lockRotation(){return this._lockRotation}set lockRotation(i){this._lockRotation=i,i&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(i){this._camera.zoom=i,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const i=this.world.scene.three,t=this.world.camera;if(!t.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(i instanceof b.Scene))throw new Error("The given world must have a THREE.Scene as a root!");const e=t.controls;if(e.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(e.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){e.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const s=i.background;i.background=this.backgroundColor,this.renderer.render(i,this._camera),i.background=s,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(i=this._size){this._size.copy(i),this.renderer.setSize(i.x,i.y);const t=i.x/i.y,e=1;this._camera.left=e*t/-2,this._camera.right=e*t/2,this._camera.top=e/2,this._camera.bottom=-e/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(i)}setup(i){const t={...this._defaultConfig,...i};this.config.visible=!0,this.config.lockRotation=t.lockRotation,this.config.zoom=t.zoom,this.config.frontOffset=t.frontOffset,this.config.sizeX=t.sizeX,this.config.sizeY=t.sizeY,this.config.backgroundColor=t.backgroundColor,this.isSetup=!0,this.onSetup.trigger()}}const vs=class vs extends mt{constructor(t){super(t);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"onSetup",new q);C(this,"enabled",!0);C(this,"list",new Map);this.components.add(vs.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a minimap!");const e=new Po(t,this.components);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t);e&&e.dispose(),this.list.delete(t)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[t,e]of this.list)e.update()}};C(vs,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let _n=vs;const Us=class Us extends mt{constructor(t){super(t);C(this,"enabled",!0);t.add(Us.uuid,this)}static distanceFromPointToLine(t,e,s,n=!1){const r=new b.Line3,o=new b.Vector3;return r.set(e,s),r.closestPointToPoint(t,n,o),o.distanceTo(t)}getFace(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const n=new Map,r=t.geometry.index.array,{plane:o}=this.getFaceData(e,s,t),a=[];for(let I=0;I<r.length/3;I++){const{plane:u,edges:d}=this.getFaceData(I,s,t);if(u.equals(o)){a.push({index:I,edges:d});for(const{id:E,points:T,distance:p}of d)n.set(E,{points:T,distance:p})}}let l=0;const h=new Map,f=new Map;for(const{index:I,edges:u}of a){const d=new Map;for(const{id:S}of u)if(h.has(S)){const N=h.get(S);d.set(S,N)}const E=u.map(S=>S.id);if(!d.size){const S=l++;for(const{id:N}of u)h.set(N,S);f.set(S,{edges:new Set(E),indices:new Set([I])});continue}let T=null;const p=new Set,m=new Set(E);for(const[S,N]of d){T===null?T=N:N!==T&&p.add(N),h.delete(S);const{edges:L}=f.get(N);L.delete(S),m.delete(S)}if(T===null)throw new Error("Error computing face!");const F=f.get(T),{indices:R}=F;R.add(I);for(const S of m){h.set(S,T);const{edges:N}=F;N.add(S)}for(const S of p){const N=f.get(S),{edges:L,indices:D}=N,P=f.get(T),{edges:v,indices:G}=P;for(const O of L)v.add(O),h.set(O,T);for(const O of D)G.add(O);f.delete(S)}}for(const[I,{indices:u,edges:d}]of f)if(u.has(e)){const E=[];for(const T of d){const p=n.get(T);E.push(p)}return{edges:E,indices:u}}return null}getVerticesAndNormal(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const n=t.geometry.index.array,r=t.geometry.attributes.position.array,o=t.geometry.attributes.normal.array,a=n[e*3]*3,l=n[e*3+1]*3,h=n[e*3+2]*3,f=new b.Vector3(r[a],r[a+1],r[a+2]),I=new b.Vector3(r[l],r[l+1],r[l+2]),u=new b.Vector3(r[h],r[h+1],r[h+2]),d=new b.Vector3(o[a],o[a+1],o[a+2]),E=new b.Vector3(o[l],o[l+1],o[l+2]),T=new b.Vector3(o[h],o[h+1],o[h+2]),p=(d.x+E.x+T.x)/3,m=(d.y+E.y+T.y)/3,F=(d.z+E.z+T.z)/3,R=new b.Vector3(p,m,F);if(s!==void 0&&t instanceof b.InstancedMesh){const S=new b.Matrix4;t.getMatrixAt(s,S);const N=new b.Matrix4;N.extractRotation(S),R.applyMatrix4(N),f.applyMatrix4(S),I.applyMatrix4(S),u.applyMatrix4(S)}return{p1:f,p2:I,p3:u,faceNormal:R}}round(t){t.x=Math.trunc(t.x*1e3)/1e3,t.y=Math.trunc(t.y*1e3)/1e3,t.z=Math.trunc(t.z*1e3)/1e3}getVolumeFromFragments(t){const e=this.components.get(pt),s=new b.Matrix4,n=[];for(const o in t){const a=e.list.get(o);if(!a)continue;const l=t[o];let h=0;for(const u of l){const d=a.getInstancesIDs(u);d&&(h+=d.size)}const f=new b.InstancedMesh(a.mesh.geometry,void 0,h);let I=0;for(const u of l){const d=a.getInstancesIDs(u);if(d)for(const E of d)a.mesh.getMatrixAt(E,s),f.setMatrixAt(I++,s)}n.push(f)}const r=this.getVolumeFromMeshes(n);for(const o of n)o.geometry=null,o.material=[],o.dispose();return r}getVolumeFromMeshes(t){let e=0;for(const s of t)e+=this.getVolumeOfMesh(s);return e}getFaceData(t,e,s){const n=this.getVerticesAndNormal(s,t,e),{p1:r,p2:o,p3:a,faceNormal:l}=n;this.round(r),this.round(o),this.round(a),this.round(l);const h=[{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${a.x}|${a.y}|${a.z}`,value:a}];h.sort((F,R)=>F.id<R.id?-1:F.id>R.id?1:0);const[{id:f,value:I},{id:u,value:d},{id:E,value:T}]=h,p=[{id:`${f}|${u}`,distance:I.distanceTo(d),points:[I,d]},{id:`${u}|${E}`,distance:d.distanceTo(T),points:[d,T]},{id:`${f}|${E}`,distance:I.distanceTo(T),points:[I,T]}],m=new b.Plane;return m.setFromNormalAndCoplanarPoint(l,r),m.constant=Math.round(m.constant*10)/10,{plane:m,edges:p}}getVolumeOfMesh(t){let e=0;const s=new b.Vector3,n=new b.Vector3,r=new b.Vector3,{index:o}=t.geometry,a=t.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const l=[];if(t instanceof b.InstancedMesh)for(let f=0;f<t.count;f++){const I=new b.Matrix4;t.getMatrixAt(f,I),l.push(I)}else l.push(new b.Matrix4().identity());const{matrixWorld:h}=t;for(let f=0;f<o.array.length-2;f+=3)for(const I of l){const u=I.multiply(h),d=o.array[f]*3,E=o.array[f+1]*3,T=o.array[f+2]*3;s.set(a[d],a[d+1],a[d+2]).applyMatrix4(u),n.set(a[E],a[E+1],a[E+2]).applyMatrix4(u),r.set(a[T],a[T+1],a[T+2]).applyMatrix4(u),e+=this.getSignedVolumeOfTriangle(s,n,r)}return Math.abs(e)}getSignedVolumeOfTriangle(t,e,s){const n=s.x*e.y*t.z,r=e.x*s.y*t.z,o=s.x*t.y*e.z,a=t.x*s.y*e.z,l=e.x*t.y*s.z,h=t.x*e.y*s.z;return 1/6*(-n+r+o-a-l+h)}};C(Us,"uuid","267ca032-672f-4cb0-afa9-d24e904f39d6");let Mn=Us;class bi{constructor(i){C(this,"cardinality","required");C(this,"instructions");C(this,"evalRequirement",(i,t,e,s)=>{const n={parameter:e,currentValue:i,requiredValue:t.parameter,pass:!1};s&&this.addCheckResult(n,s);let r=!1;if(t.type==="simple"){const o=t.parameter;r=i===o}if(t.type==="enumeration"&&(r=t.parameter.includes(i)),t.type==="pattern"){const o=t.parameter;r=new RegExp(o).test(String(i))}if(t.type==="length"){const o=t.parameter,{min:a,length:l,max:h}=o;l!==void 0&&(r=String(i).length===l),a!==void 0&&(r=String(i).length>=a),h!==void 0&&(r=String(i).length<=h)}if(t.type==="bounds"&&typeof i=="number"){const{min:o,minInclusive:a,max:l,maxInclusive:h}=t.parameter;let f=!0,I=!0;o!==void 0&&(f=a?i<=o:i<o),l!==void 0&&(I=h?i>=l:i>l),r=f&&I}return this.cardinality==="prohibited"&&(r=!r),this.cardinality==="optional"&&(r=!0),n.pass=r,n.pass});C(this,"testResult",[]);this.components=i}addCheckResult(i,t){const e=t.findIndex(({parameter:s})=>s===i.parameter);e!==-1?t[e]=i:t.push(i)}saveResult(i,t){const{GlobalId:e}=i;if(!e)return;const{value:s}=e,n={expressID:s,pass:t,checks:[],cardinality:this.cardinality};this.testResult.push(n)}}const de=(c,i)=>{let t="";return i?(i.type==="simple"&&(t=`<ids:simpleValue>${i.parameter}</ids:simpleValue>`),i.type==="enumeration"&&(t=`<xs:restriction base="xs:string">
|
|
263
|
+
</VisualizationInfo>`}}class kl extends ye{constructor(){super(...arguments);C(this,"_config",{overwriteColors:{value:!1,type:"Boolean"}})}get overwriteColors(){return this._config.overwriteColors.value}set overwriteColors(t){this._config.overwriteColors.value=t}}const yi=class yi extends mt{constructor(t){super(t);C(this,"enabled",!0);C(this,"list",new Qt);C(this,"isSetup",!1);C(this,"onSetup",new q);C(this,"config",new kl(this,this.components,"Viewpoints",yi.uuid));C(this,"onDisposed",new q);t.add(yi.uuid,this)}create(t,e){const s=new kn(this.components,t,{data:e});return e||this.list.set(s.guid,s),s}setup(){}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}};C(yi,"uuid","ee867824-a796-408d-8aa0-4e5962a83c66");let Zt=yi;class Lo extends ye{constructor(){super(...arguments);C(this,"_config",{visible:{value:!0,type:"Boolean"},lockRotation:{value:!0,type:"Boolean"},zoom:{type:"Number",interpolable:!0,value:.05,min:.001,max:5},frontOffset:{type:"Number",interpolable:!0,value:0,min:0,max:100},sizeX:{type:"Number",interpolable:!0,value:320,min:20,max:5e3},sizeY:{type:"Number",interpolable:!0,value:160,min:20,max:5e3},backgroundColor:{value:new b.Color,type:"Color"}})}get visible(){return this._config.visible.value}set visible(t){this._config.visible.value=t;const e=this._component.renderer.domElement.style;e.display=t?"block":"none"}get lockRotation(){return this._config.lockRotation.value}set lockRotation(t){this._config.lockRotation.value=t,this._component.lockRotation=t}get zoom(){return this._config.zoom.value}set zoom(t){this._config.zoom.value=t,this._component.zoom=t}get frontOffset(){return this._config.frontOffset.value}set frontOffset(t){this._config.frontOffset.value=t,this._component.frontOffset=t}get sizeX(){return this._config.sizeX.value}set sizeX(t){this._config.sizeX.value=t;const{sizeX:e,sizeY:s}=this._config,n=new b.Vector2(e.value,s.value);this._component.resize(n)}get sizeY(){return this._config.sizeY.value}set sizeY(t){this._config.sizeY.value=t;const{sizeX:e,sizeY:s}=this._config,n=new b.Vector2(e.value,s.value);this._component.resize(n)}get backgroundColor(){return this._config.backgroundColor.value}set backgroundColor(t){this._config.backgroundColor.value=t,this._component.backgroundColor=t}}class Po{constructor(i,t){C(this,"onDisposed",new q);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onResize",new q);C(this,"onSetup",new q);C(this,"frontOffset",0);C(this,"overrideMaterial",new b.MeshDepthMaterial);C(this,"backgroundColor",new b.Color(395274));C(this,"renderer");C(this,"enabled",!0);C(this,"world");C(this,"config");C(this,"isSetup",!1);C(this,"_defaultConfig",{visible:!0,lockRotation:!1,zoom:.05,frontOffset:0,sizeX:320,sizeY:160,backgroundColor:new b.Color(395274)});C(this,"_lockRotation",!0);C(this,"_size",new b.Vector2(320,160));C(this,"_camera");C(this,"_plane");C(this,"_tempVector1",new b.Vector3);C(this,"_tempVector2",new b.Vector3);C(this,"_tempTarget",new b.Vector3);C(this,"down",new b.Vector3(0,-1,0));C(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const i=[],t=this.world.renderer.three;for(const e of t.clippingPlanes)i.push(e);i.push(this._plane),this.renderer.clippingPlanes=i});if(this.world=i,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new b.WebGLRenderer,this.renderer.setSize(this._size.x,this._size.y);const e=1,s=this._size.x/this._size.y;this._camera=new b.OrthographicCamera(e*s/-2,e*s/2,e/2,e/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new b.Plane(this.down,200),this.updatePlanes(),this.config=new Lo(this,t,"MiniMap")}get lockRotation(){return this._lockRotation}set lockRotation(i){this._lockRotation=i,i&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(i){this._camera.zoom=i,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const i=this.world.scene.three,t=this.world.camera;if(!t.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(i instanceof b.Scene))throw new Error("The given world must have a THREE.Scene as a root!");const e=t.controls;if(e.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(e.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){e.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const s=i.background;i.background=this.backgroundColor,this.renderer.render(i,this._camera),i.background=s,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(i=this._size){this._size.copy(i),this.renderer.setSize(i.x,i.y);const t=i.x/i.y,e=1;this._camera.left=e*t/-2,this._camera.right=e*t/2,this._camera.top=e/2,this._camera.bottom=-e/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(i)}setup(i){const t={...this._defaultConfig,...i};this.config.visible=!0,this.config.lockRotation=t.lockRotation,this.config.zoom=t.zoom,this.config.frontOffset=t.frontOffset,this.config.sizeX=t.sizeX,this.config.sizeY=t.sizeY,this.config.backgroundColor=t.backgroundColor,this.isSetup=!0,this.onSetup.trigger()}}const vs=class vs extends mt{constructor(t){super(t);C(this,"onAfterUpdate",new q);C(this,"onBeforeUpdate",new q);C(this,"onDisposed",new q);C(this,"onSetup",new q);C(this,"enabled",!0);C(this,"list",new Map);this.components.add(vs.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a minimap!");const e=new Po(t,this.components);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t);e&&e.dispose(),this.list.delete(t)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[t,e]of this.list)e.update()}};C(vs,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let _n=vs;const Us=class Us extends mt{constructor(t){super(t);C(this,"enabled",!0);t.add(Us.uuid,this)}static distanceFromPointToLine(t,e,s,n=!1){const r=new b.Line3,o=new b.Vector3;return r.set(e,s),r.closestPointToPoint(t,n,o),o.distanceTo(t)}getFace(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const n=new Map,r=t.geometry.index.array,{plane:o}=this.getFaceData(e,s,t),a=[];for(let I=0;I<r.length/3;I++){const{plane:u,edges:d}=this.getFaceData(I,s,t);if(u.equals(o)){a.push({index:I,edges:d});for(const{id:E,points:T,distance:p}of d)n.set(E,{points:T,distance:p})}}let l=0;const h=new Map,f=new Map;for(const{index:I,edges:u}of a){const d=new Map;for(const{id:S}of u)if(h.has(S)){const N=h.get(S);d.set(S,N)}const E=u.map(S=>S.id);if(!d.size){const S=l++;for(const{id:N}of u)h.set(N,S);f.set(S,{edges:new Set(E),indices:new Set([I])});continue}let T=null;const p=new Set,m=new Set(E);for(const[S,N]of d){T===null?T=N:N!==T&&p.add(N),h.delete(S);const{edges:L}=f.get(N);L.delete(S),m.delete(S)}if(T===null)throw new Error("Error computing face!");const F=f.get(T),{indices:R}=F;R.add(I);for(const S of m){h.set(S,T);const{edges:N}=F;N.add(S)}for(const S of p){const N=f.get(S),{edges:L,indices:D}=N,P=f.get(T),{edges:v,indices:G}=P;for(const O of L)v.add(O),h.set(O,T);for(const O of D)G.add(O);f.delete(S)}}for(const[I,{indices:u,edges:d}]of f)if(u.has(e)){const E=[];for(const T of d){const p=n.get(T);E.push(p)}return{edges:E,indices:u}}return null}getVerticesAndNormal(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const n=t.geometry.index.array,r=t.geometry.attributes.position.array,o=t.geometry.attributes.normal.array,a=n[e*3]*3,l=n[e*3+1]*3,h=n[e*3+2]*3,f=new b.Vector3(r[a],r[a+1],r[a+2]),I=new b.Vector3(r[l],r[l+1],r[l+2]),u=new b.Vector3(r[h],r[h+1],r[h+2]),d=new b.Vector3(o[a],o[a+1],o[a+2]),E=new b.Vector3(o[l],o[l+1],o[l+2]),T=new b.Vector3(o[h],o[h+1],o[h+2]),p=(d.x+E.x+T.x)/3,m=(d.y+E.y+T.y)/3,F=(d.z+E.z+T.z)/3,R=new b.Vector3(p,m,F);if(s!==void 0&&t instanceof b.InstancedMesh){const S=new b.Matrix4;t.getMatrixAt(s,S);const N=new b.Matrix4;N.extractRotation(S),R.applyMatrix4(N),f.applyMatrix4(S),I.applyMatrix4(S),u.applyMatrix4(S)}return{p1:f,p2:I,p3:u,faceNormal:R}}round(t){t.x=Math.trunc(t.x*1e3)/1e3,t.y=Math.trunc(t.y*1e3)/1e3,t.z=Math.trunc(t.z*1e3)/1e3}getVolumeFromFragments(t){const e=this.components.get(pt),s=new b.Matrix4,n=[];for(const o in t){const a=e.list.get(o);if(!a)continue;const l=t[o];let h=0;for(const u of l){const d=a.getInstancesIDs(u);d&&(h+=d.size)}const f=new b.InstancedMesh(a.mesh.geometry,void 0,h);let I=0;for(const u of l){const d=a.getInstancesIDs(u);if(d)for(const E of d)a.mesh.getMatrixAt(E,s),f.setMatrixAt(I++,s)}n.push(f)}const r=this.getVolumeFromMeshes(n);for(const o of n)o.geometry=null,o.material=[],o.dispose();return r}getVolumeFromMeshes(t){let e=0;for(const s of t)e+=this.getVolumeOfMesh(s);return e}getFaceData(t,e,s){const n=this.getVerticesAndNormal(s,t,e),{p1:r,p2:o,p3:a,faceNormal:l}=n;this.round(r),this.round(o),this.round(a),this.round(l);const h=[{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${a.x}|${a.y}|${a.z}`,value:a}];h.sort((F,R)=>F.id<R.id?-1:F.id>R.id?1:0);const[{id:f,value:I},{id:u,value:d},{id:E,value:T}]=h,p=[{id:`${f}|${u}`,distance:I.distanceTo(d),points:[I,d]},{id:`${u}|${E}`,distance:d.distanceTo(T),points:[d,T]},{id:`${f}|${E}`,distance:I.distanceTo(T),points:[I,T]}],m=new b.Plane;return m.setFromNormalAndCoplanarPoint(l,r),m.constant=Math.round(m.constant*10)/10,{plane:m,edges:p}}getVolumeOfMesh(t){let e=0;const s=new b.Vector3,n=new b.Vector3,r=new b.Vector3,{index:o}=t.geometry,a=t.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const l=[];if(t instanceof b.InstancedMesh)for(let f=0;f<t.count;f++){const I=new b.Matrix4;t.getMatrixAt(f,I),l.push(I)}else l.push(new b.Matrix4().identity());const{matrixWorld:h}=t;for(let f=0;f<o.array.length-2;f+=3)for(const I of l){const u=I.multiply(h),d=o.array[f]*3,E=o.array[f+1]*3,T=o.array[f+2]*3;s.set(a[d],a[d+1],a[d+2]).applyMatrix4(u),n.set(a[E],a[E+1],a[E+2]).applyMatrix4(u),r.set(a[T],a[T+1],a[T+2]).applyMatrix4(u),e+=this.getSignedVolumeOfTriangle(s,n,r)}return Math.abs(e)}getSignedVolumeOfTriangle(t,e,s){const n=s.x*e.y*t.z,r=e.x*s.y*t.z,o=s.x*t.y*e.z,a=t.x*s.y*e.z,l=e.x*t.y*s.z,h=t.x*e.y*s.z;return 1/6*(-n+r+o-a-l+h)}};C(Us,"uuid","267ca032-672f-4cb0-afa9-d24e904f39d6");let Mn=Us;class bi{constructor(i){C(this,"cardinality","required");C(this,"instructions");C(this,"evalRequirement",(i,t,e,s)=>{const n={parameter:e,currentValue:i,requiredValue:t.parameter,pass:!1};s&&this.addCheckResult(n,s);let r=!1;if(t.type==="simple"){const o=t.parameter;r=i===o}if(t.type==="enumeration"&&(r=t.parameter.includes(i)),t.type==="pattern"){const o=t.parameter;r=new RegExp(o).test(String(i))}if(t.type==="length"){const o=t.parameter,{min:a,length:l,max:h}=o;l!==void 0&&(r=String(i).length===l),a!==void 0&&(r=String(i).length>=a),h!==void 0&&(r=String(i).length<=h)}if(t.type==="bounds"&&typeof i=="number"){const{min:o,minInclusive:a,max:l,maxInclusive:h}=t.parameter;let f=!0,I=!0;o!==void 0&&(f=a?i<=o:i<o),l!==void 0&&(I=h?i>=l:i>l),r=f&&I}return this.cardinality==="prohibited"&&(r=!r),this.cardinality==="optional"&&(r=!0),n.pass=r,n.pass});C(this,"testResult",[]);this.components=i}addCheckResult(i,t){const e=t.findIndex(({parameter:s})=>s===i.parameter);e!==-1?t[e]=i:t.push(i)}saveResult(i,t){const{GlobalId:e}=i;if(!e)return;const{value:s}=e,n={expressID:s,pass:t,checks:[],cardinality:this.cardinality};this.testResult.push(n)}}const de=(c,i)=>{let t="";return i?(i.type==="simple"&&(t=`<ids:simpleValue>${i.parameter}</ids:simpleValue>`),i.type==="enumeration"&&(t=`<xs:restriction base="xs:string">
|
|
264
264
|
${i.parameter.map(n=>`<xs:enumeration value="${n}" />`).join(`\r
|
|
265
265
|
`)}
|
|
266
266
|
</xs:restriction>`),i.type==="pattern"&&(t=`<xs:restriction base="xs:string">
|
|
@@ -287,7 +287,7 @@ ${o}
|
|
|
287
287
|
<ids:requirements>
|
|
288
288
|
${[...this.requirements].map(r=>r.serialize("requirement"))}
|
|
289
289
|
</ids:requirements>
|
|
290
|
-
</ids:specification>`}}const Ee=c=>{if(!c)return;const i={type:"simple"};if("simpleValue"in c&&(i.parameter=c.simpleValue),"restriction"in c){const t=c.restriction;if("pattern"in t&&(i.type="pattern",i.parameter=t.pattern.value),"enumeration"in t){i.type="enumeration";const e=t.enumeration.map(({value:s})=>s);i.parameter=e}}if(i.parameter!==void 0)return i},vr=(c,i)=>{const t=[];for(const e of i){const s=e.name,n=Ee(s);if(!n)continue;const r=new wo(c,n);e.cardinality&&(r.cardinality=e.cardinality),r.predefinedType=Ee(e.predefinedType),t.push(r)}return t},
|
|
290
|
+
</ids:specification>`}}const Ee=c=>{if(!c)return;const i={type:"simple"};if("simpleValue"in c&&(i.parameter=c.simpleValue),"restriction"in c){const t=c.restriction;if("pattern"in t&&(i.type="pattern",i.parameter=t.pattern.value),"enumeration"in t){i.type="enumeration";const e=t.enumeration.map(({value:s})=>s);i.parameter=e}}if(i.parameter!==void 0)return i},vr=(c,i)=>{const t=[];for(const e of i){const s=e.name,n=Ee(s);if(!n)continue;const r=new wo(c,n);e.cardinality&&(r.cardinality=e.cardinality),r.predefinedType=Ee(e.predefinedType),t.push(r)}return t},Hl=(c,i)=>{const t=[];for(const e of i){const s=e.name,n=Ee(s);if(!n)continue;const r=new _o(c,n);e.cardinality&&(r.cardinality=e.cardinality),r.value=Ee(e.value),t.push(r)}return t},Wl=(c,i)=>{const t=[];for(const e of i){const s=e.system,n=Ee(s);if(!n)continue;const r=new Mo(c,n);e.cardinality&&(r.cardinality=e.cardinality);const o=Ee(e.value);(o==null?void 0:o.type)==="simple"&&(o.parameter=String(o.parameter)),(o==null?void 0:o.type)==="enumeration"&&Array.isArray(o.parameter)&&(o.parameter=o.parameter.map(String)),r.value=o,r.uri=e.uri,t.push(r)}return t},Xl=(c,i)=>{const t=[];for(const e of i){const s=e.propertySet,n=e.baseName,r=Ee(s),o=Ee(n);if(!(o&&r))continue;const a=new Do(c,r,o);e.cardinality&&(a.cardinality=e.cardinality);const l=Ee(e.value);(l==null?void 0:l.type)==="enumeration"&&Array.isArray(l.parameter)&&(l.parameter=l.parameter.map(String)),a.value=l,a.dataType=e.dataType,a.uri=e.uri,t.push(a)}return t},Ke=class Ke extends mt{constructor(t){super(t);C(this,"enabled",!0);C(this,"list",new Qt);t.add(Ke.uuid,this)}getFragmentIdMap(t,e){const n=e.filter(h=>h.pass).map(h=>h.expressID),r=t.getFragmentMap(n),a=e.filter(h=>!h.pass).map(h=>h.expressID),l=t.getFragmentMap(a);return{pass:r,fail:l}}create(t,e){const s=new bo(this.components,t,e);return this.list.set(s.identifier,s),s}load(t){const e=[],s=Ke.xmlParser.parse(t).ids,{specifications:n}=s;if(n&&n.specification){const r=Array.isArray(n.specification)?n.specification:[n.specification];for(const o of r){const{name:a,ifcVersion:l}=o;if(!(a&&l))continue;const h=[],f=[],{applicability:I,requirements:u}=o;if(I){const{maxOccurs:d,...E}=I,T=Array.isArray(E)?E:[E];for(const p of T)for(const m in p){const F=Array.isArray(p[m])?p[m]:[p[m]];if(m==="entity"){const R=vr(this.components,F);h.push(...R)}}}if(u){const{maxOccurs:d,...E}=u,T=Array.isArray(E)?E:[E];for(const p of T)for(const m in p){const F=Array.isArray(p[m])?p[m]:[p[m]];if(m==="entity"){const R=vr(this.components,F);f.push(...R)}if(m==="attribute"){const R=Hl(this.components,F);f.push(...R)}if(m==="classification"){const R=Wl(this.components,F);f.push(...R)}if(m==="property"){const R=Xl(this.components,F);f.push(...R)}}}if(h.length>0&&f.length>0){const d=this.create(a,l.split(/\s+/));d.applicability.add(...h),d.requirements.add(...f),e.push(d)}}}return e}export(t,e=this.list.values()){const s=e??this.list;return`<ids:ids xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/1.0/ids.xsd" xmlns:ids="http://standards.buildingsmart.org/IDS">
|
|
291
291
|
<!-- Made with That Open Engine ${Li.release} (https://github.com/thatopen/engine_components) -->
|
|
292
292
|
<ids:info>
|
|
293
293
|
<ids:title>${t.title}</ids:title>
|
|
@@ -303,4 +303,4 @@ ${o}
|
|
|
303
303
|
${[...s].map(r=>r.serialize()).join(`
|
|
304
304
|
`)}
|
|
305
305
|
</ids:specifications>
|
|
306
|
-
</ids:ids>`}};C(Ke,"uuid","9f0b9f78-9b2e-481a-b766-2fbfd01f342c"),C(Ke,"xmlParser",new Ao.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,numberParseOptions:{leadingZeros:!0,hex:!0},parseAttributeValue:!0,preserveOrder:!1,processEntities:!1,removeNSPrefix:!0,trimValues:!0}));let wn=Ke;exports.AsyncEvent=fe;exports.BCFTopics=Mt;exports.BCFTopicsConfigManager=So;exports.Base=Vs;exports.BaseCamera=Yr;exports.BaseRenderer=Gr;exports.BaseScene=zr;exports.BaseWorldItem=Ys;exports.BoundingBoxer=Ts;exports.Classifier=ti;exports.Clipper=Is;exports.Comment=Cs;exports.Component=mt;exports.ComponentWithUI=Xa;exports.Components=Li;exports.ConfigManager=Ne;exports.Configurator=ye;exports.CullerRenderer=jr;exports.Cullers=fs;exports.DataMap=Qt;exports.DataSet=Ie;exports.Disposer=Ce;exports.Event=q;exports.Exploder=Ln;exports.FirstPersonMode=eo;exports.FragmentsManager=pt;exports.GeometryTypes=Vn;exports.Grids=Fn;exports.Hider=ms;exports.IDSAttribute=_o;exports.IDSClassification=Mo;exports.IDSEntity=wo;exports.IDSFacet=bi;exports.IDSProperty=Do;exports.IDSSpecification=bo;exports.IDSSpecifications=wn;exports.IfcBasicQuery=wi;exports.IfcCategories=
|
|
306
|
+
</ids:ids>`}};C(Ke,"uuid","9f0b9f78-9b2e-481a-b766-2fbfd01f342c"),C(Ke,"xmlParser",new Ao.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,numberParseOptions:{leadingZeros:!0,hex:!0},parseAttributeValue:!0,preserveOrder:!1,processEntities:!1,removeNSPrefix:!0,trimValues:!0}));let wn=Ke;exports.AsyncEvent=fe;exports.BCFTopics=Mt;exports.BCFTopicsConfigManager=So;exports.Base=Vs;exports.BaseCamera=Yr;exports.BaseRenderer=Gr;exports.BaseScene=zr;exports.BaseWorldItem=Ys;exports.BoundingBoxer=Ts;exports.Classifier=ti;exports.Clipper=Is;exports.Comment=Cs;exports.Component=mt;exports.ComponentWithUI=Xa;exports.Components=Li;exports.ConfigManager=Ne;exports.Configurator=ye;exports.CullerRenderer=jr;exports.Cullers=fs;exports.DataMap=Qt;exports.DataSet=Ie;exports.Disposer=Ce;exports.Event=q;exports.EventManager=$a;exports.Exploder=Ln;exports.FirstPersonMode=eo;exports.FragmentsManager=pt;exports.GeometryTypes=Vn;exports.Grids=Fn;exports.Hider=ms;exports.IDSAttribute=_o;exports.IDSClassification=Mo;exports.IDSEntity=wo;exports.IDSFacet=bi;exports.IDSProperty=Do;exports.IDSSpecification=bo;exports.IDSSpecifications=wn;exports.IfcBasicQuery=wi;exports.IfcCategories=Oc;exports.IfcCategoryMap=_i;exports.IfcElements=oo;exports.IfcFinder=yn;exports.IfcFinderQuery=qt;exports.IfcFragmentSettings=zs;exports.IfcGeometryTiler=Pn;exports.IfcJsonExporter=ds;exports.IfcLoader=Es;exports.IfcPropertiesManager=ps;exports.IfcPropertiesTiler=yo;exports.IfcPropertiesUtils=be;exports.IfcPropertyQuery=Di;exports.IfcRelationsIndexer=Bt;exports.IfcStreamingSettings=Oo;exports.MaterialsUtils=An;exports.MeasurementUtils=Mn;exports.MeshCullerRenderer=qr;exports.MiniMap=Po;exports.MiniMapConfigManager=Lo;exports.MiniMaps=_n;exports.Mouse=Qr;exports.OrbitMode=io;exports.OrthoPerspectiveCamera=ro;exports.PlanMode=so;exports.ProjectionManager=no;exports.PropertiesStreamingSettings=No;exports.Raycasters=ve;exports.ShadowedScene=Ec;exports.SimpleCamera=Je;exports.SimpleGrid=to;exports.SimpleGridConfigManager=Jr;exports.SimplePlane=Gs;exports.SimpleRaycaster=Kr;exports.SimpleRenderer=oc;exports.SimpleScene=Xr;exports.SimpleSceneConfigManager=Wr;exports.SimpleWorld=Hr;exports.Topic=Mi;exports.UUID=Kt;exports.VertexPicker=sc;exports.Viewpoint=kn;exports.Viewpoints=Zt;exports.Worlds=Pi;exports.extensionsImporter=Fo;exports.ifcCategoryCase=ao;exports.ifcRelAttrsPosition=fo;exports.ifcRelClassNames=Io;exports.isPointInFrontOfPlane=ic;exports.obbFromPoints=kr;exports.readPixelsAsync=Bn;exports.relToAttributesMap=Sn;
|