gl-draw 0.1.2 → 0.1.5
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 +4 -4
- package/dist/index.module.js +4 -4
- package/dist/objects/index.js +11 -11
- package/dist/objects/index.module.js +11 -11
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +1 -1
- package/dist/utils/uvGenerator.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as ke from"idb-keyval";import*as j from"three";import*as Vt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Xt from"lil-gui";import*as We from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ht from"three/examples/jsm/postprocessing/EffectComposer";import*as Zt from"three/examples/jsm/postprocessing/RenderPass";import*as Kt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as Ve from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ir from"three/examples/jsm/renderers/CSS2DRenderer";var ar={187:function(M){var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(c,h,_){return Function.prototype.apply.call(c,h,_)},B;T&&typeof T.ownKeys=="function"?B=T.ownKeys:Object.getOwnPropertySymbols?B=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:B=function(c){return Object.getOwnPropertyNames(c)};function D(l){console&&console.warn&&console.warn(l)}var O=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}M.exports=m,M.exports.once=le,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var F=10;function H(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 F},set:function(l){if(typeof l!="number"||l<0||O(l))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+l+".");F=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||O(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 V(l){return l._maxListeners===void 0?m.defaultMaxListeners:l._maxListeners}m.prototype.getMaxListeners=function(){return V(this)},m.prototype.emit=function(c){for(var h=[],_=1;_<arguments.length;_++)h.push(arguments[_]);var S=c==="error",L=this._events;if(L!==void 0)S=S&&L.error===void 0;else if(!S)return!1;if(S){var R;if(h.length>0&&(R=h[0]),R instanceof Error)throw R;var J=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw J.context=R,J}var ue=L[c];if(ue===void 0)return!1;if(typeof ue=="function")C(ue,this,h);else for(var q=ue.length,ce=oe(ue,q),_=0;_<q;++_)C(ce[_],this,h);return!0};function N(l,c,h,_){var S,L,R;if(H(h),L=l._events,L===void 0?(L=l._events=Object.create(null),l._eventsCount=0):(L.newListener!==void 0&&(l.emit("newListener",c,h.listener?h.listener:h),L=l._events),R=L[c]),R===void 0)R=L[c]=h,++l._eventsCount;else if(typeof R=="function"?R=L[c]=_?[h,R]:[R,h]:_?R.unshift(h):R.push(h),S=V(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,D(J)}return l}m.prototype.addListener=function(c,h){return N(this,c,h,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,h){return N(this,c,h,!0)};function Z(){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 f(l,c,h){var _={fired:!1,wrapFn:void 0,target:l,type:c,listener:h},S=Z.bind(_);return S.listener=h,_.wrapFn=S,S}m.prototype.once=function(c,h){return H(h),this.on(c,f(this,c,h)),this},m.prototype.prependOnceListener=function(c,h){return H(h),this.prependListener(c,f(this,c,h)),this},m.prototype.removeListener=function(c,h){var _,S,L,R,J;if(H(h),S=this._events,S===void 0)return this;if(_=S[c],_===void 0)return this;if(_===h||_.listener===h)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,_.listener||h));else if(typeof _!="function"){for(L=-1,R=_.length-1;R>=0;R--)if(_[R]===h||_[R].listener===h){J=_[R].listener,L=R;break}if(L<0)return this;L===0?_.shift():ae(_,L),_.length===1&&(S[c]=_[0]),S.removeListener!==void 0&&this.emit("removeListener",c,J||h)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var h,_,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 L=Object.keys(_),R;for(S=0;S<L.length;++S)R=L[S],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(h=_[c],typeof h=="function")this.removeListener(c,h);else if(h!==void 0)for(S=h.length-1;S>=0;S--)this.removeListener(c,h[S]);return this};function $(l,c,h){var _=l._events;if(_===void 0)return[];var S=_[c];return S===void 0?[]:typeof S=="function"?h?[S.listener||S]:[S]:h?Y(S):oe(S,S.length)}m.prototype.listeners=function(c){return $(this,c,!0)},m.prototype.rawListeners=function(c){return $(this,c,!1)},m.listenerCount=function(l,c){return typeof l.listenerCount=="function"?l.listenerCount(c):re.call(l,c)},m.prototype.listenerCount=re;function re(l){var c=this._events;if(c!==void 0){var h=c[l];if(typeof h=="function")return 1;if(h!==void 0)return h.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function oe(l,c){for(var h=new Array(c),_=0;_<c;++_)h[_]=l[_];return h}function ae(l,c){for(;c+1<l.length;c++)l[c]=l[c+1];l.pop()}function Y(l){for(var c=new Array(l.length),h=0;h<c.length;++h)c[h]=l[h].listener||l[h];return c}function le(l,c){return new Promise(function(h,_){function S(R){l.removeListener(c,L),_(R)}function L(){typeof l.removeListener=="function"&&l.removeListener("error",S),h([].slice.call(arguments))}K(l,c,L,{once:!0}),c!=="error"&&I(l,S,{once:!0})})}function I(l,c,h){typeof l.on=="function"&&K(l,"error",c,h)}function K(l,c,h,_){if(typeof l.on=="function")_.once?l.once(c,h):l.on(c,h);else if(typeof l.addEventListener=="function")l.addEventListener(c,function S(L){_.once&&l.removeEventListener(c,S),h(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof l)}},666:function(M){var T=function(C){"use strict";var B=Object.prototype,D=B.hasOwnProperty,O,m=typeof Symbol=="function"?Symbol:{},F=m.iterator||"@@iterator",H=m.asyncIterator||"@@asyncIterator",V=m.toStringTag||"@@toStringTag";function N(p,d,g){return Object.defineProperty(p,d,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{N({},"")}catch(p){N=function(d,g,E){return d[g]=E}}function Z(p,d,g,E){var w=d&&d.prototype instanceof le?d:le,X=Object.create(w.prototype),Q=new ce(E||[]);return X._invoke=R(p,g,Q),X}C.wrap=Z;function f(p,d,g){try{return{type:"normal",arg:p.call(d,g)}}catch(E){return{type:"throw",arg:E}}}var $="suspendedStart",re="suspendedYield",oe="executing",ae="completed",Y={};function le(){}function I(){}function K(){}var l={};N(l,F,function(){return this});var c=Object.getPrototypeOf,h=c&&c(c(me([])));h&&h!==B&&D.call(h,F)&&(l=h);var _=K.prototype=le.prototype=Object.create(l);I.prototype=K,N(_,"constructor",K),N(K,"constructor",I),I.displayName=N(K,V,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(d){N(p,d,function(g){return this._invoke(d,g)})})}C.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===I||(d.displayName||d.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,K):(p.__proto__=K,N(p,V,"GeneratorFunction")),p.prototype=Object.create(_),p},C.awrap=function(p){return{__await:p}};function L(p,d){function g(X,Q,ee,ne){var te=f(p[X],p,Q);if(te.type==="throw")ne(te.arg);else{var pe=te.arg,ve=pe.value;return ve&&typeof ve=="object"&&D.call(ve,"__await")?d.resolve(ve.__await).then(function(fe){g("next",fe,ee,ne)},function(fe){g("throw",fe,ee,ne)}):d.resolve(ve).then(function(fe){pe.value=fe,ee(pe)},function(fe){return g("throw",fe,ee,ne)})}}var E;function w(X,Q){function ee(){return new d(function(ne,te){g(X,Q,ne,te)})}return E=E?E.then(ee,ee):ee()}this._invoke=w}S(L.prototype),N(L.prototype,H,function(){return this}),C.AsyncIterator=L,C.async=function(p,d,g,E,w){w===void 0&&(w=Promise);var X=new L(Z(p,d,g,E),w);return C.isGeneratorFunction(d)?X:X.next().then(function(Q){return Q.done?Q.value:X.next()})};function R(p,d,g){var E=$;return function(X,Q){if(E===oe)throw new Error("Generator is already running");if(E===ae){if(X==="throw")throw Q;return Se()}for(g.method=X,g.arg=Q;;){var ee=g.delegate;if(ee){var ne=J(ee,g);if(ne){if(ne===Y)continue;return ne}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(E===$)throw E=ae,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);E=oe;var te=f(p,d,g);if(te.type==="normal"){if(E=g.done?ae:re,te.arg===Y)continue;return{value:te.arg,done:g.done}}else te.type==="throw"&&(E=ae,g.method="throw",g.arg=te.arg)}}}function J(p,d){var g=p.iterator[d.method];if(g===O){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=O,J(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var E=f(g,p.iterator,d.arg);if(E.type==="throw")return d.method="throw",d.arg=E.arg,d.delegate=null,Y;var w=E.arg;if(!w)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(w.done)d[p.resultName]=w.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=O);else return w;return d.delegate=null,Y}S(_),N(_,V,"Generator"),N(_,F,function(){return this}),N(_,"toString",function(){return"[object Generator]"});function ue(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function q(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ce(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ue,this),this.reset(!0)}C.keys=function(p){var d=[];for(var g in p)d.push(g);return d.reverse(),function E(){for(;d.length;){var w=d.pop();if(w in p)return E.value=w,E.done=!1,E}return E.done=!0,E}};function me(p){if(p){var d=p[F];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var g=-1,E=function w(){for(;++g<p.length;)if(D.call(p,g))return w.value=p[g],w.done=!1,w;return w.value=O,w.done=!0,w};return E.next=E}}return{next:Se}}C.values=me;function Se(){return{value:O,done:!0}}return ce.prototype={constructor:ce,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=O,this.done=!1,this.delegate=null,this.method="next",this.arg=O,this.tryEntries.forEach(q),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=O)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function g(ne,te){return X.type="throw",X.arg=p,d.next=ne,te&&(d.method="next",d.arg=O),!!te}for(var E=this.tryEntries.length-1;E>=0;--E){var w=this.tryEntries[E],X=w.completion;if(w.tryLoc==="root")return g("end");if(w.tryLoc<=this.prev){var Q=D.call(w,"catchLoc"),ee=D.call(w,"finallyLoc");if(Q&&ee){if(this.prev<w.catchLoc)return g(w.catchLoc,!0);if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else if(Q){if(this.prev<w.catchLoc)return g(w.catchLoc,!0)}else if(ee){if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var g=this.tryEntries.length-1;g>=0;--g){var E=this.tryEntries[g];if(E.tryLoc<=this.prev&&D.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var w=E;break}}w&&(p==="break"||p==="continue")&&w.tryLoc<=d&&d<=w.finallyLoc&&(w=null);var X=w?w.completion:{};return X.type=p,X.arg=d,w?(this.method="next",this.next=w.finallyLoc,Y):this.complete(X)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var g=this.tryEntries[d];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),q(g),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var g=this.tryEntries[d];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,d,g){return this.delegate={iterator:me(p),resultName:d,nextLoc:g},this.method==="next"&&(this.arg=O),Y}},C}(M.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(M,T,C){C.d(T,{Z:function(){return B}});function B(D){if(D.geometry&&D.geometry.dispose(),D.material){var O=Array.isArray(D.material)?D.material:[D.material];O.forEach(function(m){var F,H,V,N,Z,f,$,re,oe,ae,Y,le,I;(F=m.map)===null||F===void 0||F.dispose(),(H=m.lightMap)===null||H===void 0||H.dispose(),(V=m.bumpMap)===null||V===void 0||V.dispose(),(N=m.normalMap)===null||N===void 0||N.dispose(),(Z=m.specularMap)===null||Z===void 0||Z.dispose(),(f=m.envMap)===null||f===void 0||f.dispose(),($=m.alphaMap)===null||$===void 0||$.dispose(),(re=m.aoMap)===null||re===void 0||re.dispose(),(oe=m.displacementMap)===null||oe===void 0||oe.dispose(),(ae=m.emissiveMap)===null||ae===void 0||ae.dispose(),(Y=m.gradientMap)===null||Y===void 0||Y.dispose(),(le=m.metalnessMap)===null||le===void 0||le.dispose(),(I=m.roughnessMap)===null||I===void 0||I.dispose(),m.dispose()})}}},175:function(M,T,C){C.d(T,{wf:function(){return m.Z},PO:function(){return V.Z}});var B=C(666),D=C.n(B),O=null,m=C(182),F=C(949);function H(I){if(I.material){var K=Array.isArray(I.material)?I.material:[I.material];K.forEach(function(l){var c,h;(c=l.color)===null||c===void 0||c.convertSRGBToLinear(),(h=l.emissive)===null||h===void 0||h.convertSRGBToLinear(),l.map&&(l.map.encoding=THREE.sRGBEncoding),l.emissiveMap&&(l.emissiveMap.encoding=THREE.sRGBEncoding)})}}var V=C(975),N=C(568),Z=C(924),f=I=>{var K={};return C.d(K,I),K},$=I=>()=>I,re=f({get:()=>ke.get,set:()=>ke.set}),oe=C(620),ae=null,Y=null,le=function(){var I=(0,N.Z)(D().mark(function K(l,c){var h,_,S,L,R,J;return D().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return h=c.version,q.next=4,(0,re.get)(l);case 4:if(S=q.sent,!(S&&S[h])){q.next=9;break}_=S[h],q.next=15;break;case 9:return q.next=11,(0,oe.Z)(fetch(l).then(function(ce){if(ce.ok)return ce.blob();throw new Error}));case 11:L=q.sent,R=L.res,J=L.err,J||(_=R,(0,re.set)(l,(0,Z.Z)({},h,R)));case 15:return q.abrupt("return",_?{url:URL.createObjectURL(_)}:{url:l});case 16:case"end":return q.stop()}},K)}));return function(l,c){return I.apply(this,arguments)}}()},975:function(M,T,C){C.d(T,{Z:function(){return D}});function B(O){return Object.prototype.toString.call(O)==="[object Object]"}function D(O){if(B(O)===!1)return!1;var m=O.constructor;if(m===void 0)return!0;var F=m.prototype;return!(B(F)===!1||F.hasOwnProperty("isPrototypeOf")===!1)}},620:function(M,T,C){C.d(T,{Z:function(){return D}});var B=C(42);function D(O){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O.then(function(F){return(0,B.Z)({err:null,res:F},m)}).catch(function(F){return(0,B.Z)({err:F,res:void 0},m)})}},949:function(M,T,C){var B=O=>{var m={};return C.d(m,O),m},D=O=>()=>O;M.exports=B({ACESFilmicToneMapping:()=>j.ACESFilmicToneMapping,AdditiveBlending:()=>j.AdditiveBlending,AxesHelper:()=>j.AxesHelper,Box3:()=>j.Box3,Camera:()=>j.Camera,CineonToneMapping:()=>j.CineonToneMapping,Clock:()=>j.Clock,Color:()=>j.Color,Euler:()=>j.Euler,Group:()=>j.Group,Layers:()=>j.Layers,LinearEncoding:()=>j.LinearEncoding,LinearFilter:()=>j.LinearFilter,LinearToneMapping:()=>j.LinearToneMapping,Matrix4:()=>j.Matrix4,Mesh:()=>j.Mesh,MeshBasicMaterial:()=>j.MeshBasicMaterial,NoToneMapping:()=>j.NoToneMapping,PerspectiveCamera:()=>j.PerspectiveCamera,PlaneGeometry:()=>j.PlaneGeometry,Points:()=>j.Points,REVISION:()=>j.REVISION,RGBAFormat:()=>j.RGBAFormat,Raycaster:()=>j.Raycaster,ReinhardToneMapping:()=>j.ReinhardToneMapping,Scene:()=>j.Scene,ShaderMaterial:()=>j.ShaderMaterial,Sprite:()=>j.Sprite,SpriteMaterial:()=>j.SpriteMaterial,UniformsUtils:()=>j.UniformsUtils,UnsignedByteType:()=>j.UnsignedByteType,Vector2:()=>j.Vector2,Vector3:()=>j.Vector3,WebGLMultisampleRenderTarget:()=>j.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>j.WebGLRenderTarget,WebGLRenderer:()=>j.WebGLRenderer,sRGBEncoding:()=>j.sRGBEncoding})},568:function(M,T,C){C.d(T,{Z:function(){return D}});function B(O,m,F,H,V,N,Z){try{var f=O[N](Z),$=f.value}catch(re){F(re);return}f.done?m($):Promise.resolve($).then(H,V)}function D(O){return function(){var m=this,F=arguments;return new Promise(function(H,V){var N=O.apply(m,F);function Z($){B(N,H,V,Z,f,"next",$)}function f($){B(N,H,V,Z,f,"throw",$)}Z(void 0)})}}},924:function(M,T,C){C.d(T,{Z:function(){return B}});function B(D,O,m){return O in D?Object.defineProperty(D,O,{value:m,enumerable:!0,configurable:!0,writable:!0}):D[O]=m,D}},42:function(M,T,C){C.d(T,{Z:function(){return D}});var B=C(924);function D(O){for(var m=1;m<arguments.length;m++){var F=arguments[m]!=null?arguments[m]:{},H=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(F).filter(function(V){return Object.getOwnPropertyDescriptor(F,V).enumerable}))),H.forEach(function(V){(0,B.Z)(O,V,F[V])})}return O}}},Ie={};function G(M){var T=Ie[M];if(T!==void 0)return T.exports;var C=Ie[M]={exports:{}};return ar[M](C,C.exports,G),C.exports}(function(){G.n=function(M){var T=M&&M.__esModule?function(){return M.default}:function(){return M};return G.d(T,{a:T}),T}})(),function(){G.d=function(M,T){for(var C in T)G.o(T,C)&&!G.o(M,C)&&Object.defineProperty(M,C,{enumerable:!0,get:T[C]})}}(),function(){G.o=function(M,T){return Object.prototype.hasOwnProperty.call(M,T)}}();var _e={};(function(){G.d(_e,{L6:function(){return Nt},sb:function(){return h},z:function(){return Re},ZP:function(){return Re}});function M(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function T(n,r){for(var a=0;a<r.length;a++){var e=r[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,r,a){return r&&T(n.prototype,r),a&&T(n,a),n}var B=G(42);function D(n,r){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);r&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),a.push.apply(a,e)}return a}function O(n,r){return r=r!=null?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a))}),n}function m(n,r){(r==null||r>n.length)&&(r=n.length);for(var a=0,e=new Array(r);a<r;a++)e[a]=n[a];return e}function F(n){if(Array.isArray(n))return m(n)}function H(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function V(){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 N(n,r){if(!!n){if(typeof n=="string")return m(n,r);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,r)}}function Z(n){return F(n)||H(n)||N(n)||V()}var f=G(949),$=G(187),re=n=>{var r={};return G.d(r,n),r},oe=n=>()=>n,ae=re({default:()=>Vt.default}),Y=n=>{var r={};return G.d(r,n),r},le=n=>()=>n,I=Y({default:()=>It.default}),K=n=>{var r={};return G.d(r,n),r},l=n=>()=>n,c=K({default:()=>Xt.default}),h=function(){"use strict";function n(a){M(this,n),this.guiParams={},a&&(this.guiParams=a)}var r=n.prototype;return r.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(i){var o=e.addFolder(i),u=t.guiParams[i];Object.keys(u).forEach(function(s){var v=u[s],x=v.min,P=v.max,b=v.step,y=v.name,A=v.paramMap,z=v.items,U=v.value,W=v.target,se=s.toLowerCase().indexOf("color")>-1,k,ie=typeof U=="undefined"&&W,de=ie?W():u[s],he=ie?s:"value";z?k=o.add(de,he,z):se?k=o.addColor(de,he):k=o.add(de,he),k=k.name(y||s),typeof x!="undefined"&&(k=k.min(x)),typeof P!="undefined"&&(k=k.max(P)),typeof b!="undefined"&&(k=k.step(b)),k=k.onChange(function(){t.setTargetValue(i,s,de[he],A)}),ie&&k.listen()})})},r.setTargetValue=function(e,t,i,o){var u=this.guiParams[e][t],s=u.onChange,v=u.target,x=u.value,P=t.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&v;if(v&&!b){var y=v();Array.isArray(y)||(y=[y]),y.forEach(function(A){if(!!A)if(P)try{A[o||t].set(i)}catch(z){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else A[o||t]=i})}s&&s(i)},r.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(i){var o=e.guiParams[t][i];typeof o.value!="undefined"&&e.setTargetValue(t,i,o.value,o.paramMap)})})},n}(),_={None:f.NoToneMapping,Linear:f.LinearToneMapping,Reinhard:f.ReinhardToneMapping,Cineon:f.CineonToneMapping,ACESFilmic:f.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:f.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},L=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.width,t=a.height,i=a.rendererParams,o=i.context,u=i.alpha,s=i.devicePixelRatio,v=i.antialias,x=i.powerPreference,P=i.toneMapping,b=i.toneMappingExposure,y=i.outputEncoding,A=i.logarithmicDepthBuffer,z=i.preserveDrawingBuffer,U=new f.WebGLRenderer({context:o,alpha:u,antialias:v,powerPreference:x,logarithmicDepthBuffer:A,preserveDrawingBuffer:z});U.setSize(e,t),U.setPixelRatio(s),U.autoClear=!1,U.toneMapping=_[P],U.toneMappingExposure=b,U.outputEncoding=y,this.renderer=U}var r=n.prototype;return r.setSize=function(e,t){this.renderer.setSize(e,t)},r.render=function(){var e=this.options,t=e.scene,i=e.camera;this.renderer.render(t,i)},r.setGui=function(e){var t=this,i=new h({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:_,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});i.showGui(e)},r.dispose=function(){var e,t,i;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},n}(),R={fov:45,near:1,far:1e3},J=function(){"use strict";function n(a){M(this,n),this.oldCameraPosition=new f.Vector3,this.oldCameraRotation=new f.Euler,this.customCamera=!1,this.options=a;var e=a.width,t=a.height,i=a.cameraParams;if(i instanceof f.Camera)this.camera=i,this.customCamera=!0;else{var o=i.fov,u=i.far,s=i.near,v=new f.PerspectiveCamera(o,e/t,s,u);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var r=n.prototype;return r.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},r.setSize=function(e,t){this.camera instanceof f.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},r.setGui=function(e){var t=this,i=new h({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 f.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),i.showGui(e)},n}(),ue=G(175),q={background:null},ce=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.camera,t=a.sceneParams,i=t.background,o=new f.Scene;i&&(o.background=i),o.add(e),this.scene=o}var r=n.prototype;return r.addAxesHelper=function(){var e,t=new f.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},r.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,ue.wf)(t)})},n}(),me=n=>{var r={};return G.d(r,n),r},Se=n=>()=>n,p=me({MapControls:()=>We.MapControls,OrbitControls:()=>We.OrbitControls}),d={},g=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.camera,t=a.controlParams,i=a.mapControl,o=t.domElement,u=i?new p.MapControls(e,o):new p.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 r=n.prototype;return r.limitPan=function(e){var t=e.maxX,i=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,v=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,A=e.minY,z=A===void 0?-1/0:A,U=this.limitPanV||new f.Vector3,W=this.control,se=this.options.camera,k=new f.Vector3(u,z,P),ie=new f.Vector3(i,y,v);this.limitPanV=U,U.copy(W.target),W.target.clamp(k,ie),U.sub(W.target),se.position.sub(U)},r.update=function(){this.control.update()},r.dispose=function(){this.control.dispose()},n}(),E=n=>{var r={};return G.d(r,n),r},w=n=>()=>n,X=E({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),Q=new f.Vector3,ee=new f.Matrix4,ne=new f.Matrix4,te=new f.Vector3,pe=new f.Vector3,ve=function n(){"use strict";var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,n);var a=function(A,z){return te.setFromMatrixPosition(A.matrixWorld),pe.setFromMatrixPosition(z.matrixWorld),te.distanceToSquared(pe)},e=function(A){var z=[];return A.traverse(function(U){U.isCSS2DObject&&z.push(U)}),z},t=function(A){for(var z=e(A).sort(function(ie,de){if(ie.renderOrder!==de.renderOrder)return de.renderOrder-ie.renderOrder;var he=x.objects.get(ie).distanceToCameraSquared,ye=x.objects.get(de).distanceToCameraSquared;return he-ye}),U=z.length,W=0,se=z.length;W<se;W++){var k=z[W].userData.zIndexFix||0;z[W].element.style.zIndex=U-W+k}},i=this,o,u,s,v,x={objects:new WeakMap},P=r.element!==void 0?r.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,A){y.autoUpdate===!0&&y.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld(),ee.copy(A.matrixWorldInverse),ne.multiplyMatrices(A.projectionMatrix,ee),b(y,y,A),t(y)},this.setSize=function(y,A){o=y,u=A,s=o/2,v=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(A,"px")};function b(y,A,z){if(y.isCSS2DObject){Q.setFromMatrixPosition(y.matrixWorld),Q.applyMatrix4(ne);var U=y.visible===!0&&Q.z>=-1&&Q.z<=1&&y.layers.test(z.layers)===!0;if(y.element.style.display=U===!0?"":"none",U===!0){y.onBeforeRender(i,A,z);var W=y.element;W.style.transform="translate(-50%,-50%) translate(".concat(Q.x*s+s,"px,").concat(-Q.y*v+v,"px)"),W.parentNode!==P&&P.appendChild(W),y.onAfterRender(i,A,z)}var se={distanceToCameraSquared:a(z,y)};x.objects.set(y,se)}for(var k=0,ie=y.children.length;k<ie;k++)b(y.children[k],A,z)}},fe={zIndex:"auto"},Xe=function(){"use strict";function n(a){M(this,n),this.container=a}var r=n.prototype;return r.addRenderer=function(e,t){var i=this.container,o=i.offsetWidth,u=i.offsetHeight,s=e==="css2d"?new ve:new X.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=t.zIndex,s.setSize(o,u),i.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},r.setSize=function(e,t){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},r.render=function(e,t){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},r.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),He=n=>{var r={};return G.d(r,n),r},cr=n=>()=>n,Te=He({EffectComposer:()=>Ht.EffectComposer}),Ze=n=>{var r={};return G.d(r,n),r},fr=n=>()=>n,Ke=Ze({RenderPass:()=>Zt.RenderPass}),Qe=n=>{var r={};return G.d(r,n),r},dr=n=>()=>n,be=Qe({ShaderPass:()=>Kt.ShaderPass}),Ye=n=>{var r={};return G.d(r,n),r},hr=n=>()=>n,Ce=Ye({CopyShader:()=>Qt.CopyShader}),$e=n=>{var r={};return G.d(r,n),r},vr=n=>()=>n,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=n=>{var r={};return G.d(r,n),r},pr=n=>()=>n,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=n=>{var r={};return G.d(r,n),r},mr=n=>()=>n,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=n=>{var r={};return G.d(r,n),r},gr=n=>()=>n,it=nt({FXAAShader:()=>qt.FXAAShader}),at=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(r){return!1}},_r=0,st=1,ge=!1,Ae=at()!==!1,ot=`varying vec2 vUv;
|
|
1
|
+
import*as Ne from"idb-keyval";import*as z from"three";import*as Wt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Ht from"lil-gui";import*as ke from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Xt from"three/examples/jsm/postprocessing/EffectComposer";import*as Kt from"three/examples/jsm/postprocessing/RenderPass";import*as Zt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as We from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ar from"three/examples/jsm/renderers/CSS2DRenderer";var ir={187:function(L){var j=typeof Reflect=="object"?Reflect:null,x=j&&typeof j.apply=="function"?j.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},B;j&&typeof j.ownKeys=="function"?B=j.ownKeys:Object.getOwnPropertySymbols?B=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:B=function(u){return Object.getOwnPropertyNames(u)};function A(h){console&&console.warn&&console.warn(h)}var T=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var G=10;function H(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(h){if(typeof h!="number"||h<0||T(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");G=h}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(u){if(typeof u!="number"||u<0||T(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function R(h){return h._maxListeners===void 0?g.defaultMaxListeners:h._maxListeners}g.prototype.getMaxListeners=function(){return R(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var y=u==="error",O=this._events;if(O!==void 0)y=y&&O.error===void 0;else if(!y)return!1;if(y){var w;if(f.length>0&&(w=f[0]),w instanceof Error)throw w;var J=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw J.context=w,J}var V=O[u];if(V===void 0)return!1;if(typeof V=="function")x(V,this,f);else for(var Z=V.length,ne=ae(V,Z),m=0;m<Z;++m)x(ne[m],this,f);return!0};function U(h,u,f,m){var y,O,w;if(H(f),O=h._events,O===void 0?(O=h._events=Object.create(null),h._eventsCount=0):(O.newListener!==void 0&&(h.emit("newListener",u,f.listener?f.listener:f),O=h._events),w=O[u]),w===void 0)w=O[u]=f,++h._eventsCount;else if(typeof w=="function"?w=O[u]=m?[f,w]:[w,f]:m?w.unshift(f):w.push(f),y=R(h),y>0&&w.length>y&&!w.warned){w.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=h,J.type=u,J.count=w.length,A(J)}return h}g.prototype.addListener=function(u,f){return U(this,u,f,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,f){return U(this,u,f,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(h,u,f){var m={fired:!1,wrapFn:void 0,target:h,type:u,listener:f},y=I.bind(m);return y.listener=f,m.wrapFn=y,y}g.prototype.once=function(u,f){return H(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return H(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,y,O,w,J;if(H(f),y=this._events,y===void 0)return this;if(m=y[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete y[u],y.removeListener&&this.emit("removeListener",u,m.listener||f));else if(typeof m!="function"){for(O=-1,w=m.length-1;w>=0;w--)if(m[w]===f||m[w].listener===f){J=m[w].listener,O=w;break}if(O<0)return this;O===0?m.shift():re(m,O),m.length===1&&(y[u]=m[0]),y.removeListener!==void 0&&this.emit("removeListener",u,J||f)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var f,m,y;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var O=Object.keys(m),w;for(y=0;y<O.length;++y)w=O[y],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=m[u],typeof f=="function")this.removeListener(u,f);else if(f!==void 0)for(y=f.length-1;y>=0;y--)this.removeListener(u,f[y]);return this};function Q(h,u,f){var m=h._events;if(m===void 0)return[];var y=m[u];return y===void 0?[]:typeof y=="function"?f?[y.listener||y]:[y]:f?Y(y):ae(y,y.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(h,u){return typeof h.listenerCount=="function"?h.listenerCount(u):te.call(h,u)},g.prototype.listenerCount=te;function te(h){var u=this._events;if(u!==void 0){var f=u[h];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function ae(h,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=h[m];return f}function re(h,u){for(;u+1<h.length;u++)h[u]=h[u+1];h.pop()}function Y(h){for(var u=new Array(h.length),f=0;f<u.length;++f)u[f]=h[f].listener||h[f];return u}function oe(h,u){return new Promise(function(f,m){function y(w){h.removeListener(u,O),m(w)}function O(){typeof h.removeListener=="function"&&h.removeListener("error",y),f([].slice.call(arguments))}W(h,u,O,{once:!0}),u!=="error"&&q(h,y,{once:!0})})}function q(h,u,f){typeof h.on=="function"&&W(h,"error",u,f)}function W(h,u,f,m){if(typeof h.on=="function")m.once?h.once(u,f):h.on(u,f);else if(typeof h.addEventListener=="function")h.addEventListener(u,function y(O){m.once&&h.removeEventListener(u,y),f(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}},666:function(L){var j=function(x){"use strict";var B=Object.prototype,A=B.hasOwnProperty,T,g=typeof Symbol=="function"?Symbol:{},G=g.iterator||"@@iterator",H=g.asyncIterator||"@@asyncIterator",R=g.toStringTag||"@@toStringTag";function U(p,d,_){return Object.defineProperty(p,d,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{U({},"")}catch(p){U=function(d,_,M){return d[_]=M}}function I(p,d,_,M){var E=d&&d.prototype instanceof oe?d:oe,$=Object.create(E.prototype),ee=new ne(M||[]);return $._invoke=w(p,_,ee),$}x.wrap=I;function c(p,d,_){try{return{type:"normal",arg:p.call(d,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var h={};U(h,G,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(ve([])));f&&f!==B&&A.call(f,G)&&(h=f);var m=W.prototype=oe.prototype=Object.create(h);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,R,"GeneratorFunction");function y(p){["next","throw","return"].forEach(function(d){U(p,d,function(_){return this._invoke(d,_)})})}x.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===q||(d.displayName||d.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,R,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function O(p,d){function _($,ee,ie,ue){var se=c(p[$],p,ee);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&A.call(pe,"__await")?d.resolve(pe.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):d.resolve(pe).then(function(fe){me.value=fe,ie(me)},function(fe){return _("throw",fe,ie,ue)})}}var M;function E($,ee){function ie(){return new d(function(ue,se){_($,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=E}y(O.prototype),U(O.prototype,H,function(){return this}),x.AsyncIterator=O,x.async=function(p,d,_,M,E){E===void 0&&(E=Promise);var $=new O(I(p,d,_,M),E);return x.isGeneratorFunction(d)?$:$.next().then(function(ee){return ee.done?ee.value:$.next()})};function w(p,d,_){var M=Q;return function($,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if($==="throw")throw ee;return Se()}for(_.method=$,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=J(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=ae;var se=c(p,d,_);if(se.type==="normal"){if(M=_.done?re:te,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function J(p,d){var _=p.iterator[d.method];if(_===T){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=T,J(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,Y;var E=M.arg;if(!E)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(E.done)d[p.resultName]=E.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=T);else return E;return d.delegate=null,Y}y(m),U(m,R,"Generator"),U(m,G,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function V(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function Z(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}x.keys=function(p){var d=[];for(var _ in p)d.push(_);return d.reverse(),function M(){for(;d.length;){var E=d.pop();if(E in p)return M.value=E,M.done=!1,M}return M.done=!0,M}};function ve(p){if(p){var d=p[G];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function E(){for(;++_<p.length;)if(A.call(p,_))return E.value=p[_],E.done=!1,E;return E.value=T,E.done=!0,E};return M.next=M}}return{next:Se}}x.values=ve;function Se(){return{value:T,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(Z),!p)for(var d in this)d.charAt(0)==="t"&&A.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=T)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function _(ue,se){return $.type="throw",$.arg=p,d.next=ue,se&&(d.method="next",d.arg=T),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var E=this.tryEntries[M],$=E.completion;if(E.tryLoc==="root")return _("end");if(E.tryLoc<=this.prev){var ee=A.call(E,"catchLoc"),ie=A.call(E,"finallyLoc");if(ee&&ie){if(this.prev<E.catchLoc)return _(E.catchLoc,!0);if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else if(ee){if(this.prev<E.catchLoc)return _(E.catchLoc,!0)}else if(ie){if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var E=M;break}}E&&(p==="break"||p==="continue")&&E.tryLoc<=d&&d<=E.finallyLoc&&(E=null);var $=E?E.completion:{};return $.type=p,$.arg=d,E?(this.method="next",this.next=E.finallyLoc,Y):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),Z(_),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var E=M.arg;Z(_)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,_){return this.delegate={iterator:ve(p),resultName:d,nextLoc:_},this.method==="next"&&(this.arg=T),Y}},x}(L.exports);try{regeneratorRuntime=j}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},182:function(L,j,x){x.d(j,{Z:function(){return B}});function B(A){if(A.geometry&&A.geometry.dispose(),A.material){var T=Array.isArray(A.material)?A.material:[A.material];T.forEach(function(g){var G,H,R,U,I,c,Q,te,ae,re,Y,oe,q;(G=g.map)===null||G===void 0||G.dispose(),(H=g.lightMap)===null||H===void 0||H.dispose(),(R=g.bumpMap)===null||R===void 0||R.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(I=g.specularMap)===null||I===void 0||I.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(te=g.aoMap)===null||te===void 0||te.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(q=g.roughnessMap)===null||q===void 0||q.dispose(),g.dispose()})}}},175:function(L,j,x){x.d(j,{wf:function(){return g.Z},PO:function(){return R.Z}});var B=x(666),A=x.n(B),T=null,g=x(182),G=x(949);function H(W){if(W.material){var h=Array.isArray(W.material)?W.material:[W.material];h.forEach(function(u){var f,m;(f=u.color)===null||f===void 0||f.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=x(975),U=x(568),I=x(924),c=W=>{var h={};return x.d(h,W),h},Q=W=>()=>W,te=c({get:()=>Ne.get,set:()=>Ne.set}),ae=x(620),re=null,Y=null,oe=function(){var W=(0,U.Z)(A().mark(function h(u,f){var m,y,O,w,J,V;return A().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return m=f.version,ne.next=4,(0,te.get)(u);case 4:if(O=ne.sent,!(O&&O[m])){ne.next=9;break}y=O[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(ve){if(ve.ok)return ve.blob();throw new Error}));case 11:w=ne.sent,J=w.res,V=w.err,V||(y=J,(0,te.set)(u,(0,I.Z)({},m,J)));case 15:return ne.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:u});case 16:case"end":return ne.stop()}},h)}));return function(u,f){return W.apply(this,arguments)}}(),q=x(977)},975:function(L,j,x){x.d(j,{Z:function(){return A}});function B(T){return Object.prototype.toString.call(T)==="[object Object]"}function A(T){if(B(T)===!1)return!1;var g=T.constructor;if(g===void 0)return!0;var G=g.prototype;return!(B(G)===!1||G.hasOwnProperty("isPrototypeOf")===!1)}},620:function(L,j,x){x.d(j,{Z:function(){return A}});var B=x(42);function A(T){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(G){return(0,B.Z)({err:null,res:G},g)}).catch(function(G){return(0,B.Z)({err:G,res:void 0},g)})}},977:function(L,j,x){var B=x(949),A=new Map,T=function(G){return{generateTopUV:function(H,R,U,I,c){var Q=R[U*3],te=R[U*3+1],ae=R[I*3],re=R[I*3+1],Y=R[c*3],oe=R[c*3+1],q;if(A.has(H))q=A.get(H);else{var W=G&&G.Box3||new THREE.Box3;if(!G||!G.Box3){var h=H.parameters.shapes.getPoints();W.setFromArray(h.map(function(y){return[y.x,y.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);q={box:W,size:u},A.set(H,q)}var f=q.box,m=q.size;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y)]},generateSideWallUV:function(H,R,U,I,c,Q){var te=R[U*3],ae=R[U*3+1],re=R[U*3+2],Y=R[I*3],oe=R[I*3+1],q=R[I*3+2],W=R[c*3],h=R[c*3+1],u=R[c*3+2],f=R[Q*3],m=R[Q*3+1],y=R[Q*3+2],O;if(A.has(R))O=A.get(R);else{var w=new THREE.Box3;w.setFromArray(R);var J=w.getSize(new THREE.Vector3);O={box:w,size:J},A.set(R,O)}var V=O.box,Z=O.size;return Math.abs(ae-oe)<.01?[new THREE.Vector2((te-V.min.x)/Z.x,(re-V.min.z)/Z.z),new THREE.Vector2((Y-V.min.x)/Z.x,(q-V.min.z)/Z.z),new THREE.Vector2((W-V.min.x)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((f-V.min.x)/Z.x,(y-V.min.z)/Z.z)]:[new THREE.Vector2((ae-V.min.y)/Z.x,(re-V.min.z)/Z.z),new THREE.Vector2((oe-V.min.y)/Z.x,(q-V.min.z)/Z.z),new THREE.Vector2((h-V.min.y)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((m-V.min.y)/Z.x,(y-V.min.z)/Z.z)]}}},g=function(){A.clear()}},949:function(L,j,x){var B=T=>{var g={};return x.d(g,T),g},A=T=>()=>T;L.exports=B({ACESFilmicToneMapping:()=>z.ACESFilmicToneMapping,AdditiveBlending:()=>z.AdditiveBlending,AxesHelper:()=>z.AxesHelper,Box3:()=>z.Box3,Camera:()=>z.Camera,CineonToneMapping:()=>z.CineonToneMapping,Clock:()=>z.Clock,Color:()=>z.Color,Euler:()=>z.Euler,Group:()=>z.Group,Layers:()=>z.Layers,LinearEncoding:()=>z.LinearEncoding,LinearFilter:()=>z.LinearFilter,LinearToneMapping:()=>z.LinearToneMapping,Matrix4:()=>z.Matrix4,Mesh:()=>z.Mesh,MeshBasicMaterial:()=>z.MeshBasicMaterial,NoToneMapping:()=>z.NoToneMapping,PerspectiveCamera:()=>z.PerspectiveCamera,PlaneGeometry:()=>z.PlaneGeometry,Points:()=>z.Points,REVISION:()=>z.REVISION,RGBAFormat:()=>z.RGBAFormat,Raycaster:()=>z.Raycaster,ReinhardToneMapping:()=>z.ReinhardToneMapping,Scene:()=>z.Scene,ShaderMaterial:()=>z.ShaderMaterial,Sprite:()=>z.Sprite,SpriteMaterial:()=>z.SpriteMaterial,UniformsUtils:()=>z.UniformsUtils,UnsignedByteType:()=>z.UnsignedByteType,Vector2:()=>z.Vector2,Vector3:()=>z.Vector3,WebGLMultisampleRenderTarget:()=>z.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>z.WebGLRenderTarget,WebGLRenderer:()=>z.WebGLRenderer,sRGBEncoding:()=>z.sRGBEncoding})},568:function(L,j,x){x.d(j,{Z:function(){return A}});function B(T,g,G,H,R,U,I){try{var c=T[U](I),Q=c.value}catch(te){G(te);return}c.done?g(Q):Promise.resolve(Q).then(H,R)}function A(T){return function(){var g=this,G=arguments;return new Promise(function(H,R){var U=T.apply(g,G);function I(Q){B(U,H,R,I,c,"next",Q)}function c(Q){B(U,H,R,I,c,"throw",Q)}I(void 0)})}}},924:function(L,j,x){x.d(j,{Z:function(){return B}});function B(A,T,g){return T in A?Object.defineProperty(A,T,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[T]=g,A}},42:function(L,j,x){x.d(j,{Z:function(){return A}});var B=x(924);function A(T){for(var g=1;g<arguments.length;g++){var G=arguments[g]!=null?arguments[g]:{},H=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(G).filter(function(R){return Object.getOwnPropertyDescriptor(G,R).enumerable}))),H.forEach(function(R){(0,B.Z)(T,R,G[R])})}return T}}},Ie={};function F(L){var j=Ie[L];if(j!==void 0)return j.exports;var x=Ie[L]={exports:{}};return ir[L](x,x.exports,F),x.exports}(function(){F.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return F.d(j,{a:j}),j}})(),function(){F.d=function(L,j){for(var x in j)F.o(j,x)&&!F.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:j[x]})}}(),function(){F.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var _e={};(function(){F.d(_e,{L6:function(){return Vt},sb:function(){return f},z:function(){return Re},ZP:function(){return Re}});function L(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function j(n,r){for(var i=0;i<r.length;i++){var e=r[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,r,i){return r&&j(n.prototype,r),i&&j(n,i),n}var B=F(42);function A(n,r){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);r&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)}return i}function T(n,r){return r=r!=null?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}function g(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,e=new Array(r);i<r;i++)e[i]=n[i];return e}function G(n){if(Array.isArray(n))return g(n)}function H(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function R(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(n,r){if(!!n){if(typeof n=="string")return g(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 g(n,r)}}function I(n){return G(n)||H(n)||U(n)||R()}var c=F(949),Q=F(187),te=n=>{var r={};return F.d(r,n),r},ae=n=>()=>n,re=te({default:()=>Wt.default}),Y=n=>{var r={};return F.d(r,n),r},oe=n=>()=>n,q=Y({default:()=>It.default}),W=n=>{var r={};return F.d(r,n),r},h=n=>()=>n,u=W({default:()=>Ht.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var r=n.prototype;return r.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=t.guiParams[a];Object.keys(l).forEach(function(s){var v=l[s],C=v.min,P=v.max,b=v.step,S=v.name,D=v.paramMap,N=v.items,k=v.value,K=v.target,ce=s.toLowerCase().indexOf("color")>-1,X,le=typeof k=="undefined"&&K,de=le?K():l[s],he=le?s:"value";N?X=o.add(de,he,N):ce?X=o.addColor(de,he):X=o.add(de,he),X=X.name(S||s),typeof C!="undefined"&&(X=X.min(C)),typeof P!="undefined"&&(X=X.max(P)),typeof b!="undefined"&&(X=X.step(b)),X=X.onChange(function(){t.setTargetValue(a,s,de[he],D)}),le&&X.listen()})})},r.setTargetValue=function(e,t,a,o){var l=this.guiParams[e][t],s=l.onChange,v=l.target,C=l.value,P=t.toLowerCase().indexOf("color")>-1,b=typeof C=="undefined"&&v;if(v&&!b){var S=v();Array.isArray(S)||(S=[S]),S.forEach(function(D){if(!!D)if(P)try{D[o||t].set(a)}catch(N){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else D[o||t]=a})}s&&s(a)},r.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(a){var o=e.guiParams[t][a];typeof o.value!="undefined"&&e.setTargetValue(t,a,o.value,o.paramMap)})})},n}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},y={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},O=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,t=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,v=a.antialias,C=a.powerPreference,P=a.toneMapping,b=a.toneMappingExposure,S=a.outputEncoding,D=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,k=new c.WebGLRenderer({context:o,alpha:l,antialias:v,powerPreference:C,logarithmicDepthBuffer:D,preserveDrawingBuffer:N});k.setSize(e,t),k.setPixelRatio(s),k.autoClear=!1,k.toneMapping=m[P],k.toneMappingExposure=b,k.outputEncoding=S,this.renderer=k}var r=n.prototype;return r.setSize=function(e,t){this.renderer.setSize(e,t)},r.render=function(){var e=this.options,t=e.scene,a=e.camera;this.renderer.render(t,a)},r.setGui=function(e){var t=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});a.showGui(e)},r.dispose=function(){var e,t,a;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),w={fov:45,near:1,far:1e3},J=function(){"use strict";function n(i){L(this,n),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,t=i.height,a=i.cameraParams;if(a instanceof c.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,l=a.far,s=a.near,v=new c.PerspectiveCamera(o,e/t,s,l);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var r=n.prototype;return r.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},r.setSize=function(e,t){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},r.setGui=function(e){var t=this,a=new f({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 c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),V=F(175),Z={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,t=i.sceneParams,a=t.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var r=n.prototype;return r.addAxesHelper=function(){var e,t=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},r.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,V.wf)(t)})},n}(),ve=n=>{var r={};return F.d(r,n),r},Se=n=>()=>n,p=ve({MapControls:()=>ke.MapControls,OrbitControls:()=>ke.OrbitControls}),d={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,t=i.controlParams,a=i.mapControl,o=t.domElement,l=a?new p.MapControls(e,o):new p.OrbitControls(e,o);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var r=n.prototype;return r.limitPan=function(e){var t=e.maxX,a=t===void 0?1/0:t,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,v=s===void 0?1/0:s,C=e.minZ,P=C===void 0?-1/0:C,b=e.maxY,S=b===void 0?1/0:b,D=e.minY,N=D===void 0?-1/0:D,k=this.limitPanV||new c.Vector3,K=this.control,ce=this.options.camera,X=new c.Vector3(l,N,P),le=new c.Vector3(a,S,v);this.limitPanV=k,k.copy(K.target),K.target.clamp(X,le),k.sub(K.target),ce.position.sub(k)},r.update=function(){this.control.update()},r.dispose=function(){this.control.dispose()},n}(),M=n=>{var r={};return F.d(r,n),r},E=n=>()=>n,$=M({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,me=new c.Vector3,pe=function n(){"use strict";var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(D,N){return se.setFromMatrixPosition(D.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),se.distanceToSquared(me)},e=function(D){var N=[];return D.traverse(function(k){k.isCSS2DObject&&N.push(k)}),N},t=function(D){for(var N=e(D).sort(function(le,de){if(le.renderOrder!==de.renderOrder)return de.renderOrder-le.renderOrder;var he=C.objects.get(le).distanceToCameraSquared,ye=C.objects.get(de).distanceToCameraSquared;return he-ye}),k=N.length,K=0,ce=N.length;K<ce;K++){var X=N[K].userData.zIndexFix||0;N[K].element.style.zIndex=k-K+X}},a=this,o,l,s,v,C={objects:new WeakMap},P=r.element!==void 0?r.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:l}},this.render=function(S,D){S.autoUpdate===!0&&S.updateMatrixWorld(),D.parent===null&&D.updateMatrixWorld(),ie.copy(D.matrixWorldInverse),ue.multiplyMatrices(D.projectionMatrix,ie),b(S,S,D),t(S)},this.setSize=function(S,D){o=S,l=D,s=o/2,v=l/2,P.style.width="".concat(S,"px"),P.style.height="".concat(D,"px")};function b(S,D,N){if(S.isCSS2DObject){ee.setFromMatrixPosition(S.matrixWorld),ee.applyMatrix4(ue);var k=S.visible===!0&&ee.z>=-1&&ee.z<=1&&S.layers.test(N.layers)===!0;if(S.element.style.display=k===!0?"":"none",k===!0){S.onBeforeRender(a,D,N);var K=S.element;K.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*v+v,"px)"),K.parentNode!==P&&P.appendChild(K),S.onAfterRender(a,D,N)}var ce={distanceToCameraSquared:i(N,S)};C.objects.set(S,ce)}for(var X=0,le=S.children.length;X<le;X++)b(S.children[X],D,N)}},fe={zIndex:"auto"},He=function(){"use strict";function n(i){L(this,n),this.container=i}var r=n.prototype;return r.addRenderer=function(e,t){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new pe:new $.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=t.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},r.setSize=function(e,t){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},r.render=function(e,t){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},r.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Xe=n=>{var r={};return F.d(r,n),r},cr=n=>()=>n,Te=Xe({EffectComposer:()=>Xt.EffectComposer}),Ke=n=>{var r={};return F.d(r,n),r},fr=n=>()=>n,Ze=Ke({RenderPass:()=>Kt.RenderPass}),Qe=n=>{var r={};return F.d(r,n),r},dr=n=>()=>n,be=Qe({ShaderPass:()=>Zt.ShaderPass}),Ye=n=>{var r={};return F.d(r,n),r},hr=n=>()=>n,xe=Ye({CopyShader:()=>Qt.CopyShader}),$e=n=>{var r={};return F.d(r,n),r},vr=n=>()=>n,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=n=>{var r={};return F.d(r,n),r},pr=n=>()=>n,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=n=>{var r={};return F.d(r,n),r},mr=n=>()=>n,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=n=>{var r={};return F.d(r,n),r},gr=n=>()=>n,at=nt({FXAAShader:()=>qt.FXAAShader}),it=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(r){return!1}},_r=0,st=1,ge=!1,Le=it()!==!1,ot=`varying vec2 vUv;
|
|
2
2
|
|
|
3
3
|
void main() {
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ void main() {
|
|
|
15
15
|
|
|
16
16
|
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
17
|
|
|
18
|
-
}`;function
|
|
18
|
+
}`;function Ce(n,r){return Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ce(n,r)}function Ae(n,r){return Ce(n,r)}function lt(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),r&&Ae(n,r)}function ct(){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(i){return i.__proto__||Object.getPrototypeOf(i)},we(n)}function je(n){return we(n)}function ft(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dt(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ht(n,r){return r&&(dt(r)==="object"||typeof r=="function")?r:ft(n)}function vt(n){var r=ct();return function(){var e=je(n),t;if(r){var a=je(this).constructor;t=Reflect.construct(e,arguments,a)}else t=e.apply(this,arguments);return ht(this,t)}}var pt=n=>{var r={};return F.d(r,n),r},br=n=>()=>n,De=pt({FullScreenQuad:()=>We.FullScreenQuad,Pass:()=>We.Pass}),mt=n=>{var r={};return F.d(r,n),r},Pr=n=>()=>n,ze=mt({LuminosityHighPassShader:()=>er.LuminosityHighPassShader}),Ee=function(n){"use strict";lt(i,n);var r=vt(i);function i(t,a,o,l){L(this,i);var s;s=r.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=l,s.resolution=t!==void 0?new c.Vector2(t.x,t.y):new c.Vector2(256,256),s.clearColor=new c.Color(0,0,0);var v={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new c.WebGLRenderTarget(C,P,v),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var S=new c.WebGLRenderTarget(C,P,v);S.texture.name="UnrealBloomPass.h".concat(b),S.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(S);var D=new c.WebGLRenderTarget(C,P,v);D.texture.name="UnrealBloomPass.v".concat(b),D.texture.generateMipmaps=!1,s.renderTargetsVertical.push(D),C=Math.round(C/2),P=Math.round(P/2)}ze.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var N=ze.LuminosityHighPassShader;s.highPassUniforms=c.UniformsUtils.clone(N.uniforms),s.highPassUniforms.luminosityThreshold.value=l,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new c.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var k=[3,5,7,9,11];C=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(k[K])),s.separableBlurMaterials[K].uniforms.texSize.value=new c.Vector2(C,P),C=Math.round(C/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=a,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var ce=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=ce,s.bloomTintColors=[new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,xe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var X=xe.CopyShader;return s.copyUniforms=c.UniformsUtils.clone(X.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new c.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:X.vertexShader,fragmentShader:X.fragmentShader,blending:c.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new c.Color,s.oldClearAlpha=1,s.basic=new c.MeshBasicMaterial,s.fsQuad=new De.FullScreenQuad(void 0),s}var e=i.prototype;return e.dispose=function(){for(var a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(a,o){var l=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(l,s);for(var v=0;v<this.nMips;v++)this.renderTargetsHorizontal[v].setSize(l,s),this.renderTargetsVertical[v].setSize(l,s),this.separableBlurMaterials[v].uniforms.texSize.value=new c.Vector2(l,s),l=Math.round(l/2),s=Math.round(s/2)},e.render=function(a,o,l,s,v){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var C=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),v&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=l.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=l.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this.fsQuad.render(a);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=i.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this.fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this.fsQuad.render(a),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,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this.fsQuad.render(a),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,v&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(l),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=C},e.getSeperableBlurMaterial=function(a){return new c.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},uniforms:{colorTexture:{value:null},texSize:{value:new c.Vector2(.5,.5)},direction:{value:new c.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
19
|
void main() {
|
|
20
20
|
vUv = uv;
|
|
21
21
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -29,7 +29,7 @@ void main() {
|
|
|
29
29
|
}
|
|
30
30
|
void main() {
|
|
31
31
|
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
32
|
-
}`})},e.getCompositeMaterial=function(
|
|
32
|
+
}`})},e.getCompositeMaterial=function(a){return new c.ShaderMaterial({defines:{NUM_MIPS:a},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
|
|
33
33
|
void main() {
|
|
34
34
|
vUv = uv;
|
|
35
35
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -54,4 +54,4 @@ void main() {
|
|
|
54
54
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
55
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
56
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},a}(De.Pass);Ee.BlurDirectionX=new f.Vector2(1,0),Ee.BlurDirectionY=new f.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new f.MeshBasicMaterial({color:"black"}),bt=new f.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function n(a,e){M(this,n),this.materials={},this.bloomLayer=new f.Layers,this.active=!0,this.composerController=a,this.options=e;var t=a.renderer,i=a.renderPass,o=a.finalComposer,u=a.getSize(),s=u.width,v=u.height,x=new Ee(new f.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=x;var P=new Te.EffectComposer(t);P.renderToScreen=!1,P.addPass(i),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(st);var b=new f.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),y=new be.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var r=n.prototype;return r.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},r.render=function(e){if(!!this.active){var t=this,i=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(u[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),i.render(),e.traverse(function(s){var v=s;u[v.uuid]&&(v.material=u[v.uuid],delete u[v.uuid])})}},r.setSize=function(e,t){this.bloomComposer.setSize(e,t)},r.setGui=function(e){var t=this,i=new h({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}}}});i.showGui(e)},r.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),yt=n=>{var r={};return G.d(r,n),r},yr=n=>()=>n,St=yt({OutlinePass:()=>tr.OutlinePass}),Ct={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},xt=function(){"use strict";function n(a,e){M(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,i=a.camera,o=a.finalComposer,u=a.getSize(),s=u.width,v=u.height,x=new St.OutlinePass(new f.Vector2(s,v),t,i);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var r=n.prototype;return r.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},r.setGui=function(){var e=this,t=new h({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},r.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function wt(n,r){if(n==null)return{};var a={},e=Object.keys(n),t,i;for(i=0;i<e.length;i++)t=e[i],!(r.indexOf(t)>=0)&&(a[t]=n[t]);return a}function Et(n,r){if(n==null)return{};var a=wt(n,r),e,t;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(t=0;t<i.length;t++)e=i[t],!(r.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(a[e]=n[e]))}return a}var Rt=n=>{var r={};return G.d(r,n),r},Sr=n=>()=>n,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=n=>{var r={};return G.d(r,n),r},Cr=n=>()=>n,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),At={maxDistance:10,selects:!0},Lt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function n(a,e){M(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,i=a.camera,o=a.renderer,u=a.finalComposer,s=a.getSize(),v=s.width,x=s.height,P=new Ot.SSRPass({renderer:o,scene:t,camera:i,width:v,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var r=n.prototype;return r.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,B.Z)({},Lt,e),i=t.width,o=t.height,u=Et(t,["width","height"]),s=this.composerController,v=s.scene,x=s.getSize(),P=new f.PlaneGeometry(i,o),b=new Tt.ReflectorForSSRPass(P,O((0,B.Z)({},u),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},r.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},r.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},r.setSize=function(e,t){var i=this.groundReflector;i&&(i.getRenderTarget().setSize(e,t),i.resolution.set(e,t))},r.setGui=function(){var e=this,t=new h({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]}}}});t.setTargetValueByParams(),this.ssrGui=t},r.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Dt=function(){"use strict";function n(a){M(this,n),this.active=!0,this.options=a;var e=a.renderer,t=a.scene,i=a.camera,o=this.createRenderTarget(),u=new Te.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=i}var r=n.prototype;return r.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,i=e.type,o=e.encoding,u=this.getSize(),s={minFilter:f.LinearFilter,magFilter:f.LinearFilter,format:f.RGBAFormat,encoding:o,type:i},v;if(+f.REVISION<138&&t>0){var x=new f.WebGLMultisampleRenderTarget(u.width,u.height,s);x.samples=t,v=x}else if(+f.REVISION>=138&&t>0){var P=new f.WebGLRenderTarget(u.width,u.height,O((0,B.Z)({},s),{samples:t}));v=P}else{var b=new f.WebGLRenderTarget(u.width,u.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},r.addRenderPasss=function(){var e=this.options,t=e.scene,i=e.camera,o=new Ke.RenderPass(t,i);this.finalComposer.addPass(o),this.renderPass=o},r.addCopyPass=function(){var e=new be.ShaderPass(Ce.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},r.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},r.addFXAAPass=function(){var e=this.getSize(),t=e.width,i=e.height,o=new be.ShaderPass(it.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,i)},r.addSMAAPass=function(){var e=this.getSize(),t=e.width,i=e.height,o=this.options.renderer,u=new et.SMAAPass(t*o.getPixelRatio(),i*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},r.addSSAAPass=function(){var e=this.options,t=e.scene,i=e.camera,o=new rt.SSAARenderPass(t,i,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},r.addBloomPass=function(e){var t=new Pt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},r.addOutlinePass=function(e){var t=new xt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},r.addSSRPass=function(e){var t=new jt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},r.getSize=function(){var e=this.options.renderer;return e.getSize(new f.Vector2)},r.enable=function(){this.active||(this.active=!0)},r.disable=function(){!this.active||(this.active=!1)},r.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(i){return i!==e.renderPass&&i!==e.copyPass?i.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},r.setSize=function(e,t){var i,o;this.finalComposer.setSize(e,t),(i=this.bloomController)===null||i===void 0||i.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},r.setFXAAPassSize=function(e,t){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/(t*o)}},r.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()}},r.dispose=function(){var e,t,i;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(i=this.ssrController)===null||i===void 0||i.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,v;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.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){M(this,n),this.raycaster=new f.Raycaster,this.installPlugins=new Map,this.event=new $.EventEmitter,this.clock=new f.Clock,this.options=(0,ae.default)(n.options,a,{isMergeableObject:ue.PO});var e=this.options,t=e.container,i=e.stats,o=e.gui;if(o){var u=new c.default;u.open(!1),this.gui=u}if(i){var s=new I.default;s.showPanel(0),s.dom.style.position="absolute",t.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var r=n.prototype;return r.use=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;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(Z(i))),this.installPlugins.set(e,!0)}},r.init=function(){var e=this,t=this.options,i=t.container,o=t.isdev,u=t.axesHelper,s=t.renderer,v=t.scene,x=t.camera,P=this.getSize(),b=P.width,y=P.height,A=new J({isdev:o,width:b,height:y,cameraParams:x});this.gui&&A.setGui(this.gui);var z=A.camera,U=new ce({camera:z,sceneParams:v}),W=U.scene,se=new L({width:b,height:y,scene:W,camera:z,isdev:o,rendererParams:O((0,B.Z)({},s),{outputEncoding:f.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var k=se.renderer;u&&U.addAxesHelper(),this.sceneController=U,this.rendererController=se,this.cameraController=A,i.appendChild(k.domElement);var ie=new ResizeObserver(function(de){var he=!0,ye=!1,Ue=void 0;try{for(var Oe=de[Symbol.iterator](),Fe;!(he=(Fe=Oe.next()).done);he=!0){var kt=Fe.value,Ne=kt.contentRect;e.handeleResize(Ne.width,Ne.height)}}catch(Wt){ye=!0,Ue=Wt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});ie.observe(i),this.resizeObserver=ie},r.initComposer=function(){var e=this.options,t=e.bloom,i=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,v=e.outlineParams,x=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!Ae&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:f.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(x),t&&y.addBloomPass(s),i&&y.addOutlinePass(v),u.outputEncoding===f.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},r.initCSSRenderer=function(){var e=this.options,t=e.container,i=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(i||o){var v=new Xe(t);i&&v.addRenderer("css2d",u),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},r.initControl=function(){var e=this.options,t=e.control,i=e.mapControl,o=e.controlParams;if(t){var u=new g({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:i});this.controlController=u}},r.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},r.handeleResize=function(e,t){var i=this,o=i.rendererController,u=i.cameraController,s=i.composerController,v=i.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),s==null||s.setSize(e,t),v==null||v.setSize(e,t),this.installPlugins.forEach(function(x,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},r.pick=function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,v=s.container,x=new f.Vector2,P=v.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(t||this.scene.children,i);if(b.length)return{object:b[0].object,intersects:b}}},r.render=function(){var e,t,i,o,u=this,s=u.renderer,v=u.scene,x=u.camera,P=u.clock;if(!(!s||!v||!x||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),y=P.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(z,U){var W;(W=U.update)===null||W===void 0||W.call(U,b,y)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(i=this.cssRendererController)===null||i===void 0||i.render(v,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},r.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},r.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},r.dispose=function(){var e,t,i,o,u,s,v;this.stop(),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)}),(t=this.controlController)===null||t===void 0||t.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,(v=this.gui)===null||v===void 0||v.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:O((0,B.Z)({},S),{antialias:Ae?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:q,camera:R,bloom:!1,bloomParams:gt,outline:!1,outlineParams:Ct,css2DRenderer:!1,ssr:!1,ssrParams:At,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function Bt(){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 Pe(n,r,a){return Bt()?Pe=Reflect.construct:Pe=function(t,i,o){var u=[null];u.push.apply(u,i);var s=Function.bind.apply(t,u),v=new s;return o&&Le(v,o.prototype),v},Pe.apply(null,arguments)}function Ge(n,r,a){return Pe.apply(null,arguments)}var Gt=G(620);function zt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(e,t){a.resolve=e,a.reject=t}),n&&(a.promise=(0,Gt.Z)(a.promise,r)),a}var Ut=n=>{var r={};return G.d(r,n),r},xr=n=>()=>n,Ft=Ut({CSS2DObject:()=>ir.CSS2DObject}),ze=function(n){n&&((0,ue.wf)(n),n.children.forEach(function(r){r.userData.BaseObject_||ze(r)}))},Nt=function(){"use strict";function n(){M(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=zt(),this.visible=!1}var r=n.prototype;return r.init=function(){},r.create=function(){},r.render=function(){},r.update=function(e,t){},r.resize=function(e,t){},r.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},r.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},r.isVisible=function(){return this.visible},r.createMesh=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.object3d=Ge(f.Mesh,Z(t)),this},r.createGroup=function(){return this.object3d=new f.Group,this},r.createPoints=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.object3d=Ge(f.Points,Z(t)),this},r.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},r.createCSS3DObject=function(e){return this.object3d=new X.CSS3DObject(e),this},r.createCSS3DSprite=function(e){return this.object3d=new X.CSS3DSprite(e),this},r.createSprite=function(e){return this.object3d=new f.Sprite(e),this},r.add=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o;return(o=this.object3d).add.apply(o,Z(t)),this},r.remove=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o;return(o=this.object3d).remove.apply(o,Z(t)),this},r.getSize=function(){var e=new f.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new f.Vector3)}},r.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},r.dispose=function(){ze(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 sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
|
|
57
|
+
}`})},i}(De.Pass);Ee.BlurDirectionX=new c.Vector2(1,0),Ee.BlurDirectionY=new c.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new c.MeshBasicMaterial({color:"black"}),bt=new c.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function n(i,e){L(this,n),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var t=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,C=new Ee(new c.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=C;var P=new Te.EffectComposer(t);P.renderToScreen=!1,P.addPass(a),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(st);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),S=new be.ShaderPass(b,"baseTexture");S.needsSwap=!0,this.finalPass=S,o.addPass(S)}var r=n.prototype;return r.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},r.render=function(e){if(!!this.active){var t=this,a=t.bloomComposer,o=t.bloomLayer,l=t.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(l[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),a.render(),e.traverse(function(s){var v=s;l[v.uuid]&&(v.material=l[v.uuid],delete l[v.uuid])})}},r.setSize=function(e,t){this.bloomComposer.setSize(e,t)},r.setGui=function(e){var t=this,a=new f({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}}}});a.showGui(e)},r.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),yt=n=>{var r={};return F.d(r,n),r},yr=n=>()=>n,St=yt({OutlinePass:()=>tr.OutlinePass}),xt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ct=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var t=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,C=new St.OutlinePass(new c.Vector2(s,v),t,a);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var r=n.prototype;return r.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},r.setGui=function(){var e=this,t=new f({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},r.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function wt(n,r){if(n==null)return{};var i={},e=Object.keys(n),t,a;for(a=0;a<e.length;a++)t=e[a],!(r.indexOf(t)>=0)&&(i[t]=n[t]);return i}function Et(n,r){if(n==null)return{};var i=wt(n,r),e,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(t=0;t<a.length;t++)e=a[t],!(r.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var Rt=n=>{var r={};return F.d(r,n),r},Sr=n=>()=>n,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=n=>{var r={};return F.d(r,n),r},xr=n=>()=>n,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),Lt={maxDistance:10,selects:!0},At={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var t=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),v=s.width,C=s.height,P=new Ot.SSRPass({renderer:o,scene:t,camera:a,width:v,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,l.addPass(P),this.setGui()}var r=n.prototype;return r.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,B.Z)({},At,e),a=t.width,o=t.height,l=Et(t,["width","height"]),s=this.composerController,v=s.scene,C=s.getSize(),P=new c.PlaneGeometry(a,o),b=new Tt.ReflectorForSSRPass(P,T((0,B.Z)({},l),{textureWidth:C.width,textureHeight:C.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},r.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},r.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},r.setSize=function(e,t){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,t),a.resolution.set(e,t))},r.setGui=function(){var e=this,t=new f({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(a){a?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},r.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Dt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,t=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Te.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=a}var r=n.prototype;return r.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,a=e.type,o=e.encoding,l=this.getSize(),s={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:o,type:a},v;if(+c.REVISION<138&&t>0){var C=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);C.samples=t,v=C}else if(+c.REVISION>=138&&t>0){var P=new c.WebGLRenderTarget(l.width,l.height,T((0,B.Z)({},s),{samples:t}));v=P}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},r.addRenderPasss=function(){var e=this.options,t=e.scene,a=e.camera,o=new Ze.RenderPass(t,a);this.finalComposer.addPass(o),this.renderPass=o},r.addCopyPass=function(){var e=new be.ShaderPass(xe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},r.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},r.addFXAAPass=function(){var e=this.getSize(),t=e.width,a=e.height,o=new be.ShaderPass(at.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,a)},r.addSMAAPass=function(){var e=this.getSize(),t=e.width,a=e.height,o=this.options.renderer,l=new et.SMAAPass(t*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},r.addSSAAPass=function(){var e=this.options,t=e.scene,a=e.camera,o=new rt.SSAARenderPass(t,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},r.addBloomPass=function(e){var t=new Pt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},r.addOutlinePass=function(e){var t=new Ct(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},r.addSSRPass=function(e){var t=new jt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},r.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},r.enable=function(){this.active||(this.active=!0)},r.disable=function(){!this.active||(this.active=!1)},r.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},r.setSize=function(e,t){var a,o;this.finalComposer.setSize(e,t),(a=this.bloomController)===null||a===void 0||a.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},r.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},r.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()}},r.dispose=function(){var e,t,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,v;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.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(i){L(this,n),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(n.options,i,{isMergeableObject:V.PO});var e=this.options,t=e.container,a=e.stats,o=e.gui;if(o){var l=new u.default;l.open(!1),this.gui=l}if(a){var s=new q.default;s.showPanel(0),s.dom.style.position="absolute",t.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var r=n.prototype;return r.use=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),o=1;o<t;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(I(a))),this.installPlugins.set(e,!0)}},r.init=function(){var e=this,t=this.options,a=t.container,o=t.isdev,l=t.axesHelper,s=t.renderer,v=t.scene,C=t.camera,P=this.getSize(),b=P.width,S=P.height,D=new J({isdev:o,width:b,height:S,cameraParams:C});this.gui&&D.setGui(this.gui);var N=D.camera,k=new ne({camera:N,sceneParams:v}),K=k.scene,ce=new O({width:b,height:S,scene:K,camera:N,isdev:o,rendererParams:T((0,B.Z)({},s),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&ce.setGui(this.gui);var X=ce.renderer;l&&k.addAxesHelper(),this.sceneController=k,this.rendererController=ce,this.cameraController=D,a.appendChild(X.domElement);var le=new ResizeObserver(function(de){var he=!0,ye=!1,Ue=void 0;try{for(var Oe=de[Symbol.iterator](),Fe;!(he=(Fe=Oe.next()).done);he=!0){var Nt=Fe.value,Ve=Nt.contentRect;e.handeleResize(Ve.width,Ve.height)}}catch(kt){ye=!0,Ue=kt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});le.observe(a),this.resizeObserver=le},r.initComposer=function(){var e=this.options,t=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,v=e.outlineParams,C=e.ssrParams,P=e.multisampling,b=l.antialias;b==="msaa"&&!Le&&(b=!1,console.warn("MSAA is not supported on this browser"));var S=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=S,b==="ssaa"&&S.addSSAAPass(),o&&S.addSSRPass(C),t&&S.addBloomPass(s),a&&S.addOutlinePass(v),l.outputEncoding===c.sRGBEncoding&&S.addGammaCorrectionPass(),b==="fxaa"?S.addFXAAPass():b==="smaa"&&S.addSMAAPass(),S.checkCopyPass(),this.event.on("passcheck",function(){S.checkCopyPass()})},r.initCSSRenderer=function(){var e=this.options,t=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var v=new He(t);a&&v.addRenderer("css2d",l),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},r.initControl=function(){var e=this.options,t=e.control,a=e.mapControl,o=e.controlParams;if(t){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},r.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},r.handeleResize=function(e,t){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,v=a.cssRendererController;l==null||l.setSize(e,t),o==null||o.setSize(e,t),s==null||s.setSize(e,t),v==null||v.setSize(e,t),this.installPlugins.forEach(function(C,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},r.pick=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,v=s.container,C=new c.Vector2,P=v.getBoundingClientRect();if(C.x=(e.clientX-P.left)/(P.right-P.left)*2-1,C.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){l.setFromCamera(C,this.camera);var b=l.intersectObjects(t||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},r.render=function(){var e,t,a,o,l=this,s=l.renderer,v=l.scene,C=l.camera,P=l.clock;if(!(!s||!v||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),S=P.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(N,k){var K;(K=k.update)===null||K===void 0||K.call(k,b,S)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var D;(D=this.rendererController)===null||D===void 0||D.render()}(a=this.cssRendererController)===null||a===void 0||a.render(v,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:S})}},r.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},r.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},r.dispose=function(){var e,t,a,o,l,s,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(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:T((0,B.Z)({},y),{antialias:Le?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:Z,camera:w,bloom:!1,bloomParams:gt,outline:!1,outlineParams:xt,css2DRenderer:!1,ssr:!1,ssrParams:Lt,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function zt(){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 Pe(n,r,i){return zt()?Pe=Reflect.construct:Pe=function(t,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(t,l),v=new s;return o&&Ae(v,o.prototype),v},Pe.apply(null,arguments)}function Be(n,r,i){return Pe.apply(null,arguments)}var Bt=F(620);function Gt(){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(e,t){i.resolve=e,i.reject=t}),n&&(i.promise=(0,Bt.Z)(i.promise,r)),i}var Ut=n=>{var r={};return F.d(r,n),r},Cr=n=>()=>n,Ft=Ut({CSS2DObject:()=>ar.CSS2DObject}),Ge=function(n){n&&((0,V.wf)(n),n.children.forEach(function(r){r.userData.BaseObject_||Ge(r)}))},Vt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Gt(),this.visible=!1}var r=n.prototype;return r.init=function(){},r.create=function(){},r.render=function(){},r.update=function(e,t){},r.resize=function(e,t){},r.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},r.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},r.isVisible=function(){return this.visible},r.createMesh=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return this.object3d=Be(c.Mesh,I(t)),this},r.createGroup=function(){return this.object3d=new c.Group,this},r.createPoints=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return this.object3d=Be(c.Points,I(t)),this},r.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},r.createCSS3DObject=function(e){return this.object3d=new $.CSS3DObject(e),this},r.createCSS3DSprite=function(e){return this.object3d=new $.CSS3DSprite(e),this},r.createSprite=function(e){return this.object3d=new c.Sprite(e),this},r.add=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,I(t)),this},r.remove=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,I(t)),this},r.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},r.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},r.dispose=function(){Ge(this.object3d)},x(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 sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
|
package/dist/objects/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){var Ye={666:function(S){var L=function(M){"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,x){return c[p]=x}}function $(l,c,p,x){var w=c&&c.prototype instanceof j?c:j,z=Object.create(w.prototype),X=new _e(x||[]);return z._invoke=J(l,p,X),z}M.wrap=$;function q(l,c,p){try{return{type:"normal",arg:l.call(c,p)}}catch(x){return{type:"throw",arg:x}}}var V="suspendedStart",s="suspendedYield",he="executing",Z="completed",D={};function j(){}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=j.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)})})}M.isGeneratorFunction=function(l){var c=typeof l=="function"&&l.constructor;return c?c===U||(c.displayName||c.name)==="GeneratorFunction":!1},M.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,G):(l.__proto__=G,E(l,B,"GeneratorFunction")),l.prototype=Object.create(ee),l},M.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 x;function w(z,X){function K(){return new c(function(te,Q){p(z,X,te,Q)})}return x=x?x.then(K,K):K()}this._invoke=w}H(de.prototype),E(de.prototype,N,function(){return this}),M.AsyncIterator=de,M.async=function(l,c,p,x,w){w===void 0&&(w=Promise);var z=new de($(l,c,p,x),w);return M.isGeneratorFunction(c)?z:z.next().then(function(X){return X.done?X.value:z.next()})};function J(l,c,p){var x=V;return function(z,X){if(x===he)throw new Error("Generator is already running");if(x===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(x===V)throw x=Z,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);x=he;var Q=q(l,c,p);if(Q.type==="normal"){if(x=p.done?Z:s,Q.arg===D)continue;return{value:Q.arg,done:p.done}}else Q.type==="throw"&&(x=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 x=q(p,l.iterator,c.arg);if(x.type==="throw")return c.method="throw",c.arg=x.arg,c.delegate=null,D;var w=x.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)}M.keys=function(l){var c=[];for(var p in l)c.push(p);return c.reverse(),function x(){for(;c.length;){var w=c.pop();if(w in l)return x.value=w,x.done=!1,x}return x.done=!0,x}};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,x=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 x.next=x}}return{next:ke}}M.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 x=this.tryEntries.length-1;x>=0;--x){var w=this.tryEntries[x],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 x=this.tryEntries[p];if(x.tryLoc<=this.prev&&P.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var w=x;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 x=p.completion;if(x.type==="throw"){var w=x.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}},M}(S.exports);try{regeneratorRuntime=L}catch(M){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},182:function(S,L,M){"use strict";M.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,he,Z,D,j,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(),(he=A.displacementMap)===null||he===void 0||he.dispose(),(Z=A.emissiveMap)===null||Z===void 0||Z.dispose(),(D=A.gradientMap)===null||D===void 0||D.dispose(),(j=A.metalnessMap)===null||j===void 0||j.dispose(),(U=A.roughnessMap)===null||U===void 0||U.dispose(),A.dispose()})}}},54:function(S,L,M){"use strict";M.d(L,{disposeMesh:function(){return A.Z}});var T=M(666),P=M.n(T),R=null,A=M(182),W=M(644);function N(Z){if(Z.material){var D=Array.isArray(Z.material)?Z.material:[Z.material];D.forEach(function(j){var U,G;(U=j.color)===null||U===void 0||U.convertSRGBToLinear(),(G=j.emissive)===null||G===void 0||G.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var B=M(568),E=M(924),$=require("idb-keyval"),q=M(620),V=null,s=null,he=function(){var Z=(0,B.Z)(P().mark(function D(j,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)(j);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(j).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)(j,(0,E.Z)({},G,ee)));case 15:return J.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:j});case 16:case"end":return J.stop()}},D)}));return function(j,U){return Z.apply(this,arguments)}}()},620:function(S,L,M){"use strict";M.d(L,{Z:function(){return P}});var T=M(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,M){"use strict";M.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,M){"use strict";M.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,M){"use strict";M.d(L,{Z:function(){return P}});var T=M(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 I(S){var L=Ue[S];if(L!==void 0)return L.exports;var M=Ue[S]={exports:{}};return Ye[S](M,M.exports,I),M.exports}(function(){I.n=function(S){var L=S&&S.__esModule?function(){return S.default}:function(){return S};return I.d(L,{a:L}),L}})(),function(){I.d=function(S,L){for(var M in L)I.o(L,M)&&!I.o(S,M)&&Object.defineProperty(S,M,{enumerable:!0,get:L[M]})}}(),function(){I.o=function(S,L){return Object.prototype.hasOwnProperty.call(S,L)}}(),function(){I.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";I.r(Re),I.d(Re,{ConicPolygon:function(){return gt},ExtrudePolygon:function(){return bt},Image:function(){return x},Line:function(){return Je},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 M(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&&M(t,i)}var P=I(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=I(644);function he(){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 he()?Z=Reflect.construct:Z=function(a,e,o){var u=[null];u.push.apply(u,e);var f=Function.bind.apply(a,u),v=new f;return o&&M(v,o.prototype),v},Z.apply(null,arguments)}function D(t,i,r){return Z.apply(null,arguments)}function j(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&&j(t.prototype,i),r&&j(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=I(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=I(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,f=e.sprite,v=e.text,m=e.sizeAttenuation;if(f){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),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||{}),f=u.text,v=u.fontSize,m=u.fontFamily,d=u.fontWeight,g=u.flipX,b=u.scale,y=this.canvas;y.width=v*f.length*2,y.height=v;var _=y.getContext("2d");_.font="".concat(d," ").concat(v,"px/1 ").concat(m);var h=_.measureText(f).width;y.width=h,this.width=h,_=y.getContext("2d"),_.clearRect(0,0,y.width,y.height),g&&_.scale(-1,1),_.font="".concat(d," ").concat(v,"px/1 ").concat(m),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(f,g?h*-1:0,y.height/2),_.restore();var O=new s.Texture(y);O.anisotropy=16,O.needsUpdate=!0;var C=this.object3d;C.material.map&&C.material.map.dispose(),C.material.map=O,C.material.needsUpdate=!0,C.scale.set(O.image.width*b,O.image.height*b,1)},r}(se),l=I(568),c=I(666),p=I.n(c),x=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,f,v,m,d,g,b,y,_,h;return p().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return u=e.options,f=u.transparent,v=u.blending,m=u.src,d=u.depthWrite,g=u.alphaTest,b=u.sprite,y=u.sizeAttenuation,C.next=3,new s.TextureLoader().loadAsync(m);case 3:return _=C.sent,h=b?new s.SpriteMaterial({map:_,transparent:f!=null?f:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0,sizeAttenuation:y!=null?y:!0}):new s.MeshBasicMaterial({map:_,transparent:f!=null?f:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0}),C.abrupt("return",h);case 6:case"end":return C.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,f,v,m,d,g,b,y;return p().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,f=u.scale,v=u.position,m=u.src,d=u.cache,g=u.sprite,!(d&&!d.get(m))){h.next=7;break}return d.init(m),h.next=5,e.getMaterial();case 5:b=h.sent,d.set(m,b);case 7:if(!d){h.next=13;break}return h.next=10,d.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:y=h.t0,e.texture=y.map,g?e.createSprite(y):e.createMesh(new s.PlaneBufferGeometry(1,1),y),f&&e.setScale(f),v&&e.object3d.position.copy(v);case 21:case"end":return h.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},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 f=Object.getOwnPropertyDescriptor(u,e);return f.get?f.get.call(o||a):f.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,f=e.blending,v=e.depthWrite,m=e.format,d=e.autoPlay,g=e.loop,b=e.alphaTest,y=e.sprite,_=J(),h=document.createElement("video");return h.addEventListener("loadedmetadata",function(){var O=new s.VideoTexture(h);O.format=m!=null?m:s.RGBAFormat,O.needsUpdate=!0;var C=y?new s.SpriteMaterial({map:O,transparent:u!=null?u:!1,blending:f!=null?f:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:O,transparent:u!=null?u:!1,blending:f!=null?f:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(C)},!1),h.src=o,h.muted=!0,h.autoplay=d,h.loop=g,h.preload="auto",_.promise},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,f,v,m,d,g,b,y;return p().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,f=u.scale,v=u.position,m=u.src,d=u.cache,g=u.sprite,!(d&&!d.get(m))){h.next=7;break}return d.init(m),h.next=5,e.getMaterial();case 5:b=h.sent,d.set(m,b);case 7:if(!d){h.next=13;break}return h.next=10,d.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:y=h.t0,e.video=y.map.image,g?e.createSprite(y):e.createMesh(new s.PlaneBufferGeometry(1,1),y),f&&e.setScale(f),v&&e.object3d.position.copy(v);case 21:case"end":return h.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},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,f=e.onClick,v=e.zIndexFix,m=document.createElement("div");m.appendChild(u),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),f&&m.addEventListener("click",f),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,l.Z)(p().mark(function o(){var u,f,v,m;return p().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,f=u.getContext("2d"),f.fillStyle="#ff0000",f.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}),g.abrupt("return",m);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,f=e.scale,v=f===void 0?new s.Vector3(1,1,1):f,m=e.position,d=m===void 0?new s.Vector3(0,0,0):m,g=e.cache,b=this;return(0,l.Z)(p().mark(function y(){var _,h,O,C;return p().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(_="node-create-pick-object",!(g&&!g.get(_))){k.next=7;break}return g.init(_),k.next=5,b.getMaterial(u);case 5:h=k.sent,g.set(_,h);case 7:if(!g){k.next=13;break}return k.next=10,g.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,C=new s.Sprite(O),C.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),C.position.copy(d),b.add(C),b.pickObject=C;case 22:case"end":return k.stop()}},y)}))()},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
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
(function(){var $e={666:function(C){var z=function(w){"use strict";var S=Object.prototype,A=S.hasOwnProperty,L,O=typeof Symbol=="function"?Symbol:{},W=O.iterator||"@@iterator",U=O.asyncIterator||"@@asyncIterator",R=O.toStringTag||"@@toStringTag";function y(l,s,h){return Object.defineProperty(l,s,{value:h,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{y({},"")}catch(l){y=function(s,h,P){return s[h]=P}}function F(l,s,h,P){var b=s&&s.prototype instanceof X?s:X,G=Object.create(b.prototype),ee=new $(P||[]);return G._invoke=fe(l,h,ee),G}w.wrap=F;function I(l,s,h){try{return{type:"normal",arg:l.call(s,h)}}catch(P){return{type:"throw",arg:P}}}var T="suspendedStart",u="suspendedYield",ue="executing",Y="completed",E={};function X(){}function j(){}function k(){}var Z={};y(Z,W,function(){return this});var re=Object.getPrototypeOf,J=re&&re(re(he([])));J&&J!==S&&A.call(J,W)&&(Z=J);var N=k.prototype=X.prototype=Object.create(Z);j.prototype=k,y(N,"constructor",k),y(k,"constructor",j),j.displayName=y(k,R,"GeneratorFunction");function D(l){["next","throw","return"].forEach(function(s){y(l,s,function(h){return this._invoke(s,h)})})}w.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===j||(s.displayName||s.name)==="GeneratorFunction":!1},w.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,k):(l.__proto__=k,y(l,R,"GeneratorFunction")),l.prototype=Object.create(N),l},w.awrap=function(l){return{__await:l}};function ae(l,s){function h(G,ee,ne,oe){var ie=I(l[G],l,ee);if(ie.type==="throw")oe(ie.arg);else{var Ae=ie.arg,_e=Ae.value;return _e&&typeof _e=="object"&&A.call(_e,"__await")?s.resolve(_e.__await).then(function(te){h("next",te,ne,oe)},function(te){h("throw",te,ne,oe)}):s.resolve(_e).then(function(te){Ae.value=te,ne(Ae)},function(te){return h("throw",te,ne,oe)})}}var P;function b(G,ee){function ne(){return new s(function(oe,ie){h(G,ee,oe,ie)})}return P=P?P.then(ne,ne):ne()}this._invoke=b}D(ae.prototype),y(ae.prototype,U,function(){return this}),w.AsyncIterator=ae,w.async=function(l,s,h,P,b){b===void 0&&(b=Promise);var G=new ae(F(l,s,h,P),b);return w.isGeneratorFunction(s)?G:G.next().then(function(ee){return ee.done?ee.value:G.next()})};function fe(l,s,h){var P=T;return function(G,ee){if(P===ue)throw new Error("Generator is already running");if(P===Y){if(G==="throw")throw ee;return ze()}for(h.method=G,h.arg=ee;;){var ne=h.delegate;if(ne){var oe=Q(ne,h);if(oe){if(oe===E)continue;return oe}}if(h.method==="next")h.sent=h._sent=h.arg;else if(h.method==="throw"){if(P===T)throw P=Y,h.arg;h.dispatchException(h.arg)}else h.method==="return"&&h.abrupt("return",h.arg);P=ue;var ie=I(l,s,h);if(ie.type==="normal"){if(P=h.done?Y:u,ie.arg===E)continue;return{value:ie.arg,done:h.done}}else ie.type==="throw"&&(P=Y,h.method="throw",h.arg=ie.arg)}}}function Q(l,s){var h=l.iterator[s.method];if(h===L){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=L,Q(l,s),s.method==="throw"))return E;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var P=I(h,l.iterator,s.arg);if(P.type==="throw")return s.method="throw",s.arg=P.arg,s.delegate=null,E;var b=P.arg;if(!b)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,E;if(b.done)s[l.resultName]=b.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return b;return s.delegate=null,E}D(N),y(N,R,"Generator"),y(N,W,function(){return this}),y(N,"toString",function(){return"[object Generator]"});function me(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function K(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(me,this),this.reset(!0)}w.keys=function(l){var s=[];for(var h in l)s.push(h);return s.reverse(),function P(){for(;s.length;){var b=s.pop();if(b in l)return P.value=b,P.done=!1,P}return P.done=!0,P}};function he(l){if(l){var s=l[W];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var h=-1,P=function b(){for(;++h<l.length;)if(A.call(l,h))return b.value=l[h],b.done=!1,b;return b.value=L,b.done=!0,b};return P.next=P}}return{next:ze}}w.values=he;function ze(){return{value:L,done:!0}}return $.prototype={constructor:$,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(K),!l)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function h(oe,ie){return G.type="throw",G.arg=l,s.next=oe,ie&&(s.method="next",s.arg=L),!!ie}for(var P=this.tryEntries.length-1;P>=0;--P){var b=this.tryEntries[P],G=b.completion;if(b.tryLoc==="root")return h("end");if(b.tryLoc<=this.prev){var ee=A.call(b,"catchLoc"),ne=A.call(b,"finallyLoc");if(ee&&ne){if(this.prev<b.catchLoc)return h(b.catchLoc,!0);if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else if(ee){if(this.prev<b.catchLoc)return h(b.catchLoc,!0)}else if(ne){if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var h=this.tryEntries.length-1;h>=0;--h){var P=this.tryEntries[h];if(P.tryLoc<=this.prev&&A.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var b=P;break}}b&&(l==="break"||l==="continue")&&b.tryLoc<=s&&s<=b.finallyLoc&&(b=null);var G=b?b.completion:{};return G.type=l,G.arg=s,b?(this.method="next",this.next=b.finallyLoc,E):this.complete(G)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),E},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.finallyLoc===l)return this.complete(h.completion,h.afterLoc),K(h),E}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.tryLoc===l){var P=h.completion;if(P.type==="throw"){var b=P.arg;K(h)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,h){return this.delegate={iterator:he(l),resultName:s,nextLoc:h},this.method==="next"&&(this.arg=L),E}},w}(C.exports);try{regeneratorRuntime=z}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}},182:function(C,z,w){"use strict";w.d(z,{Z:function(){return S}});function S(A){if(A.geometry&&A.geometry.dispose(),A.material){var L=Array.isArray(A.material)?A.material:[A.material];L.forEach(function(O){var W,U,R,y,F,I,T,u,ue,Y,E,X,j;(W=O.map)===null||W===void 0||W.dispose(),(U=O.lightMap)===null||U===void 0||U.dispose(),(R=O.bumpMap)===null||R===void 0||R.dispose(),(y=O.normalMap)===null||y===void 0||y.dispose(),(F=O.specularMap)===null||F===void 0||F.dispose(),(I=O.envMap)===null||I===void 0||I.dispose(),(T=O.alphaMap)===null||T===void 0||T.dispose(),(u=O.aoMap)===null||u===void 0||u.dispose(),(ue=O.displacementMap)===null||ue===void 0||ue.dispose(),(Y=O.emissiveMap)===null||Y===void 0||Y.dispose(),(E=O.gradientMap)===null||E===void 0||E.dispose(),(X=O.metalnessMap)===null||X===void 0||X.dispose(),(j=O.roughnessMap)===null||j===void 0||j.dispose(),O.dispose()})}}},54:function(C,z,w){"use strict";w.d(z,{disposeMesh:function(){return O.Z}});var S=w(666),A=w.n(S),L=null,O=w(182),W=w(644);function U(E){if(E.material){var X=Array.isArray(E.material)?E.material:[E.material];X.forEach(function(j){var k,Z;(k=j.color)===null||k===void 0||k.convertSRGBToLinear(),(Z=j.emissive)===null||Z===void 0||Z.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=w(568),y=w(924),F=require("idb-keyval"),I=w(620),T=null,u=null,ue=function(){var E=(0,R.Z)(A().mark(function X(j,k){var Z,re,J,N,D,ae;return A().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Z=k.version,Q.next=4,(0,F.get)(j);case 4:if(J=Q.sent,!(J&&J[Z])){Q.next=9;break}re=J[Z],Q.next=15;break;case 9:return Q.next=11,(0,I.Z)(fetch(j).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:N=Q.sent,D=N.res,ae=N.err,ae||(re=D,(0,F.set)(j,(0,y.Z)({},Z,D)));case 15:return Q.abrupt("return",re?{url:URL.createObjectURL(re)}:{url:j});case 16:case"end":return Q.stop()}},X)}));return function(j,k){return E.apply(this,arguments)}}(),Y=w(977)},620:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});var S=w(42);function A(L){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(W){return(0,S.Z)({err:null,res:W},O)}).catch(function(W){return(0,S.Z)({err:W,res:void 0},O)})}},977:function(C,z,w){"use strict";w.d(z,{y:function(){return O}});var S=w(644),A=w.n(S),L=new Map,O=function(U){return{generateTopUV:function(R,y,F,I,T){var u=y[F*3],ue=y[F*3+1],Y=y[I*3],E=y[I*3+1],X=y[T*3],j=y[T*3+1],k;if(L.has(R))k=L.get(R);else{var Z=U&&U.Box3||new S.Box3;if(!U||!U.Box3){var re=R.parameters.shapes.getPoints();Z.setFromArray(re.map(function(ae){return[ae.x,ae.y,0]}).flat())}var J=Z.getSize(new S.Vector3);k={box:Z,size:J},L.set(R,k)}var N=k.box,D=k.size;return[new S.Vector2((u-N.min.x)/D.x,(ue-N.min.y)/D.y),new S.Vector2((Y-N.min.x)/D.x,(E-N.min.y)/D.y),new S.Vector2((X-N.min.x)/D.x,(j-N.min.y)/D.y)]},generateSideWallUV:function(R,y,F,I,T,u){var ue=y[F*3],Y=y[F*3+1],E=y[F*3+2],X=y[I*3],j=y[I*3+1],k=y[I*3+2],Z=y[T*3],re=y[T*3+1],J=y[T*3+2],N=y[u*3],D=y[u*3+1],ae=y[u*3+2],fe;if(L.has(y))fe=L.get(y);else{var Q=new S.Box3;Q.setFromArray(y);var me=Q.getSize(new S.Vector3);fe={box:Q,size:me},L.set(y,fe)}var K=fe.box,$=fe.size;return Math.abs(Y-j)<.01?[new S.Vector2((ue-K.min.x)/$.x,(E-K.min.z)/$.z),new S.Vector2((X-K.min.x)/$.x,(k-K.min.z)/$.z),new S.Vector2((Z-K.min.x)/$.x,(J-K.min.z)/$.z),new S.Vector2((N-K.min.x)/$.x,(ae-K.min.z)/$.z)]:[new S.Vector2((Y-K.min.y)/$.x,(E-K.min.z)/$.z),new S.Vector2((j-K.min.y)/$.x,(k-K.min.z)/$.z),new S.Vector2((re-K.min.y)/$.x,(J-K.min.z)/$.z),new S.Vector2((D-K.min.y)/$.x,(ae-K.min.z)/$.z)]}}},W=function(){L.clear()}},644:function(C){"use strict";C.exports=require("three")},568:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});function S(L,O,W,U,R,y,F){try{var I=L[y](F),T=I.value}catch(u){W(u);return}I.done?O(T):Promise.resolve(T).then(U,R)}function A(L){return function(){var O=this,W=arguments;return new Promise(function(U,R){var y=L.apply(O,W);function F(T){S(y,U,R,F,I,"next",T)}function I(T){S(y,U,R,F,I,"throw",T)}F(void 0)})}}},924:function(C,z,w){"use strict";w.d(z,{Z:function(){return S}});function S(A,L,O){return L in A?Object.defineProperty(A,L,{value:O,enumerable:!0,configurable:!0,writable:!0}):A[L]=O,A}},42:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});var S=w(924);function A(L){for(var O=1;O<arguments.length;O++){var W=arguments[O]!=null?arguments[O]:{},U=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(W).filter(function(R){return Object.getOwnPropertyDescriptor(W,R).enumerable}))),U.forEach(function(R){(0,S.Z)(L,R,W[R])})}return L}}},Ge={};function q(C){var z=Ge[C];if(z!==void 0)return z.exports;var w=Ge[C]={exports:{}};return $e[C](w,w.exports,q),w.exports}(function(){q.n=function(C){var z=C&&C.__esModule?function(){return C.default}:function(){return C};return q.d(z,{a:z}),z}})(),function(){q.d=function(C,z){for(var w in z)q.o(z,w)&&!q.o(C,w)&&Object.defineProperty(C,w,{enumerable:!0,get:z[w]})}}(),function(){q.o=function(C,z){return Object.prototype.hasOwnProperty.call(C,z)}}(),function(){q.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})}}();var ke={};(function(){"use strict";q.r(ke),q.d(ke,{ConicPolygon:function(){return mt},ExtrudePolygon:function(){return yt},Image:function(){return P},Line:function(){return Qe},MeshLine:function(){return te},MeshLineMaterial:function(){return Te},MeshLineRaycast:function(){return Ue},Node:function(){return ie},Text:function(){return ze},Video:function(){return ne}});function C(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function z(t,i){return z=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},z(t,i)}function w(t,i){return z(t,i)}function S(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&&w(t,i)}var A=q(42);function L(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 O(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(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 U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},U(t)}function R(t){return U(t)}function y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function I(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:y(t)}function T(t){var i=W();return function(){var n=R(t),a;if(i){var e=R(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return I(this,a)}}var u=q(644);function ue(){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 Y(t,i,r){return ue()?Y=Reflect.construct:Y=function(a,e,o){var c=[null];c.push.apply(c,e);var p=Function.bind.apply(a,c),v=new p;return o&&w(v,o.prototype),v},Y.apply(null,arguments)}function E(t,i,r){return Y.apply(null,arguments)}function X(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 j(t,i,r){return i&&X(t.prototype,i),r&&X(t,r),t}function k(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 Z(t){if(Array.isArray(t))return k(t)}function re(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function J(){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 N(t,i){if(!!t){if(typeof t=="string")return k(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 k(t,i)}}function D(t){return Z(t)||re(t)||N(t)||J()}var ae=q(620);function fe(){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,ae.Z)(r.promise,i)),r}var Q=require("three/examples/jsm/renderers/CSS2DRenderer"),me=require("three/examples/jsm/renderers/CSS3DRenderer"),K=q(54),$=function(t){t&&((0,K.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},he=function(){"use strict";function t(){C(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=fe(),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=E(u.Mesh,D(a)),this},i.createGroup=function(){return this.object3d=new u.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=E(u.Points,D(a)),this},i.createCSS2DObject=function(n){return this.object3d=new Q.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new me.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new me.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new u.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,D(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,D(a)),this},i.getSize=function(){var n=new u.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new u.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},j(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}(),ze=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,A.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,c=e.lookAt,p=e.sprite,v=e.text,d=e.sizeAttenuation;if(p){var m=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),x=new u.PlaneGeometry(1,1,1,1);this.createMesh(x,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},n.setText=function(e,o){var c=(0,A.Z)(O((0,A.Z)({},this.options),{text:e}),o||{}),p=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,g=c.flipX,x=c.scale,_=this.canvas;_.width=v*p.length*2,_.height=v;var M=_.getContext("2d");M.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=M.measureText(p).width;_.width=f,this.width=f,M=_.getContext("2d"),M.clearRect(0,0,_.width,_.height),g&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(p,g?f*-1:0,_.height/2),M.restore();var B=new u.Texture(_);B.anisotropy=16,B.needsUpdate=!0;var V=this.object3d;V.material.map&&V.material.map.dispose(),V.material.map=B,V.material.needsUpdate=!0,V.scale.set(B.image.width*x,B.image.height*x,1)},r}(he),l=q(568),s=q(666),h=q.n(s),P=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(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)(h().mark(function o(){var c,p,v,d,m,g,x,_,M,f;return h().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return c=e.options,p=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,g=c.alphaTest,x=c.sprite,_=c.sizeAttenuation,V.next=3,new u.TextureLoader().loadAsync(d);case 3:return M=V.sent,f=x?new u.SpriteMaterial({map:M,transparent:p!=null?p:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:_!=null?_:!0}):new u.MeshBasicMaterial({map:M,transparent:p!=null?p:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),V.abrupt("return",f);case 6:case"end":return V.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_;return h().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=e.options,p=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,e.getMaterial();case 5:x=f.sent,m.set(d,x);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);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:_=f.t0,e.texture=_.map,g?e.createSprite(_):e.createMesh(new u.PlaneBufferGeometry(1,1),_),p&&e.setScale(p),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(he);function b(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=R(t),t!==null););return t}function G(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?G=Reflect.get:G=function(a,e,o){var c=b(a,e);if(!!c){var p=Object.getOwnPropertyDescriptor(c,e);return p.get?p.get.call(o||a):p.value}},G(t,i,r)}function ee(t,i,r){return G(t,i,r)}var ne=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,c=e.transparent,p=e.blending,v=e.depthWrite,d=e.format,m=e.autoPlay,g=e.loop,x=e.alphaTest,_=e.sprite,M=fe(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var B=new u.VideoTexture(f);B.format=d!=null?d:u.RGBAFormat,B.needsUpdate=!0;var V=_?new u.SpriteMaterial({map:B,transparent:c!=null?c:!1,blending:p!=null?p:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:x!=null?x:0}):new u.MeshBasicMaterial({map:B,transparent:c!=null?c:!1,blending:p!=null?p:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:x!=null?x:0});M.resolve(V)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=g,f.preload="auto",M.promise},n.create=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_;return h().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=e.options,p=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,e.getMaterial();case 5:x=f.sent,m.set(d,x);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);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:_=f.t0,e.video=_.map.image,g?e.createSprite(_):e.createMesh(new u.PlaneBufferGeometry(1,1),_),p&&e.setScale(p),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),ee(R(r.prototype),"dispose",this).call(this)},r}(he),oe=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,c=e.children,p=e.onClick,v=e.zIndexFix,d=document.createElement("div");d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),p&&d.addEventListener("click",p),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,l.Z)(h().mark(function o(){var c,p,v,d;return h().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,p=c.getContext("2d"),p.fillStyle="#ff0000",p.fillRect(0,0,256,256),v=new u.CanvasTexture(c),d=new u.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,c=o===void 0?!1:o,p=e.scale,v=p===void 0?new u.Vector3(1,1,1):p,d=e.position,m=d===void 0?new u.Vector3(0,0,0):d,g=e.cache,x=this;return(0,l.Z)(h().mark(function _(){var M,f,B,V;return h().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(M="node-create-pick-object",!(g&&!g.get(M))){H.next=7;break}return g.init(M),H.next=5,x.getMaterial(c);case 5:f=H.sent,g.set(M,f);case 7:if(!g){H.next=13;break}return H.next=10,g.get(M);case 10:H.t0=H.sent,H.next=16;break;case 13:return H.next=15,x.getMaterial(c);case 15:H.t0=H.sent;case 16:B=H.t0,V=new u.Sprite(B),V.scale.set(B.map.image.width*v.x,B.map.image.height*v.y,1),V.position.copy(m),x.add(V),x.pickObject=V;case 22:case"end":return H.stop()}},_)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}ee(R(r.prototype),"dispose",this).call(this)},r}(he),ie=oe,Ae=`
|
|
2
|
+
`.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(u.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(u.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(u.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),_e=`
|
|
99
|
+
`.concat(u.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(u.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(u.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(u.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),Y=function(t){"use strict";T(r,t);var i=V(r);function r(){S(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new s.Matrix4,Object.defineProperties(E(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(s.BufferGeometry);Y.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Y.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},Y.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof s.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(t,i){var r=new s.Matrix4,n=new s.Ray,a=new s.Sphere,e=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new s.Vector3,f=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,y=g.position.array,_=g.width.array,h=0,O=b.length-1;h<O;h+=m){var C=b[h],F=b[h+1];u.fromArray(y,C*3),f.fromArray(y,F*3);var k=_[Math.floor(h/3)]!==void 0?_[Math.floor(h/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*k/2,xe=ce*ce,ye=n.distanceSqToSegment(u,f,e,v);if(!(ye>xe)){e.applyMatrix4(this.matrixWorld);var pe=t.ray.origin.distanceTo(e);pe<t.near||pe>t.far||(i.push({distance:pe,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=O)}}}}Y.prototype.raycast=Fe,Y.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},Y.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},Y.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new 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 Te(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}Y.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Te(i,0,r,0,a),Te(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Te(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=Se,s.ShaderChunk.meshline_frag=ge;var Ee=function(t){"use strict";T(r,t);var i=V(r);function r(n){S(this,r);var a;return a=i.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(E(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(n),a}return r}(s.ShaderMaterial);Ee.prototype.copy=function(t){return s.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function $e(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function qe(t,i){if(t==null)return{};var r=$e(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ke=require("popmotion"),Qe={nodes:[],color:new s.Color("red"),lineWidth:3,sizeAttenuation:0},Je=function(t){"use strict";T(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S(this,r);var e;return e=i.call(this),e.geometry=new s.BufferGeometry,e.meshline=new Y,e.options=(0,P.Z)({},Qe,a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,f=e.delay,v=e.onComplete,m=e.setPointWidth,d=qe(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),b=g.width,y=g.height;delete d.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,m);var _=new Ee(A((0,P.Z)({},d),{resolution:new s.Vector2(b,y)}));this.material=_,this.createMesh(this.meshline,_)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,f=e.onComplete,v=this.material.uniforms.offset,m=u!=null?u:0,d=(0,Ke.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-m,repeat:1/0,onComplete:f,onUpdate:function(g){v.value=g}});this.tween=d},n.dispose=function(){X(B(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(se);function et(t){if(Array.isArray(t))return t}function tt(){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 ue(t,i){return et(t)||re(t,i)||ee(t,i)||tt()}var we=require("d3-array"),rt=require("earcut"),Be=I.n(rt),nt=require("@turf/boolean-clockwise"),it=I.n(nt);function at(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ot=require("delaunator"),st=I.n(ot),ut=require("@turf/boolean-point-in-polygon"),ct=I.n(ut),Ae=require("d3-geo"),lt=require("d3-geo-voronoi"),Ie=require("d3-scale");function ht(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Ae.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var u=(0,Ae.geoInterpolate)(a,e),f=1/Math.ceil(o/i),v=f;v<1;)n.push(u(v)),v+=f}n.push(a=e)}),n})}function ft(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),u=(1+Math.sqrt(5))/2,f=function(h){return h/u*360%360-180},v=function(h){return Math.acos(2*h/o-1)/Math.PI*180-90},m=function(h){return o*(Math.cos((h+90)*Math.PI/180)+1)/2},d=[e!==void 0?Math.ceil(m(e)):0,a!==void 0?Math.floor(m(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(h){return h<=n}:n===void 0?function(h){return h>=r}:n>=r?function(h){return h>=r&&h<=n}:function(h){return h>=r||h<=n},b=[],y=d[0];y<=d[1];y++){var _=f(y);g(_)&&b.push([_,v(y)])}return b}function Ve(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ae.geoContains)(i,t):ct()(t,i)}function pt(t,i){var r={type:"Polygon",coordinates:t},n=ue((0,Ae.geoBounds)(r),2),a=ue(n[0],2),e=a[0],o=a[1],u=ue(n[1],2),f=u[0],v=u[1];if(Math.min(Math.abs(f-e),Math.abs(v-o))<i)return[];var m=e>f||v>=89||o<=-89;return ft(i,{minLng:e,maxLng:f,minLat:o,maxLat:v}).filter(function(d){return Ve(d,r,m)})}function vt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=ht(t,n),e=(0,we.merge)(a),o=pt(t,n),u=H(e).concat(H(o)),f={type:"Polygon",coordinates:t},v=ue((0,Ae.geoBounds)(f),2),m=ue(v[0],2),d=m[0],g=m[1],b=ue(v[1],2),y=b[0],_=b[1],h=d>y||_>=89||g<=-89,O=[];if(h){var C=(0,lt.geoVoronoi)(u).triangles(),F=new Map(u.map(function(ae,ve){var fe=ue(ae,2),oe=fe[0],Ce=fe[1];return["".concat(oe,"-").concat(Ce),ve]}));C.features.forEach(function(ae){var ve,fe=ae.geometry.coordinates[0].slice(0,3).reverse(),oe=[];if(fe.forEach(function(je){var le=ue(je,2),Ge=le[0],Mt=le[1],Xe="".concat(Ge,"-").concat(Mt);F.has(Xe)&&oe.push(F.get(Xe))}),oe.length===3){if(oe.some(function(je){return je<e.length})){var Ce=ae.properties.circumcenter;if(!Ve(Ce,f,h))return}(ve=O).push.apply(ve,H(oe))}})}else if(o.length)for(var pe=function(ae,ve){var fe,oe=[2,1,0].map(function(le){return be.triangles[ae+le]}),Ce=oe.map(function(le){return u[le]});if(oe.some(function(le){return le<e.length})){var je=[0,1].map(function(le){return(0,we.mean)(Ce,function(Ge){return Ge[le]})});if(!Ve(je,f,h))return"continue"}(fe=O).push.apply(fe,H(oe))},be=st().from(u),Me=0,Oe=be.triangles.length;Me<Oe;Me+=3)pe(Me,Oe);else{var k=Be().flatten(a),ce=k.vertices,xe=k.holes,ye=xe===void 0?[]:xe;O=Be()(ce,ye,2)}var De=(0,Ie.scaleLinear)((0,we.extent)(u,function(ae){return ae[0]}),[0,1]),_t=(0,Ie.scaleLinear)((0,we.extent)(u,function(ae){return ae[1]}),[0,1]),wt=u.map(function(ae){var ve=ue(ae,2),fe=ve[0],oe=ve[1];return[De(fe),_t(oe)]}),xt={points:u,indices:O,uvs:wt};return{contour:a,triangles:xt}}var dt=vt,Ze=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ze(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=ue(e,2),u=o[0],f=o[1];return r?at(u,f,i):[u,f,i]})});return Be().flatten(n)}function Ne(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=ze(t,i,n),e=a.vertices,o=a.holes,u=ze(t,r,n),f=u.vertices,v=(0,we.merge)([f,e]),m=Math.round(f.length/3),d=new Set(o),g=0,b=[],y=0;y<m;y++){var _=y+1;if(_===m)_=g;else if(d.has(_)){var h=_;_=g,g=h}b.push(y,y+m,_+m),b.push(_+m,_,y)}for(var O=[],C=1;C>=0;C--)for(var F=0;F<m;F+=1)O.push(F/(m-1),C);return{indices:b,vertices:v,uvs:O,topVerts:f}}function He(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:ze([t.points],i,a).vertices,uvs:r}}var mt=function(t){"use strict";T(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};S(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,P.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,u=o.startHeight,f=o.endHeight,v=o.closedBottom,m=o.closedTop,d=o.includeSides,g=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;it()(n[0])||n[0].reverse();var _=dt(n,{resolution:g}),h=_.contour,O=_.triangles,C=(0,we.merge)(O.uvs),F=[],k=[],ce=[],xe=0,ye=function(be){var Me=Math.round(F.length/3),Oe=ce.length;F=F.concat(be.vertices),k=k.concat(be.uvs),ce=ce.concat(Me?be.indices.map(function(De){return De+Me}):be.indices),e.addGroup(Oe,ce.length-Oe,xe++)};if(d){var pe=Ne(h,u,f,b);ye(pe),e.userData.rso=y?Ne(h,u,f+y,b):pe}return v&&ye(He(O,u,C,!1,b)),m&&ye(He(O,f,C,!0,b)),e.setIndex(ce),e[Ze]("position",new s.Float32BufferAttribute(F,3)),e[Ze]("uv",new s.Float32BufferAttribute(k,2)),e.computeVertexNormals(),e}return r}(s.BufferGeometry),gt=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)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,u=e.height,f=e.closedBottom,v=e.closedTop,m=e.curvatureResolution,d=e.userDataRsoOffset,g=e.cartesian,b=new mt(this.options.geojson,{startHeight:o,endHeight:o+u,closedBottom:f,closedTop:v,curvatureResolution:m,cartesian:g,userDataRsoOffset:d});this.createMesh(b,this.options.material)},r}(se),We=new Map,yt={generateTopUV:function(t,i,r,n,a){var e=i[r*3],o=i[r*3+1],u=i[n*3],f=i[n*3+1],v=i[a*3],m=i[a*3+1],d;if(We.has(t))d=We.get(t);else{var g,b,y,_,h=t.parameters.shapes.getPoints();d={minX:(g=Math).min.apply(g,H(h.map(function(F){var k=F.x;return k}))),maxX:(b=Math).max.apply(b,H(h.map(function(F){var k=F.x;return k}))),minY:(y=Math).min.apply(y,H(h.map(function(F){var k=F.y;return k}))),maxY:(_=Math).max.apply(_,H(h.map(function(F){var k=F.y;return k})))},We.set(t,d)}var O=d.maxX-d.minX,C=d.maxY-d.minY;return[new s.Vector2((e-d.minX)/O,1-(o-d.minY)/C),new s.Vector2((u-d.minX)/O,1-(f-d.minY)/C),new s.Vector2((v-d.minX)/O,1-(m-d.minY)/C)]},generateSideWallUV:function(t,i,r,n,a,e){var o=i[r*3],u=i[r*3+1],f=i[r*3+2],v=i[n*3],m=i[n*3+1],d=i[n*3+2],g=i[a*3],b=i[a*3+1],y=i[a*3+2],_=i[e*3],h=i[e*3+1],O=i[e*3+2];return Math.abs(u-m)<.01?[new s.Vector2(o,1-f),new s.Vector2(v,1-d),new s.Vector2(g,1-y),new s.Vector2(_,1-O)]:[new s.Vector2(u,1-f),new s.Vector2(m,1-d),new s.Vector2(b,1-y),new s.Vector2(h,1-O)]}},bt=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.points,u=e.depth,f=e.material,v=new s.ExtrudeBufferGeometry(new s.Shape(o),{depth:u,bevelEnabled:!1,UVGenerator:yt});this.createMesh(v,f)},r}(se)})(),module.exports=Re})();
|
|
132
|
+
`),te=function(t){"use strict";S(r,t);var i=T(r);function r(){C(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new u.Matrix4,Object.defineProperties(y(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(u.BufferGeometry);te.prototype.setMatrixWorld=function(t){this.matrixWorld=t},te.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},te.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof u.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ue(t,i){var r=new u.Matrix4,n=new u.Ray,a=new u.Sphere,e=new u.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var c=new u.Vector3,p=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var x=m.array,_=g.position.array,M=g.width.array,f=0,B=x.length-1;f<B;f+=d){var V=x[f],se=x[f+1];c.fromArray(_,V*3),p.fromArray(_,se*3);var H=M[Math.floor(f/3)]!==void 0?M[Math.floor(f/3)]:1,ve=t.params.Line.threshold+this.material.lineWidth*H/2,Pe=ve*ve,we=n.distanceSqToSegment(c,p,e,v);if(!(we>Pe)){e.applyMatrix4(this.matrixWorld);var ye=t.ray.origin.distanceTo(e);ye<t.near||ye>t.far||(i.push({distance:ye,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=B)}}}}te.prototype.raycast=Ue,te.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},te.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},te.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.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 Re(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}te.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Re(i,0,r,0,a),Re(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Re(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=Ae,u.ShaderChunk.meshline_frag=_e;var Te=function(t){"use strict";S(r,t);var i=T(r);function r(n){C(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.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 u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(y(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(n),a}return r}(u.ShaderMaterial);Te.prototype.copy=function(t){return u.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function qe(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function Ke(t,i){if(t==null)return{};var r=qe(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Xe=require("popmotion"),Ye={nodes:[],color:new u.Color("red"),lineWidth:3,sizeAttenuation:0},Qe=function(t){"use strict";S(r,t);var i=T(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var e;return e=i.call(this),e.geometry=new u.BufferGeometry,e.meshline=new te,e.options=(0,A.Z)({},Ye,a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,c=e.duration,p=e.delay,v=e.onComplete,d=e.setPointWidth,m=Ke(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),x=g.width,_=g.height;delete m.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,d);var M=new Te(O((0,A.Z)({},m),{resolution:new u.Vector2(x,_)}));this.material=M,this.createMesh(this.meshline,M)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,c=e.delay,p=e.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,Xe.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:p,onUpdate:function(g){v.value=g}});this.tween=m},n.dispose=function(){ee(R(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(he);function Je(t){if(Array.isArray(t))return t}function et(){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 pe(t,i){return Je(t)||re(t,i)||N(t,i)||et()}var Me=require("d3-array"),tt=require("earcut"),Ee=q.n(tt),rt=require("@turf/boolean-clockwise"),nt=q.n(rt);function it(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var at=require("delaunator"),ot=q.n(at),st=require("@turf/boolean-point-in-polygon"),ut=q.n(st),Oe=require("d3-geo"),ct=require("d3-geo-voronoi"),Fe=require("d3-scale");function lt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Oe.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var c=(0,Oe.geoInterpolate)(a,e),p=1/Math.ceil(o/i),v=p;v<1;)n.push(c(v)),v+=p}n.push(a=e)}),n})}function ft(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),c=(1+Math.sqrt(5))/2,p=function(f){return f/c*360%360-180},v=function(f){return Math.acos(2*f/o-1)/Math.PI*180-90},d=function(f){return o*(Math.cos((f+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(f){return f<=n}:n===void 0?function(f){return f>=r}:n>=r?function(f){return f>=r&&f<=n}:function(f){return f>=r||f<=n},x=[],_=m[0];_<=m[1];_++){var M=p(_);g(M)&&x.push([M,v(_)])}return x}function Be(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Oe.geoContains)(i,t):ut()(t,i)}function ht(t,i){var r={type:"Polygon",coordinates:t},n=pe((0,Oe.geoBounds)(r),2),a=pe(n[0],2),e=a[0],o=a[1],c=pe(n[1],2),p=c[0],v=c[1];if(Math.min(Math.abs(p-e),Math.abs(v-o))<i)return[];var d=e>p||v>=89||o<=-89;return ft(i,{minLng:e,maxLng:p,minLat:o,maxLat:v}).filter(function(m){return Be(m,r,d)})}function pt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=lt(t,n),e=(0,Me.merge)(a),o=ht(t,n),c=D(e).concat(D(o)),p={type:"Polygon",coordinates:t},v=pe((0,Oe.geoBounds)(p),2),d=pe(v[0],2),m=d[0],g=d[1],x=pe(v[1],2),_=x[0],M=x[1],f=m>_||M>=89||g<=-89,B=[];if(f){var V=(0,ct.geoVoronoi)(c).triangles(),se=new Map(c.map(function(ce,be){var ge=pe(ce,2),le=ge[0],je=ge[1];return["".concat(le,"-").concat(je),be]}));V.features.forEach(function(ce){var be,ge=ce.geometry.coordinates[0].slice(0,3).reverse(),le=[];if(ge.forEach(function(Le){var de=pe(Le,2),De=de[0],xt=de[1],He="".concat(De,"-").concat(xt);se.has(He)&&le.push(se.get(He))}),le.length===3){if(le.some(function(Le){return Le<e.length})){var je=ce.properties.circumcenter;if(!Be(je,p,f))return}(be=B).push.apply(be,D(le))}})}else if(o.length)for(var ye=function(ce,be){var ge,le=[2,1,0].map(function(de){return xe.triangles[ce+de]}),je=le.map(function(de){return c[de]});if(le.some(function(de){return de<e.length})){var Le=[0,1].map(function(de){return(0,Me.mean)(je,function(De){return De[de]})});if(!Be(Le,p,f))return"continue"}(ge=B).push.apply(ge,D(le))},xe=ot().from(c),Se=0,Ce=xe.triangles.length;Se<Ce;Se+=3)ye(Se,Ce);else{var H=Ee().flatten(a),ve=H.vertices,Pe=H.holes,we=Pe===void 0?[]:Pe;B=Ee()(ve,we,2)}var We=(0,Fe.scaleLinear)((0,Me.extent)(c,function(ce){return ce[0]}),[0,1]),bt=(0,Fe.scaleLinear)((0,Me.extent)(c,function(ce){return ce[1]}),[0,1]),_t=c.map(function(ce){var be=pe(ce,2),ge=be[0],le=be[1];return[We(ge),bt(le)]}),wt={points:c,indices:B,uvs:_t};return{contour:a,triangles:wt}}var vt=pt,Ie=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ve(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=pe(e,2),c=o[0],p=o[1];return r?it(c,p,i):[c,p,i]})});return Ee().flatten(n)}function Ze(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ve(t,i,n),e=a.vertices,o=a.holes,c=Ve(t,r,n),p=c.vertices,v=(0,Me.merge)([p,e]),d=Math.round(p.length/3),m=new Set(o),g=0,x=[],_=0;_<d;_++){var M=_+1;if(M===d)M=g;else if(m.has(M)){var f=M;M=g,g=f}x.push(_,_+d,M+d),x.push(M+d,M,_)}for(var B=[],V=1;V>=0;V--)for(var se=0;se<d;se+=1)B.push(se/(d-1),V);return{indices:x,vertices:v,uvs:B,topVerts:p}}function Ne(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ve([t.points],i,a).vertices,uvs:r}}var dt=function(t){"use strict";S(r,t);var i=T(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,A.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,c=o.startHeight,p=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,x=o.cartesian,_=o.userDataRsoOffset;nt()(n[0])||n[0].reverse();var M=vt(n,{resolution:g}),f=M.contour,B=M.triangles,V=(0,Me.merge)(B.uvs),se=[],H=[],ve=[],Pe=0,we=function(xe){var Se=Math.round(se.length/3),Ce=ve.length;se=se.concat(xe.vertices),H=H.concat(xe.uvs),ve=ve.concat(Se?xe.indices.map(function(We){return We+Se}):xe.indices),e.addGroup(Ce,ve.length-Ce,Pe++)};if(m){var ye=Ze(f,c,p,x);we(ye),e.userData.rso=_?Ze(f,c,p+_,x):ye}return v&&we(Ne(B,c,V,!1,x)),d&&we(Ne(B,p,V,!0,x)),e.setIndex(ve),e[Ie]("position",new u.Float32BufferAttribute(se,3)),e[Ie]("uv",new u.Float32BufferAttribute(H,2)),e.computeVertexNormals(),e}return r}(u.BufferGeometry),mt=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,c=e.height,p=e.closedBottom,v=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,g=e.cartesian,x=new dt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:p,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(x,this.options.material)},r}(he),gt=q(977),yt=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.points,c=e.depth,p=e.material,v=new u.ExtrudeBufferGeometry(new u.Shape(o),{depth:c,bevelEnabled:!1,UVGenerator:(0,gt.y)()});this.createMesh(v,p)},r}(he)})(),module.exports=ke})();
|