gl-draw 0.0.29 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,21 @@
1
- (function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,x=T&&typeof T.apply=="function"?T.apply:function(c,v,b){return Function.prototype.apply.call(c,v,b)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function z(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function X(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function W(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var v=[],b=1;b<arguments.length;b++)v.push(arguments[b]);var S=c==="error",A=this._events;if(A!==void 0)S=S&&A.error===void 0;else if(!S)return!1;if(S){var j;if(v.length>0&&(j=v[0]),j instanceof Error)throw j;var F=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw F.context=j,F}var oe=A[c];if(oe===void 0)return!1;if(typeof oe=="function")x(oe,this,v);else for(var de=oe.length,he=se(oe,de),b=0;b<de;++b)x(he[b],this,v);return!0};function k(f,c,v,b){var S,A,j;if(X(v),A=f._events,A===void 0?(A=f._events=Object.create(null),f._eventsCount=0):(A.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),A=f._events),j=A[c]),j===void 0)j=A[c]=v,++f._eventsCount;else if(typeof j=="function"?j=A[c]=b?[v,j]:[j,v]:b?j.unshift(v):j.push(v),S=W(f),S>0&&j.length>S&&!j.warned){j.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=f,F.type=c,F.count=j.length,z(F)}return f}m.prototype.addListener=function(c,v){return k(this,c,v,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,v){return k(this,c,v,!0)};function Q(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Y(f,c,v){var b={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},S=Q.bind(b);return S.listener=v,b.wrapFn=S,S}m.prototype.once=function(c,v){return X(v),this.on(c,Y(this,c,v)),this},m.prototype.prependOnceListener=function(c,v){return X(v),this.prependListener(c,Y(this,c,v)),this},m.prototype.removeListener=function(c,v){var b,S,A,j,F;if(X(v),S=this._events,S===void 0)return this;if(b=S[c],b===void 0)return this;if(b===v||b.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,b.listener||v));else if(typeof b!="function"){for(A=-1,j=b.length-1;j>=0;j--)if(b[j]===v||b[j].listener===v){F=b[j].listener,A=j;break}if(A<0)return this;A===0?b.shift():ie(b,A),b.length===1&&(S[c]=b[0]),S.removeListener!==void 0&&this.emit("removeListener",c,F||v)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var v,b,S;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[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[c]),this;if(arguments.length===0){var A=Object.keys(b),j;for(S=0;S<A.length;++S)j=A[S],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=b[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(c,v[S]);return this};function K(f,c,v){var b=f._events;if(b===void 0)return[];var S=b[c];return S===void 0?[]:typeof S=="function"?v?[S.listener||S]:[S]:v?I(S):se(S,S.length)}m.prototype.listeners=function(c){return K(this,c,!0)},m.prototype.rawListeners=function(c){return K(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):d.call(f,c)},m.prototype.listenerCount=d;function d(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var v=new Array(c),b=0;b<c;++b)v[b]=f[b];return v}function ie(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function I(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function $(f,c){return new Promise(function(v,b){function S(j){f.removeListener(c,A),b(j)}function A(){typeof f.removeListener=="function"&&f.removeListener("error",S),v([].slice.call(arguments))}N(f,c,A,{once:!0}),c!=="error"&&D(f,S,{once:!0})})}function D(f,c,v){typeof f.on=="function"&&N(f,"error",c,v)}function N(f,c,v,b){if(typeof f.on=="function")b.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(A){b.once&&f.removeEventListener(c,S),v(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(x){"use strict";var G=Object.prototype,z=G.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",X=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function k(p,l,g){return Object.defineProperty(p,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{k({},"")}catch(p){k=function(l,g,O){return l[g]=O}}function Q(p,l,g,O){var C=l&&l.prototype instanceof $?l:$,H=Object.create(C.prototype),te=new he(O||[]);return H._invoke=j(p,g,te),H}x.wrap=Q;function Y(p,l,g){try{return{type:"normal",arg:p.call(l,g)}}catch(O){return{type:"throw",arg:O}}}var K="suspendedStart",d="suspendedYield",se="executing",ie="completed",I={};function $(){}function D(){}function N(){}var f={};k(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(me([])));v&&v!==G&&z.call(v,B)&&(f=v);var b=N.prototype=$.prototype=Object.create(f);D.prototype=N,k(b,"constructor",N),k(N,"constructor",D),D.displayName=k(N,W,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(l){k(p,l,function(g){return this._invoke(l,g)})})}x.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===D||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,N):(p.__proto__=N,k(p,W,"GeneratorFunction")),p.prototype=Object.create(b),p},x.awrap=function(p){return{__await:p}};function A(p,l){function g(H,te,J,re){var ee=Y(p[H],p,te);if(ee.type==="throw")re(ee.arg);else{var pe=ee.arg,le=pe.value;return le&&typeof le=="object"&&z.call(le,"__await")?l.resolve(le.__await).then(function(ue){g("next",ue,J,re)},function(ue){g("throw",ue,J,re)}):l.resolve(le).then(function(ue){pe.value=ue,J(pe)},function(ue){return g("throw",ue,J,re)})}}var O;function C(H,te){function J(){return new l(function(re,ee){g(H,te,re,ee)})}return O=O?O.then(J,J):J()}this._invoke=C}S(A.prototype),k(A.prototype,X,function(){return this}),x.AsyncIterator=A,x.async=function(p,l,g,O,C){C===void 0&&(C=Promise);var H=new A(Q(p,l,g,O),C);return x.isGeneratorFunction(l)?H:H.next().then(function(te){return te.done?te.value:H.next()})};function j(p,l,g){var O=K;return function(H,te){if(O===se)throw new Error("Generator is already running");if(O===ie){if(H==="throw")throw te;return ge()}for(g.method=H,g.arg=te;;){var J=g.delegate;if(J){var re=F(J,g);if(re){if(re===I)continue;return re}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===K)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=se;var ee=Y(p,l,g);if(ee.type==="normal"){if(O=g.done?ie:d,ee.arg===I)continue;return{value:ee.arg,done:g.done}}else ee.type==="throw"&&(O=ie,g.method="throw",g.arg=ee.arg)}}}function F(p,l){var g=p.iterator[l.method];if(g===E){if(l.delegate=null,l.method==="throw"){if(p.iterator.return&&(l.method="return",l.arg=E,F(p,l),l.method==="throw"))return I;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return I}var O=Y(g,p.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,I;var C=O.arg;if(!C)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,I;if(C.done)l[p.resultName]=C.value,l.next=p.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return C;return l.delegate=null,I}S(b),k(b,W,"Generator"),k(b,B,function(){return this}),k(b,"toString",function(){return"[object Generator]"});function oe(p){var l={tryLoc:p[0]};1 in p&&(l.catchLoc=p[1]),2 in p&&(l.finallyLoc=p[2],l.afterLoc=p[3]),this.tryEntries.push(l)}function de(p){var l=p.completion||{};l.type="normal",delete l.arg,p.completion=l}function he(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(oe,this),this.reset(!0)}x.keys=function(p){var l=[];for(var g in p)l.push(g);return l.reverse(),function O(){for(;l.length;){var C=l.pop();if(C in p)return O.value=C,O.done=!1,O}return O.done=!0,O}};function me(p){if(p){var l=p[B];if(l)return l.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var g=-1,O=function C(){for(;++g<p.length;)if(z.call(p,g))return C.value=p[g],C.done=!1,C;return C.value=E,C.done=!0,C};return O.next=O}}return{next:ge}}x.values=me;function ge(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!p)for(var l in this)l.charAt(0)==="t"&&z.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var p=this.tryEntries[0],l=p.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var l=this;function g(re,ee){return H.type="throw",H.arg=p,l.next=re,ee&&(l.method="next",l.arg=E),!!ee}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],H=C.completion;if(C.tryLoc==="root")return g("end");if(C.tryLoc<=this.prev){var te=z.call(C,"catchLoc"),J=z.call(C,"finallyLoc");if(te&&J){if(this.prev<C.catchLoc)return g(C.catchLoc,!0);if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else if(te){if(this.prev<C.catchLoc)return g(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&z.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=l&&l<=C.finallyLoc&&(C=null);var H=C?C.completion:{};return H.type=p,H.arg=l,C?(this.method="next",this.next=C.finallyLoc,I):this.complete(H)},complete:function(p,l){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&l&&(this.next=l),I},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),de(g),I}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===p){var O=g.completion;if(O.type==="throw"){var C=O.arg;de(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,g){return this.delegate={iterator:me(p),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=E),I}},x}(R.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z){if(z.geometry&&z.geometry.dispose(),z.material){var E=Array.isArray(z.material)?z.material:[z.material];E.forEach(function(m){var B,X,W,k,Q,Y,K,d,se,ie,I,$,D;(B=m.map)===null||B===void 0||B.dispose(),(X=m.lightMap)===null||X===void 0||X.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(k=m.normalMap)===null||k===void 0||k.dispose(),(Q=m.specularMap)===null||Q===void 0||Q.dispose(),(Y=m.envMap)===null||Y===void 0||Y.dispose(),(K=m.alphaMap)===null||K===void 0||K.dispose(),(d=m.aoMap)===null||d===void 0||d.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(I=m.gradientMap)===null||I===void 0||I.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(D=m.roughnessMap)===null||D===void 0||D.dispose(),m.dispose()})}}},519:function(R,T,x){"use strict";x.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return W.Z}});var G=x(666),z=x.n(G),E=null,m=x(695),B=x(644);function X(I){if(I.material){var $=Array.isArray(I.material)?I.material:[I.material];$.forEach(function(D){var N,f;(N=D.color)===null||N===void 0||N.convertSRGBToLinear(),(f=D.emissive)===null||f===void 0||f.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(738),k=x(568),Q=x(924),Y=require("idb-keyval"),K=x(484),d=null,se=null,ie=function(){var I=(0,k.Z)(z().mark(function $(D,N){var f,c,v,b,S,A;return z().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return f=N.version,F.next=4,(0,Y.get)(D);case 4:if(v=F.sent,!(v&&v[f])){F.next=9;break}c=v[f],F.next=15;break;case 9:return F.next=11,(0,K.Z)(fetch(D).then(function(oe){if(oe.ok)return oe.blob();throw new Error}));case 11:b=F.sent,S=b.res,A=b.err,A||(c=S,(0,Y.set)(D,(0,Q.Z)({},f,S)));case 15:return F.abrupt("return",c?{url:URL.createObjectURL(c)}:{url:D});case 16:case"end":return F.stop()}},$)}));return function(D,N){return I.apply(this,arguments)}}()},738:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function z(E){if(G(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(42);function z(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E,m,B,X,W,k,Q){try{var Y=E[k](Q),K=Y.value}catch(d){B(d);return}Y.done?m(K):Promise.resolve(K).then(X,W)}function z(E){return function(){var m=this,B=arguments;return new Promise(function(X,W){var k=E.apply(m,B);function Q(K){G(k,X,W,Q,Y,"next",K)}function Y(K){G(k,X,W,Q,Y,"throw",K)}Q(void 0)})}}},924:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z,E,m){return E in z?Object.defineProperty(z,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):z[E]=m,z}},42:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(924);function z(E){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},X=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(B).filter(function(W){return Object.getOwnPropertyDescriptor(B,W).enumerable}))),X.forEach(function(W){(0,G.Z)(E,W,B[W])})}return E}}},Oe={};function q(R){var T=Oe[R];if(T!==void 0)return T.exports;var x=Oe[R]={exports:{}};return Be[R](x,x.exports,q),x.exports}(function(){q.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return q.d(T,{a:T}),T}})(),function(){q.d=function(R,T){for(var x in T)q.o(T,x)&&!q.o(R,x)&&Object.defineProperty(R,x,{enumerable:!0,get:T[x]})}}(),function(){q.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){q.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}(),function(){q.p="/"}();var Pe={};(function(){"use strict";q.r(Pe),q.d(Pe,{BaseObject:function(){return gt},GUIObject:function(){return c},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function x(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var G=q(42);function z(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return m(s)}function X(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function W(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function Q(s){return B(s)||X(s)||k(s)||W()}var Y=require("@tweenjs/tween.js"),K=q.n(Y),d=q(644),se=q(187),ie=require("deepmerge"),I=q.n(ie),$=require("three/examples/jsm/libs/stats.module"),D=q.n($),N=require("lil-gui"),f=q.n(N),c=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,_=h.name,M=h.paramMap,L=h.items,Z=h.value,V=h.target,ae=a.toLowerCase().indexOf("color")>-1,U,ne=typeof Z=="undefined"&&V,ce=ne?V():u[a],fe=ne?a:"value";L?U=o.add(ce,fe,L):ae?U=o.addColor(ce,fe):U=o.add(ce,fe),U=U.name(_||a),typeof w!="undefined"&&(U=U.min(w)),typeof P!="undefined"&&(U=U.max(P)),typeof y!="undefined"&&(U=U.step(y)),U=U.onChange(function(){t.setTargetValue(r,a,ce[fe],M)}),ne&&U.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var _=h();Array.isArray(_)||(_=[_]),_.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(L){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),v={None:d.NoToneMapping,Linear:d.LinearToneMapping,Reinhard:d.ReinhardToneMapping,Cineon:d.CineonToneMapping,ACESFilmic:d.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:d.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},S=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.alpha,u=r.devicePixelRatio,a=r.antialias,h=r.powerPreference,w=r.toneMapping,P=r.toneMappingExposure,y=r.outputEncoding,_=r.logarithmicDepthBuffer,M=r.preserveDrawingBuffer,L=new d.WebGLRenderer({alpha:o,antialias:a,powerPreference:h,logarithmicDepthBuffer:_,preserveDrawingBuffer:M});L.setSize(e,t),L.setPixelRatio(u),L.autoClear=!1,L.toneMapping=v[w],L.toneMappingExposure=P,L.outputEncoding=y,this.renderer=L}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:v,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),A={fov:45,near:1,far:1e3},j=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new d.Vector3,this.oldCameraRotation=new d.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof d.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new d.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof d.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof d.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),F=q(519),oe={background:null},de=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new d.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new d.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,F.disposeMesh)(t)})},s}(),he=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new he.MapControls(e,o):new he.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,_=y===void 0?1/0:y,M=e.minY,L=M===void 0?-1/0:M,Z=this.limitPanV||new d.Vector3,V=this.control,ae=this.options.camera,U=new d.Vector3(u,L,P),ne=new d.Vector3(r,_,h);this.limitPanV=Z,Z.copy(V.target),V.target.clamp(U,ne),Z.sub(V.target),ae.position.sub(Z)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),p=require("three/examples/jsm/renderers/CSS3DRenderer"),l=new d.Vector3,g=new d.Matrix4,O=new d.Matrix4,C=new d.Vector3,H=new d.Vector3,te=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,L){return C.setFromMatrixPosition(M.matrixWorld),H.setFromMatrixPosition(L.matrixWorld),C.distanceToSquared(H)},e=function(M){var L=[];return M.traverse(function(Z){Z.isCSS2DObject&&L.push(Z)}),L},t=function(M){for(var L=e(M).sort(function(ne,ce){if(ne.renderOrder!==ce.renderOrder)return ce.renderOrder-ne.renderOrder;var fe=w.objects.get(ne).distanceToCameraSquared,ye=w.objects.get(ce).distanceToCameraSquared;return fe-ye}),Z=L.length,V=0,ae=L.length;V<ae;V++){var U=L[V].userData.zIndexFix||0;L[V].element.style.zIndex=Z-V+U}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(_,M){_.autoUpdate===!0&&_.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),g.copy(M.matrixWorldInverse),O.multiplyMatrices(M.projectionMatrix,g),y(_,_,M),t(_)},this.setSize=function(_,M){o=_,u=M,a=o/2,h=u/2,P.style.width="".concat(_,"px"),P.style.height="".concat(M,"px")};function y(_,M,L){if(_.isCSS2DObject){l.setFromMatrixPosition(_.matrixWorld),l.applyMatrix4(O);var Z=_.visible===!0&&l.z>=-1&&l.z<=1&&_.layers.test(L.layers)===!0;if(_.element.style.display=Z===!0?"":"none",Z===!0){_.onBeforeRender(r,M,L);var V=_.element;V.style.transform="translate(-50%,-50%) translate(".concat(l.x*a+a,"px,").concat(-l.y*h+h,"px)"),V.parentNode!==P&&P.appendChild(V),_.onAfterRender(r,M,L)}var ae={distanceToCameraSquared:n(L,_)};w.objects.set(_,ae)}for(var U=0,ne=_.children.length;U<ne;U++)y(_.children[U],M,L)}},J={zIndex:"auto"},re=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new te:new p.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ee=require("three/examples/jsm/postprocessing/EffectComposer"),pe=require("three/examples/jsm/postprocessing/RenderPass"),le=require("three/examples/jsm/postprocessing/ShaderPass"),ue=require("three/examples/jsm/shaders/CopyShader"),Fe=require("three/examples/jsm/shaders/GammaCorrectionShader"),ke=require("three/examples/jsm/postprocessing/SMAAPass"),Ue=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ie=require("three/examples/jsm/shaders/FXAAShader"),Ve=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},Pt=0,Ne=1,ve=!1,Re=Ve()!==!1,We=q.p+"static/media/vertex.cc08e9108dec6da9504a.glsl",He=q.p+"static/media/fragment.2913fac3481dac4d4a06.glsl";function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Me(s,i){return _e(s,i)}function Ze(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Me(s,i)}function qe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function Se(s){return Se=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Se(s)}function Te(s){return Se(s)}function Xe(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Qe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function Ye(s,i){return i&&(Qe(i)==="object"||typeof i=="function")?i:Xe(s)}function Ke(s){var i=qe();return function(){var e=Te(s),t;if(i){var r=Te(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Ye(this,t)}}var je=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";Ze(n,s);var i=Ke(n);function n(t,r,o,u){R(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new d.Vector2(t.x,t.y):new d.Vector2(256,256),a.clearColor=new d.Color(0,0,0);var h={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);a.renderTargetBright=new d.WebGLRenderTarget(w,P,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var _=new d.WebGLRenderTarget(w,P,h);_.texture.name="UnrealBloomPass.h".concat(y),_.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(_);var M=new d.WebGLRenderTarget(w,P,h);M.texture.name="UnrealBloomPass.v".concat(y),M.texture.generateMipmaps=!1,a.renderTargetsVertical.push(M),w=Math.round(w/2),P=Math.round(P/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var L=Ee.LuminosityHighPassShader;a.highPassUniforms=d.UniformsUtils.clone(L.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new d.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:L.vertexShader,fragmentShader:L.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var Z=[3,5,7,9,11];w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);for(var V=0;V<a.nMips;V++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(Z[V])),a.separableBlurMaterials[V].uniforms.texSize.value=new d.Vector2(w,P),w=Math.round(w/2),P=Math.round(P/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var ae=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=ae,a.bloomTintColors=[new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,ue.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var U=ue.CopyShader;return a.copyUniforms=d.UniformsUtils.clone(U.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new d.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:U.vertexShader,fragmentShader:U.fragmentShader,blending:d.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new d.Color,a.oldClearAlpha=1,a.basic=new d.MeshBasicMaterial,a.fsQuad=new je.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new d.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var w=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var P=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),P=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=w},e.getSeperableBlurMaterial=function(r){return new d.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new d.Vector2(.5,.5)},direction:{value:new d.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
1
+ (function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,x=T&&typeof T.apply=="function"?T.apply:function(c,p,b){return Function.prototype.apply.call(c,p,b)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function z(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function q(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function W(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var S=c==="error",A=this._events;if(A!==void 0)S=S&&A.error===void 0;else if(!S)return!1;if(S){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var F=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw F.context=j,F}var oe=A[c];if(oe===void 0)return!1;if(typeof oe=="function")x(oe,this,p);else for(var de=oe.length,he=se(oe,de),b=0;b<de;++b)x(he[b],this,p);return!0};function U(f,c,p,b){var S,A,j;if(q(p),A=f._events,A===void 0?(A=f._events=Object.create(null),f._eventsCount=0):(A.newListener!==void 0&&(f.emit("newListener",c,p.listener?p.listener:p),A=f._events),j=A[c]),j===void 0)j=A[c]=p,++f._eventsCount;else if(typeof j=="function"?j=A[c]=b?[p,j]:[j,p]:b?j.unshift(p):j.push(p),S=W(f),S>0&&j.length>S&&!j.warned){j.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=f,F.type=c,F.count=j.length,z(F)}return f}m.prototype.addListener=function(c,p){return U(this,c,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,p){return U(this,c,p,!0)};function X(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Q(f,c,p){var b={fired:!1,wrapFn:void 0,target:f,type:c,listener:p},S=X.bind(b);return S.listener=p,b.wrapFn=S,S}m.prototype.once=function(c,p){return q(p),this.on(c,Q(this,c,p)),this},m.prototype.prependOnceListener=function(c,p){return q(p),this.prependListener(c,Q(this,c,p)),this},m.prototype.removeListener=function(c,p){var b,S,A,j,F;if(q(p),S=this._events,S===void 0)return this;if(b=S[c],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,b.listener||p));else if(typeof b!="function"){for(A=-1,j=b.length-1;j>=0;j--)if(b[j]===p||b[j].listener===p){F=b[j].listener,A=j;break}if(A<0)return this;A===0?b.shift():ie(b,A),b.length===1&&(S[c]=b[0]),S.removeListener!==void 0&&this.emit("removeListener",c,F||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var p,b,S;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[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[c]),this;if(arguments.length===0){var A=Object.keys(b),j;for(S=0;S<A.length;++S)j=A[S],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[c],typeof p=="function")this.removeListener(c,p);else if(p!==void 0)for(S=p.length-1;S>=0;S--)this.removeListener(c,p[S]);return this};function Y(f,c,p){var b=f._events;if(b===void 0)return[];var S=b[c];return S===void 0?[]:typeof S=="function"?p?[S.listener||S]:[S]:p?V(S):se(S,S.length)}m.prototype.listeners=function(c){return Y(this,c,!0)},m.prototype.rawListeners=function(c){return Y(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):d.call(f,c)},m.prototype.listenerCount=d;function d(f){var c=this._events;if(c!==void 0){var p=c[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var p=new Array(c),b=0;b<c;++b)p[b]=f[b];return p}function ie(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function V(f){for(var c=new Array(f.length),p=0;p<c.length;++p)c[p]=f[p].listener||f[p];return c}function $(f,c){return new Promise(function(p,b){function S(j){f.removeListener(c,A),b(j)}function A(){typeof f.removeListener=="function"&&f.removeListener("error",S),p([].slice.call(arguments))}N(f,c,A,{once:!0}),c!=="error"&&D(f,S,{once:!0})})}function D(f,c,p){typeof f.on=="function"&&N(f,"error",c,p)}function N(f,c,p,b){if(typeof f.on=="function")b.once?f.once(c,p):f.on(c,p);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(A){b.once&&f.removeEventListener(c,S),p(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(x){"use strict";var G=Object.prototype,z=G.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",q=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function U(v,l,g){return Object.defineProperty(v,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[l]}try{U({},"")}catch(v){U=function(l,g,O){return l[g]=O}}function X(v,l,g,O){var C=l&&l.prototype instanceof $?l:$,H=Object.create(C.prototype),te=new he(O||[]);return H._invoke=j(v,g,te),H}x.wrap=X;function Q(v,l,g){try{return{type:"normal",arg:v.call(l,g)}}catch(O){return{type:"throw",arg:O}}}var Y="suspendedStart",d="suspendedYield",se="executing",ie="completed",V={};function $(){}function D(){}function N(){}var f={};U(f,B,function(){return this});var c=Object.getPrototypeOf,p=c&&c(c(me([])));p&&p!==G&&z.call(p,B)&&(f=p);var b=N.prototype=$.prototype=Object.create(f);D.prototype=N,U(b,"constructor",N),U(N,"constructor",D),D.displayName=U(N,W,"GeneratorFunction");function S(v){["next","throw","return"].forEach(function(l){U(v,l,function(g){return this._invoke(l,g)})})}x.isGeneratorFunction=function(v){var l=typeof v=="function"&&v.constructor;return l?l===D||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,N):(v.__proto__=N,U(v,W,"GeneratorFunction")),v.prototype=Object.create(b),v},x.awrap=function(v){return{__await:v}};function A(v,l){function g(H,te,J,re){var ee=Q(v[H],v,te);if(ee.type==="throw")re(ee.arg);else{var ve=ee.arg,le=ve.value;return le&&typeof le=="object"&&z.call(le,"__await")?l.resolve(le.__await).then(function(ue){g("next",ue,J,re)},function(ue){g("throw",ue,J,re)}):l.resolve(le).then(function(ue){ve.value=ue,J(ve)},function(ue){return g("throw",ue,J,re)})}}var O;function C(H,te){function J(){return new l(function(re,ee){g(H,te,re,ee)})}return O=O?O.then(J,J):J()}this._invoke=C}S(A.prototype),U(A.prototype,q,function(){return this}),x.AsyncIterator=A,x.async=function(v,l,g,O,C){C===void 0&&(C=Promise);var H=new A(X(v,l,g,O),C);return x.isGeneratorFunction(l)?H:H.next().then(function(te){return te.done?te.value:H.next()})};function j(v,l,g){var O=Y;return function(H,te){if(O===se)throw new Error("Generator is already running");if(O===ie){if(H==="throw")throw te;return ge()}for(g.method=H,g.arg=te;;){var J=g.delegate;if(J){var re=F(J,g);if(re){if(re===V)continue;return re}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===Y)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=se;var ee=Q(v,l,g);if(ee.type==="normal"){if(O=g.done?ie:d,ee.arg===V)continue;return{value:ee.arg,done:g.done}}else ee.type==="throw"&&(O=ie,g.method="throw",g.arg=ee.arg)}}}function F(v,l){var g=v.iterator[l.method];if(g===E){if(l.delegate=null,l.method==="throw"){if(v.iterator.return&&(l.method="return",l.arg=E,F(v,l),l.method==="throw"))return V;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return V}var O=Q(g,v.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,V;var C=O.arg;if(!C)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,V;if(C.done)l[v.resultName]=C.value,l.next=v.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return C;return l.delegate=null,V}S(b),U(b,W,"Generator"),U(b,B,function(){return this}),U(b,"toString",function(){return"[object Generator]"});function oe(v){var l={tryLoc:v[0]};1 in v&&(l.catchLoc=v[1]),2 in v&&(l.finallyLoc=v[2],l.afterLoc=v[3]),this.tryEntries.push(l)}function de(v){var l=v.completion||{};l.type="normal",delete l.arg,v.completion=l}function he(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(oe,this),this.reset(!0)}x.keys=function(v){var l=[];for(var g in v)l.push(g);return l.reverse(),function O(){for(;l.length;){var C=l.pop();if(C in v)return O.value=C,O.done=!1,O}return O.done=!0,O}};function me(v){if(v){var l=v[B];if(l)return l.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,O=function C(){for(;++g<v.length;)if(z.call(v,g))return C.value=v[g],C.done=!1,C;return C.value=E,C.done=!0,C};return O.next=O}}return{next:ge}}x.values=me;function ge(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!v)for(var l in this)l.charAt(0)==="t"&&z.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var v=this.tryEntries[0],l=v.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var l=this;function g(re,ee){return H.type="throw",H.arg=v,l.next=re,ee&&(l.method="next",l.arg=E),!!ee}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],H=C.completion;if(C.tryLoc==="root")return g("end");if(C.tryLoc<=this.prev){var te=z.call(C,"catchLoc"),J=z.call(C,"finallyLoc");if(te&&J){if(this.prev<C.catchLoc)return g(C.catchLoc,!0);if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else if(te){if(this.prev<C.catchLoc)return g(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,l){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&z.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(v==="break"||v==="continue")&&C.tryLoc<=l&&l<=C.finallyLoc&&(C=null);var H=C?C.completion:{};return H.type=v,H.arg=l,C?(this.method="next",this.next=C.finallyLoc,V):this.complete(H)},complete:function(v,l){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&l&&(this.next=l),V},finish:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),de(g),V}},catch:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===v){var O=g.completion;if(O.type==="throw"){var C=O.arg;de(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(v,l,g){return this.delegate={iterator:me(v),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=E),V}},x}(R.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z){if(z.geometry&&z.geometry.dispose(),z.material){var E=Array.isArray(z.material)?z.material:[z.material];E.forEach(function(m){var B,q,W,U,X,Q,Y,d,se,ie,V,$,D;(B=m.map)===null||B===void 0||B.dispose(),(q=m.lightMap)===null||q===void 0||q.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(U=m.normalMap)===null||U===void 0||U.dispose(),(X=m.specularMap)===null||X===void 0||X.dispose(),(Q=m.envMap)===null||Q===void 0||Q.dispose(),(Y=m.alphaMap)===null||Y===void 0||Y.dispose(),(d=m.aoMap)===null||d===void 0||d.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(V=m.gradientMap)===null||V===void 0||V.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(D=m.roughnessMap)===null||D===void 0||D.dispose(),m.dispose()})}}},54:function(R,T,x){"use strict";x.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return W.Z}});var G=x(666),z=x.n(G),E=null,m=x(182),B=x(644);function q(V){if(V.material){var $=Array.isArray(V.material)?V.material:[V.material];$.forEach(function(D){var N,f;(N=D.color)===null||N===void 0||N.convertSRGBToLinear(),(f=D.emissive)===null||f===void 0||f.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(975),U=x(568),X=x(924),Q=require("idb-keyval"),Y=x(620),d=null,se=null,ie=function(){var V=(0,U.Z)(z().mark(function $(D,N){var f,c,p,b,S,A;return z().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return f=N.version,F.next=4,(0,Q.get)(D);case 4:if(p=F.sent,!(p&&p[f])){F.next=9;break}c=p[f],F.next=15;break;case 9:return F.next=11,(0,Y.Z)(fetch(D).then(function(oe){if(oe.ok)return oe.blob();throw new Error}));case 11:b=F.sent,S=b.res,A=b.err,A||(c=S,(0,Q.set)(D,(0,X.Z)({},f,S)));case 15:return F.abrupt("return",c?{url:URL.createObjectURL(c)}:{url:D});case 16:case"end":return F.stop()}},$)}));return function(D,N){return V.apply(this,arguments)}}()},975:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function z(E){if(G(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},620:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(42);function z(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E,m,B,q,W,U,X){try{var Q=E[U](X),Y=Q.value}catch(d){B(d);return}Q.done?m(Y):Promise.resolve(Y).then(q,W)}function z(E){return function(){var m=this,B=arguments;return new Promise(function(q,W){var U=E.apply(m,B);function X(Y){G(U,q,W,X,Q,"next",Y)}function Q(Y){G(U,q,W,X,Q,"throw",Y)}X(void 0)})}}},924:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z,E,m){return E in z?Object.defineProperty(z,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):z[E]=m,z}},42:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(924);function z(E){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},q=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(q=q.concat(Object.getOwnPropertySymbols(B).filter(function(W){return Object.getOwnPropertyDescriptor(B,W).enumerable}))),q.forEach(function(W){(0,G.Z)(E,W,B[W])})}return E}}},Oe={};function K(R){var T=Oe[R];if(T!==void 0)return T.exports;var x=Oe[R]={exports:{}};return Be[R](x,x.exports,K),x.exports}(function(){K.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return K.d(T,{a:T}),T}})(),function(){K.d=function(R,T){for(var x in T)K.o(T,x)&&!K.o(R,x)&&Object.defineProperty(R,x,{enumerable:!0,get:T[x]})}}(),function(){K.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){K.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";K.r(Pe),K.d(Pe,{BaseObject:function(){return gt},GUIObject:function(){return c},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function x(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var G=K(42);function z(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return m(s)}function q(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function W(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function X(s){return B(s)||q(s)||U(s)||W()}var Q=require("@tweenjs/tween.js"),Y=K.n(Q),d=K(644),se=K(187),ie=require("deepmerge"),V=K.n(ie),$=require("three/examples/jsm/libs/stats.module"),D=K.n($),N=require("lil-gui"),f=K.n(N),c=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,_=h.name,M=h.paramMap,L=h.items,Z=h.value,I=h.target,ae=a.toLowerCase().indexOf("color")>-1,k,ne=typeof Z=="undefined"&&I,ce=ne?I():u[a],fe=ne?a:"value";L?k=o.add(ce,fe,L):ae?k=o.addColor(ce,fe):k=o.add(ce,fe),k=k.name(_||a),typeof w!="undefined"&&(k=k.min(w)),typeof P!="undefined"&&(k=k.max(P)),typeof y!="undefined"&&(k=k.step(y)),k=k.onChange(function(){t.setTargetValue(r,a,ce[fe],M)}),ne&&k.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var _=h();Array.isArray(_)||(_=[_]),_.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(L){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),p={None:d.NoToneMapping,Linear:d.LinearToneMapping,Reinhard:d.ReinhardToneMapping,Cineon:d.CineonToneMapping,ACESFilmic:d.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:d.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},S=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.alpha,u=r.devicePixelRatio,a=r.antialias,h=r.powerPreference,w=r.toneMapping,P=r.toneMappingExposure,y=r.outputEncoding,_=r.logarithmicDepthBuffer,M=r.preserveDrawingBuffer,L=new d.WebGLRenderer({alpha:o,antialias:a,powerPreference:h,logarithmicDepthBuffer:_,preserveDrawingBuffer:M});L.setSize(e,t),L.setPixelRatio(u),L.autoClear=!1,L.toneMapping=p[w],L.toneMappingExposure=P,L.outputEncoding=y,this.renderer=L}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:p,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),A={fov:45,near:1,far:1e3},j=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new d.Vector3,this.oldCameraRotation=new d.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof d.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new d.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof d.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof d.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),F=K(54),oe={background:null},de=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new d.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new d.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,F.disposeMesh)(t)})},s}(),he=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new he.MapControls(e,o):new he.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,_=y===void 0?1/0:y,M=e.minY,L=M===void 0?-1/0:M,Z=this.limitPanV||new d.Vector3,I=this.control,ae=this.options.camera,k=new d.Vector3(u,L,P),ne=new d.Vector3(r,_,h);this.limitPanV=Z,Z.copy(I.target),I.target.clamp(k,ne),Z.sub(I.target),ae.position.sub(Z)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),v=require("three/examples/jsm/renderers/CSS3DRenderer"),l=new d.Vector3,g=new d.Matrix4,O=new d.Matrix4,C=new d.Vector3,H=new d.Vector3,te=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,L){return C.setFromMatrixPosition(M.matrixWorld),H.setFromMatrixPosition(L.matrixWorld),C.distanceToSquared(H)},e=function(M){var L=[];return M.traverse(function(Z){Z.isCSS2DObject&&L.push(Z)}),L},t=function(M){for(var L=e(M).sort(function(ne,ce){if(ne.renderOrder!==ce.renderOrder)return ce.renderOrder-ne.renderOrder;var fe=w.objects.get(ne).distanceToCameraSquared,ye=w.objects.get(ce).distanceToCameraSquared;return fe-ye}),Z=L.length,I=0,ae=L.length;I<ae;I++){var k=L[I].userData.zIndexFix||0;L[I].element.style.zIndex=Z-I+k}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(_,M){_.autoUpdate===!0&&_.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),g.copy(M.matrixWorldInverse),O.multiplyMatrices(M.projectionMatrix,g),y(_,_,M),t(_)},this.setSize=function(_,M){o=_,u=M,a=o/2,h=u/2,P.style.width="".concat(_,"px"),P.style.height="".concat(M,"px")};function y(_,M,L){if(_.isCSS2DObject){l.setFromMatrixPosition(_.matrixWorld),l.applyMatrix4(O);var Z=_.visible===!0&&l.z>=-1&&l.z<=1&&_.layers.test(L.layers)===!0;if(_.element.style.display=Z===!0?"":"none",Z===!0){_.onBeforeRender(r,M,L);var I=_.element;I.style.transform="translate(-50%,-50%) translate(".concat(l.x*a+a,"px,").concat(-l.y*h+h,"px)"),I.parentNode!==P&&P.appendChild(I),_.onAfterRender(r,M,L)}var ae={distanceToCameraSquared:n(L,_)};w.objects.set(_,ae)}for(var k=0,ne=_.children.length;k<ne;k++)y(_.children[k],M,L)}},J={zIndex:"auto"},re=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new te:new v.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ee=require("three/examples/jsm/postprocessing/EffectComposer"),ve=require("three/examples/jsm/postprocessing/RenderPass"),le=require("three/examples/jsm/postprocessing/ShaderPass"),ue=require("three/examples/jsm/shaders/CopyShader"),Fe=require("three/examples/jsm/shaders/GammaCorrectionShader"),Ue=require("three/examples/jsm/postprocessing/SMAAPass"),ke=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ve=require("three/examples/jsm/shaders/FXAAShader"),Ie=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},Pt=0,Ne=1,pe=!1,Re=Ie()!==!1,We=`varying vec2 vUv;
2
+
3
+ void main() {
4
+
5
+ vUv = uv;
6
+
7
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
8
+
9
+ }`,He=`uniform sampler2D baseTexture;
10
+ uniform sampler2D bloomTexture;
11
+
12
+ varying vec2 vUv;
13
+
14
+ void main() {
15
+
16
+ gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
+
18
+ }`;function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Me(s,i){return _e(s,i)}function Ze(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Me(s,i)}function qe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function Se(s){return Se=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Se(s)}function Te(s){return Se(s)}function Xe(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Qe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function Ye(s,i){return i&&(Qe(i)==="object"||typeof i=="function")?i:Xe(s)}function Ke(s){var i=qe();return function(){var e=Te(s),t;if(i){var r=Te(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Ye(this,t)}}var je=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";Ze(n,s);var i=Ke(n);function n(t,r,o,u){R(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new d.Vector2(t.x,t.y):new d.Vector2(256,256),a.clearColor=new d.Color(0,0,0);var h={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);a.renderTargetBright=new d.WebGLRenderTarget(w,P,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var _=new d.WebGLRenderTarget(w,P,h);_.texture.name="UnrealBloomPass.h".concat(y),_.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(_);var M=new d.WebGLRenderTarget(w,P,h);M.texture.name="UnrealBloomPass.v".concat(y),M.texture.generateMipmaps=!1,a.renderTargetsVertical.push(M),w=Math.round(w/2),P=Math.round(P/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var L=Ee.LuminosityHighPassShader;a.highPassUniforms=d.UniformsUtils.clone(L.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new d.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:L.vertexShader,fragmentShader:L.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var Z=[3,5,7,9,11];w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);for(var I=0;I<a.nMips;I++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(Z[I])),a.separableBlurMaterials[I].uniforms.texSize.value=new d.Vector2(w,P),w=Math.round(w/2),P=Math.round(P/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var ae=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=ae,a.bloomTintColors=[new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,ue.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var k=ue.CopyShader;return a.copyUniforms=d.UniformsUtils.clone(k.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new d.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:k.vertexShader,fragmentShader:k.fragmentShader,blending:d.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new d.Color,a.oldClearAlpha=1,a.basic=new d.MeshBasicMaterial,a.fsQuad=new je.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new d.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var w=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var P=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),P=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=w},e.getSeperableBlurMaterial=function(r){return new d.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new d.Vector2(.5,.5)},direction:{value:new d.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
2
19
  void main() {
3
20
  vUv = uv;
4
21
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -37,4 +54,4 @@
37
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
38
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
39
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
40
- }`})},n}(je.Pass);we.BlurDirectionX=new d.Vector2(1,0),we.BlurDirectionY=new d.Vector2(0,1);var $e={threshold:.2,strength:.5,radius:0},Je=new d.MeshBasicMaterial({color:"black"}),et=new d.SpriteMaterial({color:"#000"}),tt=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new d.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new d.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new ee.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ne);var y=new d.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:We,fragmentShader:He,defines:{}}),_=new le.ShaderPass(y,"baseTexture");_.needsSwap=!0,this.finalPass=_,o.addPass(_)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?et:Je)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new c({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),rt=require("three/examples/jsm/postprocessing/OutlinePass"),nt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},it=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new rt.OutlinePass(new d.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new c({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function at(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function st(s,i){if(s==null)return{};var n=at(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var ot=require("three/examples/jsm/postprocessing/SSRPass"),ut=require("three/examples/jsm/objects/ReflectorForSSRPass"),lt={maxDistance:10,selects:!0},ct={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},ft=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new ot.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ct,e),r=t.width,o=t.height,u=st(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new d.PlaneGeometry(r,o),y=new ut.ReflectorForSSRPass(P,E((0,G.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new c({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),dt=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ee.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat,encoding:o,type:r},h;if(+d.REVISION<138&&t>0){var w=new d.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+d.REVISION>=138&&t>0){var P=new d.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=P}else{var y=new d.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new pe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new le.ShaderPass(ue.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new le.ShaderPass(Fe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new le.ShaderPass(Ie.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new ke.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Ue.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new tt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new ft(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new d.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new d.Raycaster,this.installPlugins=new Map,this.event=new se.EventEmitter,this.clock=new d.Clock,this.options=I()(s.options,n,{isMergeableObject:F.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(f());u.open(!1),this.gui=u}if(r){var a=new(D());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(Q(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,_=P.height,M=new j({isdev:o,width:y,height:_,cameraParams:w});this.gui&&M.setGui(this.gui);var L=M.camera,Z=new de({camera:L,sceneParams:h}),V=Z.scene,ae=new S({width:y,height:_,scene:V,camera:L,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:d.LinearEncoding,antialias:!1})});this.gui&&ae.setGui(this.gui);var U=ae.renderer;u&&Z.addAxesHelper(),this.sceneController=Z,this.rendererController=ae,this.cameraController=M,r.appendChild(U.domElement);var ne=new ResizeObserver(function(ce){var fe=!0,ye=!1,De=void 0;try{for(var xe=ce[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var bt=ze.value,Ge=bt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(yt){ye=!0,De=yt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});ne.observe(r),this.resizeObserver=ne},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var _=new dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:d.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=_,y==="ssaa"&&_.addSSAAPass(),o&&_.addSSRPass(w),t&&_.addBloomPass(a),r&&_.addOutlinePass(h),u.outputEncoding===d.sRGBEncoding&&_.addGammaCorrectionPass(),y==="fxaa"?_.addFXAAPass():y==="smaa"&&_.addSMAAPass(),_.checkCopyPass(),this.event.on("passcheck",function(){_.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new re(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new ge({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new d.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),_=P.getElapsedTime();if(a.clear(),K().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(L,Z){var V;(V=Z.update)===null||V===void 0||V.call(Z,y,_)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:_})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),K().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Ce.options={isdev:ve,stats:ve,gui:ve,axesHelper:ve,control:ve,renderer:E((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:oe,camera:A,bloom:!1,bloomParams:$e,outline:!1,outlineParams:nt,css2DRenderer:!1,ssr:!1,ssrParams:lt,css2DRendererParams:(0,G.Z)({},J),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},J)};function ht(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return ht()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var pt=q(484);function vt(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,pt.Z)(n.promise,i)),n}var mt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,F.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},gt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=vt(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Mesh,Q(t)),this},i.createGroup=function(){return this.object3d=new d.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Points,Q(t)),this},i.createCSS2DObject=function(e){return this.object3d=new mt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new p.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new p.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new d.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,Q(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,Q(t)),this},i.getSize=function(){var e=new d.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new d.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
57
+ }`})},n}(je.Pass);we.BlurDirectionX=new d.Vector2(1,0),we.BlurDirectionY=new d.Vector2(0,1);var $e={threshold:.2,strength:.5,radius:0},Je=new d.MeshBasicMaterial({color:"black"}),et=new d.SpriteMaterial({color:"#000"}),tt=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new d.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new d.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new ee.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ne);var y=new d.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:We,fragmentShader:He,defines:{}}),_=new le.ShaderPass(y,"baseTexture");_.needsSwap=!0,this.finalPass=_,o.addPass(_)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?et:Je)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new c({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),rt=require("three/examples/jsm/postprocessing/OutlinePass"),nt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},it=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new rt.OutlinePass(new d.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new c({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function at(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function st(s,i){if(s==null)return{};var n=at(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var ot=require("three/examples/jsm/postprocessing/SSRPass"),ut=require("three/examples/jsm/objects/ReflectorForSSRPass"),lt={maxDistance:10,selects:!0},ct={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},ft=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new ot.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ct,e),r=t.width,o=t.height,u=st(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new d.PlaneGeometry(r,o),y=new ut.ReflectorForSSRPass(P,E((0,G.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new c({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),dt=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ee.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat,encoding:o,type:r},h;if(+d.REVISION<138&&t>0){var w=new d.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+d.REVISION>=138&&t>0){var P=new d.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=P}else{var y=new d.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new ve.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new le.ShaderPass(ue.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new le.ShaderPass(Fe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new le.ShaderPass(Ve.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new Ue.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new ke.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new tt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new ft(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new d.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new d.Raycaster,this.installPlugins=new Map,this.event=new se.EventEmitter,this.clock=new d.Clock,this.options=V()(s.options,n,{isMergeableObject:F.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(f());u.open(!1),this.gui=u}if(r){var a=new(D());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(X(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,_=P.height,M=new j({isdev:o,width:y,height:_,cameraParams:w});this.gui&&M.setGui(this.gui);var L=M.camera,Z=new de({camera:L,sceneParams:h}),I=Z.scene,ae=new S({width:y,height:_,scene:I,camera:L,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:d.LinearEncoding,antialias:!1})});this.gui&&ae.setGui(this.gui);var k=ae.renderer;u&&Z.addAxesHelper(),this.sceneController=Z,this.rendererController=ae,this.cameraController=M,r.appendChild(k.domElement);var ne=new ResizeObserver(function(ce){var fe=!0,ye=!1,De=void 0;try{for(var xe=ce[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var bt=ze.value,Ge=bt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(yt){ye=!0,De=yt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});ne.observe(r),this.resizeObserver=ne},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var _=new dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:d.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=_,y==="ssaa"&&_.addSSAAPass(),o&&_.addSSRPass(w),t&&_.addBloomPass(a),r&&_.addOutlinePass(h),u.outputEncoding===d.sRGBEncoding&&_.addGammaCorrectionPass(),y==="fxaa"?_.addFXAAPass():y==="smaa"&&_.addSMAAPass(),_.checkCopyPass(),this.event.on("passcheck",function(){_.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new re(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new ge({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new d.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),_=P.getElapsedTime();if(a.clear(),Y().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(L,Z){var I;(I=Z.update)===null||I===void 0||I.call(Z,y,_)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:_})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),Y().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Ce.options={isdev:pe,stats:pe,gui:pe,axesHelper:pe,control:pe,renderer:E((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:oe,camera:A,bloom:!1,bloomParams:$e,outline:!1,outlineParams:nt,css2DRenderer:!1,ssr:!1,ssrParams:lt,css2DRendererParams:(0,G.Z)({},J),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},J)};function ht(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return ht()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var vt=K(620);function pt(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,vt.Z)(n.promise,i)),n}var mt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,F.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},gt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=pt(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Mesh,X(t)),this},i.createGroup=function(){return this.object3d=new d.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Points,X(t)),this},i.createCSS2DObject=function(e){return this.object3d=new mt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new v.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new v.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new d.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,X(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,X(t)),this},i.getSize=function(){var e=new d.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new d.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
@@ -0,0 +1,57 @@
1
+ import*as Ve from"idb-keyval";import*as D from"three";import*as Ht from"@tweenjs/tween.js";import*as Kt from"deepmerge";import*as Zt from"three/examples/jsm/libs/stats.module";import*as Qt from"lil-gui";import*as Ie from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Yt from"three/examples/jsm/postprocessing/EffectComposer";import*as $t from"three/examples/jsm/postprocessing/RenderPass";import*as Jt from"three/examples/jsm/postprocessing/ShaderPass";import*as qt from"three/examples/jsm/shaders/CopyShader";import*as er from"three/examples/jsm/shaders/GammaCorrectionShader";import*as tr from"three/examples/jsm/postprocessing/SMAAPass";import*as rr from"three/examples/jsm/postprocessing/SSAARenderPass";import*as nr from"three/examples/jsm/shaders/FXAAShader";import*as Xe from"three/examples/jsm/postprocessing/Pass";import*as ir from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as ar from"three/examples/jsm/postprocessing/OutlinePass";import*as sr from"three/examples/jsm/postprocessing/SSRPass";import*as or from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ur from"three/examples/jsm/renderers/CSS2DRenderer";var lr={187:function(T){var A=typeof Reflect=="object"?Reflect:null,C=A&&typeof A.apply=="function"?A.apply:function(c,v,_){return Function.prototype.apply.call(c,v,_)},G;A&&typeof A.ownKeys=="function"?G=A.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function B(l){console&&console.warn&&console.warn(l)}var M=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}T.exports=m,T.exports.once=ue,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var U=10;function X(l){if(typeof l!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof l)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return U},set:function(l){if(typeof l!="number"||l<0||M(l))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+l+".");U=l}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||M(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function W(l){return l._maxListeners===void 0?m.defaultMaxListeners:l._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var v=[],_=1;_<arguments.length;_++)v.push(arguments[_]);var S=c==="error",O=this._events;if(O!==void 0)S=S&&O.error===void 0;else if(!S)return!1;if(S){var R;if(v.length>0&&(R=v[0]),R instanceof Error)throw R;var J=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw J.context=R,J}var le=O[c];if(le===void 0)return!1;if(typeof le=="function")C(le,this,v);else for(var q=le.length,ce=d(le,q),_=0;_<q;++_)C(ce[_],this,v);return!0};function F(l,c,v,_){var S,O,R;if(X(v),O=l._events,O===void 0?(O=l._events=Object.create(null),l._eventsCount=0):(O.newListener!==void 0&&(l.emit("newListener",c,v.listener?v.listener:v),O=l._events),R=O[c]),R===void 0)R=O[c]=v,++l._eventsCount;else if(typeof R=="function"?R=O[c]=_?[v,R]:[R,v]:_?R.unshift(v):R.push(v),S=W(l),S>0&&R.length>S&&!R.warned){R.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=l,J.type=c,J.count=R.length,B(J)}return l}m.prototype.addListener=function(c,v){return F(this,c,v,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,v){return F(this,c,v,!0)};function H(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Y(l,c,v){var _={fired:!1,wrapFn:void 0,target:l,type:c,listener:v},S=H.bind(_);return S.listener=v,_.wrapFn=S,S}m.prototype.once=function(c,v){return X(v),this.on(c,Y(this,c,v)),this},m.prototype.prependOnceListener=function(c,v){return X(v),this.prependListener(c,Y(this,c,v)),this},m.prototype.removeListener=function(c,v){var _,S,O,R,J;if(X(v),S=this._events,S===void 0)return this;if(_=S[c],_===void 0)return this;if(_===v||_.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,_.listener||v));else if(typeof _!="function"){for(O=-1,R=_.length-1;R>=0;R--)if(_[R]===v||_[R].listener===v){J=_[R].listener,O=R;break}if(O<0)return this;O===0?_.shift():se(_,O),_.length===1&&(S[c]=_[0]),S.removeListener!==void 0&&this.emit("removeListener",c,J||v)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var v,_,S;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[c]),this;if(arguments.length===0){var O=Object.keys(_),R;for(S=0;S<O.length;++S)R=O[S],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=_[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(c,v[S]);return this};function ee(l,c,v){var _=l._events;if(_===void 0)return[];var S=_[c];return S===void 0?[]:typeof S=="function"?v?[S.listener||S]:[S]:v?$(S):d(S,S.length)}m.prototype.listeners=function(c){return ee(this,c,!0)},m.prototype.rawListeners=function(c){return ee(this,c,!1)},m.listenerCount=function(l,c){return typeof l.listenerCount=="function"?l.listenerCount(c):te.call(l,c)},m.prototype.listenerCount=te;function te(l){var c=this._events;if(c!==void 0){var v=c[l];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function d(l,c){for(var v=new Array(c),_=0;_<c;++_)v[_]=l[_];return v}function se(l,c){for(;c+1<l.length;c++)l[c]=l[c+1];l.pop()}function $(l){for(var c=new Array(l.length),v=0;v<c.length;++v)c[v]=l[v].listener||l[v];return c}function ue(l,c){return new Promise(function(v,_){function S(R){l.removeListener(c,O),_(R)}function O(){typeof l.removeListener=="function"&&l.removeListener("error",S),v([].slice.call(arguments))}Z(l,c,O,{once:!0}),c!=="error"&&V(l,S,{once:!0})})}function V(l,c,v){typeof l.on=="function"&&Z(l,"error",c,v)}function Z(l,c,v,_){if(typeof l.on=="function")_.once?l.once(c,v):l.on(c,v);else if(typeof l.addEventListener=="function")l.addEventListener(c,function S(O){_.once&&l.removeEventListener(c,S),v(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof l)}},666:function(T){var A=function(C){"use strict";var G=Object.prototype,B=G.hasOwnProperty,M,m=typeof Symbol=="function"?Symbol:{},U=m.iterator||"@@iterator",X=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function F(p,f,g){return Object.defineProperty(p,f,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[f]}try{F({},"")}catch(p){F=function(f,g,E){return f[g]=E}}function H(p,f,g,E){var w=f&&f.prototype instanceof ue?f:ue,K=Object.create(w.prototype),re=new ce(E||[]);return K._invoke=R(p,g,re),K}C.wrap=H;function Y(p,f,g){try{return{type:"normal",arg:p.call(f,g)}}catch(E){return{type:"throw",arg:E}}}var ee="suspendedStart",te="suspendedYield",d="executing",se="completed",$={};function ue(){}function V(){}function Z(){}var l={};F(l,U,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(pe([])));v&&v!==G&&B.call(v,U)&&(l=v);var _=Z.prototype=ue.prototype=Object.create(l);V.prototype=Z,F(_,"constructor",Z),F(Z,"constructor",V),V.displayName=F(Z,W,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(f){F(p,f,function(g){return this._invoke(f,g)})})}C.isGeneratorFunction=function(p){var f=typeof p=="function"&&p.constructor;return f?f===V||(f.displayName||f.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,Z):(p.__proto__=Z,F(p,W,"GeneratorFunction")),p.prototype=Object.create(_),p},C.awrap=function(p){return{__await:p}};function O(p,f){function g(K,re,ie,ne){var Q=Y(p[K],p,re);if(Q.type==="throw")ne(Q.arg);else{var me=Q.arg,ve=me.value;return ve&&typeof ve=="object"&&B.call(ve,"__await")?f.resolve(ve.__await).then(function(fe){g("next",fe,ie,ne)},function(fe){g("throw",fe,ie,ne)}):f.resolve(ve).then(function(fe){me.value=fe,ie(me)},function(fe){return g("throw",fe,ie,ne)})}}var E;function w(K,re){function ie(){return new f(function(ne,Q){g(K,re,ne,Q)})}return E=E?E.then(ie,ie):ie()}this._invoke=w}S(O.prototype),F(O.prototype,X,function(){return this}),C.AsyncIterator=O,C.async=function(p,f,g,E,w){w===void 0&&(w=Promise);var K=new O(H(p,f,g,E),w);return C.isGeneratorFunction(f)?K:K.next().then(function(re){return re.done?re.value:K.next()})};function R(p,f,g){var E=ee;return function(K,re){if(E===d)throw new Error("Generator is already running");if(E===se){if(K==="throw")throw re;return be()}for(g.method=K,g.arg=re;;){var ie=g.delegate;if(ie){var ne=J(ie,g);if(ne){if(ne===$)continue;return ne}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(E===ee)throw E=se,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);E=d;var Q=Y(p,f,g);if(Q.type==="normal"){if(E=g.done?se:te,Q.arg===$)continue;return{value:Q.arg,done:g.done}}else Q.type==="throw"&&(E=se,g.method="throw",g.arg=Q.arg)}}}function J(p,f){var g=p.iterator[f.method];if(g===M){if(f.delegate=null,f.method==="throw"){if(p.iterator.return&&(f.method="return",f.arg=M,J(p,f),f.method==="throw"))return $;f.method="throw",f.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var E=Y(g,p.iterator,f.arg);if(E.type==="throw")return f.method="throw",f.arg=E.arg,f.delegate=null,$;var w=E.arg;if(!w)return f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,$;if(w.done)f[p.resultName]=w.value,f.next=p.nextLoc,f.method!=="return"&&(f.method="next",f.arg=M);else return w;return f.delegate=null,$}S(_),F(_,W,"Generator"),F(_,U,function(){return this}),F(_,"toString",function(){return"[object Generator]"});function le(p){var f={tryLoc:p[0]};1 in p&&(f.catchLoc=p[1]),2 in p&&(f.finallyLoc=p[2],f.afterLoc=p[3]),this.tryEntries.push(f)}function q(p){var f=p.completion||{};f.type="normal",delete f.arg,p.completion=f}function ce(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(le,this),this.reset(!0)}C.keys=function(p){var f=[];for(var g in p)f.push(g);return f.reverse(),function E(){for(;f.length;){var w=f.pop();if(w in p)return E.value=w,E.done=!1,E}return E.done=!0,E}};function pe(p){if(p){var f=p[U];if(f)return f.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var g=-1,E=function w(){for(;++g<p.length;)if(B.call(p,g))return w.value=p[g],w.done=!1,w;return w.value=M,w.done=!0,w};return E.next=E}}return{next:be}}C.values=pe;function be(){return{value:M,done:!0}}return ce.prototype={constructor:ce,reset:function(p){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(q),!p)for(var f in this)f.charAt(0)==="t"&&B.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=M)},stop:function(){this.done=!0;var p=this.tryEntries[0],f=p.completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var f=this;function g(ne,Q){return K.type="throw",K.arg=p,f.next=ne,Q&&(f.method="next",f.arg=M),!!Q}for(var E=this.tryEntries.length-1;E>=0;--E){var w=this.tryEntries[E],K=w.completion;if(w.tryLoc==="root")return g("end");if(w.tryLoc<=this.prev){var re=B.call(w,"catchLoc"),ie=B.call(w,"finallyLoc");if(re&&ie){if(this.prev<w.catchLoc)return g(w.catchLoc,!0);if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else if(re){if(this.prev<w.catchLoc)return g(w.catchLoc,!0)}else if(ie){if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,f){for(var g=this.tryEntries.length-1;g>=0;--g){var E=this.tryEntries[g];if(E.tryLoc<=this.prev&&B.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var w=E;break}}w&&(p==="break"||p==="continue")&&w.tryLoc<=f&&f<=w.finallyLoc&&(w=null);var K=w?w.completion:{};return K.type=p,K.arg=f,w?(this.method="next",this.next=w.finallyLoc,$):this.complete(K)},complete:function(p,f){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&f&&(this.next=f),$},finish:function(p){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),q(g),$}},catch:function(p){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.tryLoc===p){var E=g.completion;if(E.type==="throw"){var w=E.arg;q(g)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(p,f,g){return this.delegate={iterator:pe(p),resultName:f,nextLoc:g},this.method==="next"&&(this.arg=M),$}},C}(T.exports);try{regeneratorRuntime=A}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},182:function(T,A,C){C.d(A,{Z:function(){return G}});function G(B){if(B.geometry&&B.geometry.dispose(),B.material){var M=Array.isArray(B.material)?B.material:[B.material];M.forEach(function(m){var U,X,W,F,H,Y,ee,te,d,se,$,ue,V;(U=m.map)===null||U===void 0||U.dispose(),(X=m.lightMap)===null||X===void 0||X.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(F=m.normalMap)===null||F===void 0||F.dispose(),(H=m.specularMap)===null||H===void 0||H.dispose(),(Y=m.envMap)===null||Y===void 0||Y.dispose(),(ee=m.alphaMap)===null||ee===void 0||ee.dispose(),(te=m.aoMap)===null||te===void 0||te.dispose(),(d=m.displacementMap)===null||d===void 0||d.dispose(),(se=m.emissiveMap)===null||se===void 0||se.dispose(),($=m.gradientMap)===null||$===void 0||$.dispose(),(ue=m.metalnessMap)===null||ue===void 0||ue.dispose(),(V=m.roughnessMap)===null||V===void 0||V.dispose(),m.dispose()})}}},175:function(T,A,C){C.d(A,{wf:function(){return m.Z},PO:function(){return W.Z}});var G=C(666),B=C.n(G),M=null,m=C(182),U=C(949);function X(V){if(V.material){var Z=Array.isArray(V.material)?V.material:[V.material];Z.forEach(function(l){var c,v;(c=l.color)===null||c===void 0||c.convertSRGBToLinear(),(v=l.emissive)===null||v===void 0||v.convertSRGBToLinear(),l.map&&(l.map.encoding=THREE.sRGBEncoding),l.emissiveMap&&(l.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=C(975),F=C(568),H=C(924),Y=V=>{var Z={};return C.d(Z,V),Z},ee=V=>()=>V,te=Y({get:()=>Ve.get,set:()=>Ve.set}),d=C(620),se=null,$=null,ue=function(){var V=(0,F.Z)(B().mark(function Z(l,c){var v,_,S,O,R,J;return B().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return v=c.version,q.next=4,(0,te.get)(l);case 4:if(S=q.sent,!(S&&S[v])){q.next=9;break}_=S[v],q.next=15;break;case 9:return q.next=11,(0,d.Z)(fetch(l).then(function(ce){if(ce.ok)return ce.blob();throw new Error}));case 11:O=q.sent,R=O.res,J=O.err,J||(_=R,(0,te.set)(l,(0,H.Z)({},v,R)));case 15:return q.abrupt("return",_?{url:URL.createObjectURL(_)}:{url:l});case 16:case"end":return q.stop()}},Z)}));return function(l,c){return V.apply(this,arguments)}}()},975:function(T,A,C){C.d(A,{Z:function(){return B}});function G(M){return Object.prototype.toString.call(M)==="[object Object]"}function B(M){if(G(M)===!1)return!1;var m=M.constructor;if(m===void 0)return!0;var U=m.prototype;return!(G(U)===!1||U.hasOwnProperty("isPrototypeOf")===!1)}},620:function(T,A,C){C.d(A,{Z:function(){return B}});var G=C(42);function B(M){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M.then(function(U){return(0,G.Z)({err:null,res:U},m)}).catch(function(U){return(0,G.Z)({err:U,res:void 0},m)})}},949:function(T,A,C){var G=M=>{var m={};return C.d(m,M),m},B=M=>()=>M;T.exports=G({ACESFilmicToneMapping:()=>D.ACESFilmicToneMapping,AdditiveBlending:()=>D.AdditiveBlending,AxesHelper:()=>D.AxesHelper,Box3:()=>D.Box3,Camera:()=>D.Camera,CineonToneMapping:()=>D.CineonToneMapping,Clock:()=>D.Clock,Color:()=>D.Color,Euler:()=>D.Euler,Group:()=>D.Group,Layers:()=>D.Layers,LinearEncoding:()=>D.LinearEncoding,LinearFilter:()=>D.LinearFilter,LinearToneMapping:()=>D.LinearToneMapping,Matrix4:()=>D.Matrix4,Mesh:()=>D.Mesh,MeshBasicMaterial:()=>D.MeshBasicMaterial,NoToneMapping:()=>D.NoToneMapping,PerspectiveCamera:()=>D.PerspectiveCamera,PlaneGeometry:()=>D.PlaneGeometry,Points:()=>D.Points,REVISION:()=>D.REVISION,RGBAFormat:()=>D.RGBAFormat,Raycaster:()=>D.Raycaster,ReinhardToneMapping:()=>D.ReinhardToneMapping,Scene:()=>D.Scene,ShaderMaterial:()=>D.ShaderMaterial,Sprite:()=>D.Sprite,SpriteMaterial:()=>D.SpriteMaterial,UniformsUtils:()=>D.UniformsUtils,UnsignedByteType:()=>D.UnsignedByteType,Vector2:()=>D.Vector2,Vector3:()=>D.Vector3,WebGLMultisampleRenderTarget:()=>D.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>D.WebGLRenderTarget,WebGLRenderer:()=>D.WebGLRenderer,sRGBEncoding:()=>D.sRGBEncoding})},568:function(T,A,C){C.d(A,{Z:function(){return B}});function G(M,m,U,X,W,F,H){try{var Y=M[F](H),ee=Y.value}catch(te){U(te);return}Y.done?m(ee):Promise.resolve(ee).then(X,W)}function B(M){return function(){var m=this,U=arguments;return new Promise(function(X,W){var F=M.apply(m,U);function H(ee){G(F,X,W,H,Y,"next",ee)}function Y(ee){G(F,X,W,H,Y,"throw",ee)}H(void 0)})}}},924:function(T,A,C){C.d(A,{Z:function(){return G}});function G(B,M,m){return M in B?Object.defineProperty(B,M,{value:m,enumerable:!0,configurable:!0,writable:!0}):B[M]=m,B}},42:function(T,A,C){C.d(A,{Z:function(){return B}});var G=C(924);function B(M){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{},X=Object.keys(U);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(U).filter(function(W){return Object.getOwnPropertyDescriptor(U,W).enumerable}))),X.forEach(function(W){(0,G.Z)(M,W,U[W])})}return M}}},He={};function z(T){var A=He[T];if(A!==void 0)return A.exports;var C=He[T]={exports:{}};return lr[T](C,C.exports,z),C.exports}(function(){z.n=function(T){var A=T&&T.__esModule?function(){return T.default}:function(){return T};return z.d(A,{a:A}),A}})(),function(){z.d=function(T,A){for(var C in A)z.o(A,C)&&!z.o(T,C)&&Object.defineProperty(T,C,{enumerable:!0,get:A[C]})}}(),function(){z.o=function(T,A){return Object.prototype.hasOwnProperty.call(T,A)}}();var _e={};(function(){z.d(_e,{L6:function(){return Vt},sb:function(){return O},z:function(){return Re},ZP:function(){return Re}});function T(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function A(n,t){for(var a=0;a<t.length;a++){var e=t[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,t,a){return t&&A(n.prototype,t),a&&A(n,a),n}var G=z(42);function B(n,t){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),a.push.apply(a,e)}return a}function M(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))}),n}function m(n,t){(t==null||t>n.length)&&(t=n.length);for(var a=0,e=new Array(t);a<t;a++)e[a]=n[a];return e}function U(n){if(Array.isArray(n))return m(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function W(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(n,t){if(!!n){if(typeof n=="string")return m(n,t);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return m(n,t)}}function H(n){return U(n)||X(n)||F(n)||W()}var Y=n=>{var t={};return z.d(t,n),t},ee=n=>()=>n,te=Y({default:()=>Ht.default}),d=z(949),se=z(187),$=n=>{var t={};return z.d(t,n),t},ue=n=>()=>n,V=$({default:()=>Kt.default}),Z=n=>{var t={};return z.d(t,n),t},l=n=>()=>n,c=Z({default:()=>Zt.default}),v=n=>{var t={};return z.d(t,n),t},_=n=>()=>n,S=v({default:()=>Qt.default}),O=function(){"use strict";function n(a){T(this,n),this.guiParams={},a&&(this.guiParams=a)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(i){var o=e.addFolder(i),u=r.guiParams[i];Object.keys(u).forEach(function(s){var h=u[s],x=h.min,P=h.max,b=h.step,y=h.name,L=h.paramMap,j=h.items,I=h.value,k=h.target,oe=s.toLowerCase().indexOf("color")>-1,N,ae=typeof I=="undefined"&&k,de=ae?k():u[s],he=ae?s:"value";j?N=o.add(de,he,j):oe?N=o.addColor(de,he):N=o.add(de,he),N=N.name(y||s),typeof x!="undefined"&&(N=N.min(x)),typeof P!="undefined"&&(N=N.max(P)),typeof b!="undefined"&&(N=N.step(b)),N=N.onChange(function(){r.setTargetValue(i,s,de[he],L)}),ae&&N.listen()})})},t.setTargetValue=function(e,r,i,o){var u=this.guiParams[e][r],s=u.onChange,h=u.target,x=u.value,P=r.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&h;if(h&&!b){var y=h();Array.isArray(y)||(y=[y]),y.forEach(function(L){if(!!L)if(P)try{L[o||r].set(i)}catch(j){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else L[o||r]=i})}s&&s(i)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(i){var o=e.guiParams[r][i];typeof o.value!="undefined"&&e.setTargetValue(r,i,o.value,o.paramMap)})})},n}(),R={None:d.NoToneMapping,Linear:d.LinearToneMapping,Reinhard:d.ReinhardToneMapping,Cineon:d.CineonToneMapping,ACESFilmic:d.ACESFilmicToneMapping},J={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:d.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},le=function(){"use strict";function n(a){T(this,n),this.options=a;var e=a.width,r=a.height,i=a.rendererParams,o=i.alpha,u=i.devicePixelRatio,s=i.antialias,h=i.powerPreference,x=i.toneMapping,P=i.toneMappingExposure,b=i.outputEncoding,y=i.logarithmicDepthBuffer,L=i.preserveDrawingBuffer,j=new d.WebGLRenderer({alpha:o,antialias:s,powerPreference:h,logarithmicDepthBuffer:y,preserveDrawingBuffer:L});j.setSize(e,r),j.setPixelRatio(u),j.autoClear=!1,j.toneMapping=R[x],j.toneMappingExposure=P,j.outputEncoding=b,this.renderer=j}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,i=e.camera;this.renderer.render(r,i)},t.setGui=function(e){var r=this,i=new O({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:R,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});i.showGui(e)},t.dispose=function(){var e,r,i;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},n}(),q={fov:45,near:1,far:1e3},ce=function(){"use strict";function n(a){T(this,n),this.oldCameraPosition=new d.Vector3,this.oldCameraRotation=new d.Euler,this.customCamera=!1,this.options=a;var e=a.width,r=a.height,i=a.cameraParams;if(i instanceof d.Camera)this.camera=i,this.customCamera=!0;else{var o=i.fov,u=i.far,s=i.near,h=new d.PerspectiveCamera(o,e/r,s,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var t=n.prototype;return t.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},t.setSize=function(e,r){this.camera instanceof d.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,i=new O({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof d.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),i.showGui(e)},n}(),pe=z(175),be={background:null},p=function(){"use strict";function n(a){T(this,n),this.options=a;var e=a.camera,r=a.sceneParams,i=r.background,o=new d.Scene;i&&(o.background=i),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new d.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,pe.wf)(r)})},n}(),f=n=>{var t={};return z.d(t,n),t},g=n=>()=>n,E=f({MapControls:()=>Ie.MapControls,OrbitControls:()=>Ie.OrbitControls}),w={},K=function(){"use strict";function n(a){T(this,n),this.options=a;var e=a.camera,r=a.controlParams,i=a.mapControl,o=r.domElement,u=i?new E.MapControls(e,o):new E.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var t=n.prototype;return t.limitPan=function(e){var r=e.maxX,i=r===void 0?1/0:r,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,h=s===void 0?1/0:s,x=e.minZ,P=x===void 0?-1/0:x,b=e.maxY,y=b===void 0?1/0:b,L=e.minY,j=L===void 0?-1/0:L,I=this.limitPanV||new d.Vector3,k=this.control,oe=this.options.camera,N=new d.Vector3(u,j,P),ae=new d.Vector3(i,y,h);this.limitPanV=I,I.copy(k.target),k.target.clamp(N,ae),I.sub(k.target),oe.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),re=n=>{var t={};return z.d(t,n),t},ie=n=>()=>n,ne=re({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),Q=new d.Vector3,me=new d.Matrix4,ve=new d.Matrix4,fe=new d.Vector3,Te=new d.Vector3,Ke=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,n);var a=function(L,j){return fe.setFromMatrixPosition(L.matrixWorld),Te.setFromMatrixPosition(j.matrixWorld),fe.distanceToSquared(Te)},e=function(L){var j=[];return L.traverse(function(I){I.isCSS2DObject&&j.push(I)}),j},r=function(L){for(var j=e(L).sort(function(ae,de){if(ae.renderOrder!==de.renderOrder)return de.renderOrder-ae.renderOrder;var he=x.objects.get(ae).distanceToCameraSquared,Se=x.objects.get(de).distanceToCameraSquared;return he-Se}),I=j.length,k=0,oe=j.length;k<oe;k++){var N=j[k].userData.zIndexFix||0;j[k].element.style.zIndex=I-k+N}},i=this,o,u,s,h,x={objects:new WeakMap},P=t.element!==void 0?t.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,L){y.autoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.updateMatrixWorld(),me.copy(L.matrixWorldInverse),ve.multiplyMatrices(L.projectionMatrix,me),b(y,y,L),r(y)},this.setSize=function(y,L){o=y,u=L,s=o/2,h=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(L,"px")};function b(y,L,j){if(y.isCSS2DObject){Q.setFromMatrixPosition(y.matrixWorld),Q.applyMatrix4(ve);var I=y.visible===!0&&Q.z>=-1&&Q.z<=1&&y.layers.test(j.layers)===!0;if(y.element.style.display=I===!0?"":"none",I===!0){y.onBeforeRender(i,L,j);var k=y.element;k.style.transform="translate(-50%,-50%) translate(".concat(Q.x*s+s,"px,").concat(-Q.y*h+h,"px)"),k.parentNode!==P&&P.appendChild(k),y.onAfterRender(i,L,j)}var oe={distanceToCameraSquared:a(j,y)};x.objects.set(y,oe)}for(var N=0,ae=y.children.length;N<ae;N++)b(y.children[N],L,j)}},Ae={zIndex:"auto"},Ze=function(){"use strict";function n(a){T(this,n),this.container=a}var t=n.prototype;return t.addRenderer=function(e,r){var i=this.container,o=i.offsetWidth,u=i.offsetHeight,s=e==="css2d"?new Ke:new ne.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,u),i.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Qe=n=>{var t={};return z.d(t,n),t},vr=n=>()=>n,Le=Qe({EffectComposer:()=>Yt.EffectComposer}),Ye=n=>{var t={};return z.d(t,n),t},pr=n=>()=>n,$e=Ye({RenderPass:()=>$t.RenderPass}),Je=n=>{var t={};return z.d(t,n),t},mr=n=>()=>n,Pe=Je({ShaderPass:()=>Jt.ShaderPass}),qe=n=>{var t={};return z.d(t,n),t},gr=n=>()=>n,Ce=qe({CopyShader:()=>qt.CopyShader}),et=n=>{var t={};return z.d(t,n),t},_r=n=>()=>n,tt=et({GammaCorrectionShader:()=>er.GammaCorrectionShader}),rt=n=>{var t={};return z.d(t,n),t},br=n=>()=>n,nt=rt({SMAAPass:()=>tr.SMAAPass}),it=n=>{var t={};return z.d(t,n),t},Pr=n=>()=>n,at=it({SSAARenderPass:()=>rr.SSAARenderPass}),st=n=>{var t={};return z.d(t,n),t},yr=n=>()=>n,ot=st({FXAAShader:()=>nr.FXAAShader}),ut=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},Sr=0,lt=1,ge=!1,je=ut()!==!1,ct=`varying vec2 vUv;
2
+
3
+ void main() {
4
+
5
+ vUv = uv;
6
+
7
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
8
+
9
+ }`,ft=`uniform sampler2D baseTexture;
10
+ uniform sampler2D bloomTexture;
11
+
12
+ varying vec2 vUv;
13
+
14
+ void main() {
15
+
16
+ gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
+
18
+ }`;function xe(n,t){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(n,t)}function De(n,t){return xe(n,t)}function dt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&De(n,t)}function ht(){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(n){return!1}}function we(n){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},we(n)}function Be(n){return we(n)}function vt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function pt(n){return n&&n.constructor===Symbol?"symbol":typeof n}function mt(n,t){return t&&(pt(t)==="object"||typeof t=="function")?t:vt(n)}function gt(n){var t=ht();return function(){var e=Be(n),r;if(t){var i=Be(this).constructor;r=Reflect.construct(e,arguments,i)}else r=e.apply(this,arguments);return mt(this,r)}}var _t=n=>{var t={};return z.d(t,n),t},Cr=n=>()=>n,Ge=_t({FullScreenQuad:()=>Xe.FullScreenQuad,Pass:()=>Xe.Pass}),bt=n=>{var t={};return z.d(t,n),t},xr=n=>()=>n,ze=bt({LuminosityHighPassShader:()=>ir.LuminosityHighPassShader}),Ee=function(n){"use strict";dt(a,n);var t=gt(a);function a(r,i,o,u){T(this,a);var s;s=t.call(this),s.strength=i!==void 0?i:1,s.radius=o,s.threshold=u,s.resolution=r!==void 0?new d.Vector2(r.x,r.y):new d.Vector2(256,256),s.clearColor=new d.Color(0,0,0);var h={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var x=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new d.WebGLRenderTarget(x,P,h),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var y=new d.WebGLRenderTarget(x,P,h);y.texture.name="UnrealBloomPass.h".concat(b),y.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(y);var L=new d.WebGLRenderTarget(x,P,h);L.texture.name="UnrealBloomPass.v".concat(b),L.texture.generateMipmaps=!1,s.renderTargetsVertical.push(L),x=Math.round(x/2),P=Math.round(P/2)}ze.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var j=ze.LuminosityHighPassShader;s.highPassUniforms=d.UniformsUtils.clone(j.uniforms),s.highPassUniforms.luminosityThreshold.value=u,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new d.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:j.vertexShader,fragmentShader:j.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var I=[3,5,7,9,11];x=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var k=0;k<s.nMips;k++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(I[k])),s.separableBlurMaterials[k].uniforms.texSize.value=new d.Vector2(x,P),x=Math.round(x/2),P=Math.round(P/2);s.compositeMaterial=s.getCompositeMaterial(s.nMips),s.compositeMaterial.uniforms.blurTexture1.value=s.renderTargetsVertical[0].texture,s.compositeMaterial.uniforms.blurTexture2.value=s.renderTargetsVertical[1].texture,s.compositeMaterial.uniforms.blurTexture3.value=s.renderTargetsVertical[2].texture,s.compositeMaterial.uniforms.blurTexture4.value=s.renderTargetsVertical[3].texture,s.compositeMaterial.uniforms.blurTexture5.value=s.renderTargetsVertical[4].texture,s.compositeMaterial.uniforms.bloomStrength.value=i,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var oe=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=oe,s.bloomTintColors=[new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,Ce.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var N=Ce.CopyShader;return s.copyUniforms=d.UniformsUtils.clone(N.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new d.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,blending:d.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new d.Color,s.oldClearAlpha=1,s.basic=new d.MeshBasicMaterial,s.fsQuad=new Ge.FullScreenQuad(void 0),s}var e=a.prototype;return e.dispose=function(){for(var i=0;i<this.renderTargetsHorizontal.length;i++)this.renderTargetsHorizontal[i].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(i,o){var u=Math.round(i/2),s=Math.round(o/2);this.renderTargetBright.setSize(u,s);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,s),this.renderTargetsVertical[h].setSize(u,s),this.separableBlurMaterials[h].uniforms.texSize.value=new d.Vector2(u,s),u=Math.round(u/2),s=Math.round(s/2)},e.render=function(i,o,u,s,h){i.getClearColor(this._oldClearColor),this.oldClearAlpha=i.getClearAlpha();var x=i.autoClear;i.autoClear=!1,i.setClearColor(this.clearColor,0),h&&i.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,i.setRenderTarget(null),i.clear(),this.fsQuad.render(i)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,i.setRenderTarget(this.renderTargetBright),i.clear(),this.fsQuad.render(i);for(var P=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[b].uniforms.direction.value=a.BlurDirectionX,i.setRenderTarget(this.renderTargetsHorizontal[b]),i.clear(),this.fsQuad.render(i),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=a.BlurDirectionY,i.setRenderTarget(this.renderTargetsVertical[b]),i.clear(),this.fsQuad.render(i),P=this.renderTargetsVertical[b];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,i.setRenderTarget(this.renderTargetsHorizontal[0]),i.clear(),this.fsQuad.render(i),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&i.state.buffers.stencil.setTest(!0),this.renderToScreen?(i.setRenderTarget(null),this.fsQuad.render(i)):(i.setRenderTarget(u),this.fsQuad.render(i)),i.setClearColor(this._oldClearColor,this.oldClearAlpha),i.autoClear=x},e.getSeperableBlurMaterial=function(i){return new d.ShaderMaterial({defines:{KERNEL_RADIUS:i,SIGMA:i},uniforms:{colorTexture:{value:null},texSize:{value:new d.Vector2(.5,.5)},direction:{value:new d.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
19
+ void main() {
20
+ vUv = uv;
21
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
22
+ }`,fragmentShader:`#include <common>
23
+ varying vec2 vUv;
24
+ uniform sampler2D colorTexture;
25
+ uniform vec2 texSize;
26
+ uniform vec2 direction;
27
+ float gaussianPdf(in float x, in float sigma) {
28
+ return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
29
+ }
30
+ void main() {
31
+ vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
32
+ }`})},e.getCompositeMaterial=function(i){return new d.ShaderMaterial({defines:{NUM_MIPS:i},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
33
+ void main() {
34
+ vUv = uv;
35
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
36
+ }`,fragmentShader:`varying vec2 vUv;
37
+ uniform sampler2D blurTexture1;
38
+ uniform sampler2D blurTexture2;
39
+ uniform sampler2D blurTexture3;
40
+ uniform sampler2D blurTexture4;
41
+ uniform sampler2D blurTexture5;
42
+ uniform sampler2D dirtTexture;
43
+ uniform float bloomStrength;
44
+ uniform float bloomRadius;
45
+ uniform float bloomFactors[NUM_MIPS];
46
+ uniform vec3 bloomTintColors[NUM_MIPS];
47
+ float lerpBloomFactor(const in float factor) {
48
+ float mirrorFactor = 1.2 - factor;
49
+ return mix(factor, mirrorFactor, bloomRadius);
50
+ }
51
+ void main() {
52
+ gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
53
+ lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
54
+ lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
+ lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
+ lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
+ }`})},a}(Ge.Pass);Ee.BlurDirectionX=new d.Vector2(1,0),Ee.BlurDirectionY=new d.Vector2(0,1);var Pt={threshold:.2,strength:.5,radius:0},yt=new d.MeshBasicMaterial({color:"black"}),St=new d.SpriteMaterial({color:"#000"}),Ct=function(){"use strict";function n(a,e){T(this,n),this.materials={},this.bloomLayer=new d.Layers,this.active=!0,this.composerController=a,this.options=e;var r=a.renderer,i=a.renderPass,o=a.finalComposer,u=a.getSize(),s=u.width,h=u.height,x=new Ee(new d.Vector2(s,h),e.strength,e.radius,e.threshold);this.bloomPass=x;var P=new Le.EffectComposer(r);P.renderToScreen=!1,P.addPass(i),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(lt);var b=new d.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ct,fragmentShader:ft,defines:{}}),y=new Pe.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,i=r.bloomComposer,o=r.bloomLayer,u=r.materials;e.traverse(function(s){var h=s;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?St:yt)}),i.render(),e.traverse(function(s){var h=s;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,i=new O({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}}}});i.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),xt=n=>{var t={};return z.d(t,n),t},wr=n=>()=>n,wt=xt({OutlinePass:()=>ar.OutlinePass}),Et={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Rt=function(){"use strict";function n(a,e){T(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var r=a.scene,i=a.camera,o=a.finalComposer,u=a.getSize(),s=u.width,h=u.height,x=new wt.OutlinePass(new d.Vector2(s,h),r,i);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new O({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.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function Ot(n,t){if(n==null)return{};var a={},e=Object.keys(n),r,i;for(i=0;i<e.length;i++)r=e[i],!(t.indexOf(r)>=0)&&(a[r]=n[r]);return a}function Mt(n,t){if(n==null)return{};var a=Ot(n,t),e,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(r=0;r<i.length;r++)e=i[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(a[e]=n[e]))}return a}var Tt=n=>{var t={};return z.d(t,n),t},Er=n=>()=>n,At=Tt({SSRPass:()=>sr.SSRPass}),Lt=n=>{var t={};return z.d(t,n),t},Rr=n=>()=>n,jt=Lt({ReflectorForSSRPass:()=>or.ReflectorForSSRPass}),Dt={maxDistance:10,selects:!0},Bt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Gt=function(){"use strict";function n(a,e){T(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var r=a.scene,i=a.camera,o=a.renderer,u=a.finalComposer,s=a.getSize(),h=s.width,x=s.height,P=new At.SSRPass({renderer:o,scene:r,camera:i,width:h,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Bt,e),i=r.width,o=r.height,u=Mt(r,["width","height"]),s=this.composerController,h=s.scene,x=s.getSize(),P=new d.PlaneGeometry(i,o),b=new jt.ReflectorForSSRPass(P,M((0,G.Z)({},u),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,h.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var i=this.groundReflector;i&&(i.getRenderTarget().setSize(e,r),i.resolution.set(e,r))},t.setGui=function(){var e=this,r=new O({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(i){i?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.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),zt=function(){"use strict";function n(a){T(this,n),this.active=!0,this.options=a;var e=a.renderer,r=a.scene,i=a.camera,o=this.createRenderTarget(),u=new Le.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=i}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,i=e.type,o=e.encoding,u=this.getSize(),s={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat,encoding:o,type:i},h;if(+d.REVISION<138&&r>0){var x=new d.WebGLMultisampleRenderTarget(u.width,u.height,s);x.samples=r,h=x}else if(+d.REVISION>=138&&r>0){var P=new d.WebGLRenderTarget(u.width,u.height,M((0,G.Z)({},s),{samples:r}));h=P}else{var b=new d.WebGLRenderTarget(u.width,u.height,s);h=b}return h.texture.name="EffectComposer.rt1",h},t.addRenderPasss=function(){var e=this.options,r=e.scene,i=e.camera,o=new $e.RenderPass(r,i);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new Pe.ShaderPass(Ce.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new Pe.ShaderPass(tt.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,i=e.height,o=new Pe.ShaderPass(ot.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,i)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,i=e.height,o=this.options.renderer,u=new nt.SMAAPass(r*o.getPixelRatio(),i*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},t.addSSAAPass=function(){var e=this.options,r=e.scene,i=e.camera,o=new at.SSAARenderPass(r,i,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new Ct(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new Rt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Gt(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new d.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(i){return i!==e.renderPass&&i!==e.copyPass?i.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var i,o;this.finalComposer.setSize(e,r),(i=this.bloomController)===null||i===void 0||i.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var i=this.options.renderer,o=i.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},t.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()}},t.dispose=function(){var e,r,i;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(i=this.ssrController)===null||i===void 0||i.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(h=s.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Re=function(){"use strict";function n(a){T(this,n),this.raycaster=new d.Raycaster,this.installPlugins=new Map,this.event=new se.EventEmitter,this.clock=new d.Clock,this.options=(0,V.default)(n.options,a,{isMergeableObject:pe.PO});var e=this.options,r=e.container,i=e.stats,o=e.gui;if(o){var u=new S.default;u.open(!1),this.gui=u}if(i){var s=new c.default;s.showPanel(0),s.dom.style.position="absolute",r.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(H(i))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this,r=this.options,i=r.container,o=r.isdev,u=r.axesHelper,s=r.renderer,h=r.scene,x=r.camera,P=this.getSize(),b=P.width,y=P.height,L=new ce({isdev:o,width:b,height:y,cameraParams:x});this.gui&&L.setGui(this.gui);var j=L.camera,I=new p({camera:j,sceneParams:h}),k=I.scene,oe=new le({width:b,height:y,scene:k,camera:j,isdev:o,rendererParams:M((0,G.Z)({},s),{outputEncoding:d.LinearEncoding,antialias:!1})});this.gui&&oe.setGui(this.gui);var N=oe.renderer;u&&I.addAxesHelper(),this.sceneController=I,this.rendererController=oe,this.cameraController=L,i.appendChild(N.domElement);var ae=new ResizeObserver(function(de){var he=!0,Se=!1,Ne=void 0;try{for(var Oe=de[Symbol.iterator](),ke;!(he=(ke=Oe.next()).done);he=!0){var It=ke.value,We=It.contentRect;e.handeleResize(We.width,We.height)}}catch(Xt){Se=!0,Ne=Xt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(Se)throw Ne}}});ae.observe(i),this.resizeObserver=ae},t.initComposer=function(){var e=this.options,r=e.bloom,i=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,h=e.outlineParams,x=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!je&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new zt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:d.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(x),r&&y.addBloomPass(s),i&&y.addOutlinePass(h),u.outputEncoding===d.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,i=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(i||o){var h=new Ze(r);i&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",s),this.cssRendererController=h}},t.initControl=function(){var e=this.options,r=e.control,i=e.mapControl,o=e.controlParams;if(r){var u=new K({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:i});this.controlController=u}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.handeleResize=function(e,r){var i=this,o=i.rendererController,u=i.cameraController,s=i.composerController,h=i.cssRendererController;u==null||u.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),h==null||h.setSize(e,r),this.installPlugins.forEach(function(x,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,h=s.container,x=new d.Vector2,P=h.getBoundingClientRect();if(x.x=(e.clientX-P.left)/(P.right-P.left)*2-1,x.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(x,this.camera);var b=u.intersectObjects(r||this.scene.children,i);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,i,o,u=this,s=u.renderer,h=u.scene,x=u.camera,P=u.clock;if(!(!s||!h||!x||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),y=P.getElapsedTime();if(s.clear(),te.default.update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(j,I){var k;(k=I.update)===null||k===void 0||k.call(I,b,y)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var L;(L=this.rendererController)===null||L===void 0||L.render()}(i=this.cssRendererController)===null||i===void 0||i.render(h,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,i,o,u,s,h;this.stop(),te.default.removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(r=this.controlController)===null||r===void 0||r.dispose(),(i=this.cssRendererController)===null||i===void 0||i.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Re.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:M((0,G.Z)({},J),{antialias:je?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:be,camera:q,bloom:!1,bloomParams:Pt,outline:!1,outlineParams:Et,css2DRenderer:!1,ssr:!1,ssrParams:Dt,css2DRendererParams:(0,G.Z)({},Ae),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},Ae)};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(n){return!1}}function ye(n,t,a){return Ut()?ye=Reflect.construct:ye=function(r,i,o){var u=[null];u.push.apply(u,i);var s=Function.bind.apply(r,u),h=new s;return o&&De(h,o.prototype),h},ye.apply(null,arguments)}function Ue(n,t,a){return ye.apply(null,arguments)}var Ft=z(620);function Nt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(e,r){a.resolve=e,a.reject=r}),n&&(a.promise=(0,Ft.Z)(a.promise,t)),a}var kt=n=>{var t={};return z.d(t,n),t},Or=n=>()=>n,Wt=kt({CSS2DObject:()=>ur.CSS2DObject}),Fe=function(n){n&&((0,pe.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||Fe(t)}))},Vt=function(){"use strict";function n(){T(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Nt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Ue(d.Mesh,H(r)),this},t.createGroup=function(){return this.object3d=new d.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Ue(d.Points,H(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Wt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new ne.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new ne.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new d.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var o;return(o=this.object3d).add.apply(o,H(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var o;return(o=this.object3d).remove.apply(o,H(r)),this},t.getSize=function(){var e=new d.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new d.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){Fe(this.object3d)},C(n,[{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})}}]),n}()})();var cr=_e.L6,fr=_e.sb,dr=_e.z,hr=_e.ZP;export{cr as BaseObject,fr as GUIObject,dr as Pencil,hr as default};
@@ -1,4 +1,4 @@
1
- (function(){var $e={666:function(S){var L=function(x){"use strict";var T=Object.prototype,P=T.hasOwnProperty,R,A=typeof Symbol=="function"?Symbol:{},W=A.iterator||"@@iterator",N=A.asyncIterator||"@@asyncIterator",B=A.toStringTag||"@@toStringTag";function E(l,c,p){return Object.defineProperty(l,c,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[c]}try{E({},"")}catch(l){E=function(c,p,M){return c[p]=M}}function $(l,c,p,M){var w=c&&c.prototype instanceof C?c:C,z=Object.create(w.prototype),X=new _e(M||[]);return z._invoke=J(l,p,X),z}x.wrap=$;function q(l,c,p){try{return{type:"normal",arg:l.call(c,p)}}catch(M){return{type:"throw",arg:M}}}var V="suspendedStart",s="suspendedYield",fe="executing",Z="completed",D={};function C(){}function U(){}function G(){}var ne={};E(ne,W,function(){return this});var re=Object.getPrototypeOf,ie=re&&re(re(se([])));ie&&ie!==T&&P.call(ie,W)&&(ne=ie);var ee=G.prototype=C.prototype=Object.create(ne);U.prototype=G,E(ee,"constructor",G),E(G,"constructor",U),U.displayName=E(G,B,"GeneratorFunction");function H(l){["next","throw","return"].forEach(function(c){E(l,c,function(p){return this._invoke(c,p)})})}x.isGeneratorFunction=function(l){var c=typeof l=="function"&&l.constructor;return c?c===U||(c.displayName||c.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,G):(l.__proto__=G,E(l,B,"GeneratorFunction")),l.prototype=Object.create(ee),l},x.awrap=function(l){return{__await:l}};function de(l,c){function p(z,X,K,te){var Q=q(l[z],l,X);if(Q.type==="throw")te(Q.arg);else{var Se=Q.arg,ge=Se.value;return ge&&typeof ge=="object"&&P.call(ge,"__await")?c.resolve(ge.__await).then(function(Y){p("next",Y,K,te)},function(Y){p("throw",Y,K,te)}):c.resolve(ge).then(function(Y){Se.value=Y,K(Se)},function(Y){return p("throw",Y,K,te)})}}var M;function w(z,X){function K(){return new c(function(te,Q){p(z,X,te,Q)})}return M=M?M.then(K,K):K()}this._invoke=w}H(de.prototype),E(de.prototype,N,function(){return this}),x.AsyncIterator=de,x.async=function(l,c,p,M,w){w===void 0&&(w=Promise);var z=new de($(l,c,p,M),w);return x.isGeneratorFunction(c)?z:z.next().then(function(X){return X.done?X.value:z.next()})};function J(l,c,p){var M=V;return function(z,X){if(M===fe)throw new Error("Generator is already running");if(M===Z){if(z==="throw")throw X;return ke()}for(p.method=z,p.arg=X;;){var K=p.delegate;if(K){var te=me(K,p);if(te){if(te===D)continue;return te}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===V)throw M=Z,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=fe;var Q=q(l,c,p);if(Q.type==="normal"){if(M=p.done?Z:s,Q.arg===D)continue;return{value:Q.arg,done:p.done}}else Q.type==="throw"&&(M=Z,p.method="throw",p.arg=Q.arg)}}}function me(l,c){var p=l.iterator[c.method];if(p===R){if(c.delegate=null,c.method==="throw"){if(l.iterator.return&&(c.method="return",c.arg=R,me(l,c),c.method==="throw"))return D;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var M=q(p,l.iterator,c.arg);if(M.type==="throw")return c.method="throw",c.arg=M.arg,c.delegate=null,D;var w=M.arg;if(!w)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,D;if(w.done)c[l.resultName]=w.value,c.next=l.nextLoc,c.method!=="return"&&(c.method="next",c.arg=R);else return w;return c.delegate=null,D}H(ee),E(ee,B,"Generator"),E(ee,W,function(){return this}),E(ee,"toString",function(){return"[object Generator]"});function Le(l){var c={tryLoc:l[0]};1 in l&&(c.catchLoc=l[1]),2 in l&&(c.finallyLoc=l[2],c.afterLoc=l[3]),this.tryEntries.push(c)}function Pe(l){var c=l.completion||{};c.type="normal",delete c.arg,l.completion=c}function _e(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(Le,this),this.reset(!0)}x.keys=function(l){var c=[];for(var p in l)c.push(p);return c.reverse(),function M(){for(;c.length;){var w=c.pop();if(w in l)return M.value=w,M.done=!1,M}return M.done=!0,M}};function se(l){if(l){var c=l[W];if(c)return c.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,M=function w(){for(;++p<l.length;)if(P.call(l,p))return w.value=l[p],w.done=!1,w;return w.value=R,w.done=!0,w};return M.next=M}}return{next:ke}}x.values=se;function ke(){return{value:R,done:!0}}return _e.prototype={constructor:_e,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(Pe),!l)for(var c in this)c.charAt(0)==="t"&&P.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=R)},stop:function(){this.done=!0;var l=this.tryEntries[0],c=l.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var c=this;function p(te,Q){return z.type="throw",z.arg=l,c.next=te,Q&&(c.method="next",c.arg=R),!!Q}for(var M=this.tryEntries.length-1;M>=0;--M){var w=this.tryEntries[M],z=w.completion;if(w.tryLoc==="root")return p("end");if(w.tryLoc<=this.prev){var X=P.call(w,"catchLoc"),K=P.call(w,"finallyLoc");if(X&&K){if(this.prev<w.catchLoc)return p(w.catchLoc,!0);if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else if(X){if(this.prev<w.catchLoc)return p(w.catchLoc,!0)}else if(K){if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,c){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&P.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var w=M;break}}w&&(l==="break"||l==="continue")&&w.tryLoc<=c&&c<=w.finallyLoc&&(w=null);var z=w?w.completion:{};return z.type=l,z.arg=c,w?(this.method="next",this.next=w.finallyLoc,D):this.complete(z)},complete:function(l,c){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"&&c&&(this.next=c),D},finish:function(l){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),Pe(p),D}},catch:function(l){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.tryLoc===l){var M=p.completion;if(M.type==="throw"){var w=M.arg;Pe(p)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(l,c,p){return this.delegate={iterator:se(l),resultName:c,nextLoc:p},this.method==="next"&&(this.arg=R),D}},x}(S.exports);try{regeneratorRuntime=L}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},695:function(S,L,x){"use strict";x.d(L,{Z:function(){return T}});function T(P){if(P.geometry&&P.geometry.dispose(),P.material){var R=Array.isArray(P.material)?P.material:[P.material];R.forEach(function(A){var W,N,B,E,$,q,V,s,fe,Z,D,C,U;(W=A.map)===null||W===void 0||W.dispose(),(N=A.lightMap)===null||N===void 0||N.dispose(),(B=A.bumpMap)===null||B===void 0||B.dispose(),(E=A.normalMap)===null||E===void 0||E.dispose(),($=A.specularMap)===null||$===void 0||$.dispose(),(q=A.envMap)===null||q===void 0||q.dispose(),(V=A.alphaMap)===null||V===void 0||V.dispose(),(s=A.aoMap)===null||s===void 0||s.dispose(),(fe=A.displacementMap)===null||fe===void 0||fe.dispose(),(Z=A.emissiveMap)===null||Z===void 0||Z.dispose(),(D=A.gradientMap)===null||D===void 0||D.dispose(),(C=A.metalnessMap)===null||C===void 0||C.dispose(),(U=A.roughnessMap)===null||U===void 0||U.dispose(),A.dispose()})}}},519:function(S,L,x){"use strict";x.d(L,{disposeMesh:function(){return A.Z}});var T=x(666),P=x.n(T),R=null,A=x(695),W=x(644);function N(Z){if(Z.material){var D=Array.isArray(Z.material)?Z.material:[Z.material];D.forEach(function(C){var U,G;(U=C.color)===null||U===void 0||U.convertSRGBToLinear(),(G=C.emissive)===null||G===void 0||G.convertSRGBToLinear(),C.map&&(C.map.encoding=THREE.sRGBEncoding),C.emissiveMap&&(C.emissiveMap.encoding=THREE.sRGBEncoding)})}}var B=x(568),E=x(924),$=require("idb-keyval"),q=x(484),V=null,s=null,fe=function(){var Z=(0,B.Z)(P().mark(function D(C,U){var G,ne,re,ie,ee,H;return P().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return G=U.version,J.next=4,(0,$.get)(C);case 4:if(re=J.sent,!(re&&re[G])){J.next=9;break}ne=re[G],J.next=15;break;case 9:return J.next=11,(0,q.Z)(fetch(C).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:ie=J.sent,ee=ie.res,H=ie.err,H||(ne=ee,(0,$.set)(C,(0,E.Z)({},G,ee)));case 15:return J.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:C});case 16:case"end":return J.stop()}},D)}));return function(C,U){return Z.apply(this,arguments)}}()},484:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});var T=x(42);function P(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(W){return(0,T.Z)({err:null,res:W},A)}).catch(function(W){return(0,T.Z)({err:W,res:void 0},A)})}},644:function(S){"use strict";S.exports=require("three")},568:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});function T(R,A,W,N,B,E,$){try{var q=R[E]($),V=q.value}catch(s){W(s);return}q.done?A(V):Promise.resolve(V).then(N,B)}function P(R){return function(){var A=this,W=arguments;return new Promise(function(N,B){var E=R.apply(A,W);function $(V){T(E,N,B,$,q,"next",V)}function q(V){T(E,N,B,$,q,"throw",V)}$(void 0)})}}},924:function(S,L,x){"use strict";x.d(L,{Z:function(){return T}});function T(P,R,A){return R in P?Object.defineProperty(P,R,{value:A,enumerable:!0,configurable:!0,writable:!0}):P[R]=A,P}},42:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});var T=x(924);function P(R){for(var A=1;A<arguments.length;A++){var W=arguments[A]!=null?arguments[A]:{},N=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(N=N.concat(Object.getOwnPropertySymbols(W).filter(function(B){return Object.getOwnPropertyDescriptor(W,B).enumerable}))),N.forEach(function(B){(0,T.Z)(R,B,W[B])})}return R}}},Ue={};function F(S){var L=Ue[S];if(L!==void 0)return L.exports;var x=Ue[S]={exports:{}};return $e[S](x,x.exports,F),x.exports}(function(){F.n=function(S){var L=S&&S.__esModule?function(){return S.default}:function(){return S};return F.d(L,{a:L}),L}})(),function(){F.d=function(S,L){for(var x in L)F.o(L,x)&&!F.o(S,x)&&Object.defineProperty(S,x,{enumerable:!0,get:L[x]})}}(),function(){F.o=function(S,L){return Object.prototype.hasOwnProperty.call(S,L)}}(),function(){F.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})}}();var Re={};(function(){"use strict";F.r(Re),F.d(Re,{ConicPolygon:function(){return yt},ExtrudePolygon:function(){return _t},Image:function(){return M},Line:function(){return et},MeshLine:function(){return Y},MeshLineMaterial:function(){return Ee},MeshLineRaycast:function(){return Fe},Node:function(){return Q},Text:function(){return ke},Video:function(){return K}});function S(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function L(t,i){return L=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},L(t,i)}function x(t,i){return L(t,i)}function T(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var P=F(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function A(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function W(){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 N(t){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},N(t)}function B(t){return N(t)}function E(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 q(t,i){return i&&($(i)==="object"||typeof i=="function")?i:E(t)}function V(t){var i=W();return function(){var n=B(t),a;if(i){var e=B(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return q(this,a)}}var s=F(644);function fe(){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 Z(t,i,r){return fe()?Z=Reflect.construct:Z=function(a,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(a,u),v=new h;return o&&x(v,o.prototype),v},Z.apply(null,arguments)}function D(t,i,r){return Z.apply(null,arguments)}function C(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function U(t,i,r){return i&&C(t.prototype,i),r&&C(t,r),t}function G(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function ne(t){if(Array.isArray(t))return G(t)}function re(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ie(){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 ee(t,i){if(!!t){if(typeof t=="string")return G(t,i);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,i)}}function H(t){return ne(t)||re(t)||ee(t)||ie()}var de=F(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,de.Z)(r.promise,i)),r}var me=require("three/examples/jsm/renderers/CSS2DRenderer"),Le=require("three/examples/jsm/renderers/CSS3DRenderer"),Pe=F(519),_e=function(t){t&&((0,Pe.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||_e(i)}))},se=function(){"use strict";function t(){S(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=J(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=D(s.Mesh,H(a)),this},i.createGroup=function(){return this.object3d=new s.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=D(s.Points,H(a)),this},i.createCSS2DObject=function(n){return this.object3d=new me.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new Le.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new Le.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new s.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,H(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,H(a)),this},i.getSize=function(){var n=new s.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new s.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){_e(this.object3d)},U(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ke=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,P.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,v=e.text,m=e.sizeAttenuation;if(h){var d=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=d}else{var y=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(v)},n.setText=function(e,o){var u=(0,P.Z)(A((0,P.Z)({},this.options),{text:e}),o||{}),h=u.text,v=u.fontSize,m=u.fontFamily,d=u.fontWeight,y=u.flipX,b=u.scale,g=this.canvas;g.width=v*h.length*2,g.height=v;var _=g.getContext("2d");_.font="".concat(d," ").concat(v,"px/1 ").concat(m);var f=_.measureText(h).width;g.width=f,this.width=f,_=g.getContext("2d"),_.clearRect(0,0,g.width,g.height),y&&_.scale(-1,1),_.font="".concat(d," ").concat(v,"px/1 ").concat(m),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(h,y?f*-1:0,g.height/2),_.restore();var O=new s.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var j=this.object3d;j.material.map&&j.material.map.dispose(),j.material.map=O,j.material.needsUpdate=!0,j.scale.set(O.image.width*b,O.image.height*b,1)},r}(se),l=F(568),c=F(666),p=F.n(c),M=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g,_,f;return p().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return u=e.options,h=u.transparent,v=u.blending,m=u.src,d=u.depthWrite,y=u.alphaTest,b=u.sprite,g=u.sizeAttenuation,j.next=3,new s.TextureLoader().loadAsync(m);case 3:return _=j.sent,f=b?new s.SpriteMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new s.MeshBasicMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:y!=null?y:0}),j.abrupt("return",f);case 6:case"end":return j.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=e.options,h=u.scale,v=u.position,m=u.src,d=u.cache,y=u.sprite,!(d&&!d.get(m))){f.next=7;break}return d.init(m),f.next=5,e.getMaterial();case 5:b=f.sent,d.set(m,b);case 7:if(!d){f.next=13;break}return f.next=10,d.get(m);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,e.texture=g.map,y?e.createSprite(g):e.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&e.object3d.scale.set(g.map.image.width*h,g.map.image.height*h,1),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},r}(se);function w(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=B(t),t!==null););return t}function z(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?z=Reflect.get:z=function(a,e,o){var u=w(a,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||a):h.value}},z(t,i,r)}function X(t,i,r){return z(t,i,r)}var K=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,v=e.depthWrite,m=e.format,d=e.autoPlay,y=e.loop,b=e.alphaTest,g=e.sprite,_=J(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var O=new s.VideoTexture(f);O.format=m!=null?m:s.RGBAFormat,O.needsUpdate=!0;var j=g?new s.SpriteMaterial({map:O,transparent:u!=null?u:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:O,transparent:u!=null?u:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(j)},!1),f.src=o,f.muted=!0,f.autoplay=d,f.loop=y,f.preload="auto",_.promise},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=e.options,h=u.scale,v=u.position,m=u.src,d=u.cache,y=u.sprite,!(d&&!d.get(m))){f.next=7;break}return d.init(m),f.next=5,e.getMaterial();case 5:b=f.sent,d.set(m,b);case 7:if(!d){f.next=13;break}return f.next=10,d.get(m);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,e.video=g.map.image,y?e.createSprite(g):e.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),v&&e.object3d.position.copy(v);case 21:case"end":return f.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(B(r.prototype),"dispose",this).call(this)},r}(se),te=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=e.onClick,v=e.zIndexFix,m=document.createElement("div");m.appendChild(u),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&m.addEventListener("click",h),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,l.Z)(p().mark(function o(){var u,h,v,m;return p().wrap(function(y){for(;;)switch(y.prev=y.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),v=new s.CanvasTexture(u),m=new s.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",m);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,v=h===void 0?new s.Vector3(1,1,1):h,m=e.position,d=m===void 0?new s.Vector3(0,0,0):m,y=e.cache,b=this;return(0,l.Z)(p().mark(function g(){var _,f,O,j;return p().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(_="node-create-pick-object",!(y&&!y.get(_))){k.next=7;break}return y.init(_),k.next=5,b.getMaterial(u);case 5:f=k.sent,y.set(_,f);case 7:if(!y){k.next=13;break}return k.next=10,y.get(_);case 10:k.t0=k.sent,k.next=16;break;case 13:return k.next=15,b.getMaterial(u);case 15:k.t0=k.sent;case 16:O=k.t0,j=new s.Sprite(O),j.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),j.position.copy(d),b.add(j),b.pickObject=j;case 22:case"end":return k.stop()}},g)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}X(B(r.prototype),"dispose",this).call(this)},r}(se),Q=te,Se=`
1
+ (function(){var $e={666:function(S){var L=function(x){"use strict";var T=Object.prototype,P=T.hasOwnProperty,R,A=typeof Symbol=="function"?Symbol:{},W=A.iterator||"@@iterator",N=A.asyncIterator||"@@asyncIterator",B=A.toStringTag||"@@toStringTag";function E(l,c,p){return Object.defineProperty(l,c,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[c]}try{E({},"")}catch(l){E=function(c,p,M){return c[p]=M}}function $(l,c,p,M){var w=c&&c.prototype instanceof C?c:C,z=Object.create(w.prototype),X=new _e(M||[]);return z._invoke=J(l,p,X),z}x.wrap=$;function q(l,c,p){try{return{type:"normal",arg:l.call(c,p)}}catch(M){return{type:"throw",arg:M}}}var V="suspendedStart",s="suspendedYield",fe="executing",Z="completed",D={};function C(){}function U(){}function G(){}var ne={};E(ne,W,function(){return this});var re=Object.getPrototypeOf,ie=re&&re(re(se([])));ie&&ie!==T&&P.call(ie,W)&&(ne=ie);var ee=G.prototype=C.prototype=Object.create(ne);U.prototype=G,E(ee,"constructor",G),E(G,"constructor",U),U.displayName=E(G,B,"GeneratorFunction");function H(l){["next","throw","return"].forEach(function(c){E(l,c,function(p){return this._invoke(c,p)})})}x.isGeneratorFunction=function(l){var c=typeof l=="function"&&l.constructor;return c?c===U||(c.displayName||c.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,G):(l.__proto__=G,E(l,B,"GeneratorFunction")),l.prototype=Object.create(ee),l},x.awrap=function(l){return{__await:l}};function de(l,c){function p(z,X,K,te){var Q=q(l[z],l,X);if(Q.type==="throw")te(Q.arg);else{var Se=Q.arg,ge=Se.value;return ge&&typeof ge=="object"&&P.call(ge,"__await")?c.resolve(ge.__await).then(function(Y){p("next",Y,K,te)},function(Y){p("throw",Y,K,te)}):c.resolve(ge).then(function(Y){Se.value=Y,K(Se)},function(Y){return p("throw",Y,K,te)})}}var M;function w(z,X){function K(){return new c(function(te,Q){p(z,X,te,Q)})}return M=M?M.then(K,K):K()}this._invoke=w}H(de.prototype),E(de.prototype,N,function(){return this}),x.AsyncIterator=de,x.async=function(l,c,p,M,w){w===void 0&&(w=Promise);var z=new de($(l,c,p,M),w);return x.isGeneratorFunction(c)?z:z.next().then(function(X){return X.done?X.value:z.next()})};function J(l,c,p){var M=V;return function(z,X){if(M===fe)throw new Error("Generator is already running");if(M===Z){if(z==="throw")throw X;return ke()}for(p.method=z,p.arg=X;;){var K=p.delegate;if(K){var te=me(K,p);if(te){if(te===D)continue;return te}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===V)throw M=Z,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=fe;var Q=q(l,c,p);if(Q.type==="normal"){if(M=p.done?Z:s,Q.arg===D)continue;return{value:Q.arg,done:p.done}}else Q.type==="throw"&&(M=Z,p.method="throw",p.arg=Q.arg)}}}function me(l,c){var p=l.iterator[c.method];if(p===R){if(c.delegate=null,c.method==="throw"){if(l.iterator.return&&(c.method="return",c.arg=R,me(l,c),c.method==="throw"))return D;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var M=q(p,l.iterator,c.arg);if(M.type==="throw")return c.method="throw",c.arg=M.arg,c.delegate=null,D;var w=M.arg;if(!w)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,D;if(w.done)c[l.resultName]=w.value,c.next=l.nextLoc,c.method!=="return"&&(c.method="next",c.arg=R);else return w;return c.delegate=null,D}H(ee),E(ee,B,"Generator"),E(ee,W,function(){return this}),E(ee,"toString",function(){return"[object Generator]"});function Le(l){var c={tryLoc:l[0]};1 in l&&(c.catchLoc=l[1]),2 in l&&(c.finallyLoc=l[2],c.afterLoc=l[3]),this.tryEntries.push(c)}function Pe(l){var c=l.completion||{};c.type="normal",delete c.arg,l.completion=c}function _e(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(Le,this),this.reset(!0)}x.keys=function(l){var c=[];for(var p in l)c.push(p);return c.reverse(),function M(){for(;c.length;){var w=c.pop();if(w in l)return M.value=w,M.done=!1,M}return M.done=!0,M}};function se(l){if(l){var c=l[W];if(c)return c.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,M=function w(){for(;++p<l.length;)if(P.call(l,p))return w.value=l[p],w.done=!1,w;return w.value=R,w.done=!0,w};return M.next=M}}return{next:ke}}x.values=se;function ke(){return{value:R,done:!0}}return _e.prototype={constructor:_e,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(Pe),!l)for(var c in this)c.charAt(0)==="t"&&P.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=R)},stop:function(){this.done=!0;var l=this.tryEntries[0],c=l.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var c=this;function p(te,Q){return z.type="throw",z.arg=l,c.next=te,Q&&(c.method="next",c.arg=R),!!Q}for(var M=this.tryEntries.length-1;M>=0;--M){var w=this.tryEntries[M],z=w.completion;if(w.tryLoc==="root")return p("end");if(w.tryLoc<=this.prev){var X=P.call(w,"catchLoc"),K=P.call(w,"finallyLoc");if(X&&K){if(this.prev<w.catchLoc)return p(w.catchLoc,!0);if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else if(X){if(this.prev<w.catchLoc)return p(w.catchLoc,!0)}else if(K){if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,c){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&P.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var w=M;break}}w&&(l==="break"||l==="continue")&&w.tryLoc<=c&&c<=w.finallyLoc&&(w=null);var z=w?w.completion:{};return z.type=l,z.arg=c,w?(this.method="next",this.next=w.finallyLoc,D):this.complete(z)},complete:function(l,c){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"&&c&&(this.next=c),D},finish:function(l){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),Pe(p),D}},catch:function(l){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.tryLoc===l){var M=p.completion;if(M.type==="throw"){var w=M.arg;Pe(p)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(l,c,p){return this.delegate={iterator:se(l),resultName:c,nextLoc:p},this.method==="next"&&(this.arg=R),D}},x}(S.exports);try{regeneratorRuntime=L}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},182:function(S,L,x){"use strict";x.d(L,{Z:function(){return T}});function T(P){if(P.geometry&&P.geometry.dispose(),P.material){var R=Array.isArray(P.material)?P.material:[P.material];R.forEach(function(A){var W,N,B,E,$,q,V,s,fe,Z,D,C,U;(W=A.map)===null||W===void 0||W.dispose(),(N=A.lightMap)===null||N===void 0||N.dispose(),(B=A.bumpMap)===null||B===void 0||B.dispose(),(E=A.normalMap)===null||E===void 0||E.dispose(),($=A.specularMap)===null||$===void 0||$.dispose(),(q=A.envMap)===null||q===void 0||q.dispose(),(V=A.alphaMap)===null||V===void 0||V.dispose(),(s=A.aoMap)===null||s===void 0||s.dispose(),(fe=A.displacementMap)===null||fe===void 0||fe.dispose(),(Z=A.emissiveMap)===null||Z===void 0||Z.dispose(),(D=A.gradientMap)===null||D===void 0||D.dispose(),(C=A.metalnessMap)===null||C===void 0||C.dispose(),(U=A.roughnessMap)===null||U===void 0||U.dispose(),A.dispose()})}}},54:function(S,L,x){"use strict";x.d(L,{disposeMesh:function(){return A.Z}});var T=x(666),P=x.n(T),R=null,A=x(182),W=x(644);function N(Z){if(Z.material){var D=Array.isArray(Z.material)?Z.material:[Z.material];D.forEach(function(C){var U,G;(U=C.color)===null||U===void 0||U.convertSRGBToLinear(),(G=C.emissive)===null||G===void 0||G.convertSRGBToLinear(),C.map&&(C.map.encoding=THREE.sRGBEncoding),C.emissiveMap&&(C.emissiveMap.encoding=THREE.sRGBEncoding)})}}var B=x(568),E=x(924),$=require("idb-keyval"),q=x(620),V=null,s=null,fe=function(){var Z=(0,B.Z)(P().mark(function D(C,U){var G,ne,re,ie,ee,H;return P().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return G=U.version,J.next=4,(0,$.get)(C);case 4:if(re=J.sent,!(re&&re[G])){J.next=9;break}ne=re[G],J.next=15;break;case 9:return J.next=11,(0,q.Z)(fetch(C).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:ie=J.sent,ee=ie.res,H=ie.err,H||(ne=ee,(0,$.set)(C,(0,E.Z)({},G,ee)));case 15:return J.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:C});case 16:case"end":return J.stop()}},D)}));return function(C,U){return Z.apply(this,arguments)}}()},620:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});var T=x(42);function P(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(W){return(0,T.Z)({err:null,res:W},A)}).catch(function(W){return(0,T.Z)({err:W,res:void 0},A)})}},644:function(S){"use strict";S.exports=require("three")},568:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});function T(R,A,W,N,B,E,$){try{var q=R[E]($),V=q.value}catch(s){W(s);return}q.done?A(V):Promise.resolve(V).then(N,B)}function P(R){return function(){var A=this,W=arguments;return new Promise(function(N,B){var E=R.apply(A,W);function $(V){T(E,N,B,$,q,"next",V)}function q(V){T(E,N,B,$,q,"throw",V)}$(void 0)})}}},924:function(S,L,x){"use strict";x.d(L,{Z:function(){return T}});function T(P,R,A){return R in P?Object.defineProperty(P,R,{value:A,enumerable:!0,configurable:!0,writable:!0}):P[R]=A,P}},42:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});var T=x(924);function P(R){for(var A=1;A<arguments.length;A++){var W=arguments[A]!=null?arguments[A]:{},N=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(N=N.concat(Object.getOwnPropertySymbols(W).filter(function(B){return Object.getOwnPropertyDescriptor(W,B).enumerable}))),N.forEach(function(B){(0,T.Z)(R,B,W[B])})}return R}}},Ue={};function F(S){var L=Ue[S];if(L!==void 0)return L.exports;var x=Ue[S]={exports:{}};return $e[S](x,x.exports,F),x.exports}(function(){F.n=function(S){var L=S&&S.__esModule?function(){return S.default}:function(){return S};return F.d(L,{a:L}),L}})(),function(){F.d=function(S,L){for(var x in L)F.o(L,x)&&!F.o(S,x)&&Object.defineProperty(S,x,{enumerable:!0,get:L[x]})}}(),function(){F.o=function(S,L){return Object.prototype.hasOwnProperty.call(S,L)}}(),function(){F.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})}}();var Re={};(function(){"use strict";F.r(Re),F.d(Re,{ConicPolygon:function(){return yt},ExtrudePolygon:function(){return _t},Image:function(){return M},Line:function(){return et},MeshLine:function(){return Y},MeshLineMaterial:function(){return Ee},MeshLineRaycast:function(){return Fe},Node:function(){return Q},Text:function(){return ke},Video:function(){return K}});function S(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function L(t,i){return L=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},L(t,i)}function x(t,i){return L(t,i)}function T(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var P=F(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function A(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function W(){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 N(t){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},N(t)}function B(t){return N(t)}function E(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 q(t,i){return i&&($(i)==="object"||typeof i=="function")?i:E(t)}function V(t){var i=W();return function(){var n=B(t),a;if(i){var e=B(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return q(this,a)}}var s=F(644);function fe(){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 Z(t,i,r){return fe()?Z=Reflect.construct:Z=function(a,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(a,u),v=new h;return o&&x(v,o.prototype),v},Z.apply(null,arguments)}function D(t,i,r){return Z.apply(null,arguments)}function C(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function U(t,i,r){return i&&C(t.prototype,i),r&&C(t,r),t}function G(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function ne(t){if(Array.isArray(t))return G(t)}function re(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ie(){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 ee(t,i){if(!!t){if(typeof t=="string")return G(t,i);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,i)}}function H(t){return ne(t)||re(t)||ee(t)||ie()}var de=F(620);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,de.Z)(r.promise,i)),r}var me=require("three/examples/jsm/renderers/CSS2DRenderer"),Le=require("three/examples/jsm/renderers/CSS3DRenderer"),Pe=F(54),_e=function(t){t&&((0,Pe.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||_e(i)}))},se=function(){"use strict";function t(){S(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=J(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=D(s.Mesh,H(a)),this},i.createGroup=function(){return this.object3d=new s.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=D(s.Points,H(a)),this},i.createCSS2DObject=function(n){return this.object3d=new me.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new Le.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new Le.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new s.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,H(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,H(a)),this},i.getSize=function(){var n=new s.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new s.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){_e(this.object3d)},U(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ke=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,P.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,v=e.text,m=e.sizeAttenuation;if(h){var d=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=d}else{var y=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(v)},n.setText=function(e,o){var u=(0,P.Z)(A((0,P.Z)({},this.options),{text:e}),o||{}),h=u.text,v=u.fontSize,m=u.fontFamily,d=u.fontWeight,y=u.flipX,b=u.scale,g=this.canvas;g.width=v*h.length*2,g.height=v;var _=g.getContext("2d");_.font="".concat(d," ").concat(v,"px/1 ").concat(m);var f=_.measureText(h).width;g.width=f,this.width=f,_=g.getContext("2d"),_.clearRect(0,0,g.width,g.height),y&&_.scale(-1,1),_.font="".concat(d," ").concat(v,"px/1 ").concat(m),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(h,y?f*-1:0,g.height/2),_.restore();var O=new s.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var j=this.object3d;j.material.map&&j.material.map.dispose(),j.material.map=O,j.material.needsUpdate=!0,j.scale.set(O.image.width*b,O.image.height*b,1)},r}(se),l=F(568),c=F(666),p=F.n(c),M=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g,_,f;return p().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return u=e.options,h=u.transparent,v=u.blending,m=u.src,d=u.depthWrite,y=u.alphaTest,b=u.sprite,g=u.sizeAttenuation,j.next=3,new s.TextureLoader().loadAsync(m);case 3:return _=j.sent,f=b?new s.SpriteMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new s.MeshBasicMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:y!=null?y:0}),j.abrupt("return",f);case 6:case"end":return j.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=e.options,h=u.scale,v=u.position,m=u.src,d=u.cache,y=u.sprite,!(d&&!d.get(m))){f.next=7;break}return d.init(m),f.next=5,e.getMaterial();case 5:b=f.sent,d.set(m,b);case 7:if(!d){f.next=13;break}return f.next=10,d.get(m);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,e.texture=g.map,y?e.createSprite(g):e.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&e.object3d.scale.set(g.map.image.width*h,g.map.image.height*h,1),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},r}(se);function w(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=B(t),t!==null););return t}function z(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?z=Reflect.get:z=function(a,e,o){var u=w(a,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||a):h.value}},z(t,i,r)}function X(t,i,r){return z(t,i,r)}var K=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,v=e.depthWrite,m=e.format,d=e.autoPlay,y=e.loop,b=e.alphaTest,g=e.sprite,_=J(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var O=new s.VideoTexture(f);O.format=m!=null?m:s.RGBAFormat,O.needsUpdate=!0;var j=g?new s.SpriteMaterial({map:O,transparent:u!=null?u:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:O,transparent:u!=null?u:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(j)},!1),f.src=o,f.muted=!0,f.autoplay=d,f.loop=y,f.preload="auto",_.promise},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=e.options,h=u.scale,v=u.position,m=u.src,d=u.cache,y=u.sprite,!(d&&!d.get(m))){f.next=7;break}return d.init(m),f.next=5,e.getMaterial();case 5:b=f.sent,d.set(m,b);case 7:if(!d){f.next=13;break}return f.next=10,d.get(m);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,e.video=g.map.image,y?e.createSprite(g):e.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),v&&e.object3d.position.copy(v);case 21:case"end":return f.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(B(r.prototype),"dispose",this).call(this)},r}(se),te=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=e.onClick,v=e.zIndexFix,m=document.createElement("div");m.appendChild(u),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&m.addEventListener("click",h),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,l.Z)(p().mark(function o(){var u,h,v,m;return p().wrap(function(y){for(;;)switch(y.prev=y.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),v=new s.CanvasTexture(u),m=new s.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",m);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,v=h===void 0?new s.Vector3(1,1,1):h,m=e.position,d=m===void 0?new s.Vector3(0,0,0):m,y=e.cache,b=this;return(0,l.Z)(p().mark(function g(){var _,f,O,j;return p().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(_="node-create-pick-object",!(y&&!y.get(_))){k.next=7;break}return y.init(_),k.next=5,b.getMaterial(u);case 5:f=k.sent,y.set(_,f);case 7:if(!y){k.next=13;break}return k.next=10,y.get(_);case 10:k.t0=k.sent,k.next=16;break;case 13:return k.next=15,b.getMaterial(u);case 15:k.t0=k.sent;case 16:O=k.t0,j=new s.Sprite(O),j.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),j.position.copy(d),b.add(j),b.pickObject=j;case 22:case"end":return k.stop()}},g)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}X(B(r.prototype),"dispose",this).call(this)},r}(se),Q=te,Se=`
2
2
  `.concat(s.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(s.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -0,0 +1,132 @@
1
+ import*as Qe from"idb-keyval";import*as k from"three";import*as Vt from"three/examples/jsm/renderers/CSS2DRenderer";import*as qe from"three/examples/jsm/renderers/CSS3DRenderer";import*as Wt from"@tweenjs/tween.js";import*as Ie from"d3-array";import*as Gt from"earcut";import*as zt from"@turf/boolean-clockwise";import*as Ut from"delaunator";import*as Nt from"@turf/boolean-point-in-polygon";import*as Be from"d3-geo";import*as Ft from"d3-geo-voronoi";import*as It from"d3-scale";var Zt={666:function(O){var E=function(x){"use strict";var T=Object.prototype,S=T.hasOwnProperty,j,A=typeof Symbol=="function"?Symbol:{},z=A.iterator||"@@iterator",Z=A.asyncIterator||"@@asyncIterator",V=A.toStringTag||"@@toStringTag";function B(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{B({},"")}catch(f){B=function(u,p,M){return u[p]=M}}function J(f,u,p,M){var y=u&&u.prototype instanceof U?u:U,N=Object.create(y.prototype),G=new Ce(M||[]);return N._invoke=ye(f,p,G),N}x.wrap=J;function Q(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(M){return{type:"throw",arg:M}}}var D="suspendedStart",s="suspendedYield",pe="executing",te="completed",X={};function U(){}function H(){}function L(){}var $={};B($,z,function(){return this});var K=Object.getPrototypeOf,ne=K&&K(K(Te([])));ne&&ne!==T&&S.call(ne,z)&&($=ne);var q=L.prototype=U.prototype=Object.create($);H.prototype=L,B(q,"constructor",L),B(L,"constructor",H),H.displayName=B(L,V,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(u){B(f,u,function(p){return this._invoke(u,p)})})}x.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===H||(u.displayName||u.name)==="GeneratorFunction":!1},x.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,L):(f.__proto__=L,B(f,V,"GeneratorFunction")),f.prototype=Object.create(q),f},x.awrap=function(f){return{__await:f}};function se(f,u){function p(N,G,ee,re){var Y=Q(f[N],f,G);if(Y.type==="throw")re(Y.arg);else{var be=Y.arg,we=be.value;return we&&typeof we=="object"&&S.call(we,"__await")?u.resolve(we.__await).then(function(ve){p("next",ve,ee,re)},function(ve){p("throw",ve,ee,re)}):u.resolve(we).then(function(ve){be.value=ve,ee(be)},function(ve){return p("throw",ve,ee,re)})}}var M;function y(N,G){function ee(){return new u(function(re,Y){p(N,G,re,Y)})}return M=M?M.then(ee,ee):ee()}this._invoke=y}I(se.prototype),B(se.prototype,Z,function(){return this}),x.AsyncIterator=se,x.async=function(f,u,p,M,y){y===void 0&&(y=Promise);var N=new se(J(f,u,p,M),y);return x.isGeneratorFunction(u)?N:N.next().then(function(G){return G.done?G.value:N.next()})};function ye(f,u,p){var M=D;return function(N,G){if(M===pe)throw new Error("Generator is already running");if(M===te){if(N==="throw")throw G;return Le()}for(p.method=N,p.arg=G;;){var ee=p.delegate;if(ee){var re=Oe(ee,p);if(re){if(re===X)continue;return re}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===D)throw M=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=pe;var Y=Q(f,u,p);if(Y.type==="normal"){if(M=p.done?te:s,Y.arg===X)continue;return{value:Y.arg,done:p.done}}else Y.type==="throw"&&(M=te,p.method="throw",p.arg=Y.arg)}}}function Oe(f,u){var p=f.iterator[u.method];if(p===j){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=j,Oe(f,u),u.method==="throw"))return X;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var M=Q(p,f.iterator,u.arg);if(M.type==="throw")return u.method="throw",u.arg=M.arg,u.delegate=null,X;var y=M.arg;if(!y)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,X;if(y.done)u[f.resultName]=y.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=j);else return y;return u.delegate=null,X}I(q),B(q,V,"Generator"),B(q,z,function(){return this}),B(q,"toString",function(){return"[object Generator]"});function ie(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function me(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function Ce(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(ie,this),this.reset(!0)}x.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function M(){for(;u.length;){var y=u.pop();if(y in f)return M.value=y,M.done=!1,M}return M.done=!0,M}};function Te(f){if(f){var u=f[z];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,M=function y(){for(;++p<f.length;)if(S.call(f,p))return y.value=f[p],y.done=!1,y;return y.value=j,y.done=!0,y};return M.next=M}}return{next:Le}}x.values=Te;function Le(){return{value:j,done:!0}}return Ce.prototype={constructor:Ce,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(me),!f)for(var u in this)u.charAt(0)==="t"&&S.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=j)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(re,Y){return N.type="throw",N.arg=f,u.next=re,Y&&(u.method="next",u.arg=j),!!Y}for(var M=this.tryEntries.length-1;M>=0;--M){var y=this.tryEntries[M],N=y.completion;if(y.tryLoc==="root")return p("end");if(y.tryLoc<=this.prev){var G=S.call(y,"catchLoc"),ee=S.call(y,"finallyLoc");if(G&&ee){if(this.prev<y.catchLoc)return p(y.catchLoc,!0);if(this.prev<y.finallyLoc)return p(y.finallyLoc)}else if(G){if(this.prev<y.catchLoc)return p(y.catchLoc,!0)}else if(ee){if(this.prev<y.finallyLoc)return p(y.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&S.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var y=M;break}}y&&(f==="break"||f==="continue")&&y.tryLoc<=u&&u<=y.finallyLoc&&(y=null);var N=y?y.completion:{};return N.type=f,N.arg=u,y?(this.method="next",this.next=y.finallyLoc,X):this.complete(N)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),X},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),me(p),X}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var M=p.completion;if(M.type==="throw"){var y=M.arg;me(p)}return y}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:Te(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=j),X}},x}(O.exports);try{regeneratorRuntime=E}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=E:Function("r","regeneratorRuntime = r")(E)}},182:function(O,E,x){x.d(E,{Z:function(){return T}});function T(S){if(S.geometry&&S.geometry.dispose(),S.material){var j=Array.isArray(S.material)?S.material:[S.material];j.forEach(function(A){var z,Z,V,B,J,Q,D,s,pe,te,X,U,H;(z=A.map)===null||z===void 0||z.dispose(),(Z=A.lightMap)===null||Z===void 0||Z.dispose(),(V=A.bumpMap)===null||V===void 0||V.dispose(),(B=A.normalMap)===null||B===void 0||B.dispose(),(J=A.specularMap)===null||J===void 0||J.dispose(),(Q=A.envMap)===null||Q===void 0||Q.dispose(),(D=A.alphaMap)===null||D===void 0||D.dispose(),(s=A.aoMap)===null||s===void 0||s.dispose(),(pe=A.displacementMap)===null||pe===void 0||pe.dispose(),(te=A.emissiveMap)===null||te===void 0||te.dispose(),(X=A.gradientMap)===null||X===void 0||X.dispose(),(U=A.metalnessMap)===null||U===void 0||U.dispose(),(H=A.roughnessMap)===null||H===void 0||H.dispose(),A.dispose()})}}},175:function(O,E,x){x.d(E,{wf:function(){return A.Z}});var T=x(666),S=x.n(T),j=null,A=x(182),z=x(949);function Z(U){if(U.material){var H=Array.isArray(U.material)?U.material:[U.material];H.forEach(function(L){var $,K;($=L.color)===null||$===void 0||$.convertSRGBToLinear(),(K=L.emissive)===null||K===void 0||K.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var V=x(568),B=x(924),J=U=>{var H={};return x.d(H,U),H},Q=U=>()=>U,D=J({get:()=>Qe.get,set:()=>Qe.set}),s=x(620),pe=null,te=null,X=function(){var U=(0,V.Z)(S().mark(function H(L,$){var K,ne,q,I,se,ye;return S().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return K=$.version,ie.next=4,(0,D.get)(L);case 4:if(q=ie.sent,!(q&&q[K])){ie.next=9;break}ne=q[K],ie.next=15;break;case 9:return ie.next=11,(0,s.Z)(fetch(L).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:I=ie.sent,se=I.res,ye=I.err,ye||(ne=se,(0,D.set)(L,(0,B.Z)({},K,se)));case 15:return ie.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:L});case 16:case"end":return ie.stop()}},H)}));return function(L,$){return U.apply(this,arguments)}}()},620:function(O,E,x){x.d(E,{Z:function(){return S}});var T=x(42);function S(j){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(z){return(0,T.Z)({err:null,res:z},A)}).catch(function(z){return(0,T.Z)({err:z,res:void 0},A)})}},949:function(O,E,x){var T=j=>{var A={};return x.d(A,j),A},S=j=>()=>j;O.exports=T({Box3:()=>k.Box3,BufferAttribute:()=>k.BufferAttribute,BufferGeometry:()=>k.BufferGeometry,CanvasTexture:()=>k.CanvasTexture,Color:()=>k.Color,DoubleSide:()=>k.DoubleSide,ExtrudeBufferGeometry:()=>k.ExtrudeBufferGeometry,Float32BufferAttribute:()=>k.Float32BufferAttribute,Group:()=>k.Group,LineSegments:()=>k.LineSegments,Matrix4:()=>k.Matrix4,Mesh:()=>k.Mesh,MeshBasicMaterial:()=>k.MeshBasicMaterial,NormalBlending:()=>k.NormalBlending,PlaneBufferGeometry:()=>k.PlaneBufferGeometry,PlaneGeometry:()=>k.PlaneGeometry,Points:()=>k.Points,RGBAFormat:()=>k.RGBAFormat,Ray:()=>k.Ray,ShaderChunk:()=>k.ShaderChunk,ShaderMaterial:()=>k.ShaderMaterial,Shape:()=>k.Shape,Sphere:()=>k.Sphere,Sprite:()=>k.Sprite,SpriteMaterial:()=>k.SpriteMaterial,Texture:()=>k.Texture,TextureLoader:()=>k.TextureLoader,UniformsLib:()=>k.UniformsLib,Vector2:()=>k.Vector2,Vector3:()=>k.Vector3,VideoTexture:()=>k.VideoTexture})},568:function(O,E,x){x.d(E,{Z:function(){return S}});function T(j,A,z,Z,V,B,J){try{var Q=j[B](J),D=Q.value}catch(s){z(s);return}Q.done?A(D):Promise.resolve(D).then(Z,V)}function S(j){return function(){var A=this,z=arguments;return new Promise(function(Z,V){var B=j.apply(A,z);function J(D){T(B,Z,V,J,Q,"next",D)}function Q(D){T(B,Z,V,J,Q,"throw",D)}J(void 0)})}}},924:function(O,E,x){x.d(E,{Z:function(){return T}});function T(S,j,A){return j in S?Object.defineProperty(S,j,{value:A,enumerable:!0,configurable:!0,writable:!0}):S[j]=A,S}},42:function(O,E,x){x.d(E,{Z:function(){return S}});var T=x(924);function S(j){for(var A=1;A<arguments.length;A++){var z=arguments[A]!=null?arguments[A]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(V){return Object.getOwnPropertyDescriptor(z,V).enumerable}))),Z.forEach(function(V){(0,T.Z)(j,V,z[V])})}return j}}},et={};function W(O){var E=et[O];if(E!==void 0)return E.exports;var x=et[O]={exports:{}};return Zt[O](x,x.exports,W),x.exports}(function(){W.n=function(O){var E=O&&O.__esModule?function(){return O.default}:function(){return O};return W.d(E,{a:E}),E}})(),function(){W.d=function(O,E){for(var x in E)W.o(E,x)&&!W.o(O,x)&&Object.defineProperty(O,x,{enumerable:!0,get:E[x]})}}(),function(){W.o=function(O,E){return Object.prototype.hasOwnProperty.call(O,E)}}();var ue={};(function(){W.d(ue,{Ei:function(){return Et},Yo:function(){return Rt},Ee:function(){return ee},x1:function(){return ut},VJ:function(){return ce},r7:function(){return Ve},XA:function(){return Ze},NB:function(){return tt},xv:function(){return M},nk:function(){return we}});function O(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function E(e,n){return E=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},E(e,n)}function x(e,n){return E(e,n)}function T(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&x(e,n)}var S=W(42);function j(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function A(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}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(e){return!1}}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function V(e){return Z(e)}function B(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Q(e,n){return n&&(J(n)==="object"||typeof n=="function")?n:B(e)}function D(e){var n=z();return function(){var i=V(e),a;if(n){var t=V(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return Q(this,a)}}var s=W(949);function pe(){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(e){return!1}}function te(e,n,r){return pe()?te=Reflect.construct:te=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&x(v,o.prototype),v},te.apply(null,arguments)}function X(e,n,r){return te.apply(null,arguments)}function U(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function H(e,n,r){return n&&U(e.prototype,n),r&&U(e,r),e}function L(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function $(e){if(Array.isArray(e))return L(e)}function K(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ne(){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(e,n){if(!!e){if(typeof e=="string")return L(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(e,n)}}function I(e){return $(e)||K(e)||q(e)||ne()}var se=W(620);function ye(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,se.Z)(r.promise,n)),r}var Oe=e=>{var n={};return W.d(n,e),n},ie=e=>()=>e,me=Oe({CSS2DObject:()=>Vt.CSS2DObject}),Ce=e=>{var n={};return W.d(n,e),n},Te=e=>()=>e,Le=Ce({CSS3DObject:()=>qe.CSS3DObject,CSS3DSprite:()=>qe.CSS3DSprite}),f=W(175),u=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){O(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ye(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},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 i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=X(s.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=X(s.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new me.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Le.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Le.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},H(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),M=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,S.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,m=t.sizeAttenuation;if(h){var d=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=d}else{var g=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,S.Z)(A((0,S.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,m=c.fontFamily,d=c.fontWeight,g=c.flipX,b=c.scale,_=this.canvas;_.width=v*h.length*2,_.height=v;var w=_.getContext("2d");w.font="".concat(d," ").concat(v,"px/1 ").concat(m);var l=w.measureText(h).width;_.width=l,this.width=l,w=_.getContext("2d"),w.clearRect(0,0,_.width,_.height),g&&w.scale(-1,1),w.font="".concat(d," ").concat(v,"px/1 ").concat(m),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,g?l*-1:0,_.height/2),w.restore();var P=new s.Texture(_);P.anisotropy=16,P.needsUpdate=!0;var C=this.object3d;C.material.map&&C.material.map.dispose(),C.material.map=P,C.material.needsUpdate=!0,C.scale.set(P.image.width*b,P.image.height*b,1)},r}(p),y=W(568),N=W(666),G=W.n(N),ee=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,y.Z)(G().mark(function o(){var c,h,v,m,d,g,b,_,w,l;return G().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return c=t.options,h=c.transparent,v=c.blending,m=c.src,d=c.depthWrite,g=c.alphaTest,b=c.sprite,_=c.sizeAttenuation,C.next=3,new s.TextureLoader().loadAsync(m);case 3:return w=C.sent,l=b?new s.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0,sizeAttenuation:_!=null?_:!0}):new s.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0}),C.abrupt("return",l);case 6:case"end":return C.stop()}},o)}))()},i.create=function(){var t=this;return(0,y.Z)(G().mark(function o(){var c,h,v,m,d,g,b,_;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,m=c.src,d=c.cache,g=c.sprite,!(d&&!d.get(m))){l.next=7;break}return d.init(m),l.next=5,t.getMaterial();case 5:b=l.sent,d.set(m,b);case 7:if(!d){l.next=13;break}return l.next=10,d.get(m);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:_=l.t0,t.texture=_.map,g?t.createSprite(_):t.createMesh(new s.PlaneBufferGeometry(1,1),_),h&&t.object3d.scale.set(_.map.image.width*h,_.map.image.height*h,1),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},r}(p);function re(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=V(e),e!==null););return e}function Y(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?Y=Reflect.get:Y=function(a,t,o){var c=re(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},Y(e,n,r)}function be(e,n,r){return Y(e,n,r)}var we=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,S.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,m=t.format,d=t.autoPlay,g=t.loop,b=t.alphaTest,_=t.sprite,w=ye(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var P=new s.VideoTexture(l);P.format=m!=null?m:s.RGBAFormat,P.needsUpdate=!0;var C=_?new s.SpriteMaterial({map:P,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:P,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});w.resolve(C)},!1),l.src=o,l.muted=!0,l.autoplay=d,l.loop=g,l.preload="auto",w.promise},i.create=function(){var t=this;return(0,y.Z)(G().mark(function o(){var c,h,v,m,d,g,b,_;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,m=c.src,d=c.cache,g=c.sprite,!(d&&!d.get(m))){l.next=7;break}return d.init(m),l.next=5,t.getMaterial();case 5:b=l.sent,d.set(m,b);case 7:if(!d){l.next=13;break}return l.next=10,d.get(m);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:_=l.t0,t.video=_.map.image,g?t.createSprite(_):t.createMesh(new s.PlaneBufferGeometry(1,1),_),h&&t.object3d.scale.set(t.video.videoWidth*h,t.video.videoHeight*h,1),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),be(V(r.prototype),"dispose",this).call(this)},r}(p),ve=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,S.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,m=document.createElement("div");m.appendChild(c),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&m.addEventListener("click",h),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,y.Z)(G().mark(function o(){var c,h,v,m;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),m=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",m);case 9:case"end":return g.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,m=t.position,d=m===void 0?new s.Vector3(0,0,0):m,g=t.cache,b=this;return(0,y.Z)(G().mark(function _(){var w,l,P,C;return G().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(w="node-create-pick-object",!(g&&!g.get(w))){R.next=7;break}return g.init(w),R.next=5,b.getMaterial(c);case 5:l=R.sent,g.set(w,l);case 7:if(!g){R.next=13;break}return R.next=10,g.get(w);case 10:R.t0=R.sent,R.next=16;break;case 13:return R.next=15,b.getMaterial(c);case 15:R.t0=R.sent;case 16:P=R.t0,C=new s.Sprite(P),C.scale.set(P.map.image.width*v.x,P.map.image.height*v.y,1),C.position.copy(d),b.add(C),b.pickObject=C;case 22:case"end":return R.stop()}},_)}))()},i.dispose=function(){var t=this.options.onClick;if(t){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",t)}be(V(r.prototype),"dispose",this).call(this)},r}(p),tt=ve,rt=`
2
+ `.concat(s.ShaderChunk.logdepthbuf_pars_vertex,`
3
+ `).concat(s.ShaderChunk.fog_pars_vertex,`
4
+ attribute vec3 previous;
5
+ attribute vec3 next;
6
+ attribute float side;
7
+ attribute float width;
8
+ attribute float counters;
9
+
10
+ uniform vec2 resolution;
11
+ uniform float lineWidth;
12
+ uniform vec3 color;
13
+ uniform float opacity;
14
+ uniform float sizeAttenuation;
15
+ uniform vec2 offset;
16
+ uniform float time;
17
+ uniform vec3 lightColor;
18
+ uniform vec2 uCenter;
19
+ uniform float size;
20
+ uniform float speed;
21
+ uniform float lightWidth;
22
+ uniform float lineLightAnimation;
23
+
24
+ varying vec2 vUV;
25
+ varying vec4 vColor;
26
+ varying float vCounters;
27
+
28
+ vec2 fix(vec4 i,float aspect){
29
+
30
+ vec2 res=i.xy/i.w;
31
+ res.x*=aspect;
32
+ vCounters=counters;
33
+ return res;
34
+
35
+ }
36
+
37
+ void main(){
38
+
39
+ float aspect=resolution.x/resolution.y;
40
+ float pixelWidthRatio=1./(resolution.x*projectionMatrix[0][0]);
41
+
42
+ if (lineLightAnimation == 1.0) {
43
+ vec2 vWorld=position.xy;
44
+ float r_time=mod(time/(speed*size),2.);
45
+ float l=distance(vWorld, uCenter)/size;
46
+ float r_opacity=smoothstep(r_time-lightWidth*2.,r_time-lightWidth,l)-smoothstep(r_time-lightWidth,r_time,l);
47
+ vColor=vec4(mix(color,lightColor,r_opacity),opacity);
48
+ } else {
49
+ vColor=vec4(color,opacity);
50
+ }
51
+
52
+
53
+ vUV=uv+offset;
54
+
55
+ mat4 m=projectionMatrix*modelViewMatrix;
56
+ vec4 finalPosition=m*vec4(position,1.);
57
+ vec4 prevPos=m*vec4(previous,1.);
58
+ vec4 nextPos=m*vec4(next,1.);
59
+
60
+ vec2 currentP=fix(finalPosition,aspect);
61
+ vec2 prevP=fix(prevPos,aspect);
62
+ vec2 nextP=fix(nextPos,aspect);
63
+
64
+ float pixelWidth=finalPosition.w*pixelWidthRatio;
65
+ float w=1.8*pixelWidth*lineWidth*width;
66
+
67
+ if(sizeAttenuation==1.){
68
+ w=1.8*lineWidth*width;
69
+ }
70
+
71
+ vec2 dir;
72
+ if(nextP==currentP)dir=normalize(currentP-prevP);
73
+ else if(prevP==currentP)dir=normalize(nextP-currentP);
74
+ else{
75
+ vec2 dir1=normalize(currentP-prevP);
76
+ vec2 dir2=normalize(nextP-currentP);
77
+ dir=normalize(dir1+dir2);
78
+
79
+ vec2 perp=vec2(-dir1.y,dir1.x);
80
+ vec2 miter=vec2(-dir.y,dir.x);
81
+ //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );
82
+
83
+ }
84
+
85
+ //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;
86
+ vec2 normal=vec2(-dir.y,dir.x);
87
+ normal.x/=aspect;
88
+ normal*=.5*w;
89
+
90
+ vec4 offset=vec4(normal*side,0.,1.);
91
+ finalPosition.xy+=offset.xy;
92
+
93
+ gl_Position=finalPosition;
94
+ `).concat(s.ShaderChunk.logdepthbuf_vertex,`
95
+ vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
96
+ `).concat(s.ShaderChunk.fog_vertex,`
97
+ }
98
+ `),nt=`
99
+ `.concat(s.ShaderChunk.fog_pars_fragment,`
100
+ `).concat(s.ShaderChunk.logdepthbuf_pars_fragment,`
101
+
102
+
103
+ uniform sampler2D map;
104
+ uniform sampler2D alphaMap;
105
+ uniform float useMap;
106
+ uniform float useAlphaMap;
107
+ uniform float useDash;
108
+ uniform float dashArray;
109
+ uniform float dashOffset;
110
+ uniform float dashRatio;
111
+ uniform float visibility;
112
+ uniform float alphaTest;
113
+ uniform vec2 repeat;
114
+
115
+ varying vec2 vUV;
116
+ varying vec4 vColor;
117
+ varying float vCounters;
118
+
119
+ void main() {
120
+ `).concat(s.ShaderChunk.logdepthbuf_fragment,`
121
+ vec4 c = vColor;
122
+ if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
123
+ if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
124
+ if( c.a < alphaTest ) discard;
125
+ if( useDash == 1. ){
126
+ c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));
127
+ }
128
+ gl_FragColor = c;
129
+ gl_FragColor.a *= step(vCounters, visibility);
130
+ `).concat(s.ShaderChunk.fog_fragment,`
131
+ }
132
+ `),ce=function(e){"use strict";T(r,e);var n=D(r);function r(){O(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(B(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(s.BufferGeometry);ce.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ce.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ce.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ze(e,n){var r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,m=this instanceof s.LineSegments?2:1,d=o.index,g=o.attributes;if(d!==null)for(var b=d.array,_=g.position.array,w=g.width.array,l=0,P=b.length-1;l<P;l+=m){var C=b[l],F=b[l+1];c.fromArray(_,C*3),h.fromArray(_,F*3);var R=w[Math.floor(l/3)]!==void 0?w[Math.floor(l/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*R/2,Se=fe*fe,xe=i.distanceSqToSegment(c,h,t,v);if(!(xe>Se)){t.applyMatrix4(this.matrixWorld);var _e=e.ray.origin.distanceTo(t);_e<e.near||_e>e.far||(n.push({distance:_e,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=P)}}}}ce.prototype.raycast=Ze,ce.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ce.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ce.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-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 i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-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 s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.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 De(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ce.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;De(n,0,r,0,a),De(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,De(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=rt,s.ShaderChunk.meshline_frag=nt;var Ve=function(e){"use strict";T(r,e);var n=D(r);function r(i){O(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.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 s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(B(a),{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)}}}),a.setValues(i),a}return r}(s.ShaderMaterial);Ve.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function it(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function at(e,n){if(e==null)return{};var r=it(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var ot=e=>{var n={};return W.d(n,e),n},rr=e=>()=>e,Xe=ot({default:()=>Wt.default}),st={nodes:[],color:new s.Color("red"),lineWidth:3,sizeAttenuation:0},ut=function(e){"use strict";T(r,e);var n=D(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};O(this,r);var t;return t=n.call(this),t.geometry=new s.BufferGeometry,t.meshline=new ce,t.options=(0,S.Z)({},st,a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,c=t.duration,h=t.delay,v=t.onComplete,m=t.setPointWidth,d=at(t,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),b=g.width,_=g.height;delete d.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,m);var w=new Ve(A((0,S.Z)({},d),{resolution:new s.Vector2(b,_)}));this.material=w,this.createMesh(this.meshline,w)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,m=new Xe.default.Tween(v.value).to({x:0},o!=null?o:1e3).delay(c!=null?c:0).repeat(1/0);h&&m.onComplete(h),m.start(),this.tween=m},i.dispose=function(){be(V(r.prototype),"dispose",this).call(this),this.tween&&Xe.default.remove(this.tween)},r}(p);function ct(e){if(Array.isArray(e))return e}function lt(){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 le(e,n){return ct(e)||K(e,n)||q(e,n)||lt()}var ft=e=>{var n={};return W.d(n,e),n},nr=e=>()=>e,Ae=ft({extent:()=>Ie.extent,mean:()=>Ie.mean,merge:()=>Ie.merge}),ht=e=>{var n={};return W.d(n,e),n},ir=e=>()=>e,We=ht({default:()=>Gt.default}),pt=e=>{var n={};return W.d(n,e),n},ar=e=>()=>e,vt=pt({default:()=>zt.default});function dt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var mt=e=>{var n={};return W.d(n,e),n},or=e=>()=>e,_t=mt({default:()=>Ut.default}),gt=e=>{var n={};return W.d(n,e),n},sr=e=>()=>e,yt=gt({default:()=>Nt.default}),bt=e=>{var n={};return W.d(n,e),n},ur=e=>()=>e,Ee=bt({geoBounds:()=>Be.geoBounds,geoContains:()=>Be.geoContains,geoDistance:()=>Be.geoDistance,geoInterpolate:()=>Be.geoInterpolate}),wt=e=>{var n={};return W.d(n,e),n},cr=e=>()=>e,xt=wt({geoVoronoi:()=>Ft.geoVoronoi}),Mt=e=>{var n={};return W.d(n,e),n},lr=e=>()=>e,He=Mt({scaleLinear:()=>It.scaleLinear});function At(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Ee.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Ee.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function St(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(l){return l/c*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},m=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(m(t)):0,a!==void 0?Math.floor(m(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],_=d[0];_<=d[1];_++){var w=h(_);g(w)&&b.push([w,v(_)])}return b}function Ge(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(n,e):(0,yt.default)(e,n)}function Pt(e,n){var r={type:"Polygon",coordinates:e},i=le((0,Ee.geoBounds)(r),2),a=le(i[0],2),t=a[0],o=a[1],c=le(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var m=t>h||v>=89||o<=-89;return St(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(d){return Ge(d,r,m)})}function Ot(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=At(e,i),t=(0,Ae.merge)(a),o=Pt(e,i),c=I(t).concat(I(o)),h={type:"Polygon",coordinates:e},v=le((0,Ee.geoBounds)(h),2),m=le(v[0],2),d=m[0],g=m[1],b=le(v[1],2),_=b[0],w=b[1],l=d>_||w>=89||g<=-89,P=[];if(l){var C=(0,xt.geoVoronoi)(c).triangles(),F=new Map(c.map(function(ae,ge){var de=le(ae,2),oe=de[0],Re=de[1];return["".concat(oe,"-").concat(Re),ge]}));C.features.forEach(function(ae){var ge,de=ae.geometry.coordinates[0].slice(0,3).reverse(),oe=[];if(de.forEach(function(ke){var he=le(ke,2),Fe=he[0],Dt=he[1],Je="".concat(Fe,"-").concat(Dt);F.has(Je)&&oe.push(F.get(Je))}),oe.length===3){if(oe.some(function(ke){return ke<t.length})){var Re=ae.properties.circumcenter;if(!Ge(Re,h,l))return}(ge=P).push.apply(ge,I(oe))}})}else if(o.length)for(var _e=function(ae,ge){var de,oe=[2,1,0].map(function(he){return Me.triangles[ae+he]}),Re=oe.map(function(he){return c[he]});if(oe.some(function(he){return he<t.length})){var ke=[0,1].map(function(he){return(0,Ae.mean)(Re,function(Fe){return Fe[he]})});if(!Ge(ke,h,l))return"continue"}(de=P).push.apply(de,I(oe))},Me=_t.default.from(c),Pe=0,je=Me.triangles.length;Pe<je;Pe+=3)_e(Pe,je);else{var R=We.default.flatten(a),fe=R.vertices,Se=R.holes,xe=Se===void 0?[]:Se;P=(0,We.default)(fe,xe,2)}var Ne=(0,He.scaleLinear)((0,Ae.extent)(c,function(ae){return ae[0]}),[0,1]),kt=(0,He.scaleLinear)((0,Ae.extent)(c,function(ae){return ae[1]}),[0,1]),Tt=c.map(function(ae){var ge=le(ae,2),de=ge[0],oe=ge[1];return[Ne(de),kt(oe)]}),Bt={points:c,indices:P,uvs:Tt};return{contour:a,triangles:Bt}}var Ct=Ot,Ke=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ze(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=le(t,2),c=o[0],h=o[1];return r?dt(c,h,n):[c,h,n]})});return We.default.flatten(i)}function Ye(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=ze(e,n,i),t=a.vertices,o=a.holes,c=ze(e,r,i),h=c.vertices,v=(0,Ae.merge)([h,t]),m=Math.round(h.length/3),d=new Set(o),g=0,b=[],_=0;_<m;_++){var w=_+1;if(w===m)w=g;else if(d.has(w)){var l=w;w=g,g=l}b.push(_,_+m,w+m),b.push(w+m,w,_)}for(var P=[],C=1;C>=0;C--)for(var F=0;F<m;F+=1)P.push(F/(m-1),C);return{indices:b,vertices:v,uvs:P,topVerts:h}}function $e(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:ze([e.points],n,a).vertices,uvs:r}}var Lt=function(e){"use strict";T(r,e);var n=D(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,S.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,m=o.closedTop,d=o.includeSides,g=o.curvatureResolution,b=o.cartesian,_=o.userDataRsoOffset;(0,vt.default)(i[0])||i[0].reverse();var w=Ct(i,{resolution:g}),l=w.contour,P=w.triangles,C=(0,Ae.merge)(P.uvs),F=[],R=[],fe=[],Se=0,xe=function(Me){var Pe=Math.round(F.length/3),je=fe.length;F=F.concat(Me.vertices),R=R.concat(Me.uvs),fe=fe.concat(Pe?Me.indices.map(function(Ne){return Ne+Pe}):Me.indices),t.addGroup(je,fe.length-je,Se++)};if(d){var _e=Ye(l,c,h,b);xe(_e),t.userData.rso=_?Ye(l,c,h+_,b):_e}return v&&xe($e(P,c,C,!1,b)),m&&xe($e(P,h,C,!0,b)),t.setIndex(fe),t[Ke]("position",new s.Float32BufferAttribute(F,3)),t[Ke]("uv",new s.Float32BufferAttribute(R,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Et=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,S.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,m=t.curvatureResolution,d=t.userDataRsoOffset,g=t.cartesian,b=new Lt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:m,cartesian:g,userDataRsoOffset:d});this.createMesh(b,this.options.material)},r}(p),Ue=new Map,jt={generateTopUV:function(e,n,r,i,a){var t=n[r*3],o=n[r*3+1],c=n[i*3],h=n[i*3+1],v=n[a*3],m=n[a*3+1],d;if(Ue.has(e))d=Ue.get(e);else{var g,b,_,w,l=e.parameters.shapes.getPoints();d={minX:(g=Math).min.apply(g,I(l.map(function(F){var R=F.x;return R}))),maxX:(b=Math).max.apply(b,I(l.map(function(F){var R=F.x;return R}))),minY:(_=Math).min.apply(_,I(l.map(function(F){var R=F.y;return R}))),maxY:(w=Math).max.apply(w,I(l.map(function(F){var R=F.y;return R})))},Ue.set(e,d)}var P=d.maxX-d.minX,C=d.maxY-d.minY;return[new s.Vector2((t-d.minX)/P,1-(o-d.minY)/C),new s.Vector2((c-d.minX)/P,1-(h-d.minY)/C),new s.Vector2((v-d.minX)/P,1-(m-d.minY)/C)]},generateSideWallUV:function(e,n,r,i,a,t){var o=n[r*3],c=n[r*3+1],h=n[r*3+2],v=n[i*3],m=n[i*3+1],d=n[i*3+2],g=n[a*3],b=n[a*3+1],_=n[a*3+2],w=n[t*3],l=n[t*3+1],P=n[t*3+2];return Math.abs(c-m)<.01?[new s.Vector2(o,1-h),new s.Vector2(v,1-d),new s.Vector2(g,1-_),new s.Vector2(w,1-P)]:[new s.Vector2(c,1-h),new s.Vector2(m,1-d),new s.Vector2(b,1-_),new s.Vector2(l,1-P)]}},Rt=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,S.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.points,c=t.depth,h=t.material,v=new s.ExtrudeBufferGeometry(new s.Shape(o),{depth:c,bevelEnabled:!1,UVGenerator:jt});this.createMesh(v,h)},r}(p)})();var Xt=ue.Ei,Ht=ue.Yo,Kt=ue.Ee,Yt=ue.x1,$t=ue.VJ,Jt=ue.r7,Qt=ue.XA,qt=ue.NB,er=ue.xv,tr=ue.nk;export{Xt as ConicPolygon,Ht as ExtrudePolygon,Kt as Image,Yt as Line,$t as MeshLine,Jt as MeshLineMaterial,Qt as MeshLineRaycast,qt as Node,er as Text,tr as Video};
@@ -1 +1 @@
1
- (function(){var J={666:function(v){var d=function(s){"use strict";var O=Object.prototype,g=O.hasOwnProperty,_,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,E=Object.create(c.prototype),M=new x(f||[]);return E._invoke=p(e,n,M),E}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 Z="suspendedStart",W="suspendedYield",z="executing",P="completed",k={};function m(){}function A(){}function i(){}var o={};w(o,y,function(){return this});var a=Object.getPrototypeOf,r=a&&a(a(N([])));r&&r!==O&&g.call(r,y)&&(o=r);var u=i.prototype=m.prototype=Object.create(o);A.prototype=i,w(u,"constructor",i),w(i,"constructor",A),A.displayName=w(i,j,"GeneratorFunction");function h(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===A||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,w(e,j,"GeneratorFunction")),e.prototype=Object.create(u),e},s.awrap=function(e){return{__await:e}};function l(e,t){function n(E,M,G,B){var D=I(e[E],e,M);if(D.type==="throw")B(D.arg);else{var Y=D.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,G,B)},function($){n("throw",$,G,B)}):t.resolve(H).then(function($){Y.value=$,G(Y)},function($){return n("throw",$,G,B)})}}var f;function c(E,M){function G(){return new t(function(B,D){n(E,M,B,D)})}return f=f?f.then(G,G):G()}this._invoke=c}h(l.prototype),w(l.prototype,T,function(){return this}),s.AsyncIterator=l,s.async=function(e,t,n,f,c){c===void 0&&(c=Promise);var E=new l(R(e,t,n,f),c);return s.isGeneratorFunction(t)?E:E.next().then(function(M){return M.done?M.value:E.next()})};function p(e,t,n){var f=Z;return function(E,M){if(f===z)throw new Error("Generator is already running");if(f===P){if(E==="throw")throw M;return F()}for(n.method=E,n.arg=M;;){var G=n.delegate;if(G){var B=L(G,n);if(B){if(B===k)continue;return B}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===Z)throw f=P,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var D=I(e,t,n);if(D.type==="normal"){if(f=n.done?P:W,D.arg===k)continue;return{value:D.arg,done:n.done}}else D.type==="throw"&&(f=P,n.method="throw",n.arg=D.arg)}}}function L(e,t){var n=e.iterator[t.method];if(n===_){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=_,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=_);else return c;return t.delegate=null,k}h(u),w(u,j,"Generator"),w(u,y,function(){return this}),w(u,"toString",function(){return"[object Generator]"});function U(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,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 N(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=_,c.done=!0,c};return f.next=f}}return{next:F}}s.values=N;function F(){return{value:_,done:!0}}return x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(C),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=_)},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,D){return E.type="throw",E.arg=e,t.next=B,D&&(t.method="next",t.arg=_),!!D}for(var f=this.tryEntries.length-1;f>=0;--f){var c=this.tryEntries[f],E=c.completion;if(c.tryLoc==="root")return n("end");if(c.tryLoc<=this.prev){var M=g.call(c,"catchLoc"),G=g.call(c,"finallyLoc");if(M&&G){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(M){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else if(G){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 E=c?c.completion:{};return E.type=e,E.arg=t,c?(this.method="next",this.next=c.finallyLoc,k):this.complete(E)},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),C(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;C(n)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=_),k}},s}(v.exports);try{regeneratorRuntime=d}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=d:Function("r","regeneratorRuntime = r")(d)}},519:function(v,d,s){"use strict";s.d(d,{makePromiseCreator:function(){return O.Z}});var O=s(282),g=s(666),_=s.n(g),b=null,y=s(644);function T(P){if(P.material){var k=Array.isArray(P.material)?P.material:[P.material];k.forEach(function(m){var A,i;(A=m.color)===null||A===void 0||A.convertSRGBToLinear(),(i=m.emissive)===null||i===void 0||i.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),Z=null,W=null,z=function(){var P=(0,j.Z)(_().mark(function k(m,A){var i,o,a,r,u,h;return _().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return i=A.version,p.next=4,(0,R.get)(m);case 4:if(a=p.sent,!(a&&a[i])){p.next=9;break}o=a[i],p.next=15;break;case 9:return p.next=11,(0,I.Z)(fetch(m).then(function(L){if(L.ok)return L.blob();throw new Error}));case 11:r=p.sent,u=r.res,h=r.err,h||(o=u,(0,R.set)(m,(0,w.Z)({},i,u)));case 15:return p.abrupt("return",o?{url:URL.createObjectURL(o)}:{url:m});case 16:case"end":return p.stop()}},k)}));return function(m,A){return P.apply(this,arguments)}}()},282:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(484);function g(){var _=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}),_&&(y.promise=(0,O.Z)(y.promise,b)),y}},484:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(42);function g(_){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _.then(function(y){return(0,O.Z)({err:null,res:y},b)}).catch(function(y){return(0,O.Z)({err:y,res:void 0},b)})}},644:function(v){"use strict";v.exports=require("three")},568:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});function O(_,b,y,T,j,w,R){try{var I=_[w](R),Z=I.value}catch(W){y(W);return}I.done?b(Z):Promise.resolve(Z).then(T,j)}function g(_){return function(){var b=this,y=arguments;return new Promise(function(T,j){var w=_.apply(b,y);function R(Z){O(w,T,j,R,I,"next",Z)}function I(Z){O(w,T,j,R,I,"throw",Z)}R(void 0)})}}},924:function(v,d,s){"use strict";s.d(d,{Z:function(){return O}});function O(g,_,b){return _ in g?Object.defineProperty(g,_,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[_]=b,g}},42:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(924);function g(_){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,O.Z)(_,j,y[j])})}return _}}},X={};function S(v){var d=X[v];if(d!==void 0)return d.exports;var s=X[v]={exports:{}};return J[v](s,s.exports,S),s.exports}(function(){S.n=function(v){var d=v&&v.__esModule?function(){return v.default}:function(){return v};return S.d(d,{a:d}),d}})(),function(){S.d=function(v,d){for(var s in d)S.o(d,s)&&!S.o(v,s)&&Object.defineProperty(v,s,{enumerable:!0,get:d[s]})}}(),function(){S.o=function(v,d){return Object.prototype.hasOwnProperty.call(v,d)}}(),function(){S.r=function(v){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})}}();var K={};(function(){"use strict";S.r(K),S.d(K,{Cache:function(){return s},Data:function(){return A},Draw:function(){return m}});function v(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var d=S(519),s=function(){"use strict";function i(){v(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(){},o.init=function(r){var u=(0,d.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}(),O=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 _(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 Z(){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)||Z()}var z=S(666),P=S.n(z),k=S(644),m=function(){"use strict";function i(a){v(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 p(){v(this,p)}var L=p.prototype;return L.create=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](C)},p}();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):""),p=this.objects.get(l);return p},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):""),p=[];return this.objects.forEach(function(L,U){(U.startsWith("".concat(l,"#"))||U===l)&&p.push(L)}),p},o.draw=function(r,u,h){var l=this;return(0,O.Z)(P().mark(function p(){var L,U,C,x,N,F,e;return P().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(L=l.objectNamesToFactories.get(r),!L){n.next=15;break}return U=(u||{}).key,C="".concat(r).concat(U?"#".concat(U):""),l.objects.has(C)&&(x=k.MathUtils.generateUUID(),C+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?F=l.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?F=N:F=l.pencil.scene,e=new L().create(u),e.pencil=l.pencil,e.key=C,l.objects.set(C,e),n.next=14,l.addMesh(e,F);case 14:return n.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return n.stop()}},p)}))()},o.addMesh=function(r,u){return(0,O.Z)(P().mark(function h(){return P().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return p.stop()}},h)}))()},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(p){var L=[];if(typeof p=="string"){var U,C=R(p.split("#"),2),x=C[0],N=C[1];(U=L).push.apply(U,W(l.getAllObject(x,{key:N})))}else L.push(p);L.forEach(function(F){l.removeMesh(F)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(l){l.visible=!1,l.dispose(),u.objects.delete(l.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()},_(i,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),i}(),A=function(){"use strict";function i(){v(this,i),this.data={}}var o=i.prototype;return o.install=function(){},o.setData=function(r,u){var h,l;this.data[r]=u,(l=(h=this).cb)===null||l===void 0||l.call(h,r)},o.runAll=function(){var r=this;Object.keys(this.data).forEach(function(u){var h,l;(l=(h=r).cb)===null||l===void 0||l.call(h,u)})},o.dispose=function(){this.data={},this.cb=void 0},i}()})(),module.exports=K})();
1
+ (function(){var J={666:function(v){var d=function(s){"use strict";var O=Object.prototype,g=O.hasOwnProperty,_,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,E=Object.create(c.prototype),M=new x(f||[]);return E._invoke=p(e,n,M),E}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 Z="suspendedStart",W="suspendedYield",z="executing",P="completed",k={};function m(){}function A(){}function i(){}var o={};w(o,y,function(){return this});var a=Object.getPrototypeOf,r=a&&a(a(N([])));r&&r!==O&&g.call(r,y)&&(o=r);var u=i.prototype=m.prototype=Object.create(o);A.prototype=i,w(u,"constructor",i),w(i,"constructor",A),A.displayName=w(i,j,"GeneratorFunction");function h(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===A||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,w(e,j,"GeneratorFunction")),e.prototype=Object.create(u),e},s.awrap=function(e){return{__await:e}};function l(e,t){function n(E,M,G,B){var D=I(e[E],e,M);if(D.type==="throw")B(D.arg);else{var Y=D.arg,H=Y.value;return H&&typeof H=="object"&&g.call(H,"__await")?t.resolve(H.__await).then(function($){n("next",$,G,B)},function($){n("throw",$,G,B)}):t.resolve(H).then(function($){Y.value=$,G(Y)},function($){return n("throw",$,G,B)})}}var f;function c(E,M){function G(){return new t(function(B,D){n(E,M,B,D)})}return f=f?f.then(G,G):G()}this._invoke=c}h(l.prototype),w(l.prototype,T,function(){return this}),s.AsyncIterator=l,s.async=function(e,t,n,f,c){c===void 0&&(c=Promise);var E=new l(R(e,t,n,f),c);return s.isGeneratorFunction(t)?E:E.next().then(function(M){return M.done?M.value:E.next()})};function p(e,t,n){var f=Z;return function(E,M){if(f===z)throw new Error("Generator is already running");if(f===P){if(E==="throw")throw M;return F()}for(n.method=E,n.arg=M;;){var G=n.delegate;if(G){var B=L(G,n);if(B){if(B===k)continue;return B}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===Z)throw f=P,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=z;var D=I(e,t,n);if(D.type==="normal"){if(f=n.done?P:W,D.arg===k)continue;return{value:D.arg,done:n.done}}else D.type==="throw"&&(f=P,n.method="throw",n.arg=D.arg)}}}function L(e,t){var n=e.iterator[t.method];if(n===_){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=_,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=_);else return c;return t.delegate=null,k}h(u),w(u,j,"Generator"),w(u,y,function(){return this}),w(u,"toString",function(){return"[object Generator]"});function U(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,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 N(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=_,c.done=!0,c};return f.next=f}}return{next:F}}s.values=N;function F(){return{value:_,done:!0}}return x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(C),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=_)},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,D){return E.type="throw",E.arg=e,t.next=B,D&&(t.method="next",t.arg=_),!!D}for(var f=this.tryEntries.length-1;f>=0;--f){var c=this.tryEntries[f],E=c.completion;if(c.tryLoc==="root")return n("end");if(c.tryLoc<=this.prev){var M=g.call(c,"catchLoc"),G=g.call(c,"finallyLoc");if(M&&G){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(M){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else if(G){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 E=c?c.completion:{};return E.type=e,E.arg=t,c?(this.method="next",this.next=c.finallyLoc,k):this.complete(E)},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),C(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;C(n)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=_),k}},s}(v.exports);try{regeneratorRuntime=d}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=d:Function("r","regeneratorRuntime = r")(d)}},54:function(v,d,s){"use strict";s.d(d,{makePromiseCreator:function(){return O.Z}});var O=s(653),g=s(666),_=s.n(g),b=null,y=s(644);function T(P){if(P.material){var k=Array.isArray(P.material)?P.material:[P.material];k.forEach(function(m){var A,i;(A=m.color)===null||A===void 0||A.convertSRGBToLinear(),(i=m.emissive)===null||i===void 0||i.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(620),Z=null,W=null,z=function(){var P=(0,j.Z)(_().mark(function k(m,A){var i,o,a,r,u,h;return _().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return i=A.version,p.next=4,(0,R.get)(m);case 4:if(a=p.sent,!(a&&a[i])){p.next=9;break}o=a[i],p.next=15;break;case 9:return p.next=11,(0,I.Z)(fetch(m).then(function(L){if(L.ok)return L.blob();throw new Error}));case 11:r=p.sent,u=r.res,h=r.err,h||(o=u,(0,R.set)(m,(0,w.Z)({},i,u)));case 15:return p.abrupt("return",o?{url:URL.createObjectURL(o)}:{url:m});case 16:case"end":return p.stop()}},k)}));return function(m,A){return P.apply(this,arguments)}}()},653:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(620);function g(){var _=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}),_&&(y.promise=(0,O.Z)(y.promise,b)),y}},620:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(42);function g(_){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _.then(function(y){return(0,O.Z)({err:null,res:y},b)}).catch(function(y){return(0,O.Z)({err:y,res:void 0},b)})}},644:function(v){"use strict";v.exports=require("three")},568:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});function O(_,b,y,T,j,w,R){try{var I=_[w](R),Z=I.value}catch(W){y(W);return}I.done?b(Z):Promise.resolve(Z).then(T,j)}function g(_){return function(){var b=this,y=arguments;return new Promise(function(T,j){var w=_.apply(b,y);function R(Z){O(w,T,j,R,I,"next",Z)}function I(Z){O(w,T,j,R,I,"throw",Z)}R(void 0)})}}},924:function(v,d,s){"use strict";s.d(d,{Z:function(){return O}});function O(g,_,b){return _ in g?Object.defineProperty(g,_,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[_]=b,g}},42:function(v,d,s){"use strict";s.d(d,{Z:function(){return g}});var O=s(924);function g(_){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,O.Z)(_,j,y[j])})}return _}}},X={};function S(v){var d=X[v];if(d!==void 0)return d.exports;var s=X[v]={exports:{}};return J[v](s,s.exports,S),s.exports}(function(){S.n=function(v){var d=v&&v.__esModule?function(){return v.default}:function(){return v};return S.d(d,{a:d}),d}})(),function(){S.d=function(v,d){for(var s in d)S.o(d,s)&&!S.o(v,s)&&Object.defineProperty(v,s,{enumerable:!0,get:d[s]})}}(),function(){S.o=function(v,d){return Object.prototype.hasOwnProperty.call(v,d)}}(),function(){S.r=function(v){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})}}();var K={};(function(){"use strict";S.r(K),S.d(K,{Cache:function(){return s},Data:function(){return A},Draw:function(){return m}});function v(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var d=S(54),s=function(){"use strict";function i(){v(this,i),this.cache=new Map}var o=i.prototype;return o.install=function(){},o.init=function(r){var u=(0,d.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}(),O=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 _(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 Z(){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)||Z()}var z=S(666),P=S.n(z),k=S(644),m=function(){"use strict";function i(a){v(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 p(){v(this,p)}var L=p.prototype;return L.create=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[h](C)},p}();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):""),p=this.objects.get(l);return p},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):""),p=[];return this.objects.forEach(function(L,U){(U.startsWith("".concat(l,"#"))||U===l)&&p.push(L)}),p},o.draw=function(r,u,h){var l=this;return(0,O.Z)(P().mark(function p(){var L,U,C,x,N,F,e;return P().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(L=l.objectNamesToFactories.get(r),!L){n.next=15;break}return U=(u||{}).key,C="".concat(r).concat(U?"#".concat(U):""),l.objects.has(C)&&(x=k.MathUtils.generateUUID(),C+="#".concat(x)),N=(u==null?void 0:u.target)||h,typeof N=="string"?F=l.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?F=N:F=l.pencil.scene,e=new L().create(u),e.pencil=l.pencil,e.key=C,l.objects.set(C,e),n.next=14,l.addMesh(e,F);case 14:return n.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return n.stop()}},p)}))()},o.addMesh=function(r,u){return(0,O.Z)(P().mark(function h(){return P().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return p.stop()}},h)}))()},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(p){var L=[];if(typeof p=="string"){var U,C=R(p.split("#"),2),x=C[0],N=C[1];(U=L).push.apply(U,W(l.getAllObject(x,{key:N})))}else L.push(p);L.forEach(function(F){l.removeMesh(F)})})},o.removeMesh=function(r){var u=this,h=r.parent;r.object3d&&h.remove(r.object3d),r.traverse(function(l){l.visible=!1,l.dispose(),u.objects.delete(l.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()},_(i,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),i}(),A=function(){"use strict";function i(){v(this,i),this.data={}}var o=i.prototype;return o.install=function(){},o.setData=function(r,u){var h,l;this.data[r]=u,(l=(h=this).cb)===null||l===void 0||l.call(h,r)},o.runAll=function(){var r=this;Object.keys(this.data).forEach(function(u){var h,l;(l=(h=r).cb)===null||l===void 0||l.call(h,u)})},o.dispose=function(){this.data={},this.cb=void 0},i}()})(),module.exports=K})();
@@ -0,0 +1 @@
1
+ import*as Y from"idb-keyval";import*as J from"three";var Q={666:function(_){var v=function(u){"use strict";var j=Object.prototype,y=j.hasOwnProperty,p,m=typeof Symbol=="function"?Symbol:{},d=m.iterator||"@@iterator",L=m.asyncIterator||"@@asyncIterator",E=m.toStringTag||"@@toStringTag";function w(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{w({},"")}catch(e){w=function(t,a,f){return t[a]=f}}function N(e,t,a,f){var s=t&&t.prototype instanceof O?t:O,A=Object.create(s.prototype),M=new W(f||[]);return A._invoke=g(e,a,M),A}u.wrap=N;function I(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(f){return{type:"throw",arg:f}}}var T="suspendedStart",F="suspendedYield",K="executing",Z="completed",S={};function O(){}function P(){}function r(){}var o={};w(o,d,function(){return this});var i=Object.getPrototypeOf,n=i&&i(i(R([])));n&&n!==j&&y.call(n,d)&&(o=n);var c=r.prototype=O.prototype=Object.create(o);P.prototype=r,w(c,"constructor",r),w(r,"constructor",P),P.displayName=w(r,E,"GeneratorFunction");function h(e){["next","throw","return"].forEach(function(t){w(e,t,function(a){return this._invoke(t,a)})})}u.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===P||(t.displayName||t.name)==="GeneratorFunction":!1},u.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,w(e,E,"GeneratorFunction")),e.prototype=Object.create(c),e},u.awrap=function(e){return{__await:e}};function l(e,t){function a(A,M,G,U){var D=I(e[A],e,M);if(D.type==="throw")U(D.arg);else{var X=D.arg,z=X.value;return z&&typeof z=="object"&&y.call(z,"__await")?t.resolve(z.__await).then(function($){a("next",$,G,U)},function($){a("throw",$,G,U)}):t.resolve(z).then(function($){X.value=$,G(X)},function($){return a("throw",$,G,U)})}}var f;function s(A,M){function G(){return new t(function(U,D){a(A,M,U,D)})}return f=f?f.then(G,G):G()}this._invoke=s}h(l.prototype),w(l.prototype,L,function(){return this}),u.AsyncIterator=l,u.async=function(e,t,a,f,s){s===void 0&&(s=Promise);var A=new l(N(e,t,a,f),s);return u.isGeneratorFunction(t)?A:A.next().then(function(M){return M.done?M.value:A.next()})};function g(e,t,a){var f=T;return function(A,M){if(f===K)throw new Error("Generator is already running");if(f===Z){if(A==="throw")throw M;return B()}for(a.method=A,a.arg=M;;){var G=a.delegate;if(G){var U=C(G,a);if(U){if(U===S)continue;return U}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(f===T)throw f=Z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);f=K;var D=I(e,t,a);if(D.type==="normal"){if(f=a.done?Z:F,D.arg===S)continue;return{value:D.arg,done:a.done}}else D.type==="throw"&&(f=Z,a.method="throw",a.arg=D.arg)}}}function C(e,t){var a=e.iterator[t.method];if(a===p){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=p,C(e,t),t.method==="throw"))return S;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return S}var f=I(a,e.iterator,t.arg);if(f.type==="throw")return t.method="throw",t.arg=f.arg,t.delegate=null,S;var s=f.arg;if(!s)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S;if(s.done)t[e.resultName]=s.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=p);else return s;return t.delegate=null,S}h(c),w(c,E,"Generator"),w(c,d,function(){return this}),w(c,"toString",function(){return"[object Generator]"});function b(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 k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function W(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}u.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function f(){for(;t.length;){var s=t.pop();if(s in e)return f.value=s,f.done=!1,f}return f.done=!0,f}};function R(e){if(e){var t=e[d];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,f=function s(){for(;++a<e.length;)if(y.call(e,a))return s.value=e[a],s.done=!1,s;return s.value=p,s.done=!0,s};return f.next=f}}return{next:B}}u.values=R;function B(){return{value:p,done:!0}}return W.prototype={constructor:W,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method="next",this.arg=p,this.tryEntries.forEach(k),!e)for(var t in this)t.charAt(0)==="t"&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=p)},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 a(U,D){return A.type="throw",A.arg=e,t.next=U,D&&(t.method="next",t.arg=p),!!D}for(var f=this.tryEntries.length-1;f>=0;--f){var s=this.tryEntries[f],A=s.completion;if(s.tryLoc==="root")return a("end");if(s.tryLoc<=this.prev){var M=y.call(s,"catchLoc"),G=y.call(s,"finallyLoc");if(M&&G){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(M){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else if(G){if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.tryLoc<=this.prev&&y.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var s=f;break}}s&&(e==="break"||e==="continue")&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var A=s?s.completion:{};return A.type=e,A.arg=t,s?(this.method="next",this.next=s.finallyLoc,S):this.complete(A)},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),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),k(a),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var f=a.completion;if(f.type==="throw"){var s=f.arg;k(a)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:R(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=p),S}},u}(_.exports);try{regeneratorRuntime=v}catch(u){typeof globalThis=="object"?globalThis.regeneratorRuntime=v:Function("r","regeneratorRuntime = r")(v)}},175:function(_,v,u){u.d(v,{Mf:function(){return j.Z}});var j=u(653),y=u(666),p=u.n(y),m=null,d=u(949);function L(O){if(O.material){var P=Array.isArray(O.material)?O.material:[O.material];P.forEach(function(r){var o,i;(o=r.color)===null||o===void 0||o.convertSRGBToLinear(),(i=r.emissive)===null||i===void 0||i.convertSRGBToLinear(),r.map&&(r.map.encoding=THREE.sRGBEncoding),r.emissiveMap&&(r.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=u(568),w=u(924),N=O=>{var P={};return u.d(P,O),P},I=O=>()=>O,T=N({get:()=>Y.get,set:()=>Y.set}),F=u(620),K=null,Z=null,S=function(){var O=(0,E.Z)(p().mark(function P(r,o){var i,n,c,h,l,g;return p().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return i=o.version,b.next=4,(0,T.get)(r);case 4:if(c=b.sent,!(c&&c[i])){b.next=9;break}n=c[i],b.next=15;break;case 9:return b.next=11,(0,F.Z)(fetch(r).then(function(k){if(k.ok)return k.blob();throw new Error}));case 11:h=b.sent,l=h.res,g=h.err,g||(n=l,(0,T.set)(r,(0,w.Z)({},i,l)));case 15:return b.abrupt("return",n?{url:URL.createObjectURL(n)}:{url:r});case 16:case"end":return b.stop()}},P)}));return function(r,o){return O.apply(this,arguments)}}()},653:function(_,v,u){u.d(v,{Z:function(){return y}});var j=u(620);function y(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d={};return d.promise=new Promise(function(L,E){d.resolve=L,d.reject=E}),p&&(d.promise=(0,j.Z)(d.promise,m)),d}},620:function(_,v,u){u.d(v,{Z:function(){return y}});var j=u(42);function y(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return p.then(function(d){return(0,j.Z)({err:null,res:d},m)}).catch(function(d){return(0,j.Z)({err:d,res:void 0},m)})}},949:function(_,v,u){var j=p=>{var m={};return u.d(m,p),m},y=p=>()=>p;_.exports=j({MathUtils:()=>J.MathUtils})},568:function(_,v,u){u.d(v,{Z:function(){return y}});function j(p,m,d,L,E,w,N){try{var I=p[w](N),T=I.value}catch(F){d(F);return}I.done?m(T):Promise.resolve(T).then(L,E)}function y(p){return function(){var m=this,d=arguments;return new Promise(function(L,E){var w=p.apply(m,d);function N(T){j(w,L,E,N,I,"next",T)}function I(T){j(w,L,E,N,I,"throw",T)}N(void 0)})}}},924:function(_,v,u){u.d(v,{Z:function(){return j}});function j(y,p,m){return p in y?Object.defineProperty(y,p,{value:m,enumerable:!0,configurable:!0,writable:!0}):y[p]=m,y}},42:function(_,v,u){u.d(v,{Z:function(){return y}});var j=u(924);function y(p){for(var m=1;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{},L=Object.keys(d);typeof Object.getOwnPropertySymbols=="function"&&(L=L.concat(Object.getOwnPropertySymbols(d).filter(function(E){return Object.getOwnPropertyDescriptor(d,E).enumerable}))),L.forEach(function(E){(0,j.Z)(p,E,d[E])})}return p}}},V={};function x(_){var v=V[_];if(v!==void 0)return v.exports;var u=V[_]={exports:{}};return Q[_](u,u.exports,x),u.exports}(function(){x.n=function(_){var v=_&&_.__esModule?function(){return _.default}:function(){return _};return x.d(v,{a:v}),v}})(),function(){x.d=function(_,v){for(var u in v)x.o(v,u)&&!x.o(_,u)&&Object.defineProperty(_,u,{enumerable:!0,get:v[u]})}}(),function(){x.o=function(_,v){return Object.prototype.hasOwnProperty.call(_,v)}}();var H={};(function(){x.d(H,{Ct:function(){return u},Vw:function(){return P},hG:function(){return O}});function _(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}var v=x(175),u=function(){"use strict";function r(){_(this,r),this.cache=new Map}var o=r.prototype;return o.install=function(){},o.init=function(n){var c=(0,v.Mf)();this.cache.set(n,c)},o.get=function(n){var c;return(c=this.cache.get(n))===null||c===void 0?void 0:c.promise},o.set=function(n,c){var h=this.cache.get(n);h?h.resolve(c):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(n,c){n.reject("stop set cache:".concat(c))}),this.cache.clear()},r}(),j=x(568);function y(r,o){for(var i=0;i<o.length;i++){var n=o[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function p(r,o,i){return o&&y(r.prototype,o),i&&y(r,i),r}function m(r){if(Array.isArray(r))return r}function d(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function L(){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 E(r,o){(o==null||o>r.length)&&(o=r.length);for(var i=0,n=new Array(o);i<o;i++)n[i]=r[i];return n}function w(r,o){if(!!r){if(typeof r=="string")return E(r,o);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return E(r,o)}}function N(r,o){return m(r)||d(r,o)||w(r,o)||L()}function I(r){if(Array.isArray(r))return E(r)}function T(){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 F(r){return I(r)||d(r)||w(r)||T()}var K=x(666),Z=x.n(K),S=x(949),O=function(){"use strict";function r(i){_(this,r),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=i}var o=r.prototype;return o.install=function(n){this.pencil=n,this.initObjectFactories()},o.initObjectFactories=function(){var n=this,c=this.objects_;Object.keys(c).forEach(function(h){var l=function(){function g(){_(this,g)}var C=g.prototype;return C.create=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new c[h](k)},g}();n.objectNamesToFactories.set(h,l)})},o.getObject=function(n,c){n.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",n);var h=(c||{}).key,l="".concat(n).concat(h?"#".concat(h):""),g=this.objects.get(l);return g},o.getAllObject=function(n,c){n.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",n);var h=(c||{}).key,l="".concat(n).concat(h?"#".concat(h):""),g=[];return this.objects.forEach(function(C,b){(b.startsWith("".concat(l,"#"))||b===l)&&g.push(C)}),g},o.draw=function(n,c,h){var l=this;return(0,j.Z)(Z().mark(function g(){var C,b,k,W,R,B,e;return Z().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(C=l.objectNamesToFactories.get(n),!C){a.next=15;break}return b=(c||{}).key,k="".concat(n).concat(b?"#".concat(b):""),l.objects.has(k)&&(W=S.MathUtils.generateUUID(),k+="#".concat(W)),R=(c==null?void 0:c.target)||h,typeof R=="string"?B=l.objects.get(R):(R==null?void 0:R.objecttype__)==="BaseObject"?B=R:B=l.pencil.scene,e=new C().create(c),e.pencil=l.pencil,e.key=k,l.objects.set(k,e),a.next=14,l.addMesh(e,B);case 14:return a.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(n));case 16:case"end":return a.stop()}},g)}))()},o.addMesh=function(n,c){return(0,j.Z)(Z().mark(function h(){return Z().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,n.create();case 2:n.object3d&&(n.object3d.userData.BaseObject_=n,c.add(n.object3d)),n.visible=!0,n.render(),n.pm.resolve();case 6:case"end":return g.stop()}},h)}))()},o.erase=function(){for(var n=arguments.length,c=new Array(n),h=0;h<n;h++)c[h]=arguments[h];var l=this;F(c).forEach(function(g){var C=[];if(typeof g=="string"){var b,k=N(g.split("#"),2),W=k[0],R=k[1];(b=C).push.apply(b,F(l.getAllObject(W,{key:R})))}else C.push(g);C.forEach(function(B){l.removeMesh(B)})})},o.removeMesh=function(n){var c=this,h=n.parent;n.object3d&&h.remove(n.object3d),n.traverse(function(l){l.visible=!1,l.dispose(),c.objects.delete(l.key)})},o.update=function(n,c){this.objects.forEach(function(h){h.update(n,c)})},o.setSize=function(n,c){this.objects.forEach(function(h){h.resize(n,c)})},o.dispose=function(){this.objects.forEach(function(n,c){n.dispose(),n.pm.reject("stop draw:".concat(c))}),this.objects.clear(),this.objectNamesToFactories.clear()},p(r,[{key:"objectsPromise",get:function(){var n=[];return this.objects.forEach(function(c){n.push(c.pm.promise)}),n}}]),r}(),P=function(){"use strict";function r(){_(this,r),this.data={}}var o=r.prototype;return o.install=function(){},o.setData=function(n,c){var h,l;this.data[n]=c,(l=(h=this).cb)===null||l===void 0||l.call(h,n)},o.runAll=function(){var n=this;Object.keys(this.data).forEach(function(c){var h,l;(l=(h=n).cb)===null||l===void 0||l.call(h,c)})},o.dispose=function(){this.data={},this.cb=void 0},r}()})();var q=H.Ct,tt=H.Vw,et=H.hG;export{q as Cache,tt as Data,et as Draw};
@@ -1 +1 @@
1
- (function(){var J={666:function(_){var s=function(o){"use strict";var l=Object.prototype,u=l.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",v=r.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(t,i,h){return t[i]=h}}function g(e,t,i,h){var f=t&&t.prototype instanceof B?t:B,k=Object.create(f.prototype),C=new X(h||[]);return k._invoke=U(e,i,C),k}o.wrap=g;function P(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(h){return{type:"throw",arg:h}}}var T="suspendedStart",R="suspendedYield",W="executing",j="completed",L={};function B(){}function G(){}function I(){}var M={};d(M,n,function(){return this});var O=Object.getPrototypeOf,m=O&&O(O(A([])));m&&m!==l&&u.call(m,n)&&(M=m);var p=I.prototype=B.prototype=Object.create(M);G.prototype=I,d(p,"constructor",I),d(I,"constructor",G),G.displayName=d(I,v,"GeneratorFunction");function w(e){["next","throw","return"].forEach(function(t){d(e,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===G||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,I):(e.__proto__=I,d(e,v,"GeneratorFunction")),e.prototype=Object.create(p),e},o.awrap=function(e){return{__await:e}};function b(e,t){function i(k,C,Z,D){var S=P(e[k],e,C);if(S.type==="throw")D(S.arg);else{var H=S.arg,Y=H.value;return Y&&typeof Y=="object"&&u.call(Y,"__await")?t.resolve(Y.__await).then(function(K){i("next",K,Z,D)},function(K){i("throw",K,Z,D)}):t.resolve(Y).then(function(K){H.value=K,Z(H)},function(K){return i("throw",K,Z,D)})}}var h;function f(k,C){function Z(){return new t(function(D,S){i(k,C,D,S)})}return h=h?h.then(Z,Z):Z()}this._invoke=f}w(b.prototype),d(b.prototype,c,function(){return this}),o.AsyncIterator=b,o.async=function(e,t,i,h,f){f===void 0&&(f=Promise);var k=new b(g(e,t,i,h),f);return o.isGeneratorFunction(t)?k:k.next().then(function(C){return C.done?C.value:k.next()})};function U(e,t,i){var h=T;return function(k,C){if(h===W)throw new Error("Generator is already running");if(h===j){if(k==="throw")throw C;return $()}for(i.method=k,i.arg=C;;){var Z=i.delegate;if(Z){var D=E(Z,i);if(D){if(D===L)continue;return D}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(h===T)throw h=j,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);h=W;var S=P(e,t,i);if(S.type==="normal"){if(h=i.done?j:R,S.arg===L)continue;return{value:S.arg,done:i.done}}else S.type==="throw"&&(h=j,i.method="throw",i.arg=S.arg)}}}function E(e,t){var i=e.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,E(e,t),t.method==="throw"))return L;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return L}var h=P(i,e.iterator,t.arg);if(h.type==="throw")return t.method="throw",t.arg=h.arg,t.delegate=null,L;var f=h.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,L;if(f.done)t[e.resultName]=f.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return f;return t.delegate=null,L}w(p),d(p,v,"Generator"),d(p,n,function(){return this}),d(p,"toString",function(){return"[object Generator]"});function N(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 V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function X(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}o.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function h(){for(;t.length;){var f=t.pop();if(f in e)return h.value=f,h.done=!1,h}return h.done=!0,h}};function A(e){if(e){var t=e[n];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var i=-1,h=function f(){for(;++i<e.length;)if(u.call(e,i))return f.value=e[i],f.done=!1,f;return f.value=a,f.done=!0,f};return h.next=h}}return{next:$}}o.values=A;function $(){return{value:a,done:!0}}return X.prototype={constructor:X,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(V),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},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 i(D,S){return k.type="throw",k.arg=e,t.next=D,S&&(t.method="next",t.arg=a),!!S}for(var h=this.tryEntries.length-1;h>=0;--h){var f=this.tryEntries[h],k=f.completion;if(f.tryLoc==="root")return i("end");if(f.tryLoc<=this.prev){var C=u.call(f,"catchLoc"),Z=u.call(f,"finallyLoc");if(C&&Z){if(this.prev<f.catchLoc)return i(f.catchLoc,!0);if(this.prev<f.finallyLoc)return i(f.finallyLoc)}else if(C){if(this.prev<f.catchLoc)return i(f.catchLoc,!0)}else if(Z){if(this.prev<f.finallyLoc)return i(f.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var h=this.tryEntries[i];if(h.tryLoc<=this.prev&&u.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var f=h;break}}f&&(e==="break"||e==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var k=f?f.completion:{};return k.type=e,k.arg=t,f?(this.method="next",this.next=f.finallyLoc,L):this.complete(k)},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),L},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),V(i),L}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var h=i.completion;if(h.type==="throw"){var f=h.arg;V(i)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:A(e),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),L}},o}(_.exports);try{regeneratorRuntime=s}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},695:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var n,c,v,d,g,P,T,R,W,j,L,B,G;(n=r.map)===null||n===void 0||n.dispose(),(c=r.lightMap)===null||c===void 0||c.dispose(),(v=r.bumpMap)===null||v===void 0||v.dispose(),(d=r.normalMap)===null||d===void 0||d.dispose(),(g=r.specularMap)===null||g===void 0||g.dispose(),(P=r.envMap)===null||P===void 0||P.dispose(),(T=r.alphaMap)===null||T===void 0||T.dispose(),(R=r.aoMap)===null||R===void 0||R.dispose(),(W=r.displacementMap)===null||W===void 0||W.dispose(),(j=r.emissiveMap)===null||j===void 0||j.dispose(),(L=r.gradientMap)===null||L===void 0||L.dispose(),(B=r.metalnessMap)===null||B===void 0||B.dispose(),(G=r.roughnessMap)===null||G===void 0||G.dispose(),r.dispose()})}}},490:function(_,s,o){"use strict";o.d(s,{U:function(){return u},v:function(){return l}});var l=function(a){for(var r=a.offsetLeft,n=a.offsetParent;n!==null;)r+=n.offsetLeft,n=n.offsetParent;var c;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?c=document.body.scrollLeft:c=document.documentElement.scrollLeft,r-c},u=function(a){for(var r=a.offsetTop,n=a.offsetParent;n!==null;)r+=n.offsetTop,n=n.offsetParent;var c;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?c=document.body.scrollTop:c=document.documentElement.scrollTop,r-c}},738:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});function l(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(l(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var n=r.prototype;return!(l(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},282:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(484);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(c,v){n.resolve=c,n.reject=v}),a&&(n.promise=(0,l.Z)(n.promise,r)),n}},713:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-a)*Math.PI/180,c=(90-u)*Math.PI/180;return[r*Math.sin(n)*Math.cos(c),r*Math.cos(n),r*Math.sin(n)*Math.sin(c)]}},618:function(_,s,o){"use strict";o.d(s,{Z:function(){return a}});var l=o(438),u=function(){"use strict";function r(c){(0,l.Z)(this,r),this.onTick_=c,this.cancelPending_=null}var n=r.prototype;return n.tickAfter=function(v){var d=this;this.stop();var g=!0,P;this.cancelPending_=function(){clearTimeout(P),g=!1};var T=function(){g&&d.onTick_()};return P=window.setTimeout(T,v),this},n.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(c){(0,l.Z)(this,r),this.onTick_=c,this.ticker_=null}var n=r.prototype;return n.tickNow=function(){return this.stop(),this.onTick_(),this},n.tickAfter=function(v){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(v),this},n.tickEvery=function(v){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(v),d.onTick_()}).tickAfter(v),this},n.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},484:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(n){return(0,l.Z)({err:null,res:n},r)}).catch(function(n){return(0,l.Z)({err:n,res:void 0},r)})}},644:function(_){"use strict";_.exports=require("three")},943:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=u[r];return n}},982:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(943);function u(a){if(Array.isArray(a))return(0,l.Z)(a)}},568:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});function l(a,r,n,c,v,d,g){try{var P=a[d](g),T=P.value}catch(R){n(R);return}P.done?r(T):Promise.resolve(T).then(c,v)}function u(a){return function(){var r=this,n=arguments;return new Promise(function(c,v){var d=a.apply(r,n);function g(T){l(d,c,v,g,P,"next",T)}function P(T){l(d,c,v,g,P,"throw",T)}g(void 0)})}}},438:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(924);function u(a){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},c=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(n).filter(function(v){return Object.getOwnPropertyDescriptor(n,v).enumerable}))),c.forEach(function(v){(0,l.Z)(a,v,n[v])})}return a}},342:function(_,s,o){"use strict";o.d(s,{Z:function(){return n}});var l=o(982),u=o(375),a=o(270),r=o(566);function n(c){return(0,l.Z)(c)||(0,u.Z)(c)||(0,r.Z)(c)||(0,a.Z)()}},566:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,l.Z)(a,r);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,l.Z)(a,r)}}}},z={};function y(_){var s=z[_];if(s!==void 0)return s.exports;var o=z[_]={exports:{}};return J[_](o,o.exports,y),o.exports}(function(){y.n=function(_){var s=_&&_.__esModule?function(){return _.default}:function(){return _};return y.d(s,{a:s}),s}})(),function(){y.d=function(_,s){for(var o in s)y.o(s,o)&&!y.o(_,o)&&Object.defineProperty(_,o,{enumerable:!0,get:s[o]})}}(),function(){y.o=function(_,s){return Object.prototype.hasOwnProperty.call(_,s)}}(),function(){y.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}}();var F={};(function(){"use strict";y.r(F),y.d(F,{Chain:function(){return v},Timer:function(){return o.Z},clearAllCache:function(){return B},clearCache:function(){return L},colorCorrection:function(){return T},disposeMesh:function(){return g.Z},getCache:function(){return G},getElementViewLeft:function(){return I.v},getElementViewTop:function(){return I.U},isPlainObject:function(){return R.Z},makePromiseCreator:function(){return _.Z},polar2Cartesian:function(){return d.Z},to:function(){return s.Z}});var _=y(282),s=y(484),o=y(618),l=y(568),u=y(438),a=y(42),r=y(342),n=y(666),c=y.n(n),v=function(){"use strict";function M(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,M),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var O=M.prototype;return O.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},O.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},O.stop=function(){return this.traverse(function(p){return p.stop1()}),this},O.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},O.play=function(){var p=this;return(0,l.Z)(c().mark(function w(){var b;return c().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(b=p.chainedList[p.index],!(b&&p.isPlaying)){E.next=9;break}return E.next=4,Promise.all(b.map(function(N){return typeof N=="function"?N(p.repeatCount):N.start()}));case 4:return p.index+=1,E.next=7,p.play();case 7:E.next=17;break;case 9:if(!(!b&&p.isPlaying&&p.repeatCount<p.repeatNum)){E.next=16;break}return p.repeatCount+=1,p.index=0,E.next=14,p.play();case 14:E.next=17;break;case 16:!b&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return E.stop()}},w)}))()},O.chain=function(){for(var p=arguments.length,w=new Array(p),b=0;b<p;b++)w[b]=arguments[b];var U=this;return(0,r.Z)(w).forEach(function(E){E instanceof M&&U.children.push(E)}),this.chainedList.push((0,r.Z)(w)),this},O.repeat=function(p){return this.repeatNum=p,this},O.timeout=function(p){return this.chain(function(){return new Promise(function(w){return setTimeout(w,p)})}),this},O.traverse=function(p){p(this),this.children.forEach(function(w){w.traverse(p)})},M}(),d=y(713),g=y(695),P=y(644);function T(M){if(M.material){var O=Array.isArray(M.material)?M.material:[M.material];O.forEach(function(m){var p,w;(p=m.color)===null||p===void 0||p.convertSRGBToLinear(),(w=m.emissive)===null||w===void 0||w.convertSRGBToLinear(),m.map&&(m.map.encoding=P.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=P.sRGBEncoding)})}}var R=y(738),W=y(924),j=require("idb-keyval"),L=j.del,B=j.clear,G=function(){var M=(0,l.Z)(c().mark(function O(m,p){var w,b,U,E,N,V;return c().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return w=p.version,A.next=4,(0,j.get)(m);case 4:if(U=A.sent,!(U&&U[w])){A.next=9;break}b=U[w],A.next=15;break;case 9:return A.next=11,(0,s.Z)(fetch(m).then(function($){if($.ok)return $.blob();throw new Error}));case 11:E=A.sent,N=E.res,V=E.err,V||(b=N,(0,j.set)(m,(0,W.Z)({},w,N)));case 15:return A.abrupt("return",b?{url:URL.createObjectURL(b)}:{url:m});case 16:case"end":return A.stop()}},O)}));return function(m,p){return M.apply(this,arguments)}}(),I=y(490)})(),module.exports=F})();
1
+ (function(){var J={666:function(_){var s=function(o){"use strict";var l=Object.prototype,u=l.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",v=r.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(t,i,h){return t[i]=h}}function g(e,t,i,h){var f=t&&t.prototype instanceof B?t:B,k=Object.create(f.prototype),C=new X(h||[]);return k._invoke=U(e,i,C),k}o.wrap=g;function P(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(h){return{type:"throw",arg:h}}}var T="suspendedStart",R="suspendedYield",W="executing",j="completed",L={};function B(){}function G(){}function I(){}var M={};d(M,n,function(){return this});var O=Object.getPrototypeOf,m=O&&O(O(A([])));m&&m!==l&&u.call(m,n)&&(M=m);var p=I.prototype=B.prototype=Object.create(M);G.prototype=I,d(p,"constructor",I),d(I,"constructor",G),G.displayName=d(I,v,"GeneratorFunction");function w(e){["next","throw","return"].forEach(function(t){d(e,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===G||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,I):(e.__proto__=I,d(e,v,"GeneratorFunction")),e.prototype=Object.create(p),e},o.awrap=function(e){return{__await:e}};function b(e,t){function i(k,C,Z,D){var S=P(e[k],e,C);if(S.type==="throw")D(S.arg);else{var H=S.arg,Y=H.value;return Y&&typeof Y=="object"&&u.call(Y,"__await")?t.resolve(Y.__await).then(function(K){i("next",K,Z,D)},function(K){i("throw",K,Z,D)}):t.resolve(Y).then(function(K){H.value=K,Z(H)},function(K){return i("throw",K,Z,D)})}}var h;function f(k,C){function Z(){return new t(function(D,S){i(k,C,D,S)})}return h=h?h.then(Z,Z):Z()}this._invoke=f}w(b.prototype),d(b.prototype,c,function(){return this}),o.AsyncIterator=b,o.async=function(e,t,i,h,f){f===void 0&&(f=Promise);var k=new b(g(e,t,i,h),f);return o.isGeneratorFunction(t)?k:k.next().then(function(C){return C.done?C.value:k.next()})};function U(e,t,i){var h=T;return function(k,C){if(h===W)throw new Error("Generator is already running");if(h===j){if(k==="throw")throw C;return $()}for(i.method=k,i.arg=C;;){var Z=i.delegate;if(Z){var D=E(Z,i);if(D){if(D===L)continue;return D}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(h===T)throw h=j,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);h=W;var S=P(e,t,i);if(S.type==="normal"){if(h=i.done?j:R,S.arg===L)continue;return{value:S.arg,done:i.done}}else S.type==="throw"&&(h=j,i.method="throw",i.arg=S.arg)}}}function E(e,t){var i=e.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,E(e,t),t.method==="throw"))return L;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return L}var h=P(i,e.iterator,t.arg);if(h.type==="throw")return t.method="throw",t.arg=h.arg,t.delegate=null,L;var f=h.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,L;if(f.done)t[e.resultName]=f.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return f;return t.delegate=null,L}w(p),d(p,v,"Generator"),d(p,n,function(){return this}),d(p,"toString",function(){return"[object Generator]"});function N(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 V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function X(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}o.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function h(){for(;t.length;){var f=t.pop();if(f in e)return h.value=f,h.done=!1,h}return h.done=!0,h}};function A(e){if(e){var t=e[n];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var i=-1,h=function f(){for(;++i<e.length;)if(u.call(e,i))return f.value=e[i],f.done=!1,f;return f.value=a,f.done=!0,f};return h.next=h}}return{next:$}}o.values=A;function $(){return{value:a,done:!0}}return X.prototype={constructor:X,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(V),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},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 i(D,S){return k.type="throw",k.arg=e,t.next=D,S&&(t.method="next",t.arg=a),!!S}for(var h=this.tryEntries.length-1;h>=0;--h){var f=this.tryEntries[h],k=f.completion;if(f.tryLoc==="root")return i("end");if(f.tryLoc<=this.prev){var C=u.call(f,"catchLoc"),Z=u.call(f,"finallyLoc");if(C&&Z){if(this.prev<f.catchLoc)return i(f.catchLoc,!0);if(this.prev<f.finallyLoc)return i(f.finallyLoc)}else if(C){if(this.prev<f.catchLoc)return i(f.catchLoc,!0)}else if(Z){if(this.prev<f.finallyLoc)return i(f.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var h=this.tryEntries[i];if(h.tryLoc<=this.prev&&u.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var f=h;break}}f&&(e==="break"||e==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var k=f?f.completion:{};return k.type=e,k.arg=t,f?(this.method="next",this.next=f.finallyLoc,L):this.complete(k)},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),L},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),V(i),L}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var h=i.completion;if(h.type==="throw"){var f=h.arg;V(i)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:A(e),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),L}},o}(_.exports);try{regeneratorRuntime=s}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},182:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var n,c,v,d,g,P,T,R,W,j,L,B,G;(n=r.map)===null||n===void 0||n.dispose(),(c=r.lightMap)===null||c===void 0||c.dispose(),(v=r.bumpMap)===null||v===void 0||v.dispose(),(d=r.normalMap)===null||d===void 0||d.dispose(),(g=r.specularMap)===null||g===void 0||g.dispose(),(P=r.envMap)===null||P===void 0||P.dispose(),(T=r.alphaMap)===null||T===void 0||T.dispose(),(R=r.aoMap)===null||R===void 0||R.dispose(),(W=r.displacementMap)===null||W===void 0||W.dispose(),(j=r.emissiveMap)===null||j===void 0||j.dispose(),(L=r.gradientMap)===null||L===void 0||L.dispose(),(B=r.metalnessMap)===null||B===void 0||B.dispose(),(G=r.roughnessMap)===null||G===void 0||G.dispose(),r.dispose()})}}},794:function(_,s,o){"use strict";o.d(s,{U:function(){return u},v:function(){return l}});var l=function(a){for(var r=a.offsetLeft,n=a.offsetParent;n!==null;)r+=n.offsetLeft,n=n.offsetParent;var c;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?c=document.body.scrollLeft:c=document.documentElement.scrollLeft,r-c},u=function(a){for(var r=a.offsetTop,n=a.offsetParent;n!==null;)r+=n.offsetTop,n=n.offsetParent;var c;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?c=document.body.scrollTop:c=document.documentElement.scrollTop,r-c}},975:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});function l(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(l(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var n=r.prototype;return!(l(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},653:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(620);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(c,v){n.resolve=c,n.reject=v}),a&&(n.promise=(0,l.Z)(n.promise,r)),n}},226:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-a)*Math.PI/180,c=(90-u)*Math.PI/180;return[r*Math.sin(n)*Math.cos(c),r*Math.cos(n),r*Math.sin(n)*Math.sin(c)]}},688:function(_,s,o){"use strict";o.d(s,{Z:function(){return a}});var l=o(438),u=function(){"use strict";function r(c){(0,l.Z)(this,r),this.onTick_=c,this.cancelPending_=null}var n=r.prototype;return n.tickAfter=function(v){var d=this;this.stop();var g=!0,P;this.cancelPending_=function(){clearTimeout(P),g=!1};var T=function(){g&&d.onTick_()};return P=window.setTimeout(T,v),this},n.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(c){(0,l.Z)(this,r),this.onTick_=c,this.ticker_=null}var n=r.prototype;return n.tickNow=function(){return this.stop(),this.onTick_(),this},n.tickAfter=function(v){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(v),this},n.tickEvery=function(v){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(v),d.onTick_()}).tickAfter(v),this},n.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},620:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(n){return(0,l.Z)({err:null,res:n},r)}).catch(function(n){return(0,l.Z)({err:n,res:void 0},r)})}},644:function(_){"use strict";_.exports=require("three")},943:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=u[r];return n}},982:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(943);function u(a){if(Array.isArray(a))return(0,l.Z)(a)}},568:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});function l(a,r,n,c,v,d,g){try{var P=a[d](g),T=P.value}catch(R){n(R);return}P.done?r(T):Promise.resolve(T).then(c,v)}function u(a){return function(){var r=this,n=arguments;return new Promise(function(c,v){var d=a.apply(r,n);function g(T){l(d,c,v,g,P,"next",T)}function P(T){l(d,c,v,g,P,"throw",T)}g(void 0)})}}},438:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(_,s,o){"use strict";o.d(s,{Z:function(){return l}});function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(924);function u(a){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},c=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(n).filter(function(v){return Object.getOwnPropertyDescriptor(n,v).enumerable}))),c.forEach(function(v){(0,l.Z)(a,v,n[v])})}return a}},342:function(_,s,o){"use strict";o.d(s,{Z:function(){return n}});var l=o(982),u=o(375),a=o(270),r=o(566);function n(c){return(0,l.Z)(c)||(0,u.Z)(c)||(0,r.Z)(c)||(0,a.Z)()}},566:function(_,s,o){"use strict";o.d(s,{Z:function(){return u}});var l=o(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,l.Z)(a,r);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,l.Z)(a,r)}}}},z={};function y(_){var s=z[_];if(s!==void 0)return s.exports;var o=z[_]={exports:{}};return J[_](o,o.exports,y),o.exports}(function(){y.n=function(_){var s=_&&_.__esModule?function(){return _.default}:function(){return _};return y.d(s,{a:s}),s}})(),function(){y.d=function(_,s){for(var o in s)y.o(s,o)&&!y.o(_,o)&&Object.defineProperty(_,o,{enumerable:!0,get:s[o]})}}(),function(){y.o=function(_,s){return Object.prototype.hasOwnProperty.call(_,s)}}(),function(){y.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}}();var F={};(function(){"use strict";y.r(F),y.d(F,{Chain:function(){return v},Timer:function(){return o.Z},clearAllCache:function(){return B},clearCache:function(){return L},colorCorrection:function(){return T},disposeMesh:function(){return g.Z},getCache:function(){return G},getElementViewLeft:function(){return I.v},getElementViewTop:function(){return I.U},isPlainObject:function(){return R.Z},makePromiseCreator:function(){return _.Z},polar2Cartesian:function(){return d.Z},to:function(){return s.Z}});var _=y(653),s=y(620),o=y(688),l=y(568),u=y(438),a=y(42),r=y(342),n=y(666),c=y.n(n),v=function(){"use strict";function M(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,M),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var O=M.prototype;return O.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},O.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},O.stop=function(){return this.traverse(function(p){return p.stop1()}),this},O.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},O.play=function(){var p=this;return(0,l.Z)(c().mark(function w(){var b;return c().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(b=p.chainedList[p.index],!(b&&p.isPlaying)){E.next=9;break}return E.next=4,Promise.all(b.map(function(N){return typeof N=="function"?N(p.repeatCount):N.start()}));case 4:return p.index+=1,E.next=7,p.play();case 7:E.next=17;break;case 9:if(!(!b&&p.isPlaying&&p.repeatCount<p.repeatNum)){E.next=16;break}return p.repeatCount+=1,p.index=0,E.next=14,p.play();case 14:E.next=17;break;case 16:!b&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return E.stop()}},w)}))()},O.chain=function(){for(var p=arguments.length,w=new Array(p),b=0;b<p;b++)w[b]=arguments[b];var U=this;return(0,r.Z)(w).forEach(function(E){E instanceof M&&U.children.push(E)}),this.chainedList.push((0,r.Z)(w)),this},O.repeat=function(p){return this.repeatNum=p,this},O.timeout=function(p){return this.chain(function(){return new Promise(function(w){return setTimeout(w,p)})}),this},O.traverse=function(p){p(this),this.children.forEach(function(w){w.traverse(p)})},M}(),d=y(226),g=y(182),P=y(644);function T(M){if(M.material){var O=Array.isArray(M.material)?M.material:[M.material];O.forEach(function(m){var p,w;(p=m.color)===null||p===void 0||p.convertSRGBToLinear(),(w=m.emissive)===null||w===void 0||w.convertSRGBToLinear(),m.map&&(m.map.encoding=P.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=P.sRGBEncoding)})}}var R=y(975),W=y(924),j=require("idb-keyval"),L=j.del,B=j.clear,G=function(){var M=(0,l.Z)(c().mark(function O(m,p){var w,b,U,E,N,V;return c().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return w=p.version,A.next=4,(0,j.get)(m);case 4:if(U=A.sent,!(U&&U[w])){A.next=9;break}b=U[w],A.next=15;break;case 9:return A.next=11,(0,s.Z)(fetch(m).then(function($){if($.ok)return $.blob();throw new Error}));case 11:E=A.sent,N=E.res,V=E.err,V||(b=N,(0,j.set)(m,(0,W.Z)({},w,N)));case 15:return A.abrupt("return",b?{url:URL.createObjectURL(b)}:{url:m});case 16:case"end":return A.stop()}},O)}));return function(m,p){return M.apply(this,arguments)}}(),I=y(794)})(),module.exports=F})();
@@ -0,0 +1 @@
1
+ import*as z from"three";import*as Y from"idb-keyval";var Q={666:function(h){var s=function(o){"use strict";var _=Object.prototype,u=_.hasOwnProperty,n,r=typeof Symbol=="function"?Symbol:{},i=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",d=r.toStringTag||"@@toStringTag";function v(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{v({},"")}catch(e){v=function(t,a,l){return t[a]=l}}function w(e,t,a,l){var f=t&&t.prototype instanceof S?t:S,P=Object.create(f.prototype),C=new R(l||[]);return P._invoke=E(e,a,C),P}o.wrap=w;function L(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(l){return{type:"throw",arg:l}}}var T="suspendedStart",I="suspendedYield",K="executing",G="completed",M={};function S(){}function B(){}function U(){}var X={};v(X,i,function(){return this});var x=Object.getPrototypeOf,k=x&&x(x(V([])));k&&k!==_&&u.call(k,i)&&(X=k);var y=U.prototype=S.prototype=Object.create(X);B.prototype=U,v(y,"constructor",U),v(U,"constructor",B),B.displayName=v(U,d,"GeneratorFunction");function m(e){["next","throw","return"].forEach(function(t){v(e,t,function(a){return this._invoke(t,a)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===B||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,U):(e.__proto__=U,v(e,d,"GeneratorFunction")),e.prototype=Object.create(y),e},o.awrap=function(e){return{__await:e}};function p(e,t){function a(P,C,A,D){var Z=L(e[P],e,C);if(Z.type==="throw")D(Z.arg);else{var F=Z.arg,$=F.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(W){a("next",W,A,D)},function(W){a("throw",W,A,D)}):t.resolve($).then(function(W){F.value=W,A(F)},function(W){return a("throw",W,A,D)})}}var l;function f(P,C){function A(){return new t(function(D,Z){a(P,C,D,Z)})}return l=l?l.then(A,A):A()}this._invoke=f}m(p.prototype),v(p.prototype,c,function(){return this}),o.AsyncIterator=p,o.async=function(e,t,a,l,f){f===void 0&&(f=Promise);var P=new p(w(e,t,a,l),f);return o.isGeneratorFunction(t)?P:P.next().then(function(C){return C.done?C.value:P.next()})};function E(e,t,a){var l=T;return function(P,C){if(l===K)throw new Error("Generator is already running");if(l===G){if(P==="throw")throw C;return J()}for(a.method=P,a.arg=C;;){var A=a.delegate;if(A){var D=O(A,a);if(D){if(D===M)continue;return D}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(l===T)throw l=G,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);l=K;var Z=L(e,t,a);if(Z.type==="normal"){if(l=a.done?G:I,Z.arg===M)continue;return{value:Z.arg,done:a.done}}else Z.type==="throw"&&(l=G,a.method="throw",a.arg=Z.arg)}}}function O(e,t){var a=e.iterator[t.method];if(a===n){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=n,O(e,t),t.method==="throw"))return M;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return M}var l=L(a,e.iterator,t.arg);if(l.type==="throw")return t.method="throw",t.arg=l.arg,t.delegate=null,M;var f=l.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,M;if(f.done)t[e.resultName]=f.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=n);else return f;return t.delegate=null,M}m(y),v(y,d,"Generator"),v(y,i,function(){return this}),v(y,"toString",function(){return"[object Generator]"});function N(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 b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}o.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function l(){for(;t.length;){var f=t.pop();if(f in e)return l.value=f,l.done=!1,l}return l.done=!0,l}};function V(e){if(e){var t=e[i];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,l=function f(){for(;++a<e.length;)if(u.call(e,a))return f.value=e[a],f.done=!1,f;return f.value=n,f.done=!0,f};return l.next=l}}return{next:J}}o.values=V;function J(){return{value:n,done:!0}}return R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(b),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},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 a(D,Z){return P.type="throw",P.arg=e,t.next=D,Z&&(t.method="next",t.arg=n),!!Z}for(var l=this.tryEntries.length-1;l>=0;--l){var f=this.tryEntries[l],P=f.completion;if(f.tryLoc==="root")return a("end");if(f.tryLoc<=this.prev){var C=u.call(f,"catchLoc"),A=u.call(f,"finallyLoc");if(C&&A){if(this.prev<f.catchLoc)return a(f.catchLoc,!0);if(this.prev<f.finallyLoc)return a(f.finallyLoc)}else if(C){if(this.prev<f.catchLoc)return a(f.catchLoc,!0)}else if(A){if(this.prev<f.finallyLoc)return a(f.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a];if(l.tryLoc<=this.prev&&u.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var f=l;break}}f&&(e==="break"||e==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var P=f?f.completion:{};return P.type=e,P.arg=t,f?(this.method="next",this.next=f.finallyLoc,M):this.complete(P)},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),M},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),b(a),M}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var l=a.completion;if(l.type==="throw"){var f=l.arg;b(a)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:V(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=n),M}},o}(h.exports);try{regeneratorRuntime=s}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},182:function(h,s,o){o.d(s,{Z:function(){return _}});function _(u){if(u.geometry&&u.geometry.dispose(),u.material){var n=Array.isArray(u.material)?u.material:[u.material];n.forEach(function(r){var i,c,d,v,w,L,T,I,K,G,M,S,B;(i=r.map)===null||i===void 0||i.dispose(),(c=r.lightMap)===null||c===void 0||c.dispose(),(d=r.bumpMap)===null||d===void 0||d.dispose(),(v=r.normalMap)===null||v===void 0||v.dispose(),(w=r.specularMap)===null||w===void 0||w.dispose(),(L=r.envMap)===null||L===void 0||L.dispose(),(T=r.alphaMap)===null||T===void 0||T.dispose(),(I=r.aoMap)===null||I===void 0||I.dispose(),(K=r.displacementMap)===null||K===void 0||K.dispose(),(G=r.emissiveMap)===null||G===void 0||G.dispose(),(M=r.gradientMap)===null||M===void 0||M.dispose(),(S=r.metalnessMap)===null||S===void 0||S.dispose(),(B=r.roughnessMap)===null||B===void 0||B.dispose(),r.dispose()})}}},794:function(h,s,o){o.d(s,{U:function(){return u},v:function(){return _}});var _=function(n){for(var r=n.offsetLeft,i=n.offsetParent;i!==null;)r+=i.offsetLeft,i=i.offsetParent;var c;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?c=document.body.scrollLeft:c=document.documentElement.scrollLeft,r-c},u=function(n){for(var r=n.offsetTop,i=n.offsetParent;i!==null;)r+=i.offsetTop,i=i.offsetParent;var c;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?c=document.body.scrollTop:c=document.documentElement.scrollTop,r-c}},975:function(h,s,o){o.d(s,{Z:function(){return u}});function _(n){return Object.prototype.toString.call(n)==="[object Object]"}function u(n){if(_(n)===!1)return!1;var r=n.constructor;if(r===void 0)return!0;var i=r.prototype;return!(_(i)===!1||i.hasOwnProperty("isPrototypeOf")===!1)}},653:function(h,s,o){o.d(s,{Z:function(){return u}});var _=o(620);function u(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(c,d){i.resolve=c,i.reject=d}),n&&(i.promise=(0,_.Z)(i.promise,r)),i}},226:function(h,s,o){o.d(s,{Z:function(){return _}});function _(u,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,c=(90-u)*Math.PI/180;return[r*Math.sin(i)*Math.cos(c),r*Math.cos(i),r*Math.sin(i)*Math.sin(c)]}},688:function(h,s,o){o.d(s,{Z:function(){return n}});var _=o(438),u=function(){"use strict";function r(c){(0,_.Z)(this,r),this.onTick_=c,this.cancelPending_=null}var i=r.prototype;return i.tickAfter=function(d){var v=this;this.stop();var w=!0,L;this.cancelPending_=function(){clearTimeout(L),w=!1};var T=function(){w&&v.onTick_()};return L=window.setTimeout(T,d),this},i.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),n=function(){"use strict";function r(c){(0,_.Z)(this,r),this.onTick_=c,this.ticker_=null}var i=r.prototype;return i.tickNow=function(){return this.stop(),this.onTick_(),this},i.tickAfter=function(d){var v=this;return this.stop(),this.ticker_=new u(function(){v.onTick_()}).tickAfter(d),this},i.tickEvery=function(d){var v=this;return this.stop(),this.ticker_=new u(function(){var w;(w=v.ticker_)===null||w===void 0||w.tickAfter(d),v.onTick_()}).tickAfter(d),this},i.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},620:function(h,s,o){o.d(s,{Z:function(){return u}});var _=o(42);function u(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n.then(function(i){return(0,_.Z)({err:null,res:i},r)}).catch(function(i){return(0,_.Z)({err:i,res:void 0},r)})}},949:function(h,s,o){var _=n=>{var r={};return o.d(r,n),r},u=n=>()=>n;h.exports=_({sRGBEncoding:()=>z.sRGBEncoding})},943:function(h,s,o){o.d(s,{Z:function(){return _}});function _(u,n){(n==null||n>u.length)&&(n=u.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=u[r];return i}},982:function(h,s,o){o.d(s,{Z:function(){return u}});var _=o(943);function u(n){if(Array.isArray(n))return(0,_.Z)(n)}},568:function(h,s,o){o.d(s,{Z:function(){return u}});function _(n,r,i,c,d,v,w){try{var L=n[v](w),T=L.value}catch(I){i(I);return}L.done?r(T):Promise.resolve(T).then(c,d)}function u(n){return function(){var r=this,i=arguments;return new Promise(function(c,d){var v=n.apply(r,i);function w(T){_(v,c,d,w,L,"next",T)}function L(T){_(v,c,d,w,L,"throw",T)}w(void 0)})}}},438:function(h,s,o){o.d(s,{Z:function(){return _}});function _(u,n){if(!(u instanceof n))throw new TypeError("Cannot call a class as a function")}},924:function(h,s,o){o.d(s,{Z:function(){return _}});function _(u,n,r){return n in u?Object.defineProperty(u,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[n]=r,u}},375:function(h,s,o){o.d(s,{Z:function(){return _}});function _(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(h,s,o){o.d(s,{Z:function(){return _}});function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(h,s,o){o.d(s,{Z:function(){return u}});var _=o(924);function u(n){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{},c=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(i).filter(function(d){return Object.getOwnPropertyDescriptor(i,d).enumerable}))),c.forEach(function(d){(0,_.Z)(n,d,i[d])})}return n}},342:function(h,s,o){o.d(s,{Z:function(){return i}});var _=o(982),u=o(375),n=o(270),r=o(566);function i(c){return(0,_.Z)(c)||(0,u.Z)(c)||(0,r.Z)(c)||(0,n.Z)()}},566:function(h,s,o){o.d(s,{Z:function(){return u}});var _=o(943);function u(n,r){if(!!n){if(typeof n=="string")return(0,_.Z)(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return(0,_.Z)(n,r)}}}},H={};function g(h){var s=H[h];if(s!==void 0)return s.exports;var o=H[h]={exports:{}};return Q[h](o,o.exports,g),o.exports}(function(){g.n=function(h){var s=h&&h.__esModule?function(){return h.default}:function(){return h};return g.d(s,{a:s}),s}})(),function(){g.d=function(h,s){for(var o in s)g.o(s,o)&&!g.o(h,o)&&Object.defineProperty(h,o,{enumerable:!0,get:s[o]})}}(),function(){g.o=function(h,s){return Object.prototype.hasOwnProperty.call(h,s)}}();var j={};(function(){g.d(j,{qo:function(){return d},B7:function(){return o.Z},eK:function(){return U},LK:function(){return B},ZL:function(){return T},wf:function(){return w.Z},lJ:function(){return X},vP:function(){return x.v},Up:function(){return x.U},PO:function(){return I.Z},Mf:function(){return h.Z},Rl:function(){return v.Z},to:function(){return s.Z}});var h=g(653),s=g(620),o=g(688),_=g(568),u=g(438),n=g(42),r=g(342),i=g(666),c=g.n(i),d=function(){"use strict";function k(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,k),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,n.Z)({},{isdev:!1},m)}var y=k.prototype;return y.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},y.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},y.stop=function(){return this.traverse(function(p){return p.stop1()}),this},y.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},y.play=function(){var p=this;return(0,_.Z)(c().mark(function E(){var O;return c().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(O=p.chainedList[p.index],!(O&&p.isPlaying)){b.next=9;break}return b.next=4,Promise.all(O.map(function(R){return typeof R=="function"?R(p.repeatCount):R.start()}));case 4:return p.index+=1,b.next=7,p.play();case 7:b.next=17;break;case 9:if(!(!O&&p.isPlaying&&p.repeatCount<p.repeatNum)){b.next=16;break}return p.repeatCount+=1,p.index=0,b.next=14,p.play();case 14:b.next=17;break;case 16:!O&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return b.stop()}},E)}))()},y.chain=function(){for(var p=arguments.length,E=new Array(p),O=0;O<p;O++)E[O]=arguments[O];var N=this;return(0,r.Z)(E).forEach(function(b){b instanceof k&&N.children.push(b)}),this.chainedList.push((0,r.Z)(E)),this},y.repeat=function(p){return this.repeatNum=p,this},y.timeout=function(p){return this.chain(function(){return new Promise(function(E){return setTimeout(E,p)})}),this},y.traverse=function(p){p(this),this.children.forEach(function(E){E.traverse(p)})},k}(),v=g(226),w=g(182),L=g(949);function T(k){if(k.material){var y=Array.isArray(k.material)?k.material:[k.material];y.forEach(function(m){var p,E;(p=m.color)===null||p===void 0||p.convertSRGBToLinear(),(E=m.emissive)===null||E===void 0||E.convertSRGBToLinear(),m.map&&(m.map.encoding=L.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=L.sRGBEncoding)})}}var I=g(975),K=g(924),G=k=>{var y={};return g.d(y,k),y},M=k=>()=>k,S=G({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),B=S.del,U=S.clear,X=function(){var k=(0,_.Z)(c().mark(function y(m,p){var E,O,N,b,R,V;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E=p.version,e.next=4,(0,S.get)(m);case 4:if(N=e.sent,!(N&&N[E])){e.next=9;break}O=N[E],e.next=15;break;case 9:return e.next=11,(0,s.Z)(fetch(m).then(function(t){if(t.ok)return t.blob();throw new Error}));case 11:b=e.sent,R=b.res,V=b.err,V||(O=R,(0,S.set)(m,(0,K.Z)({},E,R)));case 15:return e.abrupt("return",O?{url:URL.createObjectURL(O)}:{url:m});case 16:case"end":return e.stop()}},y)}));return function(m,p){return k.apply(this,arguments)}}(),x=g(794)})();var q=j.qo,tt=j.B7,et=j.eK,rt=j.LK,nt=j.ZL,ot=j.wf,it=j.lJ,at=j.vP,ut=j.Up,st=j.PO,ct=j.Mf,ft=j.Rl,_t=j.to;export{q as Chain,tt as Timer,et as clearAllCache,rt as clearCache,nt as colorCorrection,ot as disposeMesh,it as getCache,at as getElementViewLeft,ut as getElementViewTop,st as isPlainObject,ct as makePromiseCreator,ft as polar2Cartesian,_t as to};
package/package.json CHANGED
@@ -1,13 +1,34 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.0.29",
3
+ "version": "0.0.32",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",
7
- "build": "BUILD_LIBRARY=src/vis/index bundler && yarn tsc",
7
+ "build": "BUILD_LIBRARY=true bundler && yarn build:module && yarn tsc",
8
+ "build:module": "EMPTY_DIR=false BUILD_LIBRARY=true ES_MODULES=true bundler",
8
9
  "tsc": "tsc -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.json && copyfiles -u 2 \"src/vis/**/*.d.ts\" dist && copyfiles -u 2 \"src/vis/geojson/*.json\" dist"
9
10
  },
10
11
  "main": "dist/index.js",
12
+ "module": "dist/index.module.js",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.module.js",
16
+ "require": "./dist/index.js"
17
+ },
18
+ "./dist/objects": {
19
+ "import": "./dist/objects/index.module.js",
20
+ "require": "./dist/objects/index.js"
21
+ },
22
+ "./dist/plugins": {
23
+ "import": "./dist/plugins/index.module.js",
24
+ "require": "./dist/plugins/index.js"
25
+ },
26
+ "./dist/utils": {
27
+ "import": "./dist/utils/index.module.js",
28
+ "require": "./dist/utils/index.js"
29
+ },
30
+ "./dist/geojson/":"./dist/geojson/"
31
+ },
11
32
  "files": [
12
33
  "dist"
13
34
  ],
@@ -27,27 +48,24 @@
27
48
  "@tweenjs/tween.js": "^18.6.4",
28
49
  "three": ">=0.136.0"
29
50
  },
30
- "resolutions": {
31
- "memfs": "^3.4.4"
32
- },
33
51
  "devDependencies": {
34
52
  "@types/three": "^0.136.0",
35
53
  "copyfiles": "^2.4.1",
36
- "eslint-config-bundler": "^0.1.4",
54
+ "eslint-config-bundler": "^0.1.5",
37
55
  "events": "^3.3.0",
38
56
  "ky": "^0.30.0",
39
57
  "msw": "^0.39.2",
40
58
  "pinia": "^2.0.14",
41
- "prettier-config-bundler": "^0.1.2",
59
+ "prettier-config-bundler": "^0.1.5",
42
60
  "regenerator-runtime": "^0.13.9",
43
61
  "stylelint": "^14.5.3",
44
62
  "stylelint-config-prettier": "^9.0.3",
45
63
  "stylelint-config-standard": "^25.0.0",
46
- "tailwind-config-bundler": "^0.1.2",
64
+ "tailwind-config-bundler": "^0.1.5",
47
65
  "tsc-alias": "^1.6.11",
48
66
  "vue": "^3.2.31",
49
67
  "vue-auto-routing": "^1.0.1",
50
- "vue-bundler": "^0.1.37",
68
+ "vue-bundler": "^0.1.40",
51
69
  "vue-router": "^4.0.14"
52
70
  },
53
71
  "dependencies": {
@@ -1,10 +0,0 @@
1
- uniform sampler2D baseTexture;
2
- uniform sampler2D bloomTexture;
3
-
4
- varying vec2 vUv;
5
-
6
- void main() {
7
-
8
- gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
9
-
10
- }
@@ -1,9 +0,0 @@
1
- varying vec2 vUv;
2
-
3
- void main() {
4
-
5
- vUv = uv;
6
-
7
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
8
-
9
- }