gl-draw 0.0.9 → 0.0.13

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.
@@ -8,7 +8,6 @@ export default class BaseObject extends GUIObject {
8
8
  key: string;
9
9
  pencil: Pencil;
10
10
  object3d: THREE.Object3D;
11
- isAdd: boolean;
12
11
  userData: Record<string, any>;
13
12
  get parent(): IBaseObject | THREE.Scene;
14
13
  get children(): IBaseObject[];
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){var Fe={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 Fe[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 ct},Pencil:function(){return Ce},default:function(){return Ce}});function O(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}function T(u,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(u,e.key,e)}}function C(u,s,n){return s&&T(u.prototype,s),n&&T(u,n),u}var G=q(42);function A(u,s){var n=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);s&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),n.push.apply(n,e)}return n}function M(u,s){return s=s!=null?s:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(s)):A(Object(s)).forEach(function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(s,n))}),u}function m(u,s){(s==null||s>u.length)&&(s=u.length);for(var n=0,e=new Array(s);n<s;n++)e[n]=u[n];return e}function D(u){if(Array.isArray(u))return m(u)}function V(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}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(u,s){if(!!u){if(typeof u=="string")return m(u,s);var n=Object.prototype.toString.call(u).slice(8,-1);if(n==="Object"&&u.constructor&&(n=u.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(u,s)}}function I(u){return D(u)||V(u)||B(u)||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 u(){O(this,u),this.guiParams={}}var s=u.prototype;return s.showGuiParams=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(t){var a=e.addFolder(t),o=r.guiParams[t];Object.keys(o).forEach(function(i){var d=o[i],y=d.min,_=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():o[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 y!="undefined"&&(Y=Y.min(y)),typeof _!="undefined"&&(Y=Y.max(_)),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 o=this.guiParams[e][r],i=o.onChange,d=o.target,y=o.value,_=r.toLowerCase().indexOf("color")>-1,P=typeof y=="undefined"&&d;if(d&&!P){var R=d();Array.isArray(R)||(R=[R]),R.forEach(function(Z){if(!!Z)if(_)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,o=a===void 0?0:a,i=this,d=this.guiParams[e][r],y=d.to,_=d.paramMap,P=_===void 0?"":_;return new(N()).Tween(this.guiParams[e][r]).to({value:y},o).onUpdate(function(R){i.setGuiTargetValue(e,r,R.value,P)})},u}(),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 u(n){O(this,u),this.options=n;var e=n.width,r=n.height,t=n.rendererParams,a=t.alpha,o=t.devicePixelRatio,i=t.antialias,d=t.powerPreference,y=t.toneMapping,_=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(o),X.autoClear=!1,X.toneMapping=p[y],X.toneMappingExposure=_,X.outputEncoding=P,this.renderer=X}var s=u.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},u}(),E={fov:45,near:1,far:1e3},j=function(){"use strict";function u(n){O(this,u),this.oldCameraPosition=new v.Vector3,this.oldCameraRotation=new v.Euler,this.customCamera=!1,this.options=n;var e=n.isdev,r=n.width,t=n.height,a=n.cameraParams;if(a instanceof v.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,i=a.far,d=a.near,y=new v.PerspectiveCamera(o,r/t,d,i);(!o||!i)&&e&&(console.warn("camera.fov \u9ED8\u8BA4\u503C\u4E3A 45\uFF0C\u65E7\u7248\u672C\u4E3A 12"),console.warn("camera.far \u9ED8\u8BA4\u503C\u4E3A 1000\uFF0C\u65E7\u7248\u672C\u4E3A 20000")),y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var s=u.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)},u}(),z=q(519),ae={background:null},le=function(){"use strict";function u(n){O(this,u),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=u.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},u}(),ce=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.camera,r=n.controlParams,t=n.mapControl,a=r.domElement,o=t?new ce.MapControls(e,a):new ce.OrbitControls(e,a);o.minPolarAngle=Math.PI*.15,o.maxPolarAngle=Math.PI*.85,o.enableDamping=!0,o.dampingFactor=.063,o.autoRotate=!1,o.autoRotateSpeed=-60,o.enableZoom=!0,o.zoomSpeed=.2,this.control=o}var s=u.prototype;return s.limitPan=function(e){var r=e.maxX,t=r===void 0?1/0:r,a=e.minX,o=a===void 0?-1/0:a,i=e.maxZ,d=i===void 0?1/0:i,y=e.minZ,_=y===void 0?-1/0:y,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(o,X,_),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},u}(),h=require("three/examples/jsm/renderers/CSS2DRenderer"),c=require("three/examples/jsm/renderers/CSS3DRenderer"),g={zIndex:"auto"},x=function(){"use strict";function u(n){O(this,u),this.container=n}var s=u.prototype;return s.addRenderer=function(e,r){var t=this.container,a=t.offsetWidth,o=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,o),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},u}(),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 u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(s){return!1}},ht=0,Ue=1,be=!1,Re=oe()!==!1,ke=`varying vec2 vUv;
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],y=d.min,_=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 y!="undefined"&&(Y=Y.min(y)),typeof _!="undefined"&&(Y=Y.max(_)),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,y=u.value,_=r.toLowerCase().indexOf("color")>-1,P=typeof y=="undefined"&&d;if(d&&!P){var R=d();Array.isArray(R)||(R=[R]),R.forEach(function(Z){if(!!Z)if(_)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],y=d.to,_=d.paramMap,P=_===void 0?"":_;return new(N()).Tween(this.guiParams[e][r]).to({value:y},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,y=t.toneMapping,_=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[y],X.toneMappingExposure=_,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.isdev,r=n.width,t=n.height,a=n.cameraParams;if(a instanceof v.Camera)this.camera=a,this.customCamera=!0;else{var u=a.fov,i=a.far,d=a.near,y=new v.PerspectiveCamera(u,r/t,d,i);(!u||!i)&&e&&(console.warn("camera.fov \u9ED8\u8BA4\u503C\u4E3A 45\uFF0C\u65E7\u7248\u672C\u4E3A 12"),console.warn("camera.far \u9ED8\u8BA4\u503C\u4E3A 1000\uFF0C\u65E7\u7248\u672C\u4E3A 20000")),y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}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,y=e.minZ,_=y===void 0?-1/0:y,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=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;
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
- }`,Ve=`uniform sampler2D baseTexture;
9
+ }`,Ie=`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(u,s){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,s)}function Te(u,s){return _e(u,s)}function je(u,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(s&&s.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),s&&Te(u,s)}function Ie(){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(u){return!1}}function we(u){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},we(u)}function Me(u){return we(u)}function Ne(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function He(u){return u&&u.constructor===Symbol?"symbol":typeof u}function Ze(u,s){return s&&(He(s)==="object"||typeof s=="function")?s:Ne(u)}function Ee(u){var s=Ie();return function(){var e=Me(u),r;if(s){var t=Me(this).constructor;r=Reflect.construct(e,arguments,t)}else r=e.apply(this,arguments);return Ze(this,r)}}var Le=require("three/examples/jsm/postprocessing/Pass"),Ae=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Se=function(u){"use strict";je(n,u);var s=Ee(n);function n(r,t,a,o){O(this,n);var i;i=s.call(this),i.strength=t!==void 0?t:1,i.radius=a,i.threshold=o,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 y=Math.round(i.resolution.x/2),_=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),y=Math.round(y/2),_=Math.round(_/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=o,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];y=Math.round(i.resolution.x/2),_=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,_),y=Math.round(y/2),_=Math.round(_/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 o=Math.round(t/2),i=Math.round(a/2);this.renderTargetBright.setSize(o,i);for(var d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(o,i),this.renderTargetsVertical[d].setSize(o,i),this.separableBlurMaterials[d].uniforms.texSize.value=new v.Vector2(o,i),o=Math.round(o/2),i=Math.round(i/2)},e.render=function(t,a,o,i,d){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();var y=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=o.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=o.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);for(var _=this.renderTargetBright,P=0;P<this.nMips;P++)this.fsQuad.material=this.separableBlurMaterials[P],this.separableBlurMaterials[P].uniforms.colorTexture.value=_.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),_=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(o),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=y},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 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 y=Math.round(i.resolution.x/2),_=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),y=Math.round(y/2),_=Math.round(_/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];y=Math.round(i.resolution.x/2),_=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,_),y=Math.round(y/2),_=Math.round(_/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 y=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 _=this.renderTargetBright,P=0;P<this.nMips;P++)this.fsQuad.material=this.separableBlurMaterials[P],this.separableBlurMaterials[P].uniforms.colorTexture.value=_.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),_=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=y},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;
19
19
  void main() {
20
20
  vUv = uv;
21
21
  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 We={threshold:.2,strength:.5,radius:0},Xe=new v.MeshBasicMaterial({color:"black"}),qe=new v.SpriteMaterial({color:"#000"}),Qe=function(){"use strict";function u(n,e){O(this,u),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,o=n.getSize(),i=o.width,d=o.height,y=new Se(new v.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=y;var _=new S.EffectComposer(r);_.renderToScreen=!1,_.addPass(t),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(Ue);var P=new v.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:ke,fragmentShader:Ve,defines:{}}),R=new Q.ShaderPass(P,"baseTexture");R.needsSwap=!0,this.finalPass=R,a.addPass(R)}var s=u.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,o=r.materials;e.traverse(function(i){var d=i;d.material&&a.test(d.layers)===!1&&(o[d.uuid]=d.material,d.material=d.isSprite?qe:Xe)}),t.render(),e.traverse(function(i){var d=i;o[d.uuid]&&(d.material=o[d.uuid],delete o[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={}},u}(),Ye=require("three/examples/jsm/postprocessing/OutlinePass"),Ke={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},$e=function(){"use strict";function u(n,e){O(this,u),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.finalComposer,o=n.getSize(),i=o.width,d=o.height,y=new Ye.OutlinePass(new v.Vector2(i,d),r,t);y.selectedObjects=this.selectedObjects,this.outlinePass=y,a.addPass(y),this.setGui()}var s=u.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=[]},u}();function Je(u,s){if(u==null)return{};var n={},e=Object.keys(u),r,t;for(t=0;t<e.length;t++)r=e[t],!(s.indexOf(r)>=0)&&(n[r]=u[r]);return n}function et(u,s){if(u==null)return{};var n=Je(u,s),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);for(r=0;r<t.length;r++)e=t[r],!(s.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(u,e)||(n[e]=u[e]))}return n}var tt=require("three/examples/jsm/postprocessing/SSRPass"),rt=require("three/examples/jsm/objects/ReflectorForSSRPass"),nt={maxDistance:10,selects:!0},it={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},at=function(){"use strict";function u(n,e){O(this,u),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.renderer,o=n.finalComposer,i=n.getSize(),d=i.width,y=i.height,_=new tt.SSRPass({renderer:a,scene:r,camera:t,width:d,height:y,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,o.addPass(_),this.setGui()}var s=u.prototype;return s.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},it,e),t=r.width,a=r.height,o=et(r,["width","height"]),i=this.composerController,d=i.scene,y=i.getSize(),_=new v.PlaneGeometry(t,a),P=new rt.ReflectorForSSRPass(_,M((0,G.Z)({},o),{textureWidth:y.width,textureHeight:y.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=[]},u}(),st=function(){"use strict";function u(n){O(this,u),this.active=!0,this.options=n;var e=n.renderer,r=n.scene,t=n.camera,a=this.createRenderTarget(),o=new S.EffectComposer(e,a);o.setPixelRatio(e.getPixelRatio()),this.finalComposer=o,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=a,this.camera=t}var s=u.prototype;return s.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,a=e.encoding,o=this.getSize(),i={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat,encoding:a,type:t},d;if(+v.REVISION<138&&r>0){var y=new v.WebGLMultisampleRenderTarget(o.width,o.height,i);y.samples=r,d=y}else if(+v.REVISION>=138&&r>0){var _=new v.WebGLRenderTarget(o.width,o.height,M((0,G.Z)({},i),{samples:r}));d=_}else{var P=new v.WebGLRenderTarget(o.width,o.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,o=new J.SMAAPass(r*a.getPixelRatio(),t*a.getPixelRatio());this.finalComposer.addPass(o),this.smaaPass=o},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 Qe(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},s.addOutlinePass=function(e){var r=new $e(this,e);r.disable(),this.options.gui&&r.outlineGui.showGuiParams(this.options.gui),this.outlineController=r},s.addSSRPass=function(e){var r=new at(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,o;(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(),(y=i.fsQuad)===null||y===void 0||(_=y.material)===null||_===void 0||_.dispose()}),(o=this.renderTarget)===null||o===void 0||o.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},u}(),Ce=function(){"use strict";function u(n){O(this,u),this.raycaster=new v.Raycaster,this.installPlugins=new Map,this.event=new ie.EventEmitter,this.clock=new v.Clock,this.options=F()(u.options,n,{isMergeableObject:z.isPlainObject});var e=this.options,r=e.container,t=e.stats,a=e.gui;if(a){var o=new(f());o.open(!1),this.gui=o}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=u.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 o;(o=e).install.apply(o,[this].concat(I(t))),this.installPlugins.set(e,!0)}},s.init=function(){var e=this,r=this.options,t=r.container,a=r.isdev,o=r.axesHelper,i=r.renderer,d=r.scene,y=r.camera,_=this.getSize(),P=_.width,R=_.height,Z=new j({isdev:a,width:P,height:R,cameraParams:y});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;o&&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,De=void 0;try{for(var xe=pe[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var ft=ze.value,Be=ft.contentRect;e.handeleResize(Be.width,Be.height)}}catch(dt){he=!0,De=dt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(he)throw De}}});Y.observe(t),this.resizeObserver=Y},s.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,a=e.ssr,o=e.renderer,i=e.bloomParams,d=e.outlineParams,y=e.ssrParams,_=e.multisampling,P=o.antialias;P==="msaa"&&!Re&&(P=!1,console.warn("MSAA is not supported on this browser"));var R=new st({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:P==="msaa"?_:0,type:v.UnsignedByteType,encoding:o.outputEncoding}});this.composerController=R,P==="ssaa"&&R.addSSAAPass(),a&&R.addSSRPass(y),r&&R.addBloomPass(i),t&&R.addOutlinePass(d),o.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,o=e.css2DRendererParams,i=e.css3DRendererParams;if(t||a){var d=new x(r);t&&d.addRenderer("css2d",o),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 o=new ge({camera:this.camera,controlParams:{domElement:(a==null?void 0:a.domElement)||this.renderer.domElement},mapControl:t});this.controlController=o}},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,o=t.cameraController,i=t.composerController,d=t.cssRendererController;o==null||o.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=_.resize)===null||P===void 0||P.call(_,{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,o=a.raycaster,i=a.options,d=i.container,y=new v.Vector2,_=d.getBoundingClientRect();if(y.x=(e.clientX-_.left)/(_.right-_.left)*2-1,y.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){o.setFromCamera(y,this.camera);var P=o.intersectObjects(r||this.scene.children,t);if(P.length)return{object:P[0].object,intersects:P}}},s.render=function(){var e,r,t,a,o=this,i=o.renderer,d=o.scene,y=o.camera,_=o.clock;if(!(!i||!d||!y||this.options.staticRender&&!this.cameraController.checkCameraChange())){var P=_.getDelta(),R=_.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,y),(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,o,i,d,y;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(_,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(),(o=this.sceneController)===null||o===void 0||o.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,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(u,[{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}}]),u}();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:We,outline:!1,outlineParams:Ke,css2DRenderer:!1,ssr:!1,ssrParams:nt,css2DRendererParams:(0,G.Z)({},g),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},g),staticPath:"/"};function ot(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function Pe(u,s,n){return ot()?Pe=Reflect.construct:Pe=function(r,t,a){var o=[null];o.push.apply(o,t);var i=Function.bind.apply(r,o),d=new i;return a&&Te(d,a.prototype),d},Pe.apply(null,arguments)}function Ge(u,s,n){return Pe.apply(null,arguments)}var ut=q(484);function lt(){var u=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}),u&&(n.promise=(0,ut.Z)(n.promise,s)),n}var ct=function(u){"use strict";je(n,u);var s=Ee(n);function n(r){O(this,n);var t;return t=s.call(this),t.objecttype__="BaseObject",t.isAdd=!1,t.userData={},t.pm=lt(),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),o=0;o<t;o++)a[o]=arguments[o];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),o=0;o<t;o++)a[o]=arguments[o];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),o=0;o<t;o++)a[o]=arguments[o];var i;return(i=this.object3d).add.apply(i,I(a)),this},e.remove=function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];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(){var t;(t=this.object3d)===null||t===void 0||t.traverse(function(a){(0,z.disposeMesh)(a)})},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 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,y=new Se(new v.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=y;var _=new S.EffectComposer(r);_.renderToScreen=!1,_.addPass(t),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(ke);var P=new v.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.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,y=new Ke.OutlinePass(new v.Vector2(i,d),r,t);y.selectedObjects=this.selectedObjects,this.outlinePass=y,a.addPass(y),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,y=i.height,_=new rt.SSRPass({renderer:a,scene:r,camera:t,width:d,height:y,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),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,y=i.getSize(),_=new v.PlaneGeometry(t,a),P=new nt.ReflectorForSSRPass(_,M((0,G.Z)({},u),{textureWidth:y.width,textureHeight:y.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 y=new v.WebGLMultisampleRenderTarget(u.width,u.height,i);y.samples=r,d=y}else if(+v.REVISION>=138&&r>0){var _=new v.WebGLRenderTarget(u.width,u.height,M((0,G.Z)({},i),{samples:r}));d=_}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(),(y=i.fsQuad)===null||y===void 0||(_=y.material)===null||_===void 0||_.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,y=r.camera,_=this.getSize(),P=_.width,R=_.height,Z=new j({isdev:a,width:P,height:R,cameraParams:y});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,y=e.ssrParams,_=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"?_:0,type:v.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=R,P==="ssaa"&&R.addSSAAPass(),a&&R.addSSRPass(y),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=_.resize)===null||P===void 0||P.call(_,{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,y=new v.Vector2,_=d.getBoundingClientRect();if(y.x=(e.clientX-_.left)/(_.right-_.left)*2-1,y.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(y,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,y=u.camera,_=u.clock;if(!(!i||!d||!y||this.options.staticRender&&!this.cameraController.checkCameraChange())){var P=_.getDelta(),R=_.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,y),(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,y;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(_,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,(y=this.gui)===null||y===void 0||y.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){console.log(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(){console.log(this),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})();
@@ -1,6 +1,6 @@
1
- (function(){var Me={666:function(A){var C=function(b){"use strict";var L=Object.prototype,M=L.hasOwnProperty,T,S=typeof Symbol=="function"?Symbol:{},R=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",W=S.toStringTag||"@@toStringTag";function k(l,s,f){return Object.defineProperty(l,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{k({},"")}catch(l){k=function(s,f,y){return s[f]=y}}function $(l,s,f,y){var d=s&&s.prototype instanceof O?s:O,V=Object.create(d.prototype),X=new de(y||[]);return V._invoke=K(l,f,X),V}b.wrap=$;function H(l,s,f){try{return{type:"normal",arg:l.call(s,f)}}catch(y){return{type:"throw",arg:y}}}var B="suspendedStart",c="suspendedYield",ie="executing",U="completed",z={};function O(){}function D(){}function G(){}var q={};k(q,R,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(le([])));te&&te!==L&&M.call(te,R)&&(q=te);var Q=G.prototype=O.prototype=Object.create(q);D.prototype=G,k(Q,"constructor",G),k(G,"constructor",D),D.displayName=k(G,W,"GeneratorFunction");function re(l){["next","throw","return"].forEach(function(s){k(l,s,function(f){return this._invoke(s,f)})})}b.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===D||(s.displayName||s.name)==="GeneratorFunction":!1},b.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,G):(l.__proto__=G,k(l,W,"GeneratorFunction")),l.prototype=Object.create(Q),l},b.awrap=function(l){return{__await:l}};function oe(l,s){function f(V,X,N,J){var Y=H(l[V],l,X);if(Y.type==="throw")J(Y.arg);else{var me=Y.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,N,J)},function(ae){f("throw",ae,N,J)}):s.resolve(ue).then(function(ae){me.value=ae,N(me)},function(ae){return f("throw",ae,N,J)})}}var y;function d(V,X){function N(){return new s(function(J,Y){f(V,X,J,Y)})}return y=y?y.then(N,N):N()}this._invoke=d}re(oe.prototype),k(oe.prototype,Z,function(){return this}),b.AsyncIterator=oe,b.async=function(l,s,f,y,d){d===void 0&&(d=Promise);var V=new oe($(l,s,f,y),d);return b.isGeneratorFunction(s)?V:V.next().then(function(X){return X.done?X.value:V.next()})};function K(l,s,f){var y=B;return function(V,X){if(y===ie)throw new Error("Generator is already running");if(y===U){if(V==="throw")throw X;return ye()}for(f.method=V,f.arg=X;;){var N=f.delegate;if(N){var J=se(N,f);if(J){if(J===z)continue;return J}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(y===B)throw y=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);y=ie;var Y=H(l,s,f);if(Y.type==="normal"){if(y=f.done?U:c,Y.arg===z)continue;return{value:Y.arg,done:f.done}}else Y.type==="throw"&&(y=U,f.method="throw",f.arg=Y.arg)}}}function se(l,s){var f=l.iterator[s.method];if(f===T){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=T,se(l,s),s.method==="throw"))return z;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var y=H(f,l.iterator,s.arg);if(y.type==="throw")return s.method="throw",s.arg=y.arg,s.delegate=null,z;var d=y.arg;if(!d)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,z;if(d.done)s[l.resultName]=d.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=T);else return d;return s.delegate=null,z}re(Q),k(Q,W,"Generator"),k(Q,R,function(){return this}),k(Q,"toString",function(){return"[object Generator]"});function pe(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function ve(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function de(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(pe,this),this.reset(!0)}b.keys=function(l){var s=[];for(var f in l)s.push(f);return s.reverse(),function y(){for(;s.length;){var d=s.pop();if(d in l)return y.value=d,y.done=!1,y}return y.done=!0,y}};function le(l){if(l){var s=l[R];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var f=-1,y=function d(){for(;++f<l.length;)if(M.call(l,f))return d.value=l[f],d.done=!1,d;return d.value=T,d.done=!0,d};return y.next=y}}return{next:ye}}b.values=le;function ye(){return{value:T,done:!0}}return de.prototype={constructor:de,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(ve),!l)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=T)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function f(J,Y){return V.type="throw",V.arg=l,s.next=J,Y&&(s.method="next",s.arg=T),!!Y}for(var y=this.tryEntries.length-1;y>=0;--y){var d=this.tryEntries[y],V=d.completion;if(d.tryLoc==="root")return f("end");if(d.tryLoc<=this.prev){var X=M.call(d,"catchLoc"),N=M.call(d,"finallyLoc");if(X&&N){if(this.prev<d.catchLoc)return f(d.catchLoc,!0);if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else if(X){if(this.prev<d.catchLoc)return f(d.catchLoc,!0)}else if(N){if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var f=this.tryEntries.length-1;f>=0;--f){var y=this.tryEntries[f];if(y.tryLoc<=this.prev&&M.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var d=y;break}}d&&(l==="break"||l==="continue")&&d.tryLoc<=s&&s<=d.finallyLoc&&(d=null);var V=d?d.completion:{};return V.type=l,V.arg=s,d?(this.method="next",this.next=d.finallyLoc,z):this.complete(V)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),z},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===l)return this.complete(f.completion,f.afterLoc),ve(f),z}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===l){var y=f.completion;if(y.type==="throw"){var d=y.arg;ve(f)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,f){return this.delegate={iterator:le(l),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=T),z}},b}(A.exports);try{regeneratorRuntime=C}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,b){"use strict";b.d(C,{Z:function(){return L}});function L(M){if(M.geometry&&M.geometry.dispose(),M.material){var T=Array.isArray(M.material)?M.material:[M.material];T.forEach(function(S){var R,Z,W,k,$,H,B,c,ie,U,z,O,D;(R=S.map)===null||R===void 0||R.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(W=S.bumpMap)===null||W===void 0||W.dispose(),(k=S.normalMap)===null||k===void 0||k.dispose(),($=S.specularMap)===null||$===void 0||$.dispose(),(H=S.envMap)===null||H===void 0||H.dispose(),(B=S.alphaMap)===null||B===void 0||B.dispose(),(c=S.aoMap)===null||c===void 0||c.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(U=S.emissiveMap)===null||U===void 0||U.dispose(),(z=S.gradientMap)===null||z===void 0||z.dispose(),(O=S.metalnessMap)===null||O===void 0||O.dispose(),(D=S.roughnessMap)===null||D===void 0||D.dispose(),S.dispose()})}}},519:function(A,C,b){"use strict";b.d(C,{disposeMesh:function(){return S.Z}});var L=b(666),M=b.n(L),T=null,S=b(695),R=b(644);function Z(U){if(U.material){var z=Array.isArray(U.material)?U.material:[U.material];z.forEach(function(O){var D,G;(D=O.color)===null||D===void 0||D.convertSRGBToLinear(),(G=O.emissive)===null||G===void 0||G.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=b(568),k=b(924),$=require("idb-keyval"),H=b(484),B=null,c=null,ie=function(){var U=(0,W.Z)(M().mark(function z(O,D){var G,q,ee,te,Q,re;return M().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return G=D.version,K.next=4,(0,$.get)(O);case 4:if(ee=K.sent,!(ee&&ee[G])){K.next=9;break}q=ee[G],K.next=15;break;case 9:return K.next=11,(0,H.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=K.sent,Q=te.res,re=te.err,re||(q=Q,(0,$.set)(O,(0,k.Z)({},G,Q)));case 15:return K.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:O});case 16:case"end":return K.stop()}},z)}));return function(O,D){return U.apply(this,arguments)}}()},484:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var L=b(42);function M(T){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(R){return(0,L.Z)({err:null,res:R},S)}).catch(function(R){return(0,L.Z)({err:R,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});function L(T,S,R,Z,W,k,$){try{var H=T[k]($),B=H.value}catch(c){R(c);return}H.done?S(B):Promise.resolve(B).then(Z,W)}function M(T){return function(){var S=this,R=arguments;return new Promise(function(Z,W){var k=T.apply(S,R);function $(B){L(k,Z,W,$,H,"next",B)}function H(B){L(k,Z,W,$,H,"throw",B)}$(void 0)})}}},924:function(A,C,b){"use strict";b.d(C,{Z:function(){return L}});function L(M,T,S){return T in M?Object.defineProperty(M,T,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[T]=S,M}},42:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var L=b(924);function M(T){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{},Z=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(R).filter(function(W){return Object.getOwnPropertyDescriptor(R,W).enumerable}))),Z.forEach(function(W){(0,L.Z)(T,W,R[W])})}return T}}},Se={};function I(A){var C=Se[A];if(C!==void 0)return C.exports;var b=Se[A]={exports:{}};return Me[A](b,b.exports,I),b.exports}(function(){I.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return I.d(C,{a:C}),C}})(),function(){I.d=function(A,C){for(var b in C)I.o(C,b)&&!I.o(A,b)&&Object.defineProperty(A,b,{enumerable:!0,get:C[b]})}}(),function(){I.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){I.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";I.r(be),I.d(be,{Image:function(){return V},Line:function(){return ke},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Ae},Node:function(){return ue},Text:function(){return s},Video:function(){return Y}});function A(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function b(t,a){return C(t,a)}function L(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&b(t,a)}var M=I(42);function T(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function R(){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(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function W(t){return Z(t)}function k(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,a){return a&&($(a)==="object"||typeof a=="function")?a:k(t)}function B(t){var a=R();return function(){var n=W(t),i;if(a){var e=W(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return H(this,i)}}var c=I(644);function ie(){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(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&b(p,o.prototype),p},U.apply(null,arguments)}function z(t,a,r){return U.apply(null,arguments)}function O(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function D(t,a,r){return a&&O(t.prototype,a),r&&O(t,r),t}function G(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return G(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){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 Q(t,a){if(!!t){if(typeof t=="string")return G(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=I(484);function K(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=I.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],_=p.min,m=p.max,g=p.step,P=p.name,w=p.to,x=p.paramMap,v=p.items,F=p.value,E=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,ce=typeof F=="undefined"&&E,fe=ce?E():u[h],he=ce?h:"value";v?j=o.add(fe,he,v):ge?j=o.addColor(fe,he):j=o.add(fe,he),j=j.name(P||h),typeof _!="undefined"&&(j=j.min(_)),typeof m!="undefined"&&(j=j.max(m)),typeof g!="undefined"&&(j=j.step(g)),j=j.onChange(function(){i.setGuiTargetValue(e,h,fe[he],x)}),(w||ce)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,_=u.value,m=i.toLowerCase().indexOf("color")>-1,g=typeof _=="undefined"&&p;if(p&&!g){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(m)try{w[o||i].set(e)}catch(x){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],_=p.to,m=p.paramMap,g=m===void 0?"":m;return new(pe()).Tween(this.guiParams[n][i]).to({value:_},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,g)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),le=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=I(519),l=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.isAdd=!1,e.userData={},e.pm=K(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=z(c.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=z(c.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new le.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new le.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new c.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){var e;(e=this.object3d)===null||e===void 0||e.traverse(function(o){(0,ye.disposeMesh)(o)})},D(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),s=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,_=e.sizeAttenuation;if(h){var m=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:_}));this.object3d=m}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),P=new c.PlaneGeometry(1,1,1,1);this.createMesh(P,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,_=u.fontFamily,m=u.fontWeight,g=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var x=w.getContext("2d");x.font="".concat(m," ").concat(p,"px/1 ").concat(_);var v=x.measureText(h).width;w.width=v,this.width=v,x=w.getContext("2d"),x.clearRect(0,0,w.width,w.height),g&&x.scale(-1,1),x.font="".concat(m," ").concat(p,"px/1 ").concat(_),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(h,g?v*-1:0,w.height/2),x.restore();var F=new c.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=F,E.material.needsUpdate=!0,E.scale.set(F.image.width*P,F.image.height*P,1)},r}(l),f=I(568),y=I(666),d=I.n(y),V=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(d().mark(function o(){var u,h,p,_,m,g,P,w,x,v;return d().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return u=e.options,h=u.transparent,p=u.blending,_=u.src,m=u.depthWrite,g=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,E.next=3,new c.TextureLoader().loadAsync(_);case 3:return x=E.sent,v=P?new c.SpriteMaterial({map:x,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new c.MeshBasicMaterial({map:x,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),E.abrupt("return",v);case 6:case"end":return E.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(d().mark(function o(){var u,h,p,_,m,g,P,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,m=u.cache,g=u.sprite,!(m&&!m.get(_))){v.next=7;break}return m.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,m.set(_,P);case 7:if(!m){v.next=13;break}return v.next=10,m.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(l);function X(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=W(t),t!==null););return t}function N(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?N=Reflect.get:N=function(i,e,o){var u=X(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},N(t,a,r)}function J(t,a,r){return N(t,a,r)}var Y=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,_=e.format,m=e.autoPlay,g=e.loop,P=e.alphaTest,w=e.sprite,x=K(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new c.VideoTexture(v);F.format=_!=null?_:c.RGBAFormat,F.needsUpdate=!0;var E=w?new c.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new c.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});x.resolve(E)},!1),v.src=o,v.muted=!0,v.autoplay=m,v.loop=g,v.preload="auto",x.promise},n.create=function(){var e=this;return(0,f.Z)(d().mark(function o(){var u,h,p,_,m,g,P,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,m=u.cache,g=u.sprite,!(m&&!m.get(_))){v.next=7;break}return m.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,m.set(_,P);case 7:if(!m){v.next=13;break}return v.next=10,m.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),J(W(r.prototype),"dispose",this).call(this)},r}(l),me=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=document.createElement("div");h.appendChild(u),this.createCSS2DObject(h),o&&this.object3d.position.copy(o)},n.getMaterial=function(e){return(0,f.Z)(d().mark(function o(){var u,h,p,_;return d().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new c.CanvasTexture(u),_=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",_);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new c.Vector3(1,1,1):h,_=e.position,m=_===void 0?new c.Vector3(0,0,0):_,g=e.cache,P=this;return(0,f.Z)(d().mark(function w(){var x,v,F,E;return d().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(x="node-create-pick-object",!(g&&!g.get(x))){j.next=7;break}return g.init(x),j.next=5,P.getMaterial(u);case 5:v=j.sent,g.set(x,v);case 7:if(!g){j.next=13;break}return j.next=10,g.get(x);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,E=new c.Sprite(F),E.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),E.position.copy(m),P.add(E),P.pickObject=E;case 22:case"end":return j.stop()}},w)}))()},r}(l),ue=me,ae=`
2
- `.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
3
- `).concat(c.ShaderChunk.fog_pars_vertex,`
1
+ (function(){var Me={666:function(A){var C=function(b){"use strict";var E=Object.prototype,M=E.hasOwnProperty,k,S=typeof Symbol=="function"?Symbol:{},z=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",R=S.toStringTag||"@@toStringTag";function L(c,s,f){return Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[s]}try{L({},"")}catch(c){L=function(s,f,d){return s[f]=d}}function I(c,s,f,d){var m=s&&s.prototype instanceof x?s:x,T=Object.create(m.prototype),Y=new de(d||[]);return T._invoke=J(c,f,Y),T}b.wrap=I;function $(c,s,f){try{return{type:"normal",arg:c.call(s,f)}}catch(d){return{type:"throw",arg:d}}}var G="suspendedStart",l="suspendedYield",ie="executing",U="completed",B={};function x(){}function V(){}function D(){}var q={};L(q,z,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(ce([])));te&&te!==E&&M.call(te,z)&&(q=te);var Q=D.prototype=x.prototype=Object.create(q);V.prototype=D,L(Q,"constructor",D),L(D,"constructor",V),V.displayName=L(D,R,"GeneratorFunction");function re(c){["next","throw","return"].forEach(function(s){L(c,s,function(f){return this._invoke(s,f)})})}b.isGeneratorFunction=function(c){var s=typeof c=="function"&&c.constructor;return s?s===V||(s.displayName||s.name)==="GeneratorFunction":!1},b.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,D):(c.__proto__=D,L(c,R,"GeneratorFunction")),c.prototype=Object.create(Q),c},b.awrap=function(c){return{__await:c}};function oe(c,s){function f(T,Y,K,H){var X=$(c[T],c,Y);if(X.type==="throw")H(X.arg);else{var me=X.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,K,H)},function(ae){f("throw",ae,K,H)}):s.resolve(ue).then(function(ae){me.value=ae,K(me)},function(ae){return f("throw",ae,K,H)})}}var d;function m(T,Y){function K(){return new s(function(H,X){f(T,Y,H,X)})}return d=d?d.then(K,K):K()}this._invoke=m}re(oe.prototype),L(oe.prototype,Z,function(){return this}),b.AsyncIterator=oe,b.async=function(c,s,f,d,m){m===void 0&&(m=Promise);var T=new oe(I(c,s,f,d),m);return b.isGeneratorFunction(s)?T:T.next().then(function(Y){return Y.done?Y.value:T.next()})};function J(c,s,f){var d=G;return function(T,Y){if(d===ie)throw new Error("Generator is already running");if(d===U){if(T==="throw")throw Y;return ye()}for(f.method=T,f.arg=Y;;){var K=f.delegate;if(K){var H=se(K,f);if(H){if(H===B)continue;return H}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d===G)throw d=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d=ie;var X=$(c,s,f);if(X.type==="normal"){if(d=f.done?U:l,X.arg===B)continue;return{value:X.arg,done:f.done}}else X.type==="throw"&&(d=U,f.method="throw",f.arg=X.arg)}}}function se(c,s){var f=c.iterator[s.method];if(f===k){if(s.delegate=null,s.method==="throw"){if(c.iterator.return&&(s.method="return",s.arg=k,se(c,s),s.method==="throw"))return B;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var d=$(f,c.iterator,s.arg);if(d.type==="throw")return s.method="throw",s.arg=d.arg,s.delegate=null,B;var m=d.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,B;if(m.done)s[c.resultName]=m.value,s.next=c.nextLoc,s.method!=="return"&&(s.method="next",s.arg=k);else return m;return s.delegate=null,B}re(Q),L(Q,R,"Generator"),L(Q,z,function(){return this}),L(Q,"toString",function(){return"[object Generator]"});function pe(c){var s={tryLoc:c[0]};1 in c&&(s.catchLoc=c[1]),2 in c&&(s.finallyLoc=c[2],s.afterLoc=c[3]),this.tryEntries.push(s)}function ve(c){var s=c.completion||{};s.type="normal",delete s.arg,c.completion=s}function de(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(pe,this),this.reset(!0)}b.keys=function(c){var s=[];for(var f in c)s.push(f);return s.reverse(),function d(){for(;s.length;){var m=s.pop();if(m in c)return d.value=m,d.done=!1,d}return d.done=!0,d}};function ce(c){if(c){var s=c[z];if(s)return s.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,d=function m(){for(;++f<c.length;)if(M.call(c,f))return m.value=c[f],m.done=!1,m;return m.value=k,m.done=!0,m};return d.next=d}}return{next:ye}}b.values=ce;function ye(){return{value:k,done:!0}}return de.prototype={constructor:de,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=k,this.done=!1,this.delegate=null,this.method="next",this.arg=k,this.tryEntries.forEach(ve),!c)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=k)},stop:function(){this.done=!0;var c=this.tryEntries[0],s=c.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var s=this;function f(H,X){return T.type="throw",T.arg=c,s.next=H,X&&(s.method="next",s.arg=k),!!X}for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d],T=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var Y=M.call(m,"catchLoc"),K=M.call(m,"finallyLoc");if(Y&&K){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(Y){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(K){if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(c,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&M.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var m=d;break}}m&&(c==="break"||c==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var T=m?m.completion:{};return T.type=c,T.arg=s,m?(this.method="next",this.next=m.finallyLoc,B):this.complete(T)},complete:function(c,s){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&s&&(this.next=s),B},finish:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===c)return this.complete(f.completion,f.afterLoc),ve(f),B}},catch:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===c){var d=f.completion;if(d.type==="throw"){var m=d.arg;ve(f)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(c,s,f){return this.delegate={iterator:ce(c),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=k),B}},b}(A.exports);try{regeneratorRuntime=C}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,b){"use strict";b.d(C,{Z:function(){return E}});function E(M){if(M.geometry&&M.geometry.dispose(),M.material){var k=Array.isArray(M.material)?M.material:[M.material];k.forEach(function(S){var z,Z,R,L,I,$,G,l,ie,U,B,x,V;(z=S.map)===null||z===void 0||z.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(R=S.bumpMap)===null||R===void 0||R.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),(I=S.specularMap)===null||I===void 0||I.dispose(),($=S.envMap)===null||$===void 0||$.dispose(),(G=S.alphaMap)===null||G===void 0||G.dispose(),(l=S.aoMap)===null||l===void 0||l.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(U=S.emissiveMap)===null||U===void 0||U.dispose(),(B=S.gradientMap)===null||B===void 0||B.dispose(),(x=S.metalnessMap)===null||x===void 0||x.dispose(),(V=S.roughnessMap)===null||V===void 0||V.dispose(),S.dispose()})}}},519:function(A,C,b){"use strict";b.d(C,{disposeMesh:function(){return S.Z}});var E=b(666),M=b.n(E),k=null,S=b(695),z=b(644);function Z(U){if(U.material){var B=Array.isArray(U.material)?U.material:[U.material];B.forEach(function(x){var V,D;(V=x.color)===null||V===void 0||V.convertSRGBToLinear(),(D=x.emissive)===null||D===void 0||D.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=b(568),L=b(924),I=require("idb-keyval"),$=b(484),G=null,l=null,ie=function(){var U=(0,R.Z)(M().mark(function B(x,V){var D,q,ee,te,Q,re;return M().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return D=V.version,J.next=4,(0,I.get)(x);case 4:if(ee=J.sent,!(ee&&ee[D])){J.next=9;break}q=ee[D],J.next=15;break;case 9:return J.next=11,(0,$.Z)(fetch(x).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=J.sent,Q=te.res,re=te.err,re||(q=Q,(0,I.set)(x,(0,L.Z)({},D,Q)));case 15:return J.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:x});case 16:case"end":return J.stop()}},B)}));return function(x,V){return U.apply(this,arguments)}}()},484:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var E=b(42);function M(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k.then(function(z){return(0,E.Z)({err:null,res:z},S)}).catch(function(z){return(0,E.Z)({err:z,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});function E(k,S,z,Z,R,L,I){try{var $=k[L](I),G=$.value}catch(l){z(l);return}$.done?S(G):Promise.resolve(G).then(Z,R)}function M(k){return function(){var S=this,z=arguments;return new Promise(function(Z,R){var L=k.apply(S,z);function I(G){E(L,Z,R,I,$,"next",G)}function $(G){E(L,Z,R,I,$,"throw",G)}I(void 0)})}}},924:function(A,C,b){"use strict";b.d(C,{Z:function(){return E}});function E(M,k,S){return k in M?Object.defineProperty(M,k,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[k]=S,M}},42:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var E=b(924);function M(k){for(var S=1;S<arguments.length;S++){var z=arguments[S]!=null?arguments[S]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(R){return Object.getOwnPropertyDescriptor(z,R).enumerable}))),Z.forEach(function(R){(0,E.Z)(k,R,z[R])})}return k}}},Se={};function N(A){var C=Se[A];if(C!==void 0)return C.exports;var b=Se[A]={exports:{}};return Me[A](b,b.exports,N),b.exports}(function(){N.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return N.d(C,{a:C}),C}})(),function(){N.d=function(A,C){for(var b in C)N.o(C,b)&&!N.o(A,b)&&Object.defineProperty(A,b,{enumerable:!0,get:C[b]})}}(),function(){N.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){N.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";N.r(be),N.d(be,{Image:function(){return Y},Line:function(){return Le},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Ae},Node:function(){return ae},Text:function(){return f},Video:function(){return me}});function A(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function b(t,a){return C(t,a)}function E(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&b(t,a)}var M=N(42);function k(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):k(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function z(){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(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function R(t){return Z(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function I(t){return t&&t.constructor===Symbol?"symbol":typeof t}function $(t,a){return a&&(I(a)==="object"||typeof a=="function")?a:L(t)}function G(t){var a=z();return function(){var n=R(t),i;if(a){var e=R(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return $(this,i)}}var l=N(644);function ie(){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(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&b(p,o.prototype),p},U.apply(null,arguments)}function B(t,a,r){return U.apply(null,arguments)}function x(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function V(t,a,r){return a&&x(t.prototype,a),r&&x(t,r),t}function D(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return D(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){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 Q(t,a){if(!!t){if(typeof t=="string")return D(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=N(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=N.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],_=p.min,y=p.max,g=p.step,P=p.name,w=p.to,O=p.paramMap,v=p.items,F=p.value,W=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,le=typeof F=="undefined"&&W,he=le?W():u[h],fe=le?h:"value";v?j=o.add(he,fe,v):ge?j=o.addColor(he,fe):j=o.add(he,fe),j=j.name(P||h),typeof _!="undefined"&&(j=j.min(_)),typeof y!="undefined"&&(j=j.max(y)),typeof g!="undefined"&&(j=j.step(g)),j=j.onChange(function(){i.setGuiTargetValue(e,h,he[fe],O)}),(w||le)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,_=u.value,y=i.toLowerCase().indexOf("color")>-1,g=typeof _=="undefined"&&p;if(p&&!g){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(y)try{w[o||i].set(e)}catch(O){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],_=p.to,y=p.paramMap,g=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:_},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,g)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),ce=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=N(519),c=function(t){console.log(t),t&&((0,ye.disposeMesh)(t),t.children.forEach(function(a){a.userData.BaseObject_||c(a)}))},s=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.userData={},e.pm=J(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new ce.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new ce.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new l.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){console.log(this),c(this.object3d)},V(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),f=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,_=e.sizeAttenuation;if(h){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:_}));this.object3d=y}else{var g=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),P=new l.PlaneGeometry(1,1,1,1);this.createMesh(P,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,_=u.fontFamily,y=u.fontWeight,g=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var O=w.getContext("2d");O.font="".concat(y," ").concat(p,"px/1 ").concat(_);var v=O.measureText(h).width;w.width=v,this.width=v,O=w.getContext("2d"),O.clearRect(0,0,w.width,w.height),g&&O.scale(-1,1),O.font="".concat(y," ").concat(p,"px/1 ").concat(_),O.textBaseline="middle",O.fillStyle="#ffffff",O.fillText(h,g?v*-1:0,w.height/2),O.restore();var F=new l.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var W=this.object3d;W.material.map&&W.material.map.dispose(),W.material.map=F,W.material.needsUpdate=!0,W.scale.set(F.image.width*P,F.image.height*P,1)},r}(s),d=N(568),m=N(666),T=N.n(m),Y=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,h,p,_,y,g,P,w,O,v;return T().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=e.options,h=u.transparent,p=u.blending,_=u.src,y=u.depthWrite,g=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,W.next=3,new l.TextureLoader().loadAsync(_);case 3:return O=W.sent,v=P?new l.SpriteMaterial({map:O,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new l.MeshBasicMaterial({map:O,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0}),W.abrupt("return",v);case 6:case"end":return W.stop()}},o)}))()},n.create=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,h,p,_,y,g,P,w;return T().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(s);function K(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=R(t),t!==null););return t}function H(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?H=Reflect.get:H=function(i,e,o){var u=K(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},H(t,a,r)}function X(t,a,r){return H(t,a,r)}var me=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,_=e.format,y=e.autoPlay,g=e.loop,P=e.alphaTest,w=e.sprite,O=J(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new l.VideoTexture(v);F.format=_!=null?_:l.RGBAFormat,F.needsUpdate=!0;var W=w?new l.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new l.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});O.resolve(W)},!1),v.src=o,v.muted=!0,v.autoplay=y,v.loop=g,v.preload="auto",O.promise},n.create=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,h,p,_,y,g,P,w;return T().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),X(R(r.prototype),"dispose",this).call(this)},r}(s),ue=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=document.createElement("div");h.appendChild(u),this.createCSS2DObject(h),o&&this.object3d.position.copy(o)},n.getMaterial=function(e){return(0,d.Z)(T().mark(function o(){var u,h,p,_;return T().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new l.CanvasTexture(u),_=new l.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",_);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new l.Vector3(1,1,1):h,_=e.position,y=_===void 0?new l.Vector3(0,0,0):_,g=e.cache,P=this;return(0,d.Z)(T().mark(function w(){var O,v,F,W;return T().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(O="node-create-pick-object",!(g&&!g.get(O))){j.next=7;break}return g.init(O),j.next=5,P.getMaterial(u);case 5:v=j.sent,g.set(O,v);case 7:if(!g){j.next=13;break}return j.next=10,g.get(O);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,W=new l.Sprite(F),W.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),W.position.copy(y),P.add(W),P.pickObject=W;case 22:case"end":return j.stop()}},w)}))()},r}(s),ae=ue,Oe=`
2
+ `.concat(l.ShaderChunk.logdepthbuf_pars_vertex,`
3
+ `).concat(l.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
5
5
  attribute vec3 next;
6
6
  attribute float side;
@@ -91,13 +91,13 @@
91
91
  finalPosition.xy+=offset.xy;
92
92
 
93
93
  gl_Position=finalPosition;
94
- `).concat(c.ShaderChunk.logdepthbuf_vertex,`
94
+ `).concat(l.ShaderChunk.logdepthbuf_vertex,`
95
95
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
96
- `).concat(c.ShaderChunk.fog_vertex,`
96
+ `).concat(l.ShaderChunk.fog_vertex,`
97
97
  }
98
98
  `),xe=`
99
- `.concat(c.ShaderChunk.fog_pars_fragment,`
100
- `).concat(c.ShaderChunk.logdepthbuf_pars_fragment,`
99
+ `.concat(l.ShaderChunk.fog_pars_fragment,`
100
+ `).concat(l.ShaderChunk.logdepthbuf_pars_fragment,`
101
101
 
102
102
 
103
103
  uniform sampler2D map;
@@ -117,7 +117,7 @@ varying vec4 vColor;
117
117
  varying float vCounters;
118
118
 
119
119
  void main() {
120
- `).concat(c.ShaderChunk.logdepthbuf_fragment,`
120
+ `).concat(l.ShaderChunk.logdepthbuf_fragment,`
121
121
  vec4 c = vColor;
122
122
  if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
123
123
  if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
@@ -127,6 +127,6 @@ void main() {
127
127
  }
128
128
  gl_FragColor = c;
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
- `).concat(c.ShaderChunk.fog_fragment,`
130
+ `).concat(l.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),ne=function(t){"use strict";L(r,t);var a=B(r);function r(){A(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(k(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Ae(t,a){var r=new c.Matrix4,n=new c.Ray,i=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new c.Vector3,h=new c.Vector3,p=new c.Vector3,_=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var P=m.array,w=g.position.array,x=g.width.array,v=0,F=P.length-1;v<F;v+=_){var E=P[v],ge=P[v+1];u.fromArray(w,E*3),h.fromArray(w,ge*3);var j=x[Math.floor(v/3)]!==void 0?x[Math.floor(v/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*j/2,fe=ce*ce,he=n.distanceSqToSegment(u,h,e,p);if(!(he>fe)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Ae,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=ae,c.ShaderChunk.meshline_frag=xe;var we=function(t){"use strict";L(r,t);var a=B(r);function r(n){A(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(k(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(c.ShaderMaterial);we.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Oe(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Ce(t,a){if(t==null)return{};var r=Oe(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var je={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Te=function(t){"use strict";L(r,t);var a=B(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=a.call(this),e.geometry=new c.BufferGeometry,e.meshline=new ne,e.options=(0,M.Z)({},je,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,_=e.setPointWidth,m=Ce(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),P=g.width,w=g.height;delete m.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,_);var x=new we(S((0,M.Z)({},m),{resolution:new c.Vector2(P,w)}));this.material=x,this.createMesh(this.meshline,x)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,_=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&_.onComplete(h),_.start(),this.tween=_},n.dispose=function(){this.tween&&pe().remove(this.tween)},r}(l),ke=Te})(),module.exports=be})();
132
+ `),ne=function(t){"use strict";E(r,t);var a=G(r);function r(){A(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new l.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(l.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof l.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Ae(t,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new l.Vector3,h=new l.Vector3,p=new l.Vector3,_=this instanceof l.LineSegments?2:1,y=o.index,g=o.attributes;if(y!==null)for(var P=y.array,w=g.position.array,O=g.width.array,v=0,F=P.length-1;v<F;v+=_){var W=P[v],ge=P[v+1];u.fromArray(w,W*3),h.fromArray(w,ge*3);var j=O[Math.floor(v/3)]!==void 0?O[Math.floor(v/3)]:1,le=t.params.Line.threshold+this.material.lineWidth*j/2,he=le*le,fe=n.distanceSqToSegment(u,h,e,p);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Ae,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=Oe,l.ShaderChunk.meshline_frag=xe;var we=function(t){"use strict";E(r,t);var a=G(r);function r(n){A(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(l.ShaderMaterial);we.prototype.copy=function(t){return l.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ce(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function je(t,a){if(t==null)return{};var r=Ce(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Te={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},ke=function(t){"use strict";E(r,t);var a=G(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=a.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ne,e.options=(0,M.Z)({},Te,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,_=e.setPointWidth,y=je(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),P=g.width,w=g.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,_);var O=new we(S((0,M.Z)({},y),{resolution:new l.Vector2(P,w)}));this.material=O,this.createMesh(this.meshline,O)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,_=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&_.onComplete(h),_.start(),this.tween=_},n.dispose=function(){X(R(r.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},r}(s),Le=ke})(),module.exports=be})();
@@ -1 +1 @@
1
- (function(){var J={666:function(p){var v=function(s){"use strict";var A=Object.prototype,g=A.hasOwnProperty,d,b=typeof Symbol=="function"?Symbol:{},y=b.iterator||"@@iterator",T=b.asyncIterator||"@@asyncIterator",j=b.toStringTag||"@@toStringTag";function w(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{w({},"")}catch(e){w=function(t,n,f){return t[n]=f}}function R(e,t,n,f){var c=t&&t.prototype instanceof m?t:m,O=Object.create(c.prototype),C=new N(f||[]);return O._invoke=_(e,n,C),O}s.wrap=R;function I(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(f){return{type:"throw",arg:f}}}var D="suspendedStart",W="suspendedYield",z="executing",k="completed",P={};function m(){}function i(){}function o(){}var a={};w(a,y,function(){return this});var r=Object.getPrototypeOf,u=r&&r(r(U([])));u&&u!==A&&g.call(u,y)&&(a=u);var h=o.prototype=m.prototype=Object.create(a);i.prototype=o,w(h,"constructor",o),w(o,"constructor",i),i.displayName=w(o,j,"GeneratorFunction");function l(e){["next","throw","return"].forEach(function(t){w(e,t,function(n){return this._invoke(t,n)})})}s.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===i||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,w(e,j,"GeneratorFunction")),e.prototype=Object.create(h),e},s.awrap=function(e){return{__await:e}};function E(e,t){function n(O,C,M,B){var G=I(e[O],e,C);if(G.type==="throw")B(G.arg);else{var Y=G.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,M,B)},function($){n("throw",$,M,B)}):t.resolve(H).then(function($){Y.value=$,M(Y)},function($){return n("throw",$,M,B)})}}var f;function c(O,C){function M(){return new t(function(B,G){n(O,C,B,G)})}return f=f?f.then(M,M):M()}this._invoke=c}l(E.prototype),w(E.prototype,T,function(){return this}),s.AsyncIterator=E,s.async=function(e,t,n,f,c){c===void 0&&(c=Promise);var O=new E(R(e,t,n,f),c);return s.isGeneratorFunction(t)?O:O.next().then(function(C){return C.done?C.value:O.next()})};function _(e,t,n){var f=D;return function(O,C){if(f===z)throw new Error("Generator is already running");if(f===k){if(O==="throw")throw C;return F()}for(n.method=O,n.arg=C;;){var M=n.delegate;if(M){var B=L(M,n);if(B){if(B===P)continue;return B}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===D)throw f=k,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var G=I(e,t,n);if(G.type==="normal"){if(f=n.done?k:W,G.arg===P)continue;return{value:G.arg,done:n.done}}else G.type==="throw"&&(f=k,n.method="throw",n.arg=G.arg)}}}function L(e,t){var n=e.iterator[t.method];if(n===d){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=d,L(e,t),t.method==="throw"))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var f=I(n,e.iterator,t.arg);if(f.type==="throw")return t.method="throw",t.arg=f.arg,t.delegate=null,P;var c=f.arg;if(!c)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P;if(c.done)t[e.resultName]=c.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return c;return t.delegate=null,P}l(h),w(h,j,"Generator"),w(h,y,function(){return this}),w(h,"toString",function(){return"[object Generator]"});function Z(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(Z,this),this.reset(!0)}s.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function f(){for(;t.length;){var c=t.pop();if(c in e)return f.value=c,f.done=!1,f}return f.done=!0,f}};function U(e){if(e){var t=e[y];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,f=function c(){for(;++n<e.length;)if(g.call(e,n))return c.value=e[n],c.done=!1,c;return c.value=d,c.done=!0,c};return f.next=f}}return{next:F}}s.values=U;function F(){return{value:d,done:!0}}return N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(x),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(B,G){return O.type="throw",O.arg=e,t.next=B,G&&(t.method="next",t.arg=d),!!G}for(var f=this.tryEntries.length-1;f>=0;--f){var c=this.tryEntries[f],O=c.completion;if(c.tryLoc==="root")return n("end");if(c.tryLoc<=this.prev){var C=g.call(c,"catchLoc"),M=g.call(c,"finallyLoc");if(C&&M){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(C){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else if(M){if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var f=this.tryEntries[n];if(f.tryLoc<=this.prev&&g.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var c=f;break}}c&&(e==="break"||e==="continue")&&c.tryLoc<=t&&t<=c.finallyLoc&&(c=null);var O=c?c.completion:{};return O.type=e,O.arg=t,c?(this.method="next",this.next=c.finallyLoc,P):this.complete(O)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),P},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),P}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var f=n.completion;if(f.type==="throw"){var c=f.arg;x(n)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:U(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=d),P}},s}(p.exports);try{regeneratorRuntime=v}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=v:Function("r","regeneratorRuntime = r")(v)}},519:function(p,v,s){"use strict";s.d(v,{makePromiseCreator:function(){return A.Z}});var A=s(282),g=s(666),d=s.n(g),b=null,y=s(644);function T(k){if(k.material){var P=Array.isArray(k.material)?k.material:[k.material];P.forEach(function(m){var i,o;(i=m.color)===null||i===void 0||i.convertSRGBToLinear(),(o=m.emissive)===null||o===void 0||o.convertSRGBToLinear(),m.map&&(m.map.encoding=THREE.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=THREE.sRGBEncoding)})}}var j=s(568),w=s(924),R=require("idb-keyval"),I=s(484),D=null,W=null,z=function(){var k=(0,j.Z)(d().mark(function P(m,i){var o,a,r,u,h,l;return d().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return o=i.version,_.next=4,(0,R.get)(m);case 4:if(r=_.sent,!(r&&r[o])){_.next=9;break}a=r[o],_.next=15;break;case 9:return _.next=11,(0,I.Z)(fetch(m).then(function(L){if(L.ok)return L.blob();throw new Error}));case 11:u=_.sent,h=u.res,l=u.err,l||(a=h,(0,R.set)(m,(0,w.Z)({},o,h)));case 15:return _.abrupt("return",a?{url:URL.createObjectURL(a)}:{url:m});case 16:case"end":return _.stop()}},P)}));return function(m,i){return k.apply(this,arguments)}}()},282:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});var A=s(484);function g(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={};return y.promise=new Promise(function(T,j){y.resolve=T,y.reject=j}),d&&(y.promise=(0,A.Z)(y.promise,b)),y}},484:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});var A=s(42);function g(d){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(y){return(0,A.Z)({err:null,res:y},b)}).catch(function(y){return(0,A.Z)({err:y,res:void 0},b)})}},644:function(p){"use strict";p.exports=require("three")},568:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});function A(d,b,y,T,j,w,R){try{var I=d[w](R),D=I.value}catch(W){y(W);return}I.done?b(D):Promise.resolve(D).then(T,j)}function g(d){return function(){var b=this,y=arguments;return new Promise(function(T,j){var w=d.apply(b,y);function R(D){A(w,T,j,R,I,"next",D)}function I(D){A(w,T,j,R,I,"throw",D)}R(void 0)})}}},924:function(p,v,s){"use strict";s.d(v,{Z:function(){return A}});function A(g,d,b){return d in g?Object.defineProperty(g,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[d]=b,g}},42:function(p,v,s){"use strict";s.d(v,{Z:function(){return g}});var A=s(924);function g(d){for(var b=1;b<arguments.length;b++){var y=arguments[b]!=null?arguments[b]:{},T=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(T=T.concat(Object.getOwnPropertySymbols(y).filter(function(j){return Object.getOwnPropertyDescriptor(y,j).enumerable}))),T.forEach(function(j){(0,A.Z)(d,j,y[j])})}return d}}},X={};function S(p){var v=X[p];if(v!==void 0)return v.exports;var s=X[p]={exports:{}};return J[p](s,s.exports,S),s.exports}(function(){S.n=function(p){var v=p&&p.__esModule?function(){return p.default}:function(){return p};return S.d(v,{a:v}),v}})(),function(){S.d=function(p,v){for(var s in v)S.o(v,s)&&!S.o(p,s)&&Object.defineProperty(p,s,{enumerable:!0,get:v[s]})}}(),function(){S.o=function(p,v){return Object.prototype.hasOwnProperty.call(p,v)}}(),function(){S.r=function(p){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})}}();var K={};(function(){"use strict";S.r(K),S.d(K,{Cache:function(){return s},Draw:function(){return m}});function p(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var v=S(519),s=function(){"use strict";function i(){p(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(r){this.pencil=r},o.init=function(r){var u=(0,v.makePromiseCreator)();this.cache.set(r,u)},o.get=function(r){var u;return(u=this.cache.get(r))===null||u===void 0?void 0:u.promise},o.set=function(r,u){var h=this.cache.get(r);h?h.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,u){r.reject("stop set cache:".concat(u))}),this.cache.clear()},i}(),A=S(568);function g(i,o){for(var a=0;a<o.length;a++){var r=o[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function d(i,o,a){return o&&g(i.prototype,o),a&&g(i,a),i}function b(i){if(Array.isArray(i))return i}function y(i){if(typeof Symbol!="undefined"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(i,o){(o==null||o>i.length)&&(o=i.length);for(var a=0,r=new Array(o);a<o;a++)r[a]=i[a];return r}function w(i,o){if(!!i){if(typeof i=="string")return j(i,o);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return j(i,o)}}function R(i,o){return b(i)||y(i,o)||w(i,o)||T()}function I(i){if(Array.isArray(i))return j(i)}function D(){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 W(i){return I(i)||y(i)||w(i)||D()}var z=S(666),k=S.n(z),P=S(644),m=function(){"use strict";function i(a){p(this,i),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var o=i.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,u=this.objects_;Object.keys(u).forEach(function(h){var l=function(){function E(){p(this,E)}var _=E.prototype;return _.create=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](Z)},E}();r.objectNamesToFactories.set(h,l)})},o.getObject=function(r,u){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,l="".concat(r).concat(h?"#".concat(h):""),E=this.objects.get(l);return E},o.getAllObject=function(r,u){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,l="".concat(r).concat(h?"#".concat(h):""),E=[];return this.objects.forEach(function(_,L){(L.startsWith("".concat(l,"#"))||L===l)&&E.push(_)}),E},o.draw=function(r,u,h){var l=this;return(0,A.Z)(k().mark(function E(){var _,L,Z,x,N,U,F;return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(_=l.objectNamesToFactories.get(r),!_){t.next=15;break}return L=(u||{}).key,Z="".concat(r).concat(L?"#".concat(L):""),l.objects.has(Z)&&(x=P.MathUtils.generateUUID(),Z+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?U=l.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?U=N:U=l.pencil.scene,F=new _().create(u),F.pencil=l.pencil,F.key=Z,l.objects.set(Z,F),t.next=14,l.addMesh(F,U);case 14:return t.abrupt("return",F);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return t.stop()}},E)}))()},o.addMesh=function(r,u){var h=this;return(0,A.Z)(k().mark(function l(){return k().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,r.init();case 2:return _.next=4,r.create();case 4:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.isAdd||(r.isAdd=!0,r.visible=!0),r.render(),h.pencil.gui&&r.showGuiParams(h.pencil.gui),r.pm.resolve();case 9:case"end":return _.stop()}},l)}))()},o.erase=function(){for(var r=arguments.length,u=new Array(r),h=0;h<r;h++)u[h]=arguments[h];var l=this;W(u).forEach(function(E){var _=[];if(typeof E=="string"){var L,Z=R(E.split("#"),2),x=Z[0],N=Z[1];(L=_).push.apply(L,W(l.getAllObject(x,{key:N})))}else _.push(E);_.forEach(function(U){l.removeMesh(U)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(l){l.isAdd&&(l.isAdd=!1,l.visible=!1),l.dispose(),u.objects.delete(l.key)})},o.update=function(r,u){this.objects.forEach(function(h){h.objecttype__==="BaseObject"&&h.update(r,u)})},o.setSize=function(r,u){this.objects.forEach(function(h){h.objecttype__==="BaseObject"&&h.resize(r,u)})},o.dispose=function(){this.objects.forEach(function(r,u){r.objecttype__==="BaseObject"&&(r.dispose(),r.pm.reject("stop draw:".concat(u)))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(i,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),i}()})(),module.exports=K})();
1
+ (function(){var J={666:function(l){var p=function(s){"use strict";var P=Object.prototype,g=P.hasOwnProperty,v,b=typeof Symbol=="function"?Symbol:{},y=b.iterator||"@@iterator",T=b.asyncIterator||"@@asyncIterator",j=b.toStringTag||"@@toStringTag";function w(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{w({},"")}catch(e){w=function(t,n,f){return t[n]=f}}function R(e,t,n,f){var c=t&&t.prototype instanceof m?t:m,O=Object.create(c.prototype),C=new N(f||[]);return O._invoke=d(e,n,C),O}s.wrap=R;function I(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(f){return{type:"throw",arg:f}}}var D="suspendedStart",W="suspendedYield",z="executing",A="completed",k={};function m(){}function i(){}function o(){}var a={};w(a,y,function(){return this});var r=Object.getPrototypeOf,u=r&&r(r(B([])));u&&u!==P&&g.call(u,y)&&(a=u);var h=o.prototype=m.prototype=Object.create(a);i.prototype=o,w(h,"constructor",o),w(o,"constructor",i),i.displayName=w(o,j,"GeneratorFunction");function _(e){["next","throw","return"].forEach(function(t){w(e,t,function(n){return this._invoke(t,n)})})}s.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===i||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,w(e,j,"GeneratorFunction")),e.prototype=Object.create(h),e},s.awrap=function(e){return{__await:e}};function E(e,t){function n(O,C,M,U){var G=I(e[O],e,C);if(G.type==="throw")U(G.arg);else{var Y=G.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,M,U)},function($){n("throw",$,M,U)}):t.resolve(H).then(function($){Y.value=$,M(Y)},function($){return n("throw",$,M,U)})}}var f;function c(O,C){function M(){return new t(function(U,G){n(O,C,U,G)})}return f=f?f.then(M,M):M()}this._invoke=c}_(E.prototype),w(E.prototype,T,function(){return this}),s.AsyncIterator=E,s.async=function(e,t,n,f,c){c===void 0&&(c=Promise);var O=new E(R(e,t,n,f),c);return s.isGeneratorFunction(t)?O:O.next().then(function(C){return C.done?C.value:O.next()})};function d(e,t,n){var f=D;return function(O,C){if(f===z)throw new Error("Generator is already running");if(f===A){if(O==="throw")throw C;return F()}for(n.method=O,n.arg=C;;){var M=n.delegate;if(M){var U=L(M,n);if(U){if(U===k)continue;return U}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===D)throw f=A,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var G=I(e,t,n);if(G.type==="normal"){if(f=n.done?A:W,G.arg===k)continue;return{value:G.arg,done:n.done}}else G.type==="throw"&&(f=A,n.method="throw",n.arg=G.arg)}}}function L(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=v,L(e,t),t.method==="throw"))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var f=I(n,e.iterator,t.arg);if(f.type==="throw")return t.method="throw",t.arg=f.arg,t.delegate=null,k;var c=f.arg;if(!c)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k;if(c.done)t[e.resultName]=c.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=v);else return c;return t.delegate=null,k}_(h),w(h,j,"Generator"),w(h,y,function(){return this}),w(h,"toString",function(){return"[object Generator]"});function Z(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(Z,this),this.reset(!0)}s.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function f(){for(;t.length;){var c=t.pop();if(c in e)return f.value=c,f.done=!1,f}return f.done=!0,f}};function B(e){if(e){var t=e[y];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,f=function c(){for(;++n<e.length;)if(g.call(e,n))return c.value=e[n],c.done=!1,c;return c.value=v,c.done=!0,c};return f.next=f}}return{next:F}}s.values=B;function F(){return{value:v,done:!0}}return N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(x),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(U,G){return O.type="throw",O.arg=e,t.next=U,G&&(t.method="next",t.arg=v),!!G}for(var f=this.tryEntries.length-1;f>=0;--f){var c=this.tryEntries[f],O=c.completion;if(c.tryLoc==="root")return n("end");if(c.tryLoc<=this.prev){var C=g.call(c,"catchLoc"),M=g.call(c,"finallyLoc");if(C&&M){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(C){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else if(M){if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var f=this.tryEntries[n];if(f.tryLoc<=this.prev&&g.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var c=f;break}}c&&(e==="break"||e==="continue")&&c.tryLoc<=t&&t<=c.finallyLoc&&(c=null);var O=c?c.completion:{};return O.type=e,O.arg=t,c?(this.method="next",this.next=c.finallyLoc,k):this.complete(O)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),k},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),k}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var f=n.completion;if(f.type==="throw"){var c=f.arg;x(n)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=v),k}},s}(l.exports);try{regeneratorRuntime=p}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=p:Function("r","regeneratorRuntime = r")(p)}},519:function(l,p,s){"use strict";s.d(p,{makePromiseCreator:function(){return P.Z}});var P=s(282),g=s(666),v=s.n(g),b=null,y=s(644);function T(A){if(A.material){var k=Array.isArray(A.material)?A.material:[A.material];k.forEach(function(m){var i,o;(i=m.color)===null||i===void 0||i.convertSRGBToLinear(),(o=m.emissive)===null||o===void 0||o.convertSRGBToLinear(),m.map&&(m.map.encoding=THREE.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=THREE.sRGBEncoding)})}}var j=s(568),w=s(924),R=require("idb-keyval"),I=s(484),D=null,W=null,z=function(){var A=(0,j.Z)(v().mark(function k(m,i){var o,a,r,u,h,_;return v().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=i.version,d.next=4,(0,R.get)(m);case 4:if(r=d.sent,!(r&&r[o])){d.next=9;break}a=r[o],d.next=15;break;case 9:return d.next=11,(0,I.Z)(fetch(m).then(function(L){if(L.ok)return L.blob();throw new Error}));case 11:u=d.sent,h=u.res,_=u.err,_||(a=h,(0,R.set)(m,(0,w.Z)({},o,h)));case 15:return d.abrupt("return",a?{url:URL.createObjectURL(a)}:{url:m});case 16:case"end":return d.stop()}},k)}));return function(m,i){return A.apply(this,arguments)}}()},282:function(l,p,s){"use strict";s.d(p,{Z:function(){return g}});var P=s(484);function g(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={};return y.promise=new Promise(function(T,j){y.resolve=T,y.reject=j}),v&&(y.promise=(0,P.Z)(y.promise,b)),y}},484:function(l,p,s){"use strict";s.d(p,{Z:function(){return g}});var P=s(42);function g(v){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.then(function(y){return(0,P.Z)({err:null,res:y},b)}).catch(function(y){return(0,P.Z)({err:y,res:void 0},b)})}},644:function(l){"use strict";l.exports=require("three")},568:function(l,p,s){"use strict";s.d(p,{Z:function(){return g}});function P(v,b,y,T,j,w,R){try{var I=v[w](R),D=I.value}catch(W){y(W);return}I.done?b(D):Promise.resolve(D).then(T,j)}function g(v){return function(){var b=this,y=arguments;return new Promise(function(T,j){var w=v.apply(b,y);function R(D){P(w,T,j,R,I,"next",D)}function I(D){P(w,T,j,R,I,"throw",D)}R(void 0)})}}},924:function(l,p,s){"use strict";s.d(p,{Z:function(){return P}});function P(g,v,b){return v in g?Object.defineProperty(g,v,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[v]=b,g}},42:function(l,p,s){"use strict";s.d(p,{Z:function(){return g}});var P=s(924);function g(v){for(var b=1;b<arguments.length;b++){var y=arguments[b]!=null?arguments[b]:{},T=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(T=T.concat(Object.getOwnPropertySymbols(y).filter(function(j){return Object.getOwnPropertyDescriptor(y,j).enumerable}))),T.forEach(function(j){(0,P.Z)(v,j,y[j])})}return v}}},X={};function S(l){var p=X[l];if(p!==void 0)return p.exports;var s=X[l]={exports:{}};return J[l](s,s.exports,S),s.exports}(function(){S.n=function(l){var p=l&&l.__esModule?function(){return l.default}:function(){return l};return S.d(p,{a:p}),p}})(),function(){S.d=function(l,p){for(var s in p)S.o(p,s)&&!S.o(l,s)&&Object.defineProperty(l,s,{enumerable:!0,get:p[s]})}}(),function(){S.o=function(l,p){return Object.prototype.hasOwnProperty.call(l,p)}}(),function(){S.r=function(l){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})}}();var K={};(function(){"use strict";S.r(K),S.d(K,{Cache:function(){return s},Draw:function(){return m}});function l(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var p=S(519),s=function(){"use strict";function i(){l(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(r){this.pencil=r},o.init=function(r){var u=(0,p.makePromiseCreator)();this.cache.set(r,u)},o.get=function(r){var u;return(u=this.cache.get(r))===null||u===void 0?void 0:u.promise},o.set=function(r,u){var h=this.cache.get(r);h?h.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,u){r.reject("stop set cache:".concat(u))}),this.cache.clear()},i}(),P=S(568);function g(i,o){for(var a=0;a<o.length;a++){var r=o[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function v(i,o,a){return o&&g(i.prototype,o),a&&g(i,a),i}function b(i){if(Array.isArray(i))return i}function y(i){if(typeof Symbol!="undefined"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(i,o){(o==null||o>i.length)&&(o=i.length);for(var a=0,r=new Array(o);a<o;a++)r[a]=i[a];return r}function w(i,o){if(!!i){if(typeof i=="string")return j(i,o);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return j(i,o)}}function R(i,o){return b(i)||y(i,o)||w(i,o)||T()}function I(i){if(Array.isArray(i))return j(i)}function D(){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 W(i){return I(i)||y(i)||w(i)||D()}var z=S(666),A=S.n(z),k=S(644),m=function(){"use strict";function i(a){l(this,i),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var o=i.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,u=this.objects_;Object.keys(u).forEach(function(h){var _=function(){function E(){l(this,E)}var d=E.prototype;return d.create=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](Z)},E}();r.objectNamesToFactories.set(h,_)})},o.getObject=function(r,u){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,_="".concat(r).concat(h?"#".concat(h):""),E=this.objects.get(_);return E},o.getAllObject=function(r,u){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var h=(u||{}).key,_="".concat(r).concat(h?"#".concat(h):""),E=[];return this.objects.forEach(function(d,L){(L.startsWith("".concat(_,"#"))||L===_)&&E.push(d)}),E},o.draw=function(r,u,h){var _=this;return(0,P.Z)(A().mark(function E(){var d,L,Z,x,N,B,F;return A().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(d=_.objectNamesToFactories.get(r),!d){t.next=15;break}return L=(u||{}).key,Z="".concat(r).concat(L?"#".concat(L):""),_.objects.has(Z)&&(x=k.MathUtils.generateUUID(),Z+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?B=_.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?B=N:B=_.pencil.scene,F=new d().create(u),F.pencil=_.pencil,F.key=Z,_.objects.set(Z,F),t.next=14,_.addMesh(F,B);case 14:return t.abrupt("return",F);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return t.stop()}},E)}))()},o.addMesh=function(r,u){var h=this;return(0,P.Z)(A().mark(function _(){return A().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,r.init();case 2:return d.next=4,r.create();case 4:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),h.pencil.gui&&r.showGuiParams(h.pencil.gui),r.pm.resolve();case 9:case"end":return d.stop()}},_)}))()},o.erase=function(){for(var r=arguments.length,u=new Array(r),h=0;h<r;h++)u[h]=arguments[h];var _=this;W(u).forEach(function(E){var d=[];if(typeof E=="string"){var L,Z=R(E.split("#"),2),x=Z[0],N=Z[1];(L=d).push.apply(L,W(_.getAllObject(x,{key:N})))}else d.push(E);d.forEach(function(B){_.removeMesh(B)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(_){_.visible=!1,_.dispose(),u.objects.delete(_.key)})},o.update=function(r,u){this.objects.forEach(function(h){h.update(r,u)})},o.setSize=function(r,u){this.objects.forEach(function(h){h.resize(r,u)})},o.dispose=function(){this.objects.forEach(function(r,u){r.dispose(),r.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},v(i,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),i}()})(),module.exports=K})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.0.9",
3
+ "version": "0.0.13",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",