gl-draw 0.0.16 → 0.0.17

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