gl-draw 0.3.13 → 0.4.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,4 +1,4 @@
1
- (function(){var Le={187:function(L){"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 E=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}L.exports=g,L.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||E(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||E(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",M=this._events;if(M!==void 0)w=w&&M.error===void 0;else if(!w)return!1;if(w){var O;if(v.length>0&&(O=v[0]),O instanceof Error)throw O;var J=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw J.context=O,J}var Q=M[c];if(Q===void 0)return!1;if(typeof Q=="function")x(Q,this,v);else for(var W=Q.length,Y=ie(Q,W),m=0;m<W;++m)x(Y[m],this,v);return!0};function C(f,c,v,m){var w,M,O;if(U(v),M=f._events,M===void 0?(M=f._events=Object.create(null),f._eventsCount=0):(M.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),M=f._events),O=M[c]),O===void 0)O=M[c]=v,++f._eventsCount;else if(typeof O=="function"?O=M[c]=m?[v,O]:[O,v]:m?O.unshift(v):O.push(v),w=F(f),w>0&&O.length>w&&!O.warned){O.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=f,J.type=c,J.count=O.length,D(J)}return f}g.prototype.addListener=function(c,v){return C(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return C(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,M,O,J;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(M=-1,O=m.length-1;O>=0;O--)if(m[O]===v||m[O].listener===v){J=m[O].listener,M=O;break}if(M<0)return this;M===0?m.shift():ne(m,M),m.length===1&&(w[c]=m[0]),w.removeListener!==void 0&&this.emit("removeListener",c,J||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 M=Object.keys(m),O;for(w=0;w<M.length;++w)O=M[w],O!=="removeListener"&&this.removeAllListeners(O);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):ee.call(f,c)},g.prototype.listenerCount=ee;function ee(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 ne(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(O){f.removeListener(c,M),m(O)}function M(){typeof f.removeListener=="function"&&f.removeListener("error",w),v([].slice.call(arguments))}T(f,c,M,{once:!0}),c!=="error"&&K(f,w,{once:!0})})}function K(f,c,v){typeof f.on=="function"&&T(f,"error",c,v)}function T(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(M){m.once&&f.removeEventListener(c,w),v(M)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(L){var A=function(x){"use strict";var G=Object.prototype,D=G.hasOwnProperty,E,g=typeof Symbol=="function"?Symbol:{},V=g.iterator||"@@iterator",U=g.asyncIterator||"@@asyncIterator",F=g.toStringTag||"@@toStringTag";function C(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{C({},"")}catch(p){C=function(d,b,j){return d[b]=j}}function k(p,d,b,j){var R=d&&d.prototype instanceof q?d:q,$=Object.create(R.prototype),se=new Y(j||[]);return $._invoke=O(p,b,se),$}x.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(j){return{type:"throw",arg:j}}}var N="suspendedStart",ee="suspendedYield",ie="executing",ne="completed",X={};function q(){}function K(){}function T(){}var f={};C(f,V,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(he([])));v&&v!==G&&D.call(v,V)&&(f=v);var m=T.prototype=q.prototype=Object.create(f);K.prototype=T,C(m,"constructor",T),C(T,"constructor",K),K.displayName=C(T,F,"GeneratorFunction");function w(p){["next","throw","return"].forEach(function(d){C(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,T):(p.__proto__=T,C(p,F,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function M(p,d){function b($,se,ae,oe){var te=l(p[$],p,se);if(te.type==="throw")oe(te.arg);else{var ve=te.arg,pe=ve.value;return pe&&typeof pe=="object"&&D.call(pe,"__await")?d.resolve(pe.__await).then(function(fe){b("next",fe,ae,oe)},function(fe){b("throw",fe,ae,oe)}):d.resolve(pe).then(function(fe){ve.value=fe,ae(ve)},function(fe){return b("throw",fe,ae,oe)})}}var j;function R($,se){function ae(){return new d(function(oe,te){b($,se,oe,te)})}return j=j?j.then(ae,ae):ae()}this._invoke=R}w(M.prototype),C(M.prototype,U,function(){return this}),x.AsyncIterator=M,x.async=function(p,d,b,j,R){R===void 0&&(R=Promise);var $=new M(k(p,d,b,j),R);return x.isGeneratorFunction(d)?$:$.next().then(function(se){return se.done?se.value:$.next()})};function O(p,d,b){var j=N;return function($,se){if(j===ie)throw new Error("Generator is already running");if(j===ne){if($==="throw")throw se;return ce()}for(b.method=$,b.arg=se;;){var ae=b.delegate;if(ae){var oe=J(ae,b);if(oe){if(oe===X)continue;return oe}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(j===N)throw j=ne,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);j=ie;var te=l(p,d,b);if(te.type==="normal"){if(j=b.done?ne:ee,te.arg===X)continue;return{value:te.arg,done:b.done}}else te.type==="throw"&&(j=ne,b.method="throw",b.arg=te.arg)}}}function J(p,d){var b=p.iterator[d.method];if(b===E){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=E,J(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 j=l(b,p.iterator,d.arg);if(j.type==="throw")return d.method="throw",d.arg=j.arg,d.delegate=null,X;var R=j.arg;if(!R)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(R.done)d[p.resultName]=R.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=E);else return R;return d.delegate=null,X}w(m),C(m,F,"Generator"),C(m,V,function(){return this}),C(m,"toString",function(){return"[object Generator]"});function Q(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 Y(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(Q,this),this.reset(!0)}x.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function j(){for(;d.length;){var R=d.pop();if(R in p)return j.value=R,j.done=!1,j}return j.done=!0,j}};function he(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,j=function R(){for(;++b<p.length;)if(D.call(p,b))return R.value=p[b],R.done=!1,R;return R.value=E,R.done=!0,R};return j.next=j}}return{next:ce}}x.values=he;function ce(){return{value:E,done:!0}}return Y.prototype={constructor:Y,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(W),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=E)},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(oe,te){return $.type="throw",$.arg=p,d.next=oe,te&&(d.method="next",d.arg=E),!!te}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],$=R.completion;if(R.tryLoc==="root")return b("end");if(R.tryLoc<=this.prev){var se=D.call(R,"catchLoc"),ae=D.call(R,"finallyLoc");if(se&&ae){if(this.prev<R.catchLoc)return b(R.catchLoc,!0);if(this.prev<R.finallyLoc)return b(R.finallyLoc)}else if(se){if(this.prev<R.catchLoc)return b(R.catchLoc,!0)}else if(ae){if(this.prev<R.finallyLoc)return b(R.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 j=this.tryEntries[b];if(j.tryLoc<=this.prev&&D.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=d&&d<=R.finallyLoc&&(R=null);var $=R?R.completion:{};return $.type=p,$.arg=d,R?(this.method="next",this.next=R.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 j=b.completion;if(j.type==="throw"){var R=j.arg;W(b)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:he(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=E),X}},x}(L.exports);try{regeneratorRuntime=A}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},695:function(L,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(g){var V,U,F,C,k,l,N,ee,ie,ne,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(),(C=g.normalMap)===null||C===void 0||C.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(),(ee=g.aoMap)===null||ee===void 0||ee.dispose(),(ie=g.displacementMap)===null||ie===void 0||ie.dispose(),(ne=g.emissiveMap)===null||ne===void 0||ne.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()})}}},519:function(L,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),E=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(T){var f,c;(f=T.color)===null||f===void 0||f.convertSRGBToLinear(),(c=T.emissive)===null||c===void 0||c.convertSRGBToLinear(),T.map&&(T.map.encoding=THREE.sRGBEncoding),T.emissiveMap&&(T.emissiveMap.encoding=THREE.sRGBEncoding)})}}var F=x(738),C=x(568),k=x(924),l=require("idb-keyval"),N=x(484),ee=null,ie=null,ne=function(){var q=(0,C.Z)(D().mark(function K(T,f){var c,v,m,w,M,O;return D().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return c=f.version,Q.next=4,(0,l.get)(T);case 4:if(m=Q.sent,!(m&&m[c])){Q.next=9;break}v=m[c],Q.next=15;break;case 9:return Q.next=11,(0,N.Z)(fetch(T).then(function(W){if(W.ok)return W.blob();throw new Error}));case 11:w=Q.sent,M=w.res,O=w.err,O||(v=M,(0,l.set)(T,(0,k.Z)({},c,M)));case 15:return Q.abrupt("return",v?{url:URL.createObjectURL(v)}:{url:T});case 16:case"end":return Q.stop()}},K)}));return function(T,f){return q.apply(this,arguments)}}(),X=x(705)},738:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(G(E)===!1)return!1;var g=E.constructor;if(g===void 0)return!0;var V=g.prototype;return!(G(V)===!1||V.hasOwnProperty("isPrototypeOf")===!1)}},484:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(42);function D(E){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.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(L,A,x){"use strict";var G=x(644),D=x.n(G),E=new Map,g=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,C,k,l,N){var ee=C[k*3],ie=C[k*3+1],ne=C[l*3],X=C[l*3+1],q=C[N*3],K=C[N*3+1],T;if(E.has(F))T=E.get(F);else{var f=U.box3||new THREE.Box3;if(!U.box3){var c=F.parameters.shapes.getPoints();f.setFromArray(c.map(function(O){return[O.x,O.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);U.split&&(v.y/=U.split),T={box:f,size:v},E.set(F,T)}var m=T.box,w=T.size,M=U.split?1-U.split:0;return[new THREE.Vector2((ee-m.min.x)/w.x,(ie-m.min.y)/w.y+M),new THREE.Vector2((ne-m.min.x)/w.x,(X-m.min.y)/w.y+M),new THREE.Vector2((q-m.min.x)/w.x,(K-m.min.y)/w.y+M)]},generateSideWallUV:function(F,C,k,l,N,ee){var ie=C[k*3],ne=C[k*3+1],X=C[k*3+2],q=C[l*3],K=C[l*3+1],T=C[l*3+2],f=C[N*3],c=C[N*3+1],v=C[N*3+2],m=C[ee*3],w=C[ee*3+1],M=C[ee*3+2],O;if(E.has(C))O=E.get(C);else{var J=new THREE.Box3;J.setFromArray(C);var Q=J.getSize(new THREE.Vector3);U.split&&(Q.z/=1-U.split),O={box:J,size:Q},E.set(C,O)}var W=O.box,Y=O.size;return Math.abs(ne-K)<Math.abs(ie-q)?[new THREE.Vector2((ie-W.min.x)/Y.x,(X-W.min.z)/Y.z),new THREE.Vector2((q-W.min.x)/Y.x,(T-W.min.z)/Y.z),new THREE.Vector2((f-W.min.x)/Y.x,(v-W.min.z)/Y.z),new THREE.Vector2((m-W.min.x)/Y.x,(M-W.min.z)/Y.z)]:[new THREE.Vector2((ne-W.min.y)/Y.x,(X-W.min.z)/Y.z),new THREE.Vector2((K-W.min.y)/Y.x,(T-W.min.z)/Y.z),new THREE.Vector2((c-W.min.y)/Y.x,(v-W.min.z)/Y.z),new THREE.Vector2((w-W.min.y)/Y.x,(M-W.min.z)/Y.z)]}}},V=function(){E.clear()}},644:function(L){"use strict";L.exports=require("three")},568:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(E,g,V,U,F,C,k){try{var l=E[C](k),N=l.value}catch(ee){V(ee);return}l.done?g(N):Promise.resolve(N).then(U,F)}function D(E){return function(){var g=this,V=arguments;return new Promise(function(U,F){var C=E.apply(g,V);function k(N){G(C,U,F,k,l,"next",N)}function l(N){G(C,U,F,k,l,"throw",N)}k(void 0)})}}},924:function(L,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D,E,g){return E in D?Object.defineProperty(D,E,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[E]=g,D}},42:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(924);function D(E){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)(E,F,V[F])})}return E}}},xe={};function re(L){var A=xe[L];if(A!==void 0)return A.exports;var x=xe[L]={exports:{}};return Le[L](x,x.exports,re),x.exports}(function(){re.n=function(L){var A=L&&L.__esModule?function(){return L.default}:function(){return L};return re.d(A,{a:A}),A}})(),function(){re.d=function(L,A){for(var x in A)re.o(A,x)&&!re.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:A[x]})}}(),function(){re.o=function(L,A){return Object.prototype.hasOwnProperty.call(L,A)}}(),function(){re.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";re.r(ye),re.d(ye,{BaseObject:function(){return ct},GUIObject:function(){return T},Pencil:function(){return Se},default:function(){return Se}});function L(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=re(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 E(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 C(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)||C(s)||F()}var l=re(644),N=re(187),ee=require("deepmerge"),ie=re.n(ee),ne=require("three/examples/jsm/libs/stats.module"),X=re.n(ne),q=require("lil-gui"),K=re.n(q),T=function(){"use strict";function s(n){L(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,ue=a.toLowerCase().indexOf("color")>-1,Z,le=typeof I=="undefined"&&H,de=le?H():u[a],me=le?a:"value";B?Z=o.add(de,me,B):ue?Z=o.addColor(de,me):Z=o.add(de,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,de[me],z)}),le&&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){L(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 T({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){L(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 T({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}(),M=re(519),O={background:null},J=function(){"use strict";function s(n){L(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,M.disposeMesh)(t)})},s}(),Q=require("three/examples/jsm/controls/OrbitControls"),W={},Y=function(){"use strict";function s(n){L(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new Q.MapControls(e,o):new Q.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,ue=this.options.camera,Z=new l.Vector3(u,B,_),le=new l.Vector3(r,P,h);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,le),I.sub(H.target),ue.position.sub(I)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),he=require("three/examples/jsm/renderers/CSS3DRenderer"),ce=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,j=new l.Vector3,R=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,s);var n=function(z,B){return b.setFromMatrixPosition(z.matrixWorld),j.setFromMatrixPosition(B.matrixWorld),b.distanceToSquared(j)},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(le,de){if(le.renderOrder!==de.renderOrder)return de.renderOrder-le.renderOrder;var me=S.objects.get(le).distanceToCameraSquared,ft=S.objects.get(de).distanceToCameraSquared;return me-ft}),I=B.length,H=0,ue=B.length;H<ue;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){ce.setFromMatrixPosition(P.matrixWorld),ce.applyMatrix4(d);var I=P.visible===!0&&ce.z>=-1&&ce.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(ce.x*a+a,"px,").concat(-ce.y*h+h,"px)"),H.parentNode!==_&&_.appendChild(H),P.onAfterRender(r,z,B)}var ue={distanceToCameraSquared:n(B,P)};S.objects.set(P,ue)}for(var Z=0,le=P.children.length;Z<le;Z++)y(P.children[Z],z,B)}},$={zIndex:"auto"},se=function(){"use strict";function s(n){L(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 R:new he.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}(),ae=require("three/examples/jsm/postprocessing/EffectComposer"),oe=require("three/examples/jsm/postprocessing/RenderPass"),te=require("three/examples/jsm/postprocessing/ShaderPass"),ve=require("three/examples/jsm/shaders/CopyShader"),pe=require("three/examples/jsm/shaders/GammaCorrectionShader"),fe=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;
1
+ (function(){var Le={187:function(L){"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 E=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}L.exports=g,L.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||E(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||E(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",M=this._events;if(M!==void 0)w=w&&M.error===void 0;else if(!w)return!1;if(w){var O;if(v.length>0&&(O=v[0]),O instanceof Error)throw O;var J=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw J.context=O,J}var Q=M[c];if(Q===void 0)return!1;if(typeof Q=="function")x(Q,this,v);else for(var W=Q.length,Y=ie(Q,W),m=0;m<W;++m)x(Y[m],this,v);return!0};function C(f,c,v,m){var w,M,O;if(U(v),M=f._events,M===void 0?(M=f._events=Object.create(null),f._eventsCount=0):(M.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),M=f._events),O=M[c]),O===void 0)O=M[c]=v,++f._eventsCount;else if(typeof O=="function"?O=M[c]=m?[v,O]:[O,v]:m?O.unshift(v):O.push(v),w=F(f),w>0&&O.length>w&&!O.warned){O.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=f,J.type=c,J.count=O.length,D(J)}return f}g.prototype.addListener=function(c,v){return C(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return C(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,M,O,J;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(M=-1,O=m.length-1;O>=0;O--)if(m[O]===v||m[O].listener===v){J=m[O].listener,M=O;break}if(M<0)return this;M===0?m.shift():ne(m,M),m.length===1&&(w[c]=m[0]),w.removeListener!==void 0&&this.emit("removeListener",c,J||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 M=Object.keys(m),O;for(w=0;w<M.length;++w)O=M[w],O!=="removeListener"&&this.removeAllListeners(O);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):ee.call(f,c)},g.prototype.listenerCount=ee;function ee(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 ne(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(O){f.removeListener(c,M),m(O)}function M(){typeof f.removeListener=="function"&&f.removeListener("error",w),v([].slice.call(arguments))}T(f,c,M,{once:!0}),c!=="error"&&K(f,w,{once:!0})})}function K(f,c,v){typeof f.on=="function"&&T(f,"error",c,v)}function T(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(M){m.once&&f.removeEventListener(c,w),v(M)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(L){var A=function(x){"use strict";var G=Object.prototype,D=G.hasOwnProperty,E,g=typeof Symbol=="function"?Symbol:{},V=g.iterator||"@@iterator",U=g.asyncIterator||"@@asyncIterator",F=g.toStringTag||"@@toStringTag";function C(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{C({},"")}catch(p){C=function(d,b,j){return d[b]=j}}function k(p,d,b,j){var R=d&&d.prototype instanceof q?d:q,$=Object.create(R.prototype),se=new Y(j||[]);return $._invoke=O(p,b,se),$}x.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(j){return{type:"throw",arg:j}}}var N="suspendedStart",ee="suspendedYield",ie="executing",ne="completed",X={};function q(){}function K(){}function T(){}var f={};C(f,V,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(he([])));v&&v!==G&&D.call(v,V)&&(f=v);var m=T.prototype=q.prototype=Object.create(f);K.prototype=T,C(m,"constructor",T),C(T,"constructor",K),K.displayName=C(T,F,"GeneratorFunction");function w(p){["next","throw","return"].forEach(function(d){C(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,T):(p.__proto__=T,C(p,F,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function M(p,d){function b($,se,ae,oe){var te=l(p[$],p,se);if(te.type==="throw")oe(te.arg);else{var ve=te.arg,pe=ve.value;return pe&&typeof pe=="object"&&D.call(pe,"__await")?d.resolve(pe.__await).then(function(fe){b("next",fe,ae,oe)},function(fe){b("throw",fe,ae,oe)}):d.resolve(pe).then(function(fe){ve.value=fe,ae(ve)},function(fe){return b("throw",fe,ae,oe)})}}var j;function R($,se){function ae(){return new d(function(oe,te){b($,se,oe,te)})}return j=j?j.then(ae,ae):ae()}this._invoke=R}w(M.prototype),C(M.prototype,U,function(){return this}),x.AsyncIterator=M,x.async=function(p,d,b,j,R){R===void 0&&(R=Promise);var $=new M(k(p,d,b,j),R);return x.isGeneratorFunction(d)?$:$.next().then(function(se){return se.done?se.value:$.next()})};function O(p,d,b){var j=N;return function($,se){if(j===ie)throw new Error("Generator is already running");if(j===ne){if($==="throw")throw se;return ce()}for(b.method=$,b.arg=se;;){var ae=b.delegate;if(ae){var oe=J(ae,b);if(oe){if(oe===X)continue;return oe}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(j===N)throw j=ne,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);j=ie;var te=l(p,d,b);if(te.type==="normal"){if(j=b.done?ne:ee,te.arg===X)continue;return{value:te.arg,done:b.done}}else te.type==="throw"&&(j=ne,b.method="throw",b.arg=te.arg)}}}function J(p,d){var b=p.iterator[d.method];if(b===E){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=E,J(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 j=l(b,p.iterator,d.arg);if(j.type==="throw")return d.method="throw",d.arg=j.arg,d.delegate=null,X;var R=j.arg;if(!R)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(R.done)d[p.resultName]=R.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=E);else return R;return d.delegate=null,X}w(m),C(m,F,"Generator"),C(m,V,function(){return this}),C(m,"toString",function(){return"[object Generator]"});function Q(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 Y(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(Q,this),this.reset(!0)}x.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function j(){for(;d.length;){var R=d.pop();if(R in p)return j.value=R,j.done=!1,j}return j.done=!0,j}};function he(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,j=function R(){for(;++b<p.length;)if(D.call(p,b))return R.value=p[b],R.done=!1,R;return R.value=E,R.done=!0,R};return j.next=j}}return{next:ce}}x.values=he;function ce(){return{value:E,done:!0}}return Y.prototype={constructor:Y,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(W),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=E)},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(oe,te){return $.type="throw",$.arg=p,d.next=oe,te&&(d.method="next",d.arg=E),!!te}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],$=R.completion;if(R.tryLoc==="root")return b("end");if(R.tryLoc<=this.prev){var se=D.call(R,"catchLoc"),ae=D.call(R,"finallyLoc");if(se&&ae){if(this.prev<R.catchLoc)return b(R.catchLoc,!0);if(this.prev<R.finallyLoc)return b(R.finallyLoc)}else if(se){if(this.prev<R.catchLoc)return b(R.catchLoc,!0)}else if(ae){if(this.prev<R.finallyLoc)return b(R.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 j=this.tryEntries[b];if(j.tryLoc<=this.prev&&D.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=d&&d<=R.finallyLoc&&(R=null);var $=R?R.completion:{};return $.type=p,$.arg=d,R?(this.method="next",this.next=R.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 j=b.completion;if(j.type==="throw"){var R=j.arg;W(b)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:he(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=E),X}},x}(L.exports);try{regeneratorRuntime=A}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},695:function(L,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(g){var V,U,F,C,k,l,N,ee,ie,ne,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(),(C=g.normalMap)===null||C===void 0||C.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(),(ee=g.aoMap)===null||ee===void 0||ee.dispose(),(ie=g.displacementMap)===null||ie===void 0||ie.dispose(),(ne=g.emissiveMap)===null||ne===void 0||ne.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()})}}},519:function(L,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),E=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(T){var f,c;(f=T.color)===null||f===void 0||f.convertSRGBToLinear(),(c=T.emissive)===null||c===void 0||c.convertSRGBToLinear(),T.map&&(T.map.encoding=THREE.sRGBEncoding),T.emissiveMap&&(T.emissiveMap.encoding=THREE.sRGBEncoding)})}}var F=x(738),C=x(568),k=x(924),l=require("idb-keyval"),N=x(484),ee=null,ie=null,ne=function(){var q=(0,C.Z)(D().mark(function K(T,f){var c,v,m,w,M,O;return D().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return c=f.version,Q.next=4,(0,l.get)(T);case 4:if(m=Q.sent,!(m&&m[c])){Q.next=9;break}v=m[c],Q.next=15;break;case 9:return Q.next=11,(0,N.Z)(fetch(T).then(function(W){if(W.ok)return W.blob();throw new Error}));case 11:w=Q.sent,M=w.res,O=w.err,O||(v=M,(0,l.set)(T,(0,k.Z)({},c,M)));case 15:return Q.abrupt("return",v?{url:URL.createObjectURL(v)}:{url:T});case 16:case"end":return Q.stop()}},K)}));return function(T,f){return q.apply(this,arguments)}}(),X=x(705)},738:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(G(E)===!1)return!1;var g=E.constructor;if(g===void 0)return!0;var V=g.prototype;return!(G(V)===!1||V.hasOwnProperty("isPrototypeOf")===!1)}},484:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(42);function D(E){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.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(L,A,x){"use strict";var G=x(644),D=x.n(G),E=new Map,g=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,C,k,l,N){var ee=C[k*3],ie=C[k*3+1],ne=C[l*3],X=C[l*3+1],q=C[N*3],K=C[N*3+1],T;if(E.has(F))T=E.get(F);else{var f=U.box3||new THREE.Box3;if(!U.box3){var c=F.parameters.shapes.getPoints();f.setFromArray(c.map(function(O){return[O.x,O.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);U.split&&(v.y/=U.split),T={box:f,size:v},E.set(F,T)}var m=T.box,w=T.size,M=U.split?1-U.split:0;return[new THREE.Vector2((ee-m.min.x)/w.x,(ie-m.min.y)/w.y+M),new THREE.Vector2((ne-m.min.x)/w.x,(X-m.min.y)/w.y+M),new THREE.Vector2((q-m.min.x)/w.x,(K-m.min.y)/w.y+M)]},generateSideWallUV:function(F,C,k,l,N,ee){var ie=C[k*3],ne=C[k*3+1],X=C[k*3+2],q=C[l*3],K=C[l*3+1],T=C[l*3+2],f=C[N*3],c=C[N*3+1],v=C[N*3+2],m=C[ee*3],w=C[ee*3+1],M=C[ee*3+2],O;if(E.has(C))O=E.get(C);else{var J=new THREE.Box3;J.setFromArray(C);var Q=J.getSize(new THREE.Vector3);U.split&&(Q.z/=1-U.split),O={box:J,size:Q},E.set(C,O)}var W=O.box,Y=O.size;return Math.abs(ne-K)<Math.abs(ie-q)?[new THREE.Vector2((ie-W.min.x)/Y.x,(X-W.min.z)/Y.z),new THREE.Vector2((q-W.min.x)/Y.x,(T-W.min.z)/Y.z),new THREE.Vector2((f-W.min.x)/Y.x,(v-W.min.z)/Y.z),new THREE.Vector2((m-W.min.x)/Y.x,(M-W.min.z)/Y.z)]:[new THREE.Vector2((ne-W.min.y)/Y.y,(X-W.min.z)/Y.z),new THREE.Vector2((K-W.min.y)/Y.y,(T-W.min.z)/Y.z),new THREE.Vector2((c-W.min.y)/Y.y,(v-W.min.z)/Y.z),new THREE.Vector2((w-W.min.y)/Y.y,(M-W.min.z)/Y.z)]}}},V=function(){E.clear()}},644:function(L){"use strict";L.exports=require("three")},568:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(E,g,V,U,F,C,k){try{var l=E[C](k),N=l.value}catch(ee){V(ee);return}l.done?g(N):Promise.resolve(N).then(U,F)}function D(E){return function(){var g=this,V=arguments;return new Promise(function(U,F){var C=E.apply(g,V);function k(N){G(C,U,F,k,l,"next",N)}function l(N){G(C,U,F,k,l,"throw",N)}k(void 0)})}}},924:function(L,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D,E,g){return E in D?Object.defineProperty(D,E,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[E]=g,D}},42:function(L,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(924);function D(E){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)(E,F,V[F])})}return E}}},xe={};function re(L){var A=xe[L];if(A!==void 0)return A.exports;var x=xe[L]={exports:{}};return Le[L](x,x.exports,re),x.exports}(function(){re.n=function(L){var A=L&&L.__esModule?function(){return L.default}:function(){return L};return re.d(A,{a:A}),A}})(),function(){re.d=function(L,A){for(var x in A)re.o(A,x)&&!re.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:A[x]})}}(),function(){re.o=function(L,A){return Object.prototype.hasOwnProperty.call(L,A)}}(),function(){re.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";re.r(ye),re.d(ye,{BaseObject:function(){return ct},GUIObject:function(){return T},Pencil:function(){return Se},default:function(){return Se}});function L(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=re(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 E(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 C(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)||C(s)||F()}var l=re(644),N=re(187),ee=require("deepmerge"),ie=re.n(ee),ne=require("three/examples/jsm/libs/stats.module"),X=re.n(ne),q=require("lil-gui"),K=re.n(q),T=function(){"use strict";function s(n){L(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,ue=a.toLowerCase().indexOf("color")>-1,Z,le=typeof I=="undefined"&&H,de=le?H():u[a],me=le?a:"value";B?Z=o.add(de,me,B):ue?Z=o.addColor(de,me):Z=o.add(de,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,de[me],z)}),le&&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){L(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 T({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){L(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 T({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}(),M=re(519),O={background:null},J=function(){"use strict";function s(n){L(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,M.disposeMesh)(t)})},s}(),Q=require("three/examples/jsm/controls/OrbitControls"),W={},Y=function(){"use strict";function s(n){L(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new Q.MapControls(e,o):new Q.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,ue=this.options.camera,Z=new l.Vector3(u,B,_),le=new l.Vector3(r,P,h);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,le),I.sub(H.target),ue.position.sub(I)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),he=require("three/examples/jsm/renderers/CSS3DRenderer"),ce=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,j=new l.Vector3,R=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,s);var n=function(z,B){return b.setFromMatrixPosition(z.matrixWorld),j.setFromMatrixPosition(B.matrixWorld),b.distanceToSquared(j)},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(le,de){if(le.renderOrder!==de.renderOrder)return de.renderOrder-le.renderOrder;var me=S.objects.get(le).distanceToCameraSquared,ft=S.objects.get(de).distanceToCameraSquared;return me-ft}),I=B.length,H=0,ue=B.length;H<ue;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){ce.setFromMatrixPosition(P.matrixWorld),ce.applyMatrix4(d);var I=P.visible===!0&&ce.z>=-1&&ce.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(ce.x*a+a,"px,").concat(-ce.y*h+h,"px)"),H.parentNode!==_&&_.appendChild(H),P.onAfterRender(r,z,B)}var ue={distanceToCameraSquared:n(B,P)};S.objects.set(P,ue)}for(var Z=0,le=P.children.length;Z<le;Z++)y(P.children[Z],z,B)}},$={zIndex:"auto"},se=function(){"use strict";function s(n){L(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 R:new he.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}(),ae=require("three/examples/jsm/postprocessing/EffectComposer"),oe=require("three/examples/jsm/postprocessing/RenderPass"),te=require("three/examples/jsm/postprocessing/ShaderPass"),ve=require("three/examples/jsm/shaders/CopyShader"),pe=require("three/examples/jsm/shaders/GammaCorrectionShader"),fe=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
2
 
3
3
  void main() {
4
4
 
@@ -1,4 +1,4 @@
1
- import*as Be from"idb-keyval";import*as B from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(L){var D=typeof Reflect=="object"?Reflect:null,C=D&&typeof D.apply=="function"?D.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:G=function(u){return Object.getOwnPropertyNames(u)};function j(v){console&&console.warn&&console.warn(v)}var A=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var z=10;function X(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return z},set:function(v){if(typeof v!="number"||v<0||A(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");z=v}}),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(u){if(typeof u!="number"||u<0||A(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function O(v){return v._maxListeners===void 0?g.defaultMaxListeners:v._maxListeners}g.prototype.getMaxListeners=function(){return O(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var S=u==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var E;if(f.length>0&&(E=f[0]),E instanceof Error)throw E;var $=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw $.context=E,$}var N=w[u];if(N===void 0)return!1;if(typeof N=="function")C(N,this,f);else for(var K=N.length,ne=ae(N,K),m=0;m<K;++m)C(ne[m],this,f);return!0};function U(v,u,f,m){var S,w,E;if(X(f),w=v._events,w===void 0?(w=v._events=Object.create(null),v._eventsCount=0):(w.newListener!==void 0&&(v.emit("newListener",u,f.listener?f.listener:f),w=v._events),E=w[u]),E===void 0)E=w[u]=f,++v._eventsCount;else if(typeof E=="function"?E=w[u]=m?[f,E]:[E,f]:m?E.unshift(f):E.push(f),S=O(v),S>0&&E.length>S&&!E.warned){E.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=v,$.type=u,$.count=E.length,j($)}return v}g.prototype.addListener=function(u,f){return U(this,u,f,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,f){return U(this,u,f,!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 c(v,u,f){var m={fired:!1,wrapFn:void 0,target:v,type:u,listener:f},S=k.bind(m);return S.listener=f,m.wrapFn=S,S}g.prototype.once=function(u,f){return X(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return X(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,S,w,E,$;if(X(f),S=this._events,S===void 0)return this;if(m=S[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete S[u],S.removeListener&&this.emit("removeListener",u,m.listener||f));else if(typeof m!="function"){for(w=-1,E=m.length-1;E>=0;E--)if(m[E]===f||m[E].listener===f){$=m[E].listener,w=E;break}if(w<0)return this;w===0?m.shift():re(m,w),m.length===1&&(S[u]=m[0]),S.removeListener!==void 0&&this.emit("removeListener",u,$||f)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var f,m,S;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[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var w=Object.keys(m),E;for(S=0;S<w.length;++S)E=w[S],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=m[u],typeof f=="function")this.removeListener(u,f);else if(f!==void 0)for(S=f.length-1;S>=0;S--)this.removeListener(u,f[S]);return this};function Q(v,u,f){var m=v._events;if(m===void 0)return[];var S=m[u];return S===void 0?[]:typeof S=="function"?f?[S.listener||S]:[S]:f?Y(S):ae(S,S.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(v,u){return typeof v.listenerCount=="function"?v.listenerCount(u):te.call(v,u)},g.prototype.listenerCount=te;function te(v){var u=this._events;if(u!==void 0){var f=u[v];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(v,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=v[m];return f}function re(v,u){for(;u+1<v.length;u++)v[u]=v[u+1];v.pop()}function Y(v){for(var u=new Array(v.length),f=0;f<u.length;++f)u[f]=v[f].listener||v[f];return u}function oe(v,u){return new Promise(function(f,m){function S(E){v.removeListener(u,w),m(E)}function w(){typeof v.removeListener=="function"&&v.removeListener("error",S),f([].slice.call(arguments))}W(v,u,w,{once:!0}),u!=="error"&&q(v,S,{once:!0})})}function q(v,u,f){typeof v.on=="function"&&W(v,"error",u,f)}function W(v,u,f,m){if(typeof v.on=="function")m.once?v.once(u,f):v.on(u,f);else if(typeof v.addEventListener=="function")v.addEventListener(u,function S(w){m.once&&v.removeEventListener(u,S),f(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}},666:function(L){var D=function(C){"use strict";var G=Object.prototype,j=G.hasOwnProperty,A,g=typeof Symbol=="function"?Symbol:{},z=g.iterator||"@@iterator",X=g.asyncIterator||"@@asyncIterator",O=g.toStringTag||"@@toStringTag";function U(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{U({},"")}catch(p){U=function(h,_,M){return h[_]=M}}function k(p,h,_,M){var R=h&&h.prototype instanceof oe?h:oe,J=Object.create(R.prototype),ee=new ne(M||[]);return J._invoke=E(p,_,ee),J}C.wrap=k;function c(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var v={};U(v,z,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(de([])));f&&f!==G&&j.call(f,z)&&(v=f);var m=W.prototype=oe.prototype=Object.create(v);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(h){U(p,h,function(_){return this._invoke(h,_)})})}C.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===q||(h.displayName||h.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,O,"GeneratorFunction")),p.prototype=Object.create(m),p},C.awrap=function(p){return{__await:p}};function w(p,h){function _(J,ee,ie,ue){var se=c(p[J],p,ee);if(se.type==="throw")ue(se.arg);else{var pe=se.arg,ve=pe.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?h.resolve(ve.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):h.resolve(ve).then(function(fe){pe.value=fe,ie(pe)},function(fe){return _("throw",fe,ie,ue)})}}var M;function R(J,ee){function ie(){return new h(function(ue,se){_(J,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=R}S(w.prototype),U(w.prototype,X,function(){return this}),C.AsyncIterator=w,C.async=function(p,h,_,M,R){R===void 0&&(R=Promise);var J=new w(k(p,h,_,M),R);return C.isGeneratorFunction(h)?J:J.next().then(function(ee){return ee.done?ee.value:J.next()})};function E(p,h,_){var M=Q;return function(J,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if(J==="throw")throw ee;return ye()}for(_.method=J,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=$(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=ae;var se=c(p,h,_);if(se.type==="normal"){if(M=_.done?re:te,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function $(p,h){var _=p.iterator[h.method];if(_===A){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=A,$(p,h),h.method==="throw"))return Y;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,h.arg);if(M.type==="throw")return h.method="throw",h.arg=M.arg,h.delegate=null,Y;var R=M.arg;if(!R)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,Y;if(R.done)h[p.resultName]=R.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=A);else return R;return h.delegate=null,Y}S(m),U(m,O,"Generator"),U(m,z,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function N(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function K(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(N,this),this.reset(!0)}C.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function M(){for(;h.length;){var R=h.pop();if(R in p)return M.value=R,M.done=!1,M}return M.done=!0,M}};function de(p){if(p){var h=p[z];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function R(){for(;++_<p.length;)if(j.call(p,_))return R.value=p[_],R.done=!1,R;return R.value=A,R.done=!0,R};return M.next=M}}return{next:ye}}C.values=de;function ye(){return{value:A,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=A,this.done=!1,this.delegate=null,this.method="next",this.arg=A,this.tryEntries.forEach(K),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=A)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,se){return J.type="throw",J.arg=p,h.next=ue,se&&(h.method="next",h.arg=A),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var R=this.tryEntries[M],J=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var ee=j.call(R,"catchLoc"),ie=j.call(R,"finallyLoc");if(ee&&ie){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(ee){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else if(ie){if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&j.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var R=M;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=h&&h<=R.finallyLoc&&(R=null);var J=R?R.completion:{};return J.type=p,J.arg=h,R?(this.method="next",this.next=R.finallyLoc,Y):this.complete(J)},complete:function(p,h){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"&&h&&(this.next=h),Y},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),Y}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var R=M.arg;K(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:de(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=A),Y}},C}(L.exports);try{regeneratorRuntime=D}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var A=Array.isArray(j.material)?j.material:[j.material];A.forEach(function(g){var z,X,O,U,k,c,Q,te,ae,re,Y,oe,q;(z=g.map)===null||z===void 0||z.dispose(),(X=g.lightMap)===null||X===void 0||X.dispose(),(O=g.bumpMap)===null||O===void 0||O.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(te=g.aoMap)===null||te===void 0||te.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(q=g.roughnessMap)===null||q===void 0||q.dispose(),g.dispose()})}}},521:function(L,D,C){C.d(D,{wf:function(){return g.Z},PO:function(){return O.Z}});var G=C(666),j=C.n(G),A=null,g=C(695),z=C(949);function X(W){if(W.material){var v=Array.isArray(W.material)?W.material:[W.material];v.forEach(function(u){var f,m;(f=u.color)===null||f===void 0||f.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=C(738),U=C(568),k=C(924),c=W=>{var v={};return C.d(v,W),v},Q=W=>()=>W,te=c({get:()=>Be.get,set:()=>Be.set}),ae=C(484),re=null,Y=null,oe=function(){var W=(0,U.Z)(j().mark(function v(u,f){var m,S,w,E,$,N;return j().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return m=f.version,ne.next=4,(0,te.get)(u);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}S=w[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(de){if(de.ok)return de.blob();throw new Error}));case 11:E=ne.sent,$=E.res,N=E.err,N||(S=$,(0,te.set)(u,(0,k.Z)({},m,$)));case 15:return ne.abrupt("return",S?{url:URL.createObjectURL(S)}:{url:u});case 16:case"end":return ne.stop()}},v)}));return function(u,f){return W.apply(this,arguments)}}(),q=C(705)},738:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A){return Object.prototype.toString.call(A)==="[object Object]"}function j(A){if(G(A)===!1)return!1;var g=A.constructor;if(g===void 0)return!0;var z=g.prototype;return!(G(z)===!1||z.hasOwnProperty("isPrototypeOf")===!1)}},484:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(42);function j(A){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A.then(function(z){return(0,G.Z)({err:null,res:z},g)}).catch(function(z){return(0,G.Z)({err:z,res:void 0},g)})}},705:function(L,D,C){var G=C(949),j=new Map,A=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,U,k,c){var Q=O[U*3],te=O[U*3+1],ae=O[k*3],re=O[k*3+1],Y=O[c*3],oe=O[c*3+1],q;if(j.has(X))q=j.get(X);else{var W=z.box3||new THREE.Box3;if(!z.box3){var v=X.parameters.shapes.getPoints();W.setFromArray(v.map(function(w){return[w.x,w.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);z.split&&(u.y/=z.split),q={box:W,size:u},j.set(X,q)}var f=q.box,m=q.size,S=z.split?1-z.split:0;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y+S),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y+S),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y+S)]},generateSideWallUV:function(X,O,U,k,c,Q){var te=O[U*3],ae=O[U*3+1],re=O[U*3+2],Y=O[k*3],oe=O[k*3+1],q=O[k*3+2],W=O[c*3],v=O[c*3+1],u=O[c*3+2],f=O[Q*3],m=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var E=new THREE.Box3;E.setFromArray(O);var $=E.getSize(new THREE.Vector3);z.split&&($.z/=1-z.split),w={box:E,size:$},j.set(O,w)}var N=w.box,K=w.size;return Math.abs(ae-oe)<Math.abs(te-Y)?[new THREE.Vector2((te-N.min.x)/K.x,(re-N.min.z)/K.z),new THREE.Vector2((Y-N.min.x)/K.x,(q-N.min.z)/K.z),new THREE.Vector2((W-N.min.x)/K.x,(u-N.min.z)/K.z),new THREE.Vector2((f-N.min.x)/K.x,(S-N.min.z)/K.z)]:[new THREE.Vector2((ae-N.min.y)/K.x,(re-N.min.z)/K.z),new THREE.Vector2((oe-N.min.y)/K.x,(q-N.min.z)/K.z),new THREE.Vector2((v-N.min.y)/K.x,(u-N.min.z)/K.z),new THREE.Vector2((m-N.min.y)/K.x,(S-N.min.z)/K.z)]}}},g=function(){j.clear()}},949:function(L,D,C){var G=A=>{var g={};return C.d(g,A),g},j=A=>()=>A;L.exports=G({ACESFilmicToneMapping:()=>B.ACESFilmicToneMapping,AdditiveBlending:()=>B.AdditiveBlending,AxesHelper:()=>B.AxesHelper,Box3:()=>B.Box3,Camera:()=>B.Camera,CineonToneMapping:()=>B.CineonToneMapping,Clock:()=>B.Clock,Color:()=>B.Color,Euler:()=>B.Euler,Group:()=>B.Group,Layers:()=>B.Layers,LinearEncoding:()=>B.LinearEncoding,LinearFilter:()=>B.LinearFilter,LinearToneMapping:()=>B.LinearToneMapping,Matrix4:()=>B.Matrix4,Mesh:()=>B.Mesh,MeshBasicMaterial:()=>B.MeshBasicMaterial,NoToneMapping:()=>B.NoToneMapping,PerspectiveCamera:()=>B.PerspectiveCamera,PlaneGeometry:()=>B.PlaneGeometry,Points:()=>B.Points,REVISION:()=>B.REVISION,RGBAFormat:()=>B.RGBAFormat,Raycaster:()=>B.Raycaster,ReinhardToneMapping:()=>B.ReinhardToneMapping,Scene:()=>B.Scene,ShaderMaterial:()=>B.ShaderMaterial,Sprite:()=>B.Sprite,SpriteMaterial:()=>B.SpriteMaterial,UniformsUtils:()=>B.UniformsUtils,UnsignedByteType:()=>B.UnsignedByteType,Vector2:()=>B.Vector2,Vector3:()=>B.Vector3,WebGLMultisampleRenderTarget:()=>B.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>B.WebGLRenderTarget,WebGLRenderer:()=>B.WebGLRenderer,sRGBEncoding:()=>B.sRGBEncoding})},568:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A,g,z,X,O,U,k){try{var c=A[U](k),Q=c.value}catch(te){z(te);return}c.done?g(Q):Promise.resolve(Q).then(X,O)}function j(A){return function(){var g=this,z=arguments;return new Promise(function(X,O){var U=A.apply(g,z);function k(Q){G(U,X,O,k,c,"next",Q)}function c(Q){G(U,X,O,k,c,"throw",Q)}k(void 0)})}}},924:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j,A,g){return A in j?Object.defineProperty(j,A,{value:g,enumerable:!0,configurable:!0,writable:!0}):j[A]=g,j}},42:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(924);function j(A){for(var g=1;g<arguments.length;g++){var z=arguments[g]!=null?arguments[g]:{},X=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(z).filter(function(O){return Object.getOwnPropertyDescriptor(z,O).enumerable}))),X.forEach(function(O){(0,G.Z)(A,O,z[O])})}return A}}},Fe={};function V(L){var D=Fe[L];if(D!==void 0)return D.exports;var C=Fe[L]={exports:{}};return qt[L](C,C.exports,V),C.exports}(function(){V.n=function(L){var D=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(D,{a:D}),D}})(),function(){V.d=function(L,D){for(var C in D)V.o(D,C)&&!V.o(L,C)&&Object.defineProperty(L,C,{enumerable:!0,get:D[C]})}}(),function(){V.o=function(L,D){return Object.prototype.hasOwnProperty.call(L,D)}}();var _e={};(function(){V.d(_e,{L6:function(){return zt},sb:function(){return f},z:function(){return Ee},ZP:function(){return Ee}});function L(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=V(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function A(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function g(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function z(n){if(Array.isArray(n))return g(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){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 U(n,t){if(!!n){if(typeof n=="string")return g(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(n,t)}}function k(n){return z(n)||X(n)||U(n)||O()}var c=V(949),Q=V(187),te=n=>{var t={};return V.d(t,n),t},ae=n=>()=>n,re=te({default:()=>Gt.default}),Y=n=>{var t={};return V.d(t,n),t},oe=n=>()=>n,q=Y({default:()=>Ut.default}),W=n=>{var t={};return V.d(t,n),t},v=n=>()=>n,u=W({default:()=>Ft.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=r.guiParams[a];Object.keys(l).forEach(function(s){var d=l[s],x=d.min,y=d.max,b=d.step,P=d.name,T=d.paramMap,F=d.items,I=d.value,H=d.target,le=s.toLowerCase().indexOf("color")>-1,Z,ce=typeof I=="undefined"&&H,he=ce?H():l[s],me=ce?s:"value";F?Z=o.add(he,me,F):le?Z=o.addColor(he,me):Z=o.add(he,me),Z=Z.name(P||s),typeof x!="undefined"&&(Z=Z.min(x)),typeof y!="undefined"&&(Z=Z.max(y)),typeof b!="undefined"&&(Z=Z.step(b)),Z=Z.onChange(function(){r.setTargetValue(a,s,he[me],T)}),ce&&Z.listen()})})},t.setTargetValue=function(e,r,a,o){var l=this.guiParams[e][r],s=l.onChange,d=l.target,x=l.value,y=r.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&d;if(d&&!b){var P=d();Array.isArray(P)||(P=[P]),P.forEach(function(T){if(!!T)if(y)try{T[o||r].set(a)}catch(F){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else T[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,a,o.value,o.paramMap)})})},n}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},w=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,d=a.antialias,x=a.powerPreference,y=a.toneMapping,b=a.toneMappingExposure,P=a.outputEncoding,T=a.logarithmicDepthBuffer,F=a.preserveDrawingBuffer,I=new c.WebGLRenderer({context:o,alpha:l,antialias:d,powerPreference:x,logarithmicDepthBuffer:T,preserveDrawingBuffer:F});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=m[y],I.toneMappingExposure=b,I.outputEncoding=P,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),E={fov:45,near:1,far:1e3},$=function(){"use strict";function n(i){L(this,n),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,a=i.cameraParams;if(a instanceof c.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,l=a.far,s=a.near,d=new c.PerspectiveCamera(o,e/r,s,l);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var t=n.prototype;return t.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},t.setSize=function(e,r){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new f({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(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),N=V(521),K={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,N.wf)(r)})},n}(),de=n=>{var t={};return V.d(t,n),t},ye=n=>()=>n,p=de({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),h={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.domElement,l=a?new p.MapControls(e,o):new p.OrbitControls(e,o);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,d=s===void 0?1/0:s,x=e.minZ,y=x===void 0?-1/0:x,b=e.maxY,P=b===void 0?1/0:b,T=e.minY,F=T===void 0?-1/0:T,I=this.limitPanV||new c.Vector3,H=this.control,le=this.options.camera,Z=new c.Vector3(l,F,y),ce=new c.Vector3(a,P,d);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),M=n=>{var t={};return V.d(t,n),t},R=n=>()=>n,J=M({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,pe=new c.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(T,F){return se.setFromMatrixPosition(T.matrixWorld),pe.setFromMatrixPosition(F.matrixWorld),se.distanceToSquared(pe)},e=function(T){var F=[];return T.traverse(function(I){I.isCSS2DObject&&F.push(I)}),F},r=function(T){for(var F=e(T).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var me=x.objects.get(ce).distanceToCameraSquared,Bt=x.objects.get(he).distanceToCameraSquared;return me-Bt}),I=F.length,H=0,le=F.length;H<le;H++){var Z=F[H].userData.zIndexFix||0;F[H].element.style.zIndex=I-H+Z}},a=this,o,l,s,d,x={objects:new WeakMap},y=t.element!==void 0?t.element:document.createElement("div");y.style.overflow="hidden",this.domElement=y,this.getSize=function(){return{width:o,height:l}},this.render=function(P,T){+c.REVISION<144?(P.autoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.updateMatrixWorld()):(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld()),ie.copy(T.matrixWorldInverse),ue.multiplyMatrices(T.projectionMatrix,ie),b(P,P,T),r(P)},this.setSize=function(P,T){o=P,l=T,s=o/2,d=l/2,y.style.width="".concat(P,"px"),y.style.height="".concat(T,"px")};function b(P,T,F){if(P.isCSS2DObject){ee.setFromMatrixPosition(P.matrixWorld),ee.applyMatrix4(ue);var I=P.visible===!0&&ee.z>=-1&&ee.z<=1&&P.layers.test(F.layers)===!0;if(P.element.style.display=I===!0?"":"none",I===!0){P.onBeforeRender(a,T,F);var H=P.element;H.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*d+d,"px)"),H.parentNode!==y&&y.appendChild(H),P.onAfterRender(a,T,F)}var le={distanceToCameraSquared:i(F,P)};x.objects.set(P,le)}for(var Z=0,ce=P.children.length;Z<ce;Z++)b(P.children[Z],T,F)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){L(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return V.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return V.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return V.d(t,n),t},sr=n=>()=>n,be=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return V.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return V.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return V.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return V.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return V.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,ge=!1,Me=et()!==!1,rt=`varying vec2 vUv;
1
+ import*as Be from"idb-keyval";import*as B from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(L){var D=typeof Reflect=="object"?Reflect:null,C=D&&typeof D.apply=="function"?D.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:G=function(u){return Object.getOwnPropertyNames(u)};function j(v){console&&console.warn&&console.warn(v)}var A=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var z=10;function X(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return z},set:function(v){if(typeof v!="number"||v<0||A(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");z=v}}),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(u){if(typeof u!="number"||u<0||A(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function O(v){return v._maxListeners===void 0?g.defaultMaxListeners:v._maxListeners}g.prototype.getMaxListeners=function(){return O(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var S=u==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var E;if(f.length>0&&(E=f[0]),E instanceof Error)throw E;var $=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw $.context=E,$}var N=w[u];if(N===void 0)return!1;if(typeof N=="function")C(N,this,f);else for(var K=N.length,ne=ae(N,K),m=0;m<K;++m)C(ne[m],this,f);return!0};function U(v,u,f,m){var S,w,E;if(X(f),w=v._events,w===void 0?(w=v._events=Object.create(null),v._eventsCount=0):(w.newListener!==void 0&&(v.emit("newListener",u,f.listener?f.listener:f),w=v._events),E=w[u]),E===void 0)E=w[u]=f,++v._eventsCount;else if(typeof E=="function"?E=w[u]=m?[f,E]:[E,f]:m?E.unshift(f):E.push(f),S=O(v),S>0&&E.length>S&&!E.warned){E.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=v,$.type=u,$.count=E.length,j($)}return v}g.prototype.addListener=function(u,f){return U(this,u,f,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,f){return U(this,u,f,!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 c(v,u,f){var m={fired:!1,wrapFn:void 0,target:v,type:u,listener:f},S=k.bind(m);return S.listener=f,m.wrapFn=S,S}g.prototype.once=function(u,f){return X(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return X(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,S,w,E,$;if(X(f),S=this._events,S===void 0)return this;if(m=S[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete S[u],S.removeListener&&this.emit("removeListener",u,m.listener||f));else if(typeof m!="function"){for(w=-1,E=m.length-1;E>=0;E--)if(m[E]===f||m[E].listener===f){$=m[E].listener,w=E;break}if(w<0)return this;w===0?m.shift():re(m,w),m.length===1&&(S[u]=m[0]),S.removeListener!==void 0&&this.emit("removeListener",u,$||f)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var f,m,S;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[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var w=Object.keys(m),E;for(S=0;S<w.length;++S)E=w[S],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=m[u],typeof f=="function")this.removeListener(u,f);else if(f!==void 0)for(S=f.length-1;S>=0;S--)this.removeListener(u,f[S]);return this};function Q(v,u,f){var m=v._events;if(m===void 0)return[];var S=m[u];return S===void 0?[]:typeof S=="function"?f?[S.listener||S]:[S]:f?Y(S):ae(S,S.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(v,u){return typeof v.listenerCount=="function"?v.listenerCount(u):te.call(v,u)},g.prototype.listenerCount=te;function te(v){var u=this._events;if(u!==void 0){var f=u[v];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(v,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=v[m];return f}function re(v,u){for(;u+1<v.length;u++)v[u]=v[u+1];v.pop()}function Y(v){for(var u=new Array(v.length),f=0;f<u.length;++f)u[f]=v[f].listener||v[f];return u}function oe(v,u){return new Promise(function(f,m){function S(E){v.removeListener(u,w),m(E)}function w(){typeof v.removeListener=="function"&&v.removeListener("error",S),f([].slice.call(arguments))}W(v,u,w,{once:!0}),u!=="error"&&q(v,S,{once:!0})})}function q(v,u,f){typeof v.on=="function"&&W(v,"error",u,f)}function W(v,u,f,m){if(typeof v.on=="function")m.once?v.once(u,f):v.on(u,f);else if(typeof v.addEventListener=="function")v.addEventListener(u,function S(w){m.once&&v.removeEventListener(u,S),f(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}},666:function(L){var D=function(C){"use strict";var G=Object.prototype,j=G.hasOwnProperty,A,g=typeof Symbol=="function"?Symbol:{},z=g.iterator||"@@iterator",X=g.asyncIterator||"@@asyncIterator",O=g.toStringTag||"@@toStringTag";function U(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{U({},"")}catch(p){U=function(h,_,M){return h[_]=M}}function k(p,h,_,M){var R=h&&h.prototype instanceof oe?h:oe,J=Object.create(R.prototype),ee=new ne(M||[]);return J._invoke=E(p,_,ee),J}C.wrap=k;function c(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var v={};U(v,z,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(de([])));f&&f!==G&&j.call(f,z)&&(v=f);var m=W.prototype=oe.prototype=Object.create(v);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(h){U(p,h,function(_){return this._invoke(h,_)})})}C.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===q||(h.displayName||h.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,O,"GeneratorFunction")),p.prototype=Object.create(m),p},C.awrap=function(p){return{__await:p}};function w(p,h){function _(J,ee,ie,ue){var se=c(p[J],p,ee);if(se.type==="throw")ue(se.arg);else{var pe=se.arg,ve=pe.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?h.resolve(ve.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):h.resolve(ve).then(function(fe){pe.value=fe,ie(pe)},function(fe){return _("throw",fe,ie,ue)})}}var M;function R(J,ee){function ie(){return new h(function(ue,se){_(J,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=R}S(w.prototype),U(w.prototype,X,function(){return this}),C.AsyncIterator=w,C.async=function(p,h,_,M,R){R===void 0&&(R=Promise);var J=new w(k(p,h,_,M),R);return C.isGeneratorFunction(h)?J:J.next().then(function(ee){return ee.done?ee.value:J.next()})};function E(p,h,_){var M=Q;return function(J,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if(J==="throw")throw ee;return ye()}for(_.method=J,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=$(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=ae;var se=c(p,h,_);if(se.type==="normal"){if(M=_.done?re:te,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function $(p,h){var _=p.iterator[h.method];if(_===A){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=A,$(p,h),h.method==="throw"))return Y;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,h.arg);if(M.type==="throw")return h.method="throw",h.arg=M.arg,h.delegate=null,Y;var R=M.arg;if(!R)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,Y;if(R.done)h[p.resultName]=R.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=A);else return R;return h.delegate=null,Y}S(m),U(m,O,"Generator"),U(m,z,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function N(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function K(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(N,this),this.reset(!0)}C.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function M(){for(;h.length;){var R=h.pop();if(R in p)return M.value=R,M.done=!1,M}return M.done=!0,M}};function de(p){if(p){var h=p[z];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function R(){for(;++_<p.length;)if(j.call(p,_))return R.value=p[_],R.done=!1,R;return R.value=A,R.done=!0,R};return M.next=M}}return{next:ye}}C.values=de;function ye(){return{value:A,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=A,this.done=!1,this.delegate=null,this.method="next",this.arg=A,this.tryEntries.forEach(K),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=A)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,se){return J.type="throw",J.arg=p,h.next=ue,se&&(h.method="next",h.arg=A),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var R=this.tryEntries[M],J=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var ee=j.call(R,"catchLoc"),ie=j.call(R,"finallyLoc");if(ee&&ie){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(ee){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else if(ie){if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&j.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var R=M;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=h&&h<=R.finallyLoc&&(R=null);var J=R?R.completion:{};return J.type=p,J.arg=h,R?(this.method="next",this.next=R.finallyLoc,Y):this.complete(J)},complete:function(p,h){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"&&h&&(this.next=h),Y},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),Y}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var R=M.arg;K(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:de(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=A),Y}},C}(L.exports);try{regeneratorRuntime=D}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var A=Array.isArray(j.material)?j.material:[j.material];A.forEach(function(g){var z,X,O,U,k,c,Q,te,ae,re,Y,oe,q;(z=g.map)===null||z===void 0||z.dispose(),(X=g.lightMap)===null||X===void 0||X.dispose(),(O=g.bumpMap)===null||O===void 0||O.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(te=g.aoMap)===null||te===void 0||te.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(q=g.roughnessMap)===null||q===void 0||q.dispose(),g.dispose()})}}},521:function(L,D,C){C.d(D,{wf:function(){return g.Z},PO:function(){return O.Z}});var G=C(666),j=C.n(G),A=null,g=C(695),z=C(949);function X(W){if(W.material){var v=Array.isArray(W.material)?W.material:[W.material];v.forEach(function(u){var f,m;(f=u.color)===null||f===void 0||f.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=C(738),U=C(568),k=C(924),c=W=>{var v={};return C.d(v,W),v},Q=W=>()=>W,te=c({get:()=>Be.get,set:()=>Be.set}),ae=C(484),re=null,Y=null,oe=function(){var W=(0,U.Z)(j().mark(function v(u,f){var m,S,w,E,$,N;return j().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return m=f.version,ne.next=4,(0,te.get)(u);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}S=w[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(de){if(de.ok)return de.blob();throw new Error}));case 11:E=ne.sent,$=E.res,N=E.err,N||(S=$,(0,te.set)(u,(0,k.Z)({},m,$)));case 15:return ne.abrupt("return",S?{url:URL.createObjectURL(S)}:{url:u});case 16:case"end":return ne.stop()}},v)}));return function(u,f){return W.apply(this,arguments)}}(),q=C(705)},738:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A){return Object.prototype.toString.call(A)==="[object Object]"}function j(A){if(G(A)===!1)return!1;var g=A.constructor;if(g===void 0)return!0;var z=g.prototype;return!(G(z)===!1||z.hasOwnProperty("isPrototypeOf")===!1)}},484:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(42);function j(A){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A.then(function(z){return(0,G.Z)({err:null,res:z},g)}).catch(function(z){return(0,G.Z)({err:z,res:void 0},g)})}},705:function(L,D,C){var G=C(949),j=new Map,A=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,U,k,c){var Q=O[U*3],te=O[U*3+1],ae=O[k*3],re=O[k*3+1],Y=O[c*3],oe=O[c*3+1],q;if(j.has(X))q=j.get(X);else{var W=z.box3||new THREE.Box3;if(!z.box3){var v=X.parameters.shapes.getPoints();W.setFromArray(v.map(function(w){return[w.x,w.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);z.split&&(u.y/=z.split),q={box:W,size:u},j.set(X,q)}var f=q.box,m=q.size,S=z.split?1-z.split:0;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y+S),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y+S),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y+S)]},generateSideWallUV:function(X,O,U,k,c,Q){var te=O[U*3],ae=O[U*3+1],re=O[U*3+2],Y=O[k*3],oe=O[k*3+1],q=O[k*3+2],W=O[c*3],v=O[c*3+1],u=O[c*3+2],f=O[Q*3],m=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var E=new THREE.Box3;E.setFromArray(O);var $=E.getSize(new THREE.Vector3);z.split&&($.z/=1-z.split),w={box:E,size:$},j.set(O,w)}var N=w.box,K=w.size;return Math.abs(ae-oe)<Math.abs(te-Y)?[new THREE.Vector2((te-N.min.x)/K.x,(re-N.min.z)/K.z),new THREE.Vector2((Y-N.min.x)/K.x,(q-N.min.z)/K.z),new THREE.Vector2((W-N.min.x)/K.x,(u-N.min.z)/K.z),new THREE.Vector2((f-N.min.x)/K.x,(S-N.min.z)/K.z)]:[new THREE.Vector2((ae-N.min.y)/K.y,(re-N.min.z)/K.z),new THREE.Vector2((oe-N.min.y)/K.y,(q-N.min.z)/K.z),new THREE.Vector2((v-N.min.y)/K.y,(u-N.min.z)/K.z),new THREE.Vector2((m-N.min.y)/K.y,(S-N.min.z)/K.z)]}}},g=function(){j.clear()}},949:function(L,D,C){var G=A=>{var g={};return C.d(g,A),g},j=A=>()=>A;L.exports=G({ACESFilmicToneMapping:()=>B.ACESFilmicToneMapping,AdditiveBlending:()=>B.AdditiveBlending,AxesHelper:()=>B.AxesHelper,Box3:()=>B.Box3,Camera:()=>B.Camera,CineonToneMapping:()=>B.CineonToneMapping,Clock:()=>B.Clock,Color:()=>B.Color,Euler:()=>B.Euler,Group:()=>B.Group,Layers:()=>B.Layers,LinearEncoding:()=>B.LinearEncoding,LinearFilter:()=>B.LinearFilter,LinearToneMapping:()=>B.LinearToneMapping,Matrix4:()=>B.Matrix4,Mesh:()=>B.Mesh,MeshBasicMaterial:()=>B.MeshBasicMaterial,NoToneMapping:()=>B.NoToneMapping,PerspectiveCamera:()=>B.PerspectiveCamera,PlaneGeometry:()=>B.PlaneGeometry,Points:()=>B.Points,REVISION:()=>B.REVISION,RGBAFormat:()=>B.RGBAFormat,Raycaster:()=>B.Raycaster,ReinhardToneMapping:()=>B.ReinhardToneMapping,Scene:()=>B.Scene,ShaderMaterial:()=>B.ShaderMaterial,Sprite:()=>B.Sprite,SpriteMaterial:()=>B.SpriteMaterial,UniformsUtils:()=>B.UniformsUtils,UnsignedByteType:()=>B.UnsignedByteType,Vector2:()=>B.Vector2,Vector3:()=>B.Vector3,WebGLMultisampleRenderTarget:()=>B.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>B.WebGLRenderTarget,WebGLRenderer:()=>B.WebGLRenderer,sRGBEncoding:()=>B.sRGBEncoding})},568:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A,g,z,X,O,U,k){try{var c=A[U](k),Q=c.value}catch(te){z(te);return}c.done?g(Q):Promise.resolve(Q).then(X,O)}function j(A){return function(){var g=this,z=arguments;return new Promise(function(X,O){var U=A.apply(g,z);function k(Q){G(U,X,O,k,c,"next",Q)}function c(Q){G(U,X,O,k,c,"throw",Q)}k(void 0)})}}},924:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j,A,g){return A in j?Object.defineProperty(j,A,{value:g,enumerable:!0,configurable:!0,writable:!0}):j[A]=g,j}},42:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(924);function j(A){for(var g=1;g<arguments.length;g++){var z=arguments[g]!=null?arguments[g]:{},X=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(z).filter(function(O){return Object.getOwnPropertyDescriptor(z,O).enumerable}))),X.forEach(function(O){(0,G.Z)(A,O,z[O])})}return A}}},Fe={};function V(L){var D=Fe[L];if(D!==void 0)return D.exports;var C=Fe[L]={exports:{}};return qt[L](C,C.exports,V),C.exports}(function(){V.n=function(L){var D=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(D,{a:D}),D}})(),function(){V.d=function(L,D){for(var C in D)V.o(D,C)&&!V.o(L,C)&&Object.defineProperty(L,C,{enumerable:!0,get:D[C]})}}(),function(){V.o=function(L,D){return Object.prototype.hasOwnProperty.call(L,D)}}();var _e={};(function(){V.d(_e,{L6:function(){return zt},sb:function(){return f},z:function(){return Ee},ZP:function(){return Ee}});function L(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=V(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function A(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function g(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function z(n){if(Array.isArray(n))return g(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){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 U(n,t){if(!!n){if(typeof n=="string")return g(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(n,t)}}function k(n){return z(n)||X(n)||U(n)||O()}var c=V(949),Q=V(187),te=n=>{var t={};return V.d(t,n),t},ae=n=>()=>n,re=te({default:()=>Gt.default}),Y=n=>{var t={};return V.d(t,n),t},oe=n=>()=>n,q=Y({default:()=>Ut.default}),W=n=>{var t={};return V.d(t,n),t},v=n=>()=>n,u=W({default:()=>Ft.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=r.guiParams[a];Object.keys(l).forEach(function(s){var d=l[s],x=d.min,y=d.max,b=d.step,P=d.name,T=d.paramMap,F=d.items,I=d.value,H=d.target,le=s.toLowerCase().indexOf("color")>-1,Z,ce=typeof I=="undefined"&&H,he=ce?H():l[s],me=ce?s:"value";F?Z=o.add(he,me,F):le?Z=o.addColor(he,me):Z=o.add(he,me),Z=Z.name(P||s),typeof x!="undefined"&&(Z=Z.min(x)),typeof y!="undefined"&&(Z=Z.max(y)),typeof b!="undefined"&&(Z=Z.step(b)),Z=Z.onChange(function(){r.setTargetValue(a,s,he[me],T)}),ce&&Z.listen()})})},t.setTargetValue=function(e,r,a,o){var l=this.guiParams[e][r],s=l.onChange,d=l.target,x=l.value,y=r.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&d;if(d&&!b){var P=d();Array.isArray(P)||(P=[P]),P.forEach(function(T){if(!!T)if(y)try{T[o||r].set(a)}catch(F){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else T[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,a,o.value,o.paramMap)})})},n}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},w=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,d=a.antialias,x=a.powerPreference,y=a.toneMapping,b=a.toneMappingExposure,P=a.outputEncoding,T=a.logarithmicDepthBuffer,F=a.preserveDrawingBuffer,I=new c.WebGLRenderer({context:o,alpha:l,antialias:d,powerPreference:x,logarithmicDepthBuffer:T,preserveDrawingBuffer:F});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=m[y],I.toneMappingExposure=b,I.outputEncoding=P,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),E={fov:45,near:1,far:1e3},$=function(){"use strict";function n(i){L(this,n),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,a=i.cameraParams;if(a instanceof c.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,l=a.far,s=a.near,d=new c.PerspectiveCamera(o,e/r,s,l);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var t=n.prototype;return t.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},t.setSize=function(e,r){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new f({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(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),N=V(521),K={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,N.wf)(r)})},n}(),de=n=>{var t={};return V.d(t,n),t},ye=n=>()=>n,p=de({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),h={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.domElement,l=a?new p.MapControls(e,o):new p.OrbitControls(e,o);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,d=s===void 0?1/0:s,x=e.minZ,y=x===void 0?-1/0:x,b=e.maxY,P=b===void 0?1/0:b,T=e.minY,F=T===void 0?-1/0:T,I=this.limitPanV||new c.Vector3,H=this.control,le=this.options.camera,Z=new c.Vector3(l,F,y),ce=new c.Vector3(a,P,d);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),M=n=>{var t={};return V.d(t,n),t},R=n=>()=>n,J=M({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,pe=new c.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(T,F){return se.setFromMatrixPosition(T.matrixWorld),pe.setFromMatrixPosition(F.matrixWorld),se.distanceToSquared(pe)},e=function(T){var F=[];return T.traverse(function(I){I.isCSS2DObject&&F.push(I)}),F},r=function(T){for(var F=e(T).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var me=x.objects.get(ce).distanceToCameraSquared,Bt=x.objects.get(he).distanceToCameraSquared;return me-Bt}),I=F.length,H=0,le=F.length;H<le;H++){var Z=F[H].userData.zIndexFix||0;F[H].element.style.zIndex=I-H+Z}},a=this,o,l,s,d,x={objects:new WeakMap},y=t.element!==void 0?t.element:document.createElement("div");y.style.overflow="hidden",this.domElement=y,this.getSize=function(){return{width:o,height:l}},this.render=function(P,T){+c.REVISION<144?(P.autoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.updateMatrixWorld()):(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld()),ie.copy(T.matrixWorldInverse),ue.multiplyMatrices(T.projectionMatrix,ie),b(P,P,T),r(P)},this.setSize=function(P,T){o=P,l=T,s=o/2,d=l/2,y.style.width="".concat(P,"px"),y.style.height="".concat(T,"px")};function b(P,T,F){if(P.isCSS2DObject){ee.setFromMatrixPosition(P.matrixWorld),ee.applyMatrix4(ue);var I=P.visible===!0&&ee.z>=-1&&ee.z<=1&&P.layers.test(F.layers)===!0;if(P.element.style.display=I===!0?"":"none",I===!0){P.onBeforeRender(a,T,F);var H=P.element;H.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*d+d,"px)"),H.parentNode!==y&&y.appendChild(H),P.onAfterRender(a,T,F)}var le={distanceToCameraSquared:i(F,P)};x.objects.set(P,le)}for(var Z=0,ce=P.children.length;Z<ce;Z++)b(P.children[Z],T,F)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){L(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return V.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return V.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return V.d(t,n),t},sr=n=>()=>n,be=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return V.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return V.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return V.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return V.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return V.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,ge=!1,Me=et()!==!1,rt=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -1,13 +1,20 @@
1
1
  import * as THREE from 'three';
2
2
  import BaseObject from '../../core/BaseObject';
3
3
  import type WorkerController from '../../plugins/Worker';
4
+ import Cache from '../../plugins/Cache';
4
5
  declare type Coordinate = [number, number];
5
6
  interface Options {
6
7
  points?: THREE.Vector2[];
7
8
  pointsArr?: THREE.Vector2[][];
8
9
  coordinatesArr?: Coordinate[][];
9
- material: THREE.Material | THREE.Material[];
10
+ material?: THREE.Material | THREE.Material[];
10
11
  depth: number;
12
+ topColor?: string;
13
+ sideMap?: string;
14
+ createCanvasObjectURL?: boolean;
15
+ cache?: Cache;
16
+ materialType?: 'MeshBasicMaterial' | 'MeshStandardMaterial';
17
+ materialOptions?: Record<string, any>;
11
18
  split?: number;
12
19
  useGroups?: boolean;
13
20
  workerController?: WorkerController;
@@ -19,6 +26,7 @@ interface Options {
19
26
  export default class extends BaseObject {
20
27
  options: Options;
21
28
  constructor(options: Options);
22
- create(): Promise<unknown> | undefined;
29
+ create(): Promise<unknown>;
30
+ getMaterial(): Promise<THREE.Material | THREE.Material[]>;
23
31
  }
24
32
  export {};