gl-draw 0.6.6 → 0.7.0

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/index.js CHANGED
@@ -1,57 +1 @@
1
- (function(){var Le={187:function(M){"use strict";var A=typeof Reflect=="object"?Reflect:null,x=A&&typeof A.apply=="function"?A.apply:function(c,v,m){return Function.prototype.apply.call(c,v,m)},G;A&&typeof A.ownKeys=="function"?G=A.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function D(f){console&&console.warn&&console.warn(f)}var j=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}M.exports=g,M.exports.once=Q,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var V=10;function U(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return V},set:function(f){if(typeof f!="number"||f<0||j(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");V=f}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||j(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function F(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return F(this)},g.prototype.emit=function(c){for(var v=[],m=1;m<arguments.length;m++)v.push(arguments[m]);var w=c==="error",E=this._events;if(E!==void 0)w=w&&E.error===void 0;else if(!w)return!1;if(w){var C;if(v.length>0&&(C=v[0]),C instanceof Error)throw C;var Y=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw Y.context=C,Y}var ae=E[c];if(ae===void 0)return!1;if(typeof ae=="function")x(ae,this,v);else for(var W=ae.length,q=ie(ae,W),m=0;m<W;++m)x(q[m],this,v);return!0};function O(f,c,v,m){var w,E,C;if(U(v),E=f._events,E===void 0?(E=f._events=Object.create(null),f._eventsCount=0):(E.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),E=f._events),C=E[c]),C===void 0)C=E[c]=v,++f._eventsCount;else if(typeof C=="function"?C=E[c]=m?[v,C]:[C,v]:m?C.unshift(v):C.push(v),w=F(f),w>0&&C.length>w&&!C.warned){C.warned=!0;var Y=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");Y.name="MaxListenersExceededWarning",Y.emitter=f,Y.type=c,Y.count=C.length,D(Y)}return f}g.prototype.addListener=function(c,v){return O(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return O(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var m={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},w=k.bind(m);return w.listener=v,m.wrapFn=w,w}g.prototype.once=function(c,v){return U(v),this.on(c,l(this,c,v)),this},g.prototype.prependOnceListener=function(c,v){return U(v),this.prependListener(c,l(this,c,v)),this},g.prototype.removeListener=function(c,v){var m,w,E,C,Y;if(U(v),w=this._events,w===void 0)return this;if(m=w[c],m===void 0)return this;if(m===v||m.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete w[c],w.removeListener&&this.emit("removeListener",c,m.listener||v));else if(typeof m!="function"){for(E=-1,C=m.length-1;C>=0;C--)if(m[C]===v||m[C].listener===v){Y=m[C].listener,E=C;break}if(E<0)return this;E===0?m.shift():re(m,E),m.length===1&&(w[c]=m[0]),w.removeListener!==void 0&&this.emit("removeListener",c,Y||v)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(c){var v,m,w;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[c]),this;if(arguments.length===0){var E=Object.keys(m),C;for(w=0;w<E.length;++w)C=E[w],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=m[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(w=v.length-1;w>=0;w--)this.removeListener(c,v[w]);return this};function N(f,c,v){var m=f._events;if(m===void 0)return[];var w=m[c];return w===void 0?[]:typeof w=="function"?v?[w.listener||w]:[w]:v?X(w):ie(w,w.length)}g.prototype.listeners=function(c){return N(this,c,!0)},g.prototype.rawListeners=function(c){return N(this,c,!1)},g.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):J.call(f,c)},g.prototype.listenerCount=J;function J(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ie(f,c){for(var v=new Array(c),m=0;m<c;++m)v[m]=f[m];return v}function re(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function X(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function Q(f,c){return new Promise(function(v,m){function w(C){f.removeListener(c,E),m(C)}function E(){typeof f.removeListener=="function"&&f.removeListener("error",w),v([].slice.call(arguments))}R(f,c,E,{once:!0}),c!=="error"&&K(f,w,{once:!0})})}function K(f,c,v){typeof f.on=="function"&&R(f,"error",c,v)}function R(f,c,v,m){if(typeof f.on=="function")m.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function w(E){m.once&&f.removeEventListener(c,w),v(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(M){var A=function(x){"use strict";var G=Object.prototype,D=G.hasOwnProperty,j,g=typeof Symbol=="function"?Symbol:{},V=g.iterator||"@@iterator",U=g.asyncIterator||"@@asyncIterator",F=g.toStringTag||"@@toStringTag";function O(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{O({},"")}catch(p){O=function(d,b,L){return d[b]=L}}function k(p,d,b,L){var T=d&&d.prototype instanceof Q?d:Q,$=Object.create(T.prototype),oe=new q(L||[]);return $._invoke=C(p,b,oe),$}x.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(L){return{type:"throw",arg:L}}}var N="suspendedStart",J="suspendedYield",ie="executing",re="completed",X={};function Q(){}function K(){}function R(){}var f={};O(f,V,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(ne([])));v&&v!==G&&D.call(v,V)&&(f=v);var m=R.prototype=Q.prototype=Object.create(f);K.prototype=R,O(m,"constructor",R),O(R,"constructor",K),K.displayName=O(R,F,"GeneratorFunction");function w(p){["next","throw","return"].forEach(function(d){O(p,d,function(b){return this._invoke(d,b)})})}x.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===K||(d.displayName||d.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,R):(p.__proto__=R,O(p,F,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function E(p,d){function b($,oe,se,ue){var ee=l(p[$],p,oe);if(ee.type==="throw")ue(ee.arg);else{var ve=ee.arg,pe=ve.value;return pe&&typeof pe=="object"&&D.call(pe,"__await")?d.resolve(pe.__await).then(function(de){b("next",de,se,ue)},function(de){b("throw",de,se,ue)}):d.resolve(pe).then(function(de){ve.value=de,se(ve)},function(de){return b("throw",de,se,ue)})}}var L;function T($,oe){function se(){return new d(function(ue,ee){b($,oe,ue,ee)})}return L=L?L.then(se,se):se()}this._invoke=T}w(E.prototype),O(E.prototype,U,function(){return this}),x.AsyncIterator=E,x.async=function(p,d,b,L,T){T===void 0&&(T=Promise);var $=new E(k(p,d,b,L),T);return x.isGeneratorFunction(d)?$:$.next().then(function(oe){return oe.done?oe.value:$.next()})};function C(p,d,b){var L=N;return function($,oe){if(L===ie)throw new Error("Generator is already running");if(L===re){if($==="throw")throw oe;return le()}for(b.method=$,b.arg=oe;;){var se=b.delegate;if(se){var ue=Y(se,b);if(ue){if(ue===X)continue;return ue}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(L===N)throw L=re,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);L=ie;var ee=l(p,d,b);if(ee.type==="normal"){if(L=b.done?re:J,ee.arg===X)continue;return{value:ee.arg,done:b.done}}else ee.type==="throw"&&(L=re,b.method="throw",b.arg=ee.arg)}}}function Y(p,d){var b=p.iterator[d.method];if(b===j){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=j,Y(p,d),d.method==="throw"))return X;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var L=l(b,p.iterator,d.arg);if(L.type==="throw")return d.method="throw",d.arg=L.arg,d.delegate=null,X;var T=L.arg;if(!T)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(T.done)d[p.resultName]=T.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=j);else return T;return d.delegate=null,X}w(m),O(m,F,"Generator"),O(m,V,function(){return this}),O(m,"toString",function(){return"[object Generator]"});function ae(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function W(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function q(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ae,this),this.reset(!0)}x.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function L(){for(;d.length;){var T=d.pop();if(T in p)return L.value=T,L.done=!1,L}return L.done=!0,L}};function ne(p){if(p){var d=p[V];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var b=-1,L=function T(){for(;++b<p.length;)if(D.call(p,b))return T.value=p[b],T.done=!1,T;return T.value=j,T.done=!0,T};return L.next=L}}return{next:le}}x.values=ne;function le(){return{value:j,done:!0}}return q.prototype={constructor:q,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(W),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=j)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function b(ue,ee){return $.type="throw",$.arg=p,d.next=ue,ee&&(d.method="next",d.arg=j),!!ee}for(var L=this.tryEntries.length-1;L>=0;--L){var T=this.tryEntries[L],$=T.completion;if(T.tryLoc==="root")return b("end");if(T.tryLoc<=this.prev){var oe=D.call(T,"catchLoc"),se=D.call(T,"finallyLoc");if(oe&&se){if(this.prev<T.catchLoc)return b(T.catchLoc,!0);if(this.prev<T.finallyLoc)return b(T.finallyLoc)}else if(oe){if(this.prev<T.catchLoc)return b(T.catchLoc,!0)}else if(se){if(this.prev<T.finallyLoc)return b(T.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var b=this.tryEntries.length-1;b>=0;--b){var L=this.tryEntries[b];if(L.tryLoc<=this.prev&&D.call(L,"finallyLoc")&&this.prev<L.finallyLoc){var T=L;break}}T&&(p==="break"||p==="continue")&&T.tryLoc<=d&&d<=T.finallyLoc&&(T=null);var $=T?T.completion:{};return $.type=p,$.arg=d,T?(this.method="next",this.next=T.finallyLoc,X):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),X},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.finallyLoc===p)return this.complete(b.completion,b.afterLoc),W(b),X}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.tryLoc===p){var L=b.completion;if(L.type==="throw"){var T=L.arg;W(b)}return T}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:ne(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=j),X}},x}(M.exports);try{regeneratorRuntime=A}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},695:function(M,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var j=Array.isArray(D.material)?D.material:[D.material];j.forEach(function(g){var V,U,F,O,k,l,N,J,ie,re,X,Q,K;(V=g.map)===null||V===void 0||V.dispose(),(U=g.lightMap)===null||U===void 0||U.dispose(),(F=g.bumpMap)===null||F===void 0||F.dispose(),(O=g.normalMap)===null||O===void 0||O.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(l=g.envMap)===null||l===void 0||l.dispose(),(N=g.alphaMap)===null||N===void 0||N.dispose(),(J=g.aoMap)===null||J===void 0||J.dispose(),(ie=g.displacementMap)===null||ie===void 0||ie.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(X=g.gradientMap)===null||X===void 0||X.dispose(),(Q=g.metalnessMap)===null||Q===void 0||Q.dispose(),(K=g.roughnessMap)===null||K===void 0||K.dispose(),g.dispose()})}}},584:function(M,A,x){"use strict";x.d(A,{disposeMesh:function(){return g.Z},isPlainObject:function(){return F.Z}});var G=x(666),D=x.n(G),j=null,g=x(695),V=x(644);function U(Q){if(Q.material){var K=Array.isArray(Q.material)?Q.material:[Q.material];K.forEach(function(R){var f,c;(f=R.color)===null||f===void 0||f.convertSRGBToLinear(),(c=R.emissive)===null||c===void 0||c.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var F=x(738),O=x(568),k=x(924),l=x(360),N=x(484),J=null,ie=null,re=function(){var Q=(0,O.Z)(D().mark(function K(R,f){var c,v,m,w,E,C,Y,ae,W;return D().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return c=f.type,v=c===void 0?"blob":c,m=f.version,w=m===void 0?"1":m,ne.next=4,(0,l.get)(R);case 4:if(C=ne.sent,!(C&&C[w])){ne.next=9;break}E=C[w],ne.next=15;break;case 9:return ne.next=11,(0,N.Z)(fetch(R).then(function(le){if(le.ok)return le[v]();throw new Error}));case 11:Y=ne.sent,ae=Y.res,W=Y.err,W||(E=ae,(0,l.set)(R,(0,k.Z)({},w,ae)));case 15:return ne.abrupt("return",E?{url:v==="json"?R:URL.createObjectURL(E),store:E}:{url:R});case 16:case"end":return ne.stop()}},K)}));return function(R,f){return Q.apply(this,arguments)}}(),X=x(705)},738:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(j){return Object.prototype.toString.call(j)==="[object Object]"}function D(j){if(G(j)===!1)return!1;var g=j.constructor;if(g===void 0)return!0;var V=g.prototype;return!(G(V)===!1||V.hasOwnProperty("isPrototypeOf")===!1)}},484:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(42);function D(j){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(V){return(0,G.Z)({err:null,res:V},g)}).catch(function(V){return(0,G.Z)({err:V,res:void 0},g)})}},705:function(M,A,x){"use strict";var G=x(644),D=x.n(G),j=new Map,g=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,O,k,l,N){var J=O[k*3],ie=O[k*3+1],re=O[l*3],X=O[l*3+1],Q=O[N*3],K=O[N*3+1],R;if(j.has(F))R=j.get(F);else{var f=U.box3||new THREE.Box3;if(!U.box3){var c=F.parameters.shapes.getPoints();f.setFromArray(c.map(function(C){return[C.x,C.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);U.split&&(v.y/=U.split),R={box:f,size:v},j.set(F,R)}var m=R.box,w=R.size,E=U.split?1-U.split:0;return[new THREE.Vector2((J-m.min.x)/w.x,(ie-m.min.y)/w.y+E),new THREE.Vector2((re-m.min.x)/w.x,(X-m.min.y)/w.y+E),new THREE.Vector2((Q-m.min.x)/w.x,(K-m.min.y)/w.y+E)]},generateSideWallUV:function(F,O,k,l,N,J){var ie=O[k*3],re=O[k*3+1],X=O[k*3+2],Q=O[l*3],K=O[l*3+1],R=O[l*3+2],f=O[N*3],c=O[N*3+1],v=O[N*3+2],m=O[J*3],w=O[J*3+1],E=O[J*3+2],C;if(j.has(O))C=j.get(O);else{var Y=new THREE.Box3;Y.setFromArray(O);var ae=Y.getSize(new THREE.Vector3);U.split&&(ae.z/=1-U.split),C={box:Y,size:ae},j.set(O,C)}var W=C.box,q=C.size;return Math.abs(re-K)<Math.abs(ie-Q)?[new THREE.Vector2((ie-W.min.x)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Q-W.min.x)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((f-W.min.x)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((m-W.min.x)/q.x,(E-W.min.z)/q.z)]:[new THREE.Vector2((re-W.min.y)/q.y,(X-W.min.z)/q.z),new THREE.Vector2((K-W.min.y)/q.y,(R-W.min.z)/q.z),new THREE.Vector2((c-W.min.y)/q.y,(v-W.min.z)/q.z),new THREE.Vector2((w-W.min.y)/q.y,(E-W.min.z)/q.z)]}}},V=function(){j.clear()}},360:function(M){"use strict";M.exports=require("idb-keyval")},644:function(M){"use strict";M.exports=require("three")},568:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(j,g,V,U,F,O,k){try{var l=j[O](k),N=l.value}catch(J){V(J);return}l.done?g(N):Promise.resolve(N).then(U,F)}function D(j){return function(){var g=this,V=arguments;return new Promise(function(U,F){var O=j.apply(g,V);function k(N){G(O,U,F,k,l,"next",N)}function l(N){G(O,U,F,k,l,"throw",N)}k(void 0)})}}},924:function(M,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D,j,g){return j in D?Object.defineProperty(D,j,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[j]=g,D}},42:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(924);function D(j){for(var g=1;g<arguments.length;g++){var V=arguments[g]!=null?arguments[g]:{},U=Object.keys(V);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(V).filter(function(F){return Object.getOwnPropertyDescriptor(V,F).enumerable}))),U.forEach(function(F){(0,G.Z)(j,F,V[F])})}return j}}},xe={};function te(M){var A=xe[M];if(A!==void 0)return A.exports;var x=xe[M]={exports:{}};return Le[M](x,x.exports,te),x.exports}(function(){te.n=function(M){var A=M&&M.__esModule?function(){return M.default}:function(){return M};return te.d(A,{a:A}),A}})(),function(){te.d=function(M,A){for(var x in A)te.o(A,x)&&!te.o(M,x)&&Object.defineProperty(M,x,{enumerable:!0,get:A[x]})}}(),function(){te.o=function(M,A){return Object.prototype.hasOwnProperty.call(M,A)}}(),function(){te.r=function(M){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(M,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";te.r(ye),te.d(ye,{BaseObject:function(){return ct},GUIObject:function(){return R},Pencil:function(){return Se},default:function(){return Se}});function M(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function A(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function x(s,i,n){return i&&A(s.prototype,i),n&&A(s,n),s}var G=te(42);function D(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function j(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function g(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function V(s){if(Array.isArray(s))return g(s)}function U(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function F(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(s,i){if(!!s){if(typeof s=="string")return g(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(s,i)}}function k(s){return V(s)||U(s)||O(s)||F()}var l=te(644),N=te(187),J=require("deepmerge"),ie=te.n(J),re=require("three/examples/jsm/libs/stats.module"),X=te.n(re),Q=require("lil-gui"),K=te.n(Q),R=function(){"use strict";function s(n){M(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],S=h.min,_=h.max,y=h.step,P=h.name,z=h.paramMap,B=h.items,I=h.value,H=h.target,ce=a.toLowerCase().indexOf("color")>-1,Z,fe=typeof I=="undefined"&&H,he=fe?H():u[a],me=fe?a:"value";B?Z=o.add(he,me,B):ce?Z=o.addColor(he,me):Z=o.add(he,me),Z=Z.name(P||a),typeof S!="undefined"&&(Z=Z.min(S)),typeof _!="undefined"&&(Z=Z.max(_)),typeof y!="undefined"&&(Z=Z.step(y)),Z=Z.onChange(function(){t.setTargetValue(r,a,he[me],z)}),fe&&Z.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,S=u.value,_=t.toLowerCase().indexOf("color")>-1,y=typeof S=="undefined"&&h;if(h&&!y){var P=h();Array.isArray(P)||(P=[P]),P.forEach(function(z){if(!!z)if(_)try{z[o||t].set(r)}catch(B){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else z[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},c={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},v=function(){"use strict";function s(n){M(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.context,u=r.alpha,a=r.devicePixelRatio,h=r.antialias,S=r.powerPreference,_=r.toneMapping,y=r.toneMappingExposure,P=r.outputEncoding,z=r.logarithmicDepthBuffer,B=r.preserveDrawingBuffer,I=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:S,logarithmicDepthBuffer:z,preserveDrawingBuffer:B});I.setSize(e,t),I.setPixelRatio(a),I.autoClear=!1,I.toneMapping=f[_],I.toneMappingExposure=y,I.outputEncoding=P,this.renderer=I}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new R({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),m={fov:45,near:1,far:1e3},w=function(){"use strict";function s(n){M(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new R({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),E=te(584),C={background:null},Y=function(){"use strict";function s(n){M(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,E.disposeMesh)(t)})},s}(),ae=require("three/examples/jsm/controls/OrbitControls"),W={},q=function(){"use strict";function s(n){M(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new ae.MapControls(e,o):new ae.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,S=e.minZ,_=S===void 0?-1/0:S,y=e.maxY,P=y===void 0?1/0:y,z=e.minY,B=z===void 0?-1/0:z,I=this.limitPanV||new l.Vector3,H=this.control,ce=this.options.camera,Z=new l.Vector3(u,B,_),fe=new l.Vector3(r,P,h);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,fe),I.sub(H.target),ce.position.sub(I)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ne=require("three/examples/jsm/renderers/CSS3DRenderer"),le=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,L=new l.Vector3,T=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,s);var n=function(z,B){return b.setFromMatrixPosition(z.matrixWorld),L.setFromMatrixPosition(B.matrixWorld),b.distanceToSquared(L)},e=function(z){var B=[];return z.traverse(function(I){I.isCSS2DObject&&B.push(I)}),B},t=function(z){for(var B=e(z).sort(function(fe,he){if(fe.renderOrder!==he.renderOrder)return he.renderOrder-fe.renderOrder;var me=S.objects.get(fe).distanceToCameraSquared,ft=S.objects.get(he).distanceToCameraSquared;return me-ft}),I=B.length,H=0,ce=B.length;H<ce;H++){var Z=B[H].userData.zIndexFix||0;B[H].element.style.zIndex=I-H+Z}},r=this,o,u,a,h,S={objects:new WeakMap},_=i.element!==void 0?i.element:document.createElement("div");_.style.overflow="hidden",this.domElement=_,this.getSize=function(){return{width:o,height:u}},this.render=function(P,z){+l.REVISION<144?(P.autoUpdate===!0&&P.updateMatrixWorld(),z.parent===null&&z.updateMatrixWorld()):(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld()),p.copy(z.matrixWorldInverse),d.multiplyMatrices(z.projectionMatrix,p),y(P,P,z),t(P)},this.setSize=function(P,z){o=P,u=z,a=o/2,h=u/2,_.style.width="".concat(P,"px"),_.style.height="".concat(z,"px")};function y(P,z,B){if(P.isCSS2DObject){le.setFromMatrixPosition(P.matrixWorld),le.applyMatrix4(d);var I=P.visible===!0&&le.z>=-1&&le.z<=1&&P.layers.test(B.layers)===!0;if(P.element.style.display=I===!0?"":"none",I===!0){P.onBeforeRender(r,z,B);var H=P.element;H.style.transform="translate(-50%,-50%) translate(".concat(le.x*a+a,"px,").concat(-le.y*h+h,"px)"),H.parentNode!==_&&_.appendChild(H),P.onAfterRender(r,z,B)}var ce={distanceToCameraSquared:n(B,P)};S.objects.set(P,ce)}for(var Z=0,fe=P.children.length;Z<fe;Z++)y(P.children[Z],z,B)}},$={zIndex:"auto"},oe=function(){"use strict";function s(n){M(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new T:new ne.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),se=require("three/examples/jsm/postprocessing/EffectComposer"),ue=require("three/examples/jsm/postprocessing/RenderPass"),ee=require("three/examples/jsm/postprocessing/ShaderPass"),ve=require("three/examples/jsm/shaders/CopyShader"),pe=require("three/examples/jsm/shaders/GammaCorrectionShader"),de=require("three/examples/jsm/postprocessing/SMAAPass"),ze=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ae=require("three/examples/jsm/shaders/FXAAShader"),De=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},dt=0,Ge=1,ge=!1,Ce=De()!==!1,Be=`varying vec2 vUv;
2
-
3
- void main() {
4
-
5
- vUv = uv;
6
-
7
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
8
-
9
- }`,Ve=`uniform sampler2D baseTexture;
10
- uniform sampler2D bloomTexture;
11
-
12
- varying vec2 vUv;
13
-
14
- void main() {
15
-
16
- gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
-
18
- }`;function Pe(s,i){return Pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pe(s,i)}function Oe(s,i){return Pe(s,i)}function Ue(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Oe(s,i)}function Fe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function _e(s){return _e=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},_e(s)}function Re(s){return _e(s)}function ke(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Ie(s){return s&&s.constructor===Symbol?"symbol":typeof s}function He(s,i){return i&&(Ie(i)==="object"||typeof i=="function")?i:ke(s)}function Ne(s){var i=Fe();return function(){var e=Re(s),t;if(i){var r=Re(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return He(this,t)}}var Te=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";Ue(n,s);var i=Ne(n);function n(t,r,o,u){M(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new l.Vector2(t.x,t.y):new l.Vector2(256,256),a.clearColor=new l.Color(0,0,0);var h={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var S=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(S,_,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var P=new l.WebGLRenderTarget(S,_,h);P.texture.name="UnrealBloomPass.h".concat(y),P.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(P);var z=new l.WebGLRenderTarget(S,_,h);z.texture.name="UnrealBloomPass.v".concat(y),z.texture.generateMipmaps=!1,a.renderTargetsVertical.push(z),S=Math.round(S/2),_=Math.round(_/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var B=Ee.LuminosityHighPassShader;a.highPassUniforms=l.UniformsUtils.clone(B.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new l.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:B.vertexShader,fragmentShader:B.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var I=[3,5,7,9,11];S=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);for(var H=0;H<a.nMips;H++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(I[H])),a.separableBlurMaterials[H].uniforms.texSize.value=new l.Vector2(S,_),S=Math.round(S/2),_=Math.round(_/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var ce=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=ce,a.bloomTintColors=[new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,ve.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Z=ve.CopyShader;return a.copyUniforms=l.UniformsUtils.clone(Z.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new l.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:Z.vertexShader,fragmentShader:Z.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new l.Color,a.oldClearAlpha=1,a.basic=new l.MeshBasicMaterial,a.fsQuad=new Te.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new l.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var S=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var _=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=_.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),_=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=S},e.getSeperableBlurMaterial=function(r){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
19
- void main() {
20
- vUv = uv;
21
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
22
- }`,fragmentShader:`#include <common>
23
- varying vec2 vUv;
24
- uniform sampler2D colorTexture;
25
- uniform vec2 texSize;
26
- uniform vec2 direction;
27
- float gaussianPdf(in float x, in float sigma) {
28
- return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
29
- }
30
- void main() {
31
- vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
32
- }`})},e.getCompositeMaterial=function(r){return new l.ShaderMaterial({defines:{NUM_MIPS:r},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
33
- void main() {
34
- vUv = uv;
35
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
36
- }`,fragmentShader:`varying vec2 vUv;
37
- uniform sampler2D blurTexture1;
38
- uniform sampler2D blurTexture2;
39
- uniform sampler2D blurTexture3;
40
- uniform sampler2D blurTexture4;
41
- uniform sampler2D blurTexture5;
42
- uniform sampler2D dirtTexture;
43
- uniform float bloomStrength;
44
- uniform float bloomRadius;
45
- uniform float bloomFactors[NUM_MIPS];
46
- uniform vec3 bloomTintColors[NUM_MIPS];
47
- float lerpBloomFactor(const in float factor) {
48
- float mirrorFactor = 1.2 - factor;
49
- return mix(factor, mirrorFactor, bloomRadius);
50
- }
51
- void main() {
52
- gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
53
- lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
54
- lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
- lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
- lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},n}(Te.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var We={threshold:.2,strength:.5,radius:0},Ze=new l.MeshBasicMaterial({color:"black"}),Xe=new l.SpriteMaterial({color:"#000"}),qe=function(){"use strict";function s(n,e){M(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,S=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=S;var _=new se.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(Ge);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Be,fragmentShader:Ve,defines:{}}),P=new ee.ShaderPass(y,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?Xe:Ze)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new R({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),Qe=require("three/examples/jsm/postprocessing/OutlinePass"),Ye={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ke=function(){"use strict";function s(n,e){M(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,S=new Qe.OutlinePass(new l.Vector2(a,h),t,r);S.selectedObjects=this.selectedObjects,this.outlinePass=S,o.addPass(S),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new R({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function $e(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function Je(s,i){if(s==null)return{};var n=$e(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var et=require("three/examples/jsm/postprocessing/SSRPass"),tt=require("three/examples/jsm/objects/ReflectorForSSRPass"),rt={maxDistance:10,selects:!0},nt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},it=function(){"use strict";function s(n,e){M(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,S=a.height,_=new et.SSRPass({renderer:o,scene:t,camera:r,width:h,height:S,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},nt,e),r=t.width,o=t.height,u=Je(t,["width","height"]),a=this.composerController,h=a.scene,S=a.getSize(),_=new l.PlaneGeometry(r,o),y=new tt.ReflectorForSSRPass(_,j((0,G.Z)({},u),{textureWidth:S.width,textureHeight:S.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new R({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),at=function(){"use strict";function s(n){M(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new se.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var S=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);S.samples=t,h=S}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,j((0,G.Z)({},a),{samples:t}));h=_}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new ue.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new ee.ShaderPass(ve.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new ee.ShaderPass(pe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new ee.ShaderPass(Ae.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new de.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new ze.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new qe(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new Ke(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Se=function(){"use strict";function s(n){M(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ie()(s.options,n,{isMergeableObject:E.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui,u=e.resizeObserver;if(o){var a=new(K());a.open(!1),this.gui=a}if(r){var h=new(X());h.showPanel(0),h.dom.style.position="absolute",t.appendChild(h.dom),this.stats=h}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,t=e.container,r=e.isdev,o=e.axesHelper,u=e.renderer,a=e.scene,h=e.camera,S=this.getSize(),_=S.width,y=S.height,P=new w({isdev:r,width:_,height:y,cameraParams:h});this.gui&&P.setGui(this.gui);var z=P.camera,B=new Y({camera:z,sceneParams:a}),I=B.scene,H=new v({width:_,height:y,scene:I,camera:z,isdev:r,rendererParams:j((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var ce=H.renderer;o&&B.addAxesHelper(),this.sceneController=B,this.rendererController=H,this.cameraController=P,t.appendChild(ce.domElement)},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,S=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Ce&&(y=!1,console.warn("MSAA is not supported on this browser"));var P=new at({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=P,y==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(S),t&&P.addBloomPass(a),r&&P.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&P.addGammaCorrectionPass(),y==="fxaa"?P.addFXAAPass():y==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new oe(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new q({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,t=this.options.container;if(!this.resizeObserver){var r=new ResizeObserver(function(o){var u=!0,a=!1,h=void 0;try{for(var S=o[Symbol.iterator](),_;!(u=(_=S.next()).done);u=!0){var y=_.value,P=y.contentRect;e.handeleResize(P.width,P.height),e.render()}}catch(z){a=!0,h=z}finally{try{!u&&S.return!=null&&S.return()}finally{if(a)throw h}}});r.observe(t),this.resizeObserver=r}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(S,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,S=new l.Vector2,_=h.getBoundingClientRect();if(S.x=(e.clientX-_.left)/(_.right-_.left)*2-1,S.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(S,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,S=u.camera,_=u.clock;if(!(!a||!h||!S||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),P=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(B,I){var H;(H=I.update)===null||H===void 0||H.call(I,y,P)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var z;(z=this.rendererController)===null||z===void 0||z.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,S),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:P})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(S,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Se.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:j((0,G.Z)({},c),{antialias:Ce?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:C,camera:m,bloom:!1,bloomParams:We,outline:!1,outlineParams:Ye,css2DRenderer:!1,ssr:!1,ssrParams:rt,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function st(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return st()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Oe(h,o.prototype),h},be.apply(null,arguments)}function Me(s,i,n){return be.apply(null,arguments)}var ot=te(484);function ut(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,ot.Z)(n.promise,i)),n}var lt=require("three/examples/jsm/renderers/CSS2DRenderer"),je=function(s){s&&((0,E.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||je(i)}))},ct=function(){"use strict";function s(){M(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ut(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Me(l.Mesh,k(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Me(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new lt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ne.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ne.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,k(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,k(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){je(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=ye})();
1
+ (function(){var xe={187:function(R){"use strict";var j=typeof Reflect=="object"?Reflect:null,_=j&&typeof j.apply=="function"?j.apply:function(o,l,d){return Function.prototype.apply.call(o,l,d)},T;j&&typeof j.ownKeys=="function"?T=j.ownKeys:Object.getOwnPropertySymbols?T=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:T=function(o){return Object.getOwnPropertyNames(o)};function A(a){console&&console.warn&&console.warn(a)}var L=Number.isNaN||function(o){return o!==o};function h(){h.init.call(this)}R.exports=h,R.exports.once=K,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var G=10;function k(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(a){if(typeof a!="number"||a<0||L(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");G=a}}),h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||L(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function B(a){return a._maxListeners===void 0?h.defaultMaxListeners:a._maxListeners}h.prototype.getMaxListeners=function(){return B(this)},h.prototype.emit=function(o){for(var l=[],d=1;d<arguments.length;d++)l.push(arguments[d]);var m=o==="error",E=this._events;if(E!==void 0)m=m&&E.error===void 0;else if(!m)return!1;if(m){var w;if(l.length>0&&(w=l[0]),w instanceof Error)throw w;var q=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw q.context=w,q}var oe=E[o];if(oe===void 0)return!1;if(typeof oe=="function")_(oe,this,l);else for(var F=oe.length,X=ie(oe,F),d=0;d<F;++d)_(X[d],this,l);return!0};function P(a,o,l,d){var m,E,w;if(k(l),E=a._events,E===void 0?(E=a._events=Object.create(null),a._eventsCount=0):(E.newListener!==void 0&&(a.emit("newListener",o,l.listener?l.listener:l),E=a._events),w=E[o]),w===void 0)w=E[o]=l,++a._eventsCount;else if(typeof w=="function"?w=E[o]=d?[l,w]:[w,l]:d?w.unshift(l):w.push(l),m=B(a),m>0&&w.length>m&&!w.warned){w.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=a,q.type=o,q.count=w.length,A(q)}return a}h.prototype.addListener=function(o,l){return P(this,o,l,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(o,l){return P(this,o,l,!0)};function V(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(a,o,l){var d={fired:!1,wrapFn:void 0,target:a,type:o,listener:l},m=V.bind(d);return m.listener=l,d.wrapFn=m,m}h.prototype.once=function(o,l){return k(l),this.on(o,b(this,o,l)),this},h.prototype.prependOnceListener=function(o,l){return k(l),this.prependListener(o,b(this,o,l)),this},h.prototype.removeListener=function(o,l){var d,m,E,w,q;if(k(l),m=this._events,m===void 0)return this;if(d=m[o],d===void 0)return this;if(d===l||d.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[o],m.removeListener&&this.emit("removeListener",o,d.listener||l));else if(typeof d!="function"){for(E=-1,w=d.length-1;w>=0;w--)if(d[w]===l||d[w].listener===l){q=d[w].listener,E=w;break}if(E<0)return this;E===0?d.shift():re(d,E),d.length===1&&(m[o]=d[0]),m.removeListener!==void 0&&this.emit("removeListener",o,q||l)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(o){var l,d,m;if(d=this._events,d===void 0)return this;if(d.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):d[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete d[o]),this;if(arguments.length===0){var E=Object.keys(d),w;for(m=0;m<E.length;++m)w=E[m],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(l=d[o],typeof l=="function")this.removeListener(o,l);else if(l!==void 0)for(m=l.length-1;m>=0;m--)this.removeListener(o,l[m]);return this};function W(a,o,l){var d=a._events;if(d===void 0)return[];var m=d[o];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?U(m):ie(m,m.length)}h.prototype.listeners=function(o){return W(this,o,!0)},h.prototype.rawListeners=function(o){return W(this,o,!1)},h.listenerCount=function(a,o){return typeof a.listenerCount=="function"?a.listenerCount(o):ee.call(a,o)},h.prototype.listenerCount=ee;function ee(a){var o=this._events;if(o!==void 0){var l=o[a];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?T(this._events):[]};function ie(a,o){for(var l=new Array(o),d=0;d<o;++d)l[d]=a[d];return l}function re(a,o){for(;o+1<a.length;o++)a[o]=a[o+1];a.pop()}function U(a){for(var o=new Array(a.length),l=0;l<o.length;++l)o[l]=a[l].listener||a[l];return o}function K(a,o){return new Promise(function(l,d){function m(w){a.removeListener(o,E),d(w)}function E(){typeof a.removeListener=="function"&&a.removeListener("error",m),l([].slice.call(arguments))}x(a,o,E,{once:!0}),o!=="error"&&$(a,m,{once:!0})})}function $(a,o,l){typeof a.on=="function"&&x(a,"error",o,l)}function x(a,o,l,d){if(typeof a.on=="function")d.once?a.once(o,l):a.on(o,l);else if(typeof a.addEventListener=="function")a.addEventListener(o,function m(E){d.once&&a.removeEventListener(o,m),l(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}},666:function(R){var j=function(_){"use strict";var T=Object.prototype,A=T.hasOwnProperty,L,h=typeof Symbol=="function"?Symbol:{},G=h.iterator||"@@iterator",k=h.asyncIterator||"@@asyncIterator",B=h.toStringTag||"@@toStringTag";function P(f,s,v){return Object.defineProperty(f,s,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[s]}try{P({},"")}catch(f){P=function(s,v,O){return s[v]=O}}function V(f,s,v,O){var C=s&&s.prototype instanceof K?s:K,J=Object.create(C.prototype),ae=new X(O||[]);return J._invoke=w(f,v,ae),J}_.wrap=V;function b(f,s,v){try{return{type:"normal",arg:f.call(s,v)}}catch(O){return{type:"throw",arg:O}}}var W="suspendedStart",ee="suspendedYield",ie="executing",re="completed",U={};function K(){}function $(){}function x(){}var a={};P(a,G,function(){return this});var o=Object.getPrototypeOf,l=o&&o(o(ne([])));l&&l!==T&&A.call(l,G)&&(a=l);var d=x.prototype=K.prototype=Object.create(a);$.prototype=x,P(d,"constructor",x),P(x,"constructor",$),$.displayName=P(x,B,"GeneratorFunction");function m(f){["next","throw","return"].forEach(function(s){P(f,s,function(v){return this._invoke(s,v)})})}_.isGeneratorFunction=function(f){var s=typeof f=="function"&&f.constructor;return s?s===$||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,x):(f.__proto__=x,P(f,B,"GeneratorFunction")),f.prototype=Object.create(d),f},_.awrap=function(f){return{__await:f}};function E(f,s){function v(J,ae,Y,ue){var se=b(f[J],f,ae);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&A.call(pe,"__await")?s.resolve(pe.__await).then(function(ce){v("next",ce,Y,ue)},function(ce){v("throw",ce,Y,ue)}):s.resolve(pe).then(function(ce){me.value=ce,Y(me)},function(ce){return v("throw",ce,Y,ue)})}}var O;function C(J,ae){function Y(){return new s(function(ue,se){v(J,ae,ue,se)})}return O=O?O.then(Y,Y):Y()}this._invoke=C}m(E.prototype),P(E.prototype,k,function(){return this}),_.AsyncIterator=E,_.async=function(f,s,v,O,C){C===void 0&&(C=Promise);var J=new E(V(f,s,v,O),C);return _.isGeneratorFunction(s)?J:J.next().then(function(ae){return ae.done?ae.value:J.next()})};function w(f,s,v){var O=W;return function(J,ae){if(O===ie)throw new Error("Generator is already running");if(O===re){if(J==="throw")throw ae;return le()}for(v.method=J,v.arg=ae;;){var Y=v.delegate;if(Y){var ue=q(Y,v);if(ue){if(ue===U)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===W)throw O=re,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ie;var se=b(f,s,v);if(se.type==="normal"){if(O=v.done?re:ee,se.arg===U)continue;return{value:se.arg,done:v.done}}else se.type==="throw"&&(O=re,v.method="throw",v.arg=se.arg)}}}function q(f,s){var v=f.iterator[s.method];if(v===L){if(s.delegate=null,s.method==="throw"){if(f.iterator.return&&(s.method="return",s.arg=L,q(f,s),s.method==="throw"))return U;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return U}var O=b(v,f.iterator,s.arg);if(O.type==="throw")return s.method="throw",s.arg=O.arg,s.delegate=null,U;var C=O.arg;if(!C)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,U;if(C.done)s[f.resultName]=C.value,s.next=f.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return C;return s.delegate=null,U}m(d),P(d,B,"Generator"),P(d,G,function(){return this}),P(d,"toString",function(){return"[object Generator]"});function oe(f){var s={tryLoc:f[0]};1 in f&&(s.catchLoc=f[1]),2 in f&&(s.finallyLoc=f[2],s.afterLoc=f[3]),this.tryEntries.push(s)}function F(f){var s=f.completion||{};s.type="normal",delete s.arg,f.completion=s}function X(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(oe,this),this.reset(!0)}_.keys=function(f){var s=[];for(var v in f)s.push(v);return s.reverse(),function O(){for(;s.length;){var C=s.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function ne(f){if(f){var s=f[G];if(s)return s.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(A.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=L,C.done=!0,C};return O.next=O}}return{next:le}}_.values=ne;function le(){return{value:L,done:!0}}return X.prototype={constructor:X,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(F),!f)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var f=this.tryEntries[0],s=f.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function v(ue,se){return J.type="throw",J.arg=f,s.next=ue,se&&(s.method="next",s.arg=L),!!se}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],J=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var ae=A.call(C,"catchLoc"),Y=A.call(C,"finallyLoc");if(ae&&Y){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(ae){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(Y){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,s){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&A.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=s&&s<=C.finallyLoc&&(C=null);var J=C?C.completion:{};return J.type=f,J.arg=s,C?(this.method="next",this.next=C.finallyLoc,U):this.complete(J)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),U},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),U}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,v){return this.delegate={iterator:ne(f),resultName:s,nextLoc:v},this.method==="next"&&(this.arg=L),U}},_}(R.exports);try{regeneratorRuntime=j}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function T(A){if(A.geometry&&A.geometry.dispose(),A.material){var L=Array.isArray(A.material)?A.material:[A.material];L.forEach(function(h){var G,k,B,P,V,b,W,ee,ie,re,U,K,$;(G=h.map)===null||G===void 0||G.dispose(),(k=h.lightMap)===null||k===void 0||k.dispose(),(B=h.bumpMap)===null||B===void 0||B.dispose(),(P=h.normalMap)===null||P===void 0||P.dispose(),(V=h.specularMap)===null||V===void 0||V.dispose(),(b=h.envMap)===null||b===void 0||b.dispose(),(W=h.alphaMap)===null||W===void 0||W.dispose(),(ee=h.aoMap)===null||ee===void 0||ee.dispose(),(ie=h.displacementMap)===null||ie===void 0||ie.dispose(),(re=h.emissiveMap)===null||re===void 0||re.dispose(),(U=h.gradientMap)===null||U===void 0||U.dispose(),(K=h.metalnessMap)===null||K===void 0||K.dispose(),($=h.roughnessMap)===null||$===void 0||$.dispose(),h.dispose()})}}},584:function(R,j,_){"use strict";_.d(j,{disposeMesh:function(){return h.Z},isPlainObject:function(){return B.Z}});var T=_(666),A=_.n(T),L=null,h=_(695),G=_(644);function k(K){if(K.material){var $=Array.isArray(K.material)?K.material:[K.material];$.forEach(function(x){var a,o;(a=x.color)===null||a===void 0||a.convertSRGBToLinear(),(o=x.emissive)===null||o===void 0||o.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var B=_(738),P=_(568),V=_(924),b=_(360),W=_(484),ee=null,ie=null,re=function(){var K=(0,P.Z)(A().mark(function $(x,a){var o,l,d,m,E,w,q,oe,F;return A().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return o=a.type,l=o===void 0?"blob":o,d=a.version,m=d===void 0?"1":d,ne.next=4,(0,b.get)(x);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}E=w[m],ne.next=15;break;case 9:return ne.next=11,(0,W.Z)(fetch(x).then(function(le){if(le.ok)return le[l]();throw new Error}));case 11:q=ne.sent,oe=q.res,F=q.err,F||(E=oe,(0,b.set)(x,(0,V.Z)({},m,oe)));case 15:return ne.abrupt("return",E?{url:l==="json"?x:URL.createObjectURL(E),store:E}:{url:x});case 16:case"end":return ne.stop()}},$)}));return function(x,a){return K.apply(this,arguments)}}(),U=_(705)},738:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});function T(L){return Object.prototype.toString.call(L)==="[object Object]"}function A(L){if(T(L)===!1)return!1;var h=L.constructor;if(h===void 0)return!0;var G=h.prototype;return!(T(G)===!1||G.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});var T=_(42);function A(L){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(G){return(0,T.Z)({err:null,res:G},h)}).catch(function(G){return(0,T.Z)({err:G,res:void 0},h)})}},705:function(R,j,_){"use strict";var T=_(644),A=_.n(T),L=new Map,h=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(B,P,V,b,W){var ee=P[V*3],ie=P[V*3+1],re=P[b*3],U=P[b*3+1],K=P[W*3],$=P[W*3+1],x;if(L.has(B))x=L.get(B);else{var a=k.box3||new THREE.Box3;if(!k.box3){var o=B.parameters.shapes.getPoints();a.setFromArray(o.map(function(w){return[w.x,w.y,0]}).flat())}var l=a.getSize(new THREE.Vector3);k.split&&(l.y/=k.split),x={box:a,size:l},L.set(B,x)}var d=x.box,m=x.size,E=k.split?1-k.split:0;return[new THREE.Vector2((ee-d.min.x)/m.x,(ie-d.min.y)/m.y+E),new THREE.Vector2((re-d.min.x)/m.x,(U-d.min.y)/m.y+E),new THREE.Vector2((K-d.min.x)/m.x,($-d.min.y)/m.y+E)]},generateSideWallUV:function(B,P,V,b,W,ee){var ie=P[V*3],re=P[V*3+1],U=P[V*3+2],K=P[b*3],$=P[b*3+1],x=P[b*3+2],a=P[W*3],o=P[W*3+1],l=P[W*3+2],d=P[ee*3],m=P[ee*3+1],E=P[ee*3+2],w;if(L.has(P))w=L.get(P);else{var q=new THREE.Box3;q.setFromArray(P);var oe=q.getSize(new THREE.Vector3);k.split&&(oe.z/=1-k.split),w={box:q,size:oe},L.set(P,w)}var F=w.box,X=w.size;return Math.abs(re-$)<Math.abs(ie-K)?[new THREE.Vector2((ie-F.min.x)/X.x,(U-F.min.z)/X.z),new THREE.Vector2((K-F.min.x)/X.x,(x-F.min.z)/X.z),new THREE.Vector2((a-F.min.x)/X.x,(l-F.min.z)/X.z),new THREE.Vector2((d-F.min.x)/X.x,(E-F.min.z)/X.z)]:[new THREE.Vector2((re-F.min.y)/X.y,(U-F.min.z)/X.z),new THREE.Vector2(($-F.min.y)/X.y,(x-F.min.z)/X.z),new THREE.Vector2((o-F.min.y)/X.y,(l-F.min.z)/X.z),new THREE.Vector2((m-F.min.y)/X.y,(E-F.min.z)/X.z)]}}},G=function(){L.clear()}},360:function(R){"use strict";R.exports=require("idb-keyval")},644:function(R){"use strict";R.exports=require("three")},568:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});function T(L,h,G,k,B,P,V){try{var b=L[P](V),W=b.value}catch(ee){G(ee);return}b.done?h(W):Promise.resolve(W).then(k,B)}function A(L){return function(){var h=this,G=arguments;return new Promise(function(k,B){var P=L.apply(h,G);function V(W){T(P,k,B,V,b,"next",W)}function b(W){T(P,k,B,V,b,"throw",W)}V(void 0)})}}},924:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function T(A,L,h){return L in A?Object.defineProperty(A,L,{value:h,enumerable:!0,configurable:!0,writable:!0}):A[L]=h,A}},42:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});var T=_(924);function A(L){for(var h=1;h<arguments.length;h++){var G=arguments[h]!=null?arguments[h]:{},k=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(k=k.concat(Object.getOwnPropertySymbols(G).filter(function(B){return Object.getOwnPropertyDescriptor(G,B).enumerable}))),k.forEach(function(B){(0,T.Z)(L,B,G[B])})}return L}}},we={};function te(R){var j=we[R];if(j!==void 0)return j.exports;var _=we[R]={exports:{}};return xe[R](_,_.exports,te),_.exports}(function(){te.n=function(R){var j=R&&R.__esModule?function(){return R.default}:function(){return R};return te.d(j,{a:j}),j}})(),function(){te.d=function(R,j){for(var _ in j)te.o(j,_)&&!te.o(R,_)&&Object.defineProperty(R,_,{enumerable:!0,get:j[_]})}}(),function(){te.o=function(R,j){return Object.prototype.hasOwnProperty.call(R,j)}}(),function(){te.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";te.r(ye),te.d(ye,{BaseObject:function(){return Me},GUIObject:function(){return x},Pencil:function(){return be},default:function(){return be}});function R(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}function j(u,i){for(var t=0;t<i.length;t++){var e=i[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function _(u,i,t){return i&&j(u.prototype,i),t&&j(u,t),u}var T=te(42);function A(u,i){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),t.push.apply(t,e)}return t}function L(u,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(i,t))}),u}function h(u,i){(i==null||i>u.length)&&(i=u.length);for(var t=0,e=new Array(i);t<i;t++)e[t]=u[t];return e}function G(u){if(Array.isArray(u))return h(u)}function k(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function B(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(u,i){if(!!u){if(typeof u=="string")return h(u,i);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(u,i)}}function V(u){return G(u)||k(u)||P(u)||B()}var b=te(644),W=te(187),ee=require("deepmerge"),ie=te.n(ee),re=require("three/examples/jsm/libs/stats.module"),U=te.n(re),K=require("lil-gui"),$=te.n(K),x=function(){"use strict";function u(t){R(this,u),this.guiParams={},t&&(this.guiParams=t)}var i=u.prototype;return i.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(n){var c=e.addFolder(n),p=r.guiParams[n];Object.keys(p).forEach(function(y){var g=p[y],N=g.min,z=g.max,D=g.step,S=g.name,M=g.paramMap,H=g.items,Q=g.value,Z=g.target,fe=y.toLowerCase().indexOf("color")>-1,I,de=typeof Q=="undefined"&&Z,he=de?Z():p[y],ve=de?y:"value";H?I=c.add(he,ve,H):fe?I=c.addColor(he,ve):I=c.add(he,ve),I=I.name(S||y),typeof N!="undefined"&&(I=I.min(N)),typeof z!="undefined"&&(I=I.max(z)),typeof D!="undefined"&&(I=I.step(D)),I=I.onChange(function(){r.setTargetValue(n,y,he[ve],M)}),de&&I.listen()})})},i.setTargetValue=function(e,r,n,c){var p=this.guiParams[e][r],y=p.onChange,g=p.target,N=p.value,z=r.toLowerCase().indexOf("color")>-1,D=typeof N=="undefined"&&g;if(g&&!D){var S=g();Array.isArray(S)||(S=[S]),S.forEach(function(M){if(!!M)if(z)try{M[c||r].set(n)}catch(H){r!=="color"&&!c&&console.warn("".concat(r," is not a color,set paramMap"))}else M[c||r]=n})}y&&y(n)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(n){var c=e.guiParams[r][n];typeof c.value!="undefined"&&e.setTargetValue(r,n,c.value,c.paramMap)})})},u}(),a={None:b.NoToneMapping,Linear:b.LinearToneMapping,Reinhard:b.ReinhardToneMapping,Cineon:b.CineonToneMapping,ACESFilmic:b.ACESFilmicToneMapping},o={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:b.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},l=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.width,r=t.height,n=t.rendererParams,c=n.context,p=n.alpha,y=n.devicePixelRatio,g=n.antialias,N=n.powerPreference,z=n.toneMapping,D=n.toneMappingExposure,S=n.outputEncoding,M=n.logarithmicDepthBuffer,H=n.preserveDrawingBuffer,Q=n.stencil,Z=n.depth,fe=n.physicallyCorrectLights,I=new b.WebGLRenderer({context:c,alpha:p,antialias:g,powerPreference:N,logarithmicDepthBuffer:M,preserveDrawingBuffer:H,stencil:Q,depth:Z});I.setSize(e,r),I.setPixelRatio(y),I.toneMapping=a[z],I.toneMappingExposure=D,I.outputEncoding=S,I.physicallyCorrectLights=fe,this.renderer=I}var i=u.prototype;return i.setSize=function(e,r){this.renderer.setSize(e,r)},i.render=function(){var e=this.options,r=e.scene,n=e.camera;this.renderer.render(r,n)},i.setGui=function(e){var r=this,n=new x({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:a,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});n.showGui(e)},i.dispose=function(){var e,r,n;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(n=this.renderer)===null||n===void 0||n.renderLists.dispose()},u}(),d={fov:45,near:1,far:1e3},m=function(){"use strict";function u(t){R(this,u),this.oldCameraPosition=new b.Vector3,this.oldCameraRotation=new b.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,n=t.cameraParams;if(n instanceof b.Camera)this.camera=n,this.customCamera=!0;else{var c=n.fov,p=n.far,y=n.near,g=new b.PerspectiveCamera(c,e/r,y,p);g.position.set(0,0,400),g.lookAt(0,0,0),this.camera=g}}var i=u.prototype;return i.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},i.setSize=function(e,r){this.camera instanceof b.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},i.setGui=function(e){var r=this,n=new x({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}}});this.camera instanceof b.PerspectiveCamera&&(n.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}),n.showGui(e)},u}(),E=te(584),w={background:null},q=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.sceneParams,n=r.background,c=new b.Scene;n&&(c.background=n),c.add(e),this.scene=c}var i=u.prototype;return i.addAxesHelper=function(){var e,r=new b.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,E.disposeMesh)(r)})},u}(),oe=require("three/examples/jsm/controls/OrbitControls"),F={},X=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.controlParams,n=t.mapControl,c=r.domElement,p=n?new oe.MapControls(e,c):new oe.OrbitControls(e,c);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var i=u.prototype;return i.limitPan=function(e){var r=e.maxX,n=r===void 0?1/0:r,c=e.minX,p=c===void 0?-1/0:c,y=e.maxZ,g=y===void 0?1/0:y,N=e.minZ,z=N===void 0?-1/0:N,D=e.maxY,S=D===void 0?1/0:D,M=e.minY,H=M===void 0?-1/0:M,Q=this.limitPanV||new b.Vector3,Z=this.control,fe=this.options.camera,I=new b.Vector3(p,H,z),de=new b.Vector3(n,S,g);this.limitPanV=Q,Q.copy(Z.target),Z.target.clamp(I,de),Q.sub(Z.target),fe.position.sub(Q)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},u}(),ne=require("three/examples/jsm/renderers/CSS3DRenderer"),le=new b.Vector3,f=new b.Matrix4,s=new b.Matrix4,v=new b.Vector3,O=new b.Vector3,C=function u(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,u);var t=function(M,H){return v.setFromMatrixPosition(M.matrixWorld),O.setFromMatrixPosition(H.matrixWorld),v.distanceToSquared(O)},e=function(M){var H=[];return M.traverse(function(Q){Q.isCSS2DObject&&H.push(Q)}),H},r=function(M){for(var H=e(M).sort(function(de,he){if(de.renderOrder!==he.renderOrder)return he.renderOrder-de.renderOrder;var ve=N.objects.get(de).distanceToCameraSquared,ze=N.objects.get(he).distanceToCameraSquared;return ve-ze}),Q=H.length,Z=0,fe=H.length;Z<fe;Z++){var I=H[Z].userData.zIndexFix||0;H[Z].element.style.zIndex=Q-Z+I}},n=this,c,p,y,g,N={objects:new WeakMap},z=i.element!==void 0?i.element:document.createElement("div");z.style.overflow="hidden",this.domElement=z,this.getSize=function(){return{width:c,height:p}},this.render=function(S,M){+b.REVISION<144?(S.autoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld()):(S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld()),f.copy(M.matrixWorldInverse),s.multiplyMatrices(M.projectionMatrix,f),D(S,S,M),r(S)},this.setSize=function(S,M){c=S,p=M,y=c/2,g=p/2,z.style.width="".concat(S,"px"),z.style.height="".concat(M,"px")};function D(S,M,H){if(S.isCSS2DObject){le.setFromMatrixPosition(S.matrixWorld),le.applyMatrix4(s);var Q=S.visible===!0&&le.z>=-1&&le.z<=1&&S.layers.test(H.layers)===!0;if(S.element.style.display=Q===!0?"":"none",Q===!0){S.onBeforeRender(n,M,H);var Z=S.element;Z.style.transform="translate(-50%,-50%) translate(".concat(le.x*y+y,"px,").concat(-le.y*g+g,"px)"),Z.parentNode!==z&&z.appendChild(Z),S.onAfterRender(n,M,H)}var fe={distanceToCameraSquared:t(H,S)};N.objects.set(S,fe)}for(var I=0,de=S.children.length;I<de;I++)D(S.children[I],M,H)}},J={zIndex:"auto"},ae=function(){"use strict";function u(t){R(this,u),this.container=t}var i=u.prototype;return i.addRenderer=function(e,r){var n=this.container,c=n.offsetWidth,p=n.offsetHeight,y=e==="css2d"?new C:new ne.CSS3DRenderer;y.domElement.style.position="absolute",y.domElement.style.top="0",y.domElement.style.pointerEvents="none",y.domElement.style.zIndex=r.zIndex,y.setSize(c,p),n.appendChild(y.domElement),e==="css2d"?this.css2Drenderer=y:e==="css3d"&&(this.css3Drenderer=y)},i.setSize=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.setSize(e,r),(c=this.css3Drenderer)===null||c===void 0||c.setSize(e,r)},i.render=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.render(e,r),(c=this.css3Drenderer)===null||c===void 0||c.render(e,r)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),Y=require("postprocessing"),ue={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},se=function(){"use strict";function u(t){R(this,u),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,n=t.camera,c=t.composerParams,p=c.multisampling,y=e.capabilities.maxSamples,g=new Y.EffectComposer(e,{multisampling:Math.min(p,y)});g.addPass(new Y.RenderPass(r,n)),this.finalComposer=g,this.renderer=e,this.scene=r,this.camera=n}var i=u.prototype;return i.addCopyPass=function(){var e=new Y.CopyPass;this.finalComposer.addPass(e),this.copyPass=e},i.addFXAAPass=function(){var e=this.camera,r=new Y.FXAAEffect({blendFunction:Y.BlendFunction.NORMAL}),n=new Y.EffectPass(e,r);this.finalComposer.addPass(n),this.fxaaPass=n},i.addBloomPass=function(e){var r=this,n=r.camera,c=r.scene,p=new Y.SelectiveBloomEffect(c,n,(0,T.Z)({},e));p.inverted=!0;var y=new Y.EffectPass(n,p);this.finalComposer.addPass(y),this.bloomPass=y,this.bloomEffect=p},i.addBloomGui=function(e){var r=this,n=new x({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(c){r.bloomEffect.luminancePass.enabled=c}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});n.showGui(e)},i.toggleBloomSelection=function(e){this.bloomEffect.selection.toggle(e)},i.getSize=function(){var e=this.options.renderer;return e.getSize(new b.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this.finalComposer.passes.some(function(r){return r instanceof Y.RenderPass||r instanceof Y.CopyPass?!1:r.enabled});e&&this.copyPass?this.copyPass.enabled=!1:!e&&this.copyPass?this.copyPass.enabled=!0:!e&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,r){this.finalComposer.setSize(e,r)},i.render=function(){!this.active||this.finalComposer.render()},i.dispose=function(){this.finalComposer.dispose()},u}(),me=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(i){return!1}},pe=0,ce=!1,Pe=me()!==!1,be=function(){"use strict";function u(t){R(this,u),this.raycaster=new b.Raycaster,this.installPlugins=new Map,this.event=new W.EventEmitter,this.clock=new b.Clock,this.options=ie()(u.options,t,{isMergeableObject:E.isPlainObject});var e=this.options,r=e.container,n=e.stats,c=e.gui,p=e.resizeObserver;if(c){var y=new($());y.open(!1),this.gui=y}if(n){var g=new(U());g.showPanel(0),g.dom.style.position="absolute",r.appendChild(g.dom),this.stats=g}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=u.prototype;return i.use=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),c=1;c<r;c++)n[c-1]=arguments[c];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(V(n))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,r=e.container,n=e.isdev,c=e.axesHelper,p=e.renderer,y=e.scene,g=e.camera,N=this.getSize(),z=N.width,D=N.height,S=new m({isdev:n,width:z,height:D,cameraParams:g});this.gui&&S.setGui(this.gui);var M=S.camera,H=new q({camera:M,sceneParams:y}),Q=H.scene,Z=new l({width:z,height:D,scene:Q,camera:M,isdev:n,rendererParams:L((0,T.Z)({},p),{antialias:!1})});this.gui&&Z.setGui(this.gui);var fe=Z.renderer;c&&H.addAxesHelper(),this.sceneController=H,this.rendererController=Z,this.cameraController=S,r.appendChild(fe.domElement)},i.initComposer=function(){var e=this.options,r=e.bloom,n=e.bloomParams,c=e.renderer,p=e.multisampling,y=c.antialias;y==="msaa"&&!Pe&&(y=!1,console.warn("MSAA is not supported on this browser"));var g=new se({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:y==="msaa"?p:0,type:b.UnsignedByteType,encoding:c.outputEncoding}});this.composerController=g,r&&(g.addBloomPass(n),this.gui&&g.addBloomGui(this.gui)),y==="fxaa"&&g.addFXAAPass(),g.checkCopyPass(),this.event.on("passcheck",function(){g.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,r=e.container,n=e.css2DRenderer,c=e.css3DRenderer,p=e.css2DRendererParams,y=e.css3DRendererParams;if(n||c){var g=new ae(r);n&&g.addRenderer("css2d",p),c&&g.addRenderer("css3d",y),this.cssRendererController=g}},i.initControl=function(){var e=this.options,r=e.control,n=e.mapControl,c=e.controlParams;if(r){var p=new X({camera:this.camera,controlParams:{domElement:(c==null?void 0:c.domElement)||this.renderer.domElement},mapControl:n});this.controlController=p}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var n=new ResizeObserver(function(c){var p=!0,y=!1,g=void 0;try{for(var N=c[Symbol.iterator](),z;!(p=(z=N.next()).done);p=!0){var D=z.value,S=D.contentRect;e.handeleResize(S.width,S.height),e.render()}}catch(M){y=!0,g=M}finally{try{!p&&N.return!=null&&N.return()}finally{if(y)throw g}}});n.observe(r),this.resizeObserver=n}},i.handeleResize=function(e,r){var n=this,c=n.rendererController,p=n.cameraController,y=n.composerController,g=n.cssRendererController;p==null||p.setSize(e,r),c==null||c.setSize(e,r),y==null||y.setSize(e,r),g==null||g.setSize(e,r),this.installPlugins.forEach(function(N,z){var D;(D=z.resize)===null||D===void 0||D.call(z,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},i.pick=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=this,p=c.raycaster,y=c.options,g=y.container,N=new b.Vector2,z=g.getBoundingClientRect();if(N.x=(e.clientX-z.left)/(z.right-z.left)*2-1,N.y=-((e.clientY-z.top)/(z.bottom-z.top))*2+1,this.camera&&this.scene){p.setFromCamera(N,this.camera);var D=p.intersectObjects(r||this.scene.children,n);if(D.length)return{object:D[0].object,intersects:D}}},i.render=function(){var e,r,n,c,p=this,y=p.renderer,g=p.scene,N=p.camera,z=p.clock;if(!(!y||!g||!N||this.options.staticRender&&!this.cameraController.checkCameraChange())){var D=z.getDelta(),S=z.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,Q){var Z;(Z=Q.update)===null||Z===void 0||Z.call(Q,D,S)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(n=this.cssRendererController)===null||n===void 0||n.render(g,N),(c=this.stats)===null||c===void 0||c.update(),this.event.emit("render",{delta:D,elapsed:S})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,r,n,c,p,y,g;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(N,z){var D;(D=z.dispose)===null||D===void 0||D.call(z)}),(r=this.controlController)===null||r===void 0||r.dispose(),(n=this.cssRendererController)===null||n===void 0||n.dispose(),(c=this.sceneController)===null||c===void 0||c.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(y=this.rendererController)===null||y===void 0||y.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(g=this.gui)===null||g===void 0||g.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},_(u,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),u}();be.options={isdev:ce,stats:ce,gui:ce,axesHelper:ce,control:ce,resizeObserver:!0,renderer:L((0,T.Z)({},o),{antialias:Pe?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:w,camera:d,bloom:!1,bloomParams:ue,css2DRenderer:!1,css2DRendererParams:(0,T.Z)({},J),css3DRenderer:!1,css3DRendererParams:(0,T.Z)({},J)};function _e(u,i){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,i)}function Oe(u,i){return _e(u,i)}function Se(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function ge(u,i,t){return Se()?ge=Reflect.construct:ge=function(r,n,c){var p=[null];p.push.apply(p,n);var y=Function.bind.apply(r,p),g=new y;return c&&Oe(g,c.prototype),g},ge.apply(null,arguments)}function Ce(u,i,t){return ge.apply(null,arguments)}var Le=te(484);function Re(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),u&&(t.promise=(0,Le.Z)(t.promise,i)),t}var je=require("three/examples/jsm/renderers/CSS2DRenderer"),Ee=function(u){u&&((0,E.disposeMesh)(u),u.children.forEach(function(i){i.userData.BaseObject_||Ee(i)}))},Me=function(){"use strict";function u(){R(this,u),this.objecttype__="BaseObject",this.userData={},this.pm=Re(),this.visible=!1}var i=u.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,r){},i.resize=function(e,r){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(b.Mesh,V(r)),this},i.createGroup=function(){return this.object3d=new b.Group,this},i.createPoints=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(b.Points,V(r)),this},i.createCSS2DObject=function(e){return this.object3d=new je.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ne.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ne.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new b.Sprite(e),this},i.add=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).add.apply(c,V(r)),this},i.remove=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).remove.apply(c,V(r)),this},i.getSize=function(){var e=new b.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new b.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},i.dispose=function(){Ee(this.object3d)},_(u,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),u}()})(),module.exports=ye})();