gl-draw 0.1.2 → 0.1.3
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 +1986 -5
- package/dist/index.module.js +1986 -5
- package/dist/objects/index.js +11 -11
- package/dist/objects/index.module.js +11 -11
- package/package.json +1 -1
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 Je={666:function(C){var E=function(P){"use strict";var T=Object.prototype,O=T.hasOwnProperty,R,j=typeof Symbol=="function"?Symbol:{},B=j.iterator||"@@iterator",H=j.asyncIterator||"@@asyncIterator",z=j.toStringTag||"@@toStringTag";function W(d,p,b){return Object.defineProperty(d,p,{value:b,enumerable:!0,configurable:!0,writable:!0}),d[p]}try{W({},"")}catch(d){W=function(p,b,S){return p[b]=S}}function X(d,p,b,S){var w=p&&p.prototype instanceof k?p:k,F=Object.create(w.prototype),V=new Me(S||[]);return F._invoke=Q(d,b,V),F}P.wrap=X;function Y(d,p,b){try{return{type:"normal",arg:d.call(p,b)}}catch(S){return{type:"throw",arg:S}}}var D="suspendedStart",l="suspendedYield",pe="executing",Z="completed",G={};function k(){}function I(){}function U(){}var ne={};W(ne,B,function(){return this});var ee=Object.getPrototypeOf,ie=ee&&ee(ee(Se([])));ie&&ie!==T&&O.call(ie,B)&&(ne=ie);var J=U.prototype=k.prototype=Object.create(ne);I.prototype=U,W(J,"constructor",U),W(U,"constructor",I),I.displayName=W(U,z,"GeneratorFunction");function q(d){["next","throw","return"].forEach(function(p){W(d,p,function(b){return this._invoke(p,b)})})}P.isGeneratorFunction=function(d){var p=typeof d=="function"&&d.constructor;return p?p===I||(p.displayName||p.name)==="GeneratorFunction":!1},P.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,U):(d.__proto__=U,W(d,z,"GeneratorFunction")),d.prototype=Object.create(J),d},P.awrap=function(d){return{__await:d}};function be(d,p){function b(F,V,$,te){var K=Y(d[F],d,V);if(K.type==="throw")te(K.arg);else{var Pe=K.arg,re=Pe.value;return re&&typeof re=="object"&&O.call(re,"__await")?p.resolve(re.__await).then(function(ve){b("next",ve,$,te)},function(ve){b("throw",ve,$,te)}):p.resolve(re).then(function(ve){Pe.value=ve,$(Pe)},function(ve){return b("throw",ve,$,te)})}}var S;function w(F,V){function $(){return new p(function(te,K){b(F,V,te,K)})}return S=S?S.then($,$):$()}this._invoke=w}q(be.prototype),W(be.prototype,H,function(){return this}),P.AsyncIterator=be,P.async=function(d,p,b,S,w){w===void 0&&(w=Promise);var F=new be(X(d,p,b,S),w);return P.isGeneratorFunction(p)?F:F.next().then(function(V){return V.done?V.value:F.next()})};function Q(d,p,b){var S=D;return function(F,V){if(S===pe)throw new Error("Generator is already running");if(S===Z){if(F==="throw")throw V;return je()}for(b.method=F,b.arg=V;;){var $=b.delegate;if($){var te=me($,b);if(te){if(te===G)continue;return te}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(S===D)throw S=Z,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);S=pe;var K=Y(d,p,b);if(K.type==="normal"){if(S=b.done?Z:l,K.arg===G)continue;return{value:K.arg,done:b.done}}else K.type==="throw"&&(S=Z,b.method="throw",b.arg=K.arg)}}}function me(d,p){var b=d.iterator[p.method];if(b===R){if(p.delegate=null,p.method==="throw"){if(d.iterator.return&&(p.method="return",p.arg=R,me(d,p),p.method==="throw"))return G;p.method="throw",p.arg=new TypeError("The iterator does not provide a 'throw' method")}return G}var S=Y(b,d.iterator,p.arg);if(S.type==="throw")return p.method="throw",p.arg=S.arg,p.delegate=null,G;var w=S.arg;if(!w)return p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,G;if(w.done)p[d.resultName]=w.value,p.next=d.nextLoc,p.method!=="return"&&(p.method="next",p.arg=R);else return w;return p.delegate=null,G}q(J),W(J,z,"Generator"),W(J,B,function(){return this}),W(J,"toString",function(){return"[object Generator]"});function ue(d){var p={tryLoc:d[0]};1 in d&&(p.catchLoc=d[1]),2 in d&&(p.finallyLoc=d[2],p.afterLoc=d[3]),this.tryEntries.push(p)}function xe(d){var p=d.completion||{};p.type="normal",delete p.arg,d.completion=p}function Me(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(ue,this),this.reset(!0)}P.keys=function(d){var p=[];for(var b in d)p.push(b);return p.reverse(),function S(){for(;p.length;){var w=p.pop();if(w in d)return S.value=w,S.done=!1,S}return S.done=!0,S}};function Se(d){if(d){var p=d[B];if(p)return p.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var b=-1,S=function w(){for(;++b<d.length;)if(O.call(d,b))return w.value=d[b],w.done=!1,w;return w.value=R,w.done=!0,w};return S.next=S}}return{next:je}}P.values=Se;function je(){return{value:R,done:!0}}return Me.prototype={constructor:Me,reset:function(d){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(xe),!d)for(var p in this)p.charAt(0)==="t"&&O.call(this,p)&&!isNaN(+p.slice(1))&&(this[p]=R)},stop:function(){this.done=!0;var d=this.tryEntries[0],p=d.completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var p=this;function b(te,K){return F.type="throw",F.arg=d,p.next=te,K&&(p.method="next",p.arg=R),!!K}for(var S=this.tryEntries.length-1;S>=0;--S){var w=this.tryEntries[S],F=w.completion;if(w.tryLoc==="root")return b("end");if(w.tryLoc<=this.prev){var V=O.call(w,"catchLoc"),$=O.call(w,"finallyLoc");if(V&&$){if(this.prev<w.catchLoc)return b(w.catchLoc,!0);if(this.prev<w.finallyLoc)return b(w.finallyLoc)}else if(V){if(this.prev<w.catchLoc)return b(w.catchLoc,!0)}else if($){if(this.prev<w.finallyLoc)return b(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(d,p){for(var b=this.tryEntries.length-1;b>=0;--b){var S=this.tryEntries[b];if(S.tryLoc<=this.prev&&O.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var w=S;break}}w&&(d==="break"||d==="continue")&&w.tryLoc<=p&&p<=w.finallyLoc&&(w=null);var F=w?w.completion:{};return F.type=d,F.arg=p,w?(this.method="next",this.next=w.finallyLoc,G):this.complete(F)},complete:function(d,p){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&p&&(this.next=p),G},finish:function(d){for(var p=this.tryEntries.length-1;p>=0;--p){var b=this.tryEntries[p];if(b.finallyLoc===d)return this.complete(b.completion,b.afterLoc),xe(b),G}},catch:function(d){for(var p=this.tryEntries.length-1;p>=0;--p){var b=this.tryEntries[p];if(b.tryLoc===d){var S=b.completion;if(S.type==="throw"){var w=S.arg;xe(b)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(d,p,b){return this.delegate={iterator:Se(d),resultName:p,nextLoc:b},this.method==="next"&&(this.arg=R),G}},P}(C.exports);try{regeneratorRuntime=E}catch(P){typeof globalThis=="object"?globalThis.regeneratorRuntime=E:Function("r","regeneratorRuntime = r")(E)}},182:function(C,E,P){"use strict";P.d(E,{Z:function(){return T}});function T(O){if(O.geometry&&O.geometry.dispose(),O.material){var R=Array.isArray(O.material)?O.material:[O.material];R.forEach(function(j){var B,H,z,W,X,Y,D,l,pe,Z,G,k,I;(B=j.map)===null||B===void 0||B.dispose(),(H=j.lightMap)===null||H===void 0||H.dispose(),(z=j.bumpMap)===null||z===void 0||z.dispose(),(W=j.normalMap)===null||W===void 0||W.dispose(),(X=j.specularMap)===null||X===void 0||X.dispose(),(Y=j.envMap)===null||Y===void 0||Y.dispose(),(D=j.alphaMap)===null||D===void 0||D.dispose(),(l=j.aoMap)===null||l===void 0||l.dispose(),(pe=j.displacementMap)===null||pe===void 0||pe.dispose(),(Z=j.emissiveMap)===null||Z===void 0||Z.dispose(),(G=j.gradientMap)===null||G===void 0||G.dispose(),(k=j.metalnessMap)===null||k===void 0||k.dispose(),(I=j.roughnessMap)===null||I===void 0||I.dispose(),j.dispose()})}}},54:function(C,E,P){"use strict";P.d(E,{disposeMesh:function(){return j.Z}});var T=P(666),O=P.n(T),R=null,j=P(182),B=P(644);function H(Z){if(Z.material){var G=Array.isArray(Z.material)?Z.material:[Z.material];G.forEach(function(k){var I,U;(I=k.color)===null||I===void 0||I.convertSRGBToLinear(),(U=k.emissive)===null||U===void 0||U.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var z=P(568),W=P(924),X=require("idb-keyval"),Y=P(620),D=null,l=null,pe=function(){var Z=(0,z.Z)(O().mark(function G(k,I){var U,ne,ee,ie,J,q;return O().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return U=I.version,Q.next=4,(0,X.get)(k);case 4:if(ee=Q.sent,!(ee&&ee[U])){Q.next=9;break}ne=ee[U],Q.next=15;break;case 9:return Q.next=11,(0,Y.Z)(fetch(k).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:ie=Q.sent,J=ie.res,q=ie.err,q||(ne=J,(0,X.set)(k,(0,W.Z)({},U,J)));case 15:return Q.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:k});case 16:case"end":return Q.stop()}},G)}));return function(k,I){return Z.apply(this,arguments)}}()},620:function(C,E,P){"use strict";P.d(E,{Z:function(){return O}});var T=P(42);function O(R){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(B){return(0,T.Z)({err:null,res:B},j)}).catch(function(B){return(0,T.Z)({err:B,res:void 0},j)})}},644:function(C){"use strict";C.exports=require("three")},568:function(C,E,P){"use strict";P.d(E,{Z:function(){return O}});function T(R,j,B,H,z,W,X){try{var Y=R[W](X),D=Y.value}catch(l){B(l);return}Y.done?j(D):Promise.resolve(D).then(H,z)}function O(R){return function(){var j=this,B=arguments;return new Promise(function(H,z){var W=R.apply(j,B);function X(D){T(W,H,z,X,Y,"next",D)}function Y(D){T(W,H,z,X,Y,"throw",D)}X(void 0)})}}},924:function(C,E,P){"use strict";P.d(E,{Z:function(){return T}});function T(O,R,j){return R in O?Object.defineProperty(O,R,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[R]=j,O}},42:function(C,E,P){"use strict";P.d(E,{Z:function(){return O}});var T=P(924);function O(R){for(var j=1;j<arguments.length;j++){var B=arguments[j]!=null?arguments[j]:{},H=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(B).filter(function(z){return Object.getOwnPropertyDescriptor(B,z).enumerable}))),H.forEach(function(z){(0,T.Z)(R,z,B[z])})}return R}}},He={};function N(C){var E=He[C];if(E!==void 0)return E.exports;var P=He[C]={exports:{}};return Je[C](P,P.exports,N),P.exports}(function(){N.n=function(C){var E=C&&C.__esModule?function(){return C.default}:function(){return C};return N.d(E,{a:E}),E}})(),function(){N.d=function(C,E){for(var P in E)N.o(E,P)&&!N.o(C,P)&&Object.defineProperty(C,P,{enumerable:!0,get:E[P]})}}(),function(){N.o=function(C,E){return Object.prototype.hasOwnProperty.call(C,E)}}(),function(){N.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})}}();var ze={};(function(){"use strict";N.r(ze),N.d(ze,{ConicPolygon:function(){return Lt},ExtrudePolygon:function(){return Et},Image:function(){return tt},Line:function(){return ft},MeshLine:function(){return ce},MeshLineMaterial:function(){return Be},MeshLineRaycast:function(){return qe},Node:function(){return at},Text:function(){return ve},Video:function(){return nt}});function C(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function E(r,n){return E=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},E(r,n)}function P(r,n){return E(r,n)}function T(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),n&&P(r,n)}var O=N(42);function R(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,i)}return t}function j(r,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}),r}function B(){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(r){return!1}}function H(r){return H=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},H(r)}function z(r){return H(r)}function W(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function X(r){return r&&r.constructor===Symbol?"symbol":typeof r}function Y(r,n){return n&&(X(n)==="object"||typeof n=="function")?n:W(r)}function D(r){var n=B();return function(){var i=z(r),a;if(n){var e=z(this).constructor;a=Reflect.construct(i,arguments,e)}else a=i.apply(this,arguments);return Y(this,a)}}var l=N(644);function pe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}function Z(r,n,t){return pe()?Z=Reflect.construct:Z=function(a,e,o){var c=[null];c.push.apply(c,e);var v=Function.bind.apply(a,c),m=new v;return o&&P(m,o.prototype),m},Z.apply(null,arguments)}function G(r,n,t){return Z.apply(null,arguments)}function k(r,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function I(r,n,t){return n&&k(r.prototype,n),t&&k(r,t),r}function U(r,n){(n==null||n>r.length)&&(n=r.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=r[t];return i}function ne(r){if(Array.isArray(r))return U(r)}function ee(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}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 J(r,n){if(!!r){if(typeof r=="string")return U(r,n);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return U(r,n)}}function q(r){return ne(r)||ee(r)||J(r)||ie()}var be=N(620);function Q(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(i,a){t.resolve=i,t.reject=a}),r&&(t.promise=(0,be.Z)(t.promise,n)),t}class me extends l.Object3D{constructor(n=document.createElement("div")){super(),this.element=n,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(n,t){return super.copy(n,t),this.element=n.element.cloneNode(!0),this}}me.prototype.isCSS2DObject=!0;const ue=new l.Vector3,xe=new l.Matrix4,Me=new l.Matrix4,Se=new l.Vector3,je=new l.Vector3;class d{constructor(n={}){const t=this;let i,a,e,o;const c={objects:new WeakMap},v=n.element!==void 0?n.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v,this.getSize=function(){return{width:i,height:a}},this.render=function(g,h){g.autoUpdate===!0&&g.updateMatrixWorld(),h.parent===null&&h.updateMatrixWorld(),xe.copy(h.matrixWorldInverse),Me.multiplyMatrices(h.projectionMatrix,xe),m(g,g,h),_(g)},this.setSize=function(g,h){i=g,a=h,e=i/2,o=a/2,v.style.width=g+"px",v.style.height=h+"px"};function m(g,h,u){if(g.isCSS2DObject){g.onBeforeRender(t,h,u),ue.setFromMatrixPosition(g.matrixWorld),ue.applyMatrix4(Me);const s=g.element;/apple/i.test(navigator.vendor)?s.style.transform="translate(-50%,-50%) translate("+Math.round(ue.x*e+e)+"px,"+Math.round(-ue.y*o+o)+"px)":s.style.transform="translate(-50%,-50%) translate("+(ue.x*e+e)+"px,"+(-ue.y*o+o)+"px)",s.style.display=g.visible&&ue.z>=-1&&ue.z<=1?"":"none";const x={distanceToCameraSquared:f(u,g)};c.objects.set(g,x),s.parentNode!==v&&v.appendChild(s),g.onAfterRender(t,h,u)}for(let s=0,x=g.children.length;s<x;s++)m(g.children[s],h,u)}function f(g,h){return Se.setFromMatrixPosition(g.matrixWorld),je.setFromMatrixPosition(h.matrixWorld),Se.distanceToSquared(je)}function y(g){const h=[];return g.traverse(function(u){u.isCSS2DObject&&h.push(u)}),h}function _(g){const h=y(g).sort(function(s,x){const M=c.objects.get(s).distanceToCameraSquared,L=c.objects.get(x).distanceToCameraSquared;return M-L}),u=h.length;for(let s=0,x=h.length;s<x;s++)h[s].element.style.zIndex=u-s}}}const p=new l.Vector3,b=new l.Quaternion,S=new l.Vector3;class w extends l.Object3D{constructor(n=document.createElement("div")){super(),this.element=n,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(n,t){return super.copy(n,t),this.element=n.element.cloneNode(!0),this}}w.prototype.isCSS3DObject=!0;class F extends w{constructor(n){super(n),this.rotation2D=0}copy(n,t){return super.copy(n,t),this.rotation2D=n.rotation2D,this}}F.prototype.isCSS3DSprite=!0;const V=new l.Matrix4,$=new l.Matrix4;class te{constructor(n={}){const t=this;let i,a,e,o;const c={camera:{fov:0,style:""},objects:new WeakMap},v=n.element!==void 0?n.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v;const m=document.createElement("div");m.style.transformStyle="preserve-3d",m.style.pointerEvents="none",v.appendChild(m),this.getSize=function(){return{width:i,height:a}},this.render=function(h,u){const s=u.projectionMatrix.elements[5]*o;c.camera.fov!==s&&(v.style.perspective=u.isPerspectiveCamera?s+"px":"",c.camera.fov=s),h.autoUpdate===!0&&h.updateMatrixWorld(),u.parent===null&&u.updateMatrixWorld();let x,M;u.isOrthographicCamera&&(x=-(u.right+u.left)/2,M=(u.top+u.bottom)/2);const L=u.isOrthographicCamera?"scale("+s+")translate("+f(x)+"px,"+f(M)+"px)"+y(u.matrixWorldInverse):"translateZ("+s+"px)"+y(u.matrixWorldInverse),A=L+"translate("+e+"px,"+o+"px)";c.camera.style!==A&&(m.style.transform=A,c.camera.style=A),g(h,h,u,L)},this.setSize=function(h,u){i=h,a=u,e=i/2,o=a/2,v.style.width=h+"px",v.style.height=u+"px",m.style.width=h+"px",m.style.height=u+"px"};function f(h){return Math.abs(h)<1e-10?0:h}function y(h){const u=h.elements;return"matrix3d("+f(u[0])+","+f(-u[1])+","+f(u[2])+","+f(u[3])+","+f(u[4])+","+f(-u[5])+","+f(u[6])+","+f(u[7])+","+f(u[8])+","+f(-u[9])+","+f(u[10])+","+f(u[11])+","+f(u[12])+","+f(-u[13])+","+f(u[14])+","+f(u[15])+")"}function _(h){const u=h.elements,s="matrix3d("+f(u[0])+","+f(u[1])+","+f(u[2])+","+f(u[3])+","+f(-u[4])+","+f(-u[5])+","+f(-u[6])+","+f(-u[7])+","+f(u[8])+","+f(u[9])+","+f(u[10])+","+f(u[11])+","+f(u[12])+","+f(u[13])+","+f(u[14])+","+f(u[15])+")";return"translate(-50%,-50%)"+s}function g(h,u,s,x){if(h.isCSS3DObject){h.onBeforeRender(t,u,s);let M;h.isCSS3DSprite?(V.copy(s.matrixWorldInverse),V.transpose(),h.rotation2D!==0&&V.multiply($.makeRotationZ(h.rotation2D)),h.matrixWorld.decompose(p,b,S),V.setPosition(p),V.scale(S),V.elements[3]=0,V.elements[7]=0,V.elements[11]=0,V.elements[15]=1,M=_(V)):M=_(h.matrixWorld);const L=h.element,A=c.objects.get(h);if(A===void 0||A.style!==M){L.style.transform=M;const ae={style:M};c.objects.set(h,ae)}L.style.display=h.visible?"":"none",L.parentNode!==m&&m.appendChild(L),h.onAfterRender(t,u,s)}for(let M=0,L=h.children.length;M<L;M++)g(h.children[M],u,s,x)}}}var K=N(54),Pe=function(r){r&&((0,K.disposeMesh)(r),r.children.forEach(function(n){n.userData.BaseObject_||Pe(n)}))},re=function(){"use strict";function r(){C(this,r),this.objecttype__="BaseObject",this.userData={},this.pm=Q(),this.visible=!1}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),e=0;e<i;e++)a[e]=arguments[e];return this.object3d=G(l.Mesh,q(a)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),e=0;e<i;e++)a[e]=arguments[e];return this.object3d=G(l.Points,q(a)),this},n.createCSS2DObject=function(i){return this.object3d=new me(i),this},n.createCSS3DObject=function(i){return this.object3d=new w(i),this},n.createCSS3DSprite=function(i){return this.object3d=new F(i),this},n.createSprite=function(i){return this.object3d=new l.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),e=0;e<i;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,q(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),e=0;e<i;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,q(a)),this},n.getSize=function(){var i=new l.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new l.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){Pe(this.object3d)},I(r,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),r}(),ve=function(r){"use strict";T(t,r);var n=D(t);function t(a){C(this,t);var e;return e=n.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,O.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var i=t.prototype;return i.create=function(){var e=this.options,o=e.position,c=e.lookAt,v=e.sprite,m=e.text,f=e.sizeAttenuation;if(v){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:f}));this.object3d=y}else{var _=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),g=new l.PlaneGeometry(1,1,1,1);this.createMesh(g,_)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(m)},i.setText=function(e,o){var c=(0,O.Z)(j((0,O.Z)({},this.options),{text:e}),o||{}),v=c.text,m=c.fontSize,f=c.fontFamily,y=c.fontWeight,_=c.flipX,g=c.scale,h=this.canvas;h.width=m*v.length*2,h.height=m;var u=h.getContext("2d");u.font="".concat(y," ").concat(m,"px/1 ").concat(f);var s=u.measureText(v).width;h.width=s,this.width=s,u=h.getContext("2d"),u.clearRect(0,0,h.width,h.height),_&&u.scale(-1,1),u.font="".concat(y," ").concat(m,"px/1 ").concat(f),u.textBaseline="middle",u.fillStyle="#ffffff",u.fillText(v,_?s*-1:0,h.height/2),u.restore();var x=new l.Texture(h);x.anisotropy=16,x.needsUpdate=!0;var M=this.object3d;M.material.map&&M.material.map.dispose(),M.material.map=x,M.material.needsUpdate=!0,M.scale.set(x.image.width*g,x.image.height*g,1)},t}(re),Le=N(568),et=N(666),le=N.n(et),tt=function(r){"use strict";T(t,r);var n=D(t);function t(a){C(this,t);var e;return e=n.call(this),e.options=a,e}var i=t.prototype;return i.getMaterial=function(){var e=this;return(0,Le.Z)(le().mark(function o(){var c,v,m,f,y,_,g,h,u,s;return le().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return c=e.options,v=c.transparent,m=c.blending,f=c.src,y=c.depthWrite,_=c.alphaTest,g=c.sprite,h=c.sizeAttenuation,M.next=3,new l.TextureLoader().loadAsync(f);case 3:return u=M.sent,s=g?new l.SpriteMaterial({map:u,transparent:v!=null?v:!1,blending:m!=null?m:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:_!=null?_:0,sizeAttenuation:h!=null?h:!0}):new l.MeshBasicMaterial({map:u,transparent:v!=null?v:!1,blending:m!=null?m:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:_!=null?_:0}),M.abrupt("return",s);case 6:case"end":return M.stop()}},o)}))()},i.create=function(){var e=this;return(0,Le.Z)(le().mark(function o(){var c,v,m,f,y,_,g,h;return le().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(c=e.options,v=c.scale,m=c.position,f=c.src,y=c.cache,_=c.sprite,!(y&&!y.get(f))){s.next=7;break}return y.init(f),s.next=5,e.getMaterial();case 5:g=s.sent,y.set(f,g);case 7:if(!y){s.next=13;break}return s.next=10,y.get(f);case 10:s.t0=s.sent,s.next=16;break;case 13:return s.next=15,e.getMaterial();case 15:s.t0=s.sent;case 16:h=s.t0,e.texture=h.map,_?e.createSprite(h):e.createMesh(new l.PlaneBufferGeometry(1,1),h),v&&e.setScale(v),m&&e.object3d.position.copy(m);case 21:case"end":return s.stop()}},o)}))()},i.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},t}(re);function rt(r,n){for(;!Object.prototype.hasOwnProperty.call(r,n)&&(r=z(r),r!==null););return r}function We(r,n,t){return typeof Reflect!="undefined"&&Reflect.get?We=Reflect.get:We=function(a,e,o){var c=rt(a,e);if(!!c){var v=Object.getOwnPropertyDescriptor(c,e);return v.get?v.get.call(o||a):v.value}},We(r,n,t)}function De(r,n,t){return We(r,n,t)}var nt=function(r){"use strict";T(t,r);var n=D(t);function t(a){C(this,t);var e;return e=n.call(this),e.options=(0,O.Z)({},{autoPlay:!0,loop:!0},a),e}var i=t.prototype;return i.getMaterial=function(){var e=this.options,o=e.src,c=e.transparent,v=e.blending,m=e.depthWrite,f=e.format,y=e.autoPlay,_=e.loop,g=e.alphaTest,h=e.sprite,u=Q(),s=document.createElement("video");return s.addEventListener("loadedmetadata",function(){var x=new l.VideoTexture(s);x.format=f!=null?f:l.RGBAFormat,x.needsUpdate=!0;var M=h?new l.SpriteMaterial({map:x,transparent:c!=null?c:!1,blending:v!=null?v:l.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}):new l.MeshBasicMaterial({map:x,transparent:c!=null?c:!1,blending:v!=null?v:l.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0});u.resolve(M)},!1),s.src=o,s.muted=!0,s.autoplay=y,s.loop=_,s.preload="auto",u.promise},i.create=function(){var e=this;return(0,Le.Z)(le().mark(function o(){var c,v,m,f,y,_,g,h;return le().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(c=e.options,v=c.scale,m=c.position,f=c.src,y=c.cache,_=c.sprite,!(y&&!y.get(f))){s.next=7;break}return y.init(f),s.next=5,e.getMaterial();case 5:g=s.sent,y.set(f,g);case 7:if(!y){s.next=13;break}return s.next=10,y.get(f);case 10:s.t0=s.sent,s.next=16;break;case 13:return s.next=15,e.getMaterial();case 15:s.t0=s.sent;case 16:h=s.t0,e.video=h.map.image,_?e.createSprite(h):e.createMesh(new l.PlaneBufferGeometry(1,1),h),v&&e.setScale(v),m&&e.object3d.position.copy(m);case 21:case"end":return s.stop()}},o)}))()},i.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},i.render=function(){var e=this.options.autoPlay;e&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),De(z(t.prototype),"dispose",this).call(this)},t}(re),it=function(r){"use strict";T(t,r);var n=D(t);function t(a){C(this,t);var e;return e=n.call(this),e.options=(0,O.Z)({},a),e}var i=t.prototype;return i.create=function(){var e=this.options,o=e.position,c=e.children,v=e.onClick,m=e.zIndexFix,f=document.createElement("div");f.appendChild(c),this.createCSS2DObject(f),o&&this.object3d.position.copy(o),v&&f.addEventListener("click",v),m&&(this.object3d.userData.zIndexFix=m)},i.getMaterial=function(e){return(0,Le.Z)(le().mark(function o(){var c,v,m,f;return le().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,v=c.getContext("2d"),v.fillStyle="#ff0000",v.fillRect(0,0,256,256),m=new l.CanvasTexture(c),f=new l.SpriteMaterial({map:m,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",f);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(e){var o=e.show,c=o===void 0?!1:o,v=e.scale,m=v===void 0?new l.Vector3(1,1,1):v,f=e.position,y=f===void 0?new l.Vector3(0,0,0):f,_=e.cache,g=this;return(0,Le.Z)(le().mark(function h(){var u,s,x,M;return le().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(u="node-create-pick-object",!(_&&!_.get(u))){A.next=7;break}return _.init(u),A.next=5,g.getMaterial(c);case 5:s=A.sent,_.set(u,s);case 7:if(!_){A.next=13;break}return A.next=10,_.get(u);case 10:A.t0=A.sent,A.next=16;break;case 13:return A.next=15,g.getMaterial(c);case 15:A.t0=A.sent;case 16:x=A.t0,M=new l.Sprite(x),M.scale.set(x.map.image.width*m.x,x.map.image.height*m.y,1),M.position.copy(y),g.add(M),g.pickObject=M;case 22:case"end":return A.stop()}},h)}))()},i.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}De(z(t.prototype),"dispose",this).call(this)},t}(re),at=it,ot=`
|
|
2
|
+
`.concat(l.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(l.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(l.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(l.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),st=`
|
|
99
|
+
`.concat(l.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(l.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(l.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(l.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
|
+
`),ce=function(r){"use strict";T(t,r);var n=D(t);function t(){C(this,t);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new l.Matrix4,Object.defineProperties(W(i),{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)}}}),i}return t}(l.BufferGeometry);ce.prototype.setMatrixWorld=function(r){this.matrixWorld=r},ce.prototype.setGeometry=function(r,n){this._geometry=r,this.setPoints(r.getAttribute("position").array,n)},ce.prototype.setPoints=function(r,n){if(!(r instanceof Float32Array)&&!(r instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=r,this.widthCallback=n,this.positions=[],this.counters=[],r.length&&r[0]instanceof l.Vector3)for(var t=0;t<r.length;t++){var i=r[t],a=t/r.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var t=0;t<r.length;t+=3){var a=t/r.length;this.positions.push(r[t],r[t+1],r[t+2]),this.positions.push(r[t],r[t+1],r[t+2]),this.counters.push(a),this.counters.push(a)}this.process()};function qe(r,n){var t=new l.Matrix4,i=new l.Ray,a=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),r.ray.intersectSphere(a,e)!==!1){t.copy(this.matrixWorld).invert(),i.copy(r.ray).applyMatrix4(t);var c=new l.Vector3,v=new l.Vector3,m=new l.Vector3,f=this instanceof l.LineSegments?2:1,y=o.index,_=o.attributes;if(y!==null)for(var g=y.array,h=_.position.array,u=_.width.array,s=0,x=g.length-1;s<x;s+=f){var M=g[s],L=g[s+1];c.fromArray(h,M*3),v.fromArray(h,L*3);var A=u[Math.floor(s/3)]!==void 0?u[Math.floor(s/3)]:1,ae=r.params.Line.threshold+this.material.lineWidth*A/2,Ae=ae*ae,_e=i.distanceSqToSegment(c,v,e,m);if(!(_e>Ae)){e.applyMatrix4(this.matrixWorld);var ge=r.ray.origin.distanceTo(e);ge<r.near||ge>r.far||(n.push({distance:ge,point:m.clone().applyMatrix4(this.matrixWorld),index:s,face:null,faceIndex:null,object:this}),s=x)}}}}ce.prototype.raycast=qe,ce.prototype.compareV3=function(r,n){var t=r*6,i=n*6;return this.positions[t]===this.positions[i]&&this.positions[t+1]===this.positions[i+1]&&this.positions[t+2]===this.positions[i+2]},ce.prototype.copyV3=function(r){var n=r*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ce.prototype.process=function(){var r=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,t;this.compareV3(0,r-1)?t=this.copyV3(r-2):t=this.copyV3(0),this.previous.push(t[0],t[1],t[2]),this.previous.push(t[0],t[1],t[2]);for(var i=0;i<r;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(r-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(r-1),0),this.uvs.push(i/(r-1),1),i<r-1){t=this.copyV3(i),this.previous.push(t[0],t[1],t[2]),this.previous.push(t[0],t[1],t[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(t=this.copyV3(i),this.next.push(t[0],t[1],t[2]),this.next.push(t[0],t[1],t[2]))}this.compareV3(r-1,0)?t=this.copyV3(1):t=this.copyV3(r-1),this.next.push(t[0],t[1],t[2]),this.next.push(t[0],t[1],t[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ve(r,n,t,i,a){var e;if(r=r.subarray||r.slice?r:r.buffer,t=t.subarray||t.slice?t:t.buffer,r=n?r.subarray?r.subarray(n,a&&n+a):r.slice(n,a&&n+a):r,t.set)t.set(r,i);else for(e=0;e<r.length;e++)t[e+i]=r[e];return t}ce.prototype.advance=function(r){var n=this._attributes.position.array,t=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ve(n,0,t,0,a),Ve(n,6,n,0,a-6),n[a-6]=r.x,n[a-5]=r.y,n[a-4]=r.z,n[a-3]=r.x,n[a-2]=r.y,n[a-1]=r.z,Ve(n,6,i,0,a-6),i[a-6]=r.x,i[a-5]=r.y,i[a-4]=r.z,i[a-3]=r.x,i[a-2]=r.y,i[a-1]=r.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=ot,l.ShaderChunk.meshline_frag=st;var Be=function(r){"use strict";T(t,r);var n=D(t);function t(i){C(this,t);var a;return a=n.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(W(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return t}(l.ShaderMaterial);Be.prototype.copy=function(r){return l.ShaderMaterial.prototype.copy.call(this,r),this.lineWidth=r.lineWidth,this.map=r.map,this.useMap=r.useMap,this.alphaMap=r.alphaMap,this.useAlphaMap=r.useAlphaMap,this.color.copy(r.color),this.opacity=r.opacity,this.resolution.copy(r.resolution),this.sizeAttenuation=r.sizeAttenuation,this.dashArray.copy(r.dashArray),this.dashOffset.copy(r.dashOffset),this.dashRatio.copy(r.dashRatio),this.useDash=r.useDash,this.visibility=r.visibility,this.alphaTest=r.alphaTest,this.repeat.copy(r.repeat),this};function ut(r,n){if(r==null)return{};var t={},i=Object.keys(r),a,e;for(e=0;e<i.length;e++)a=i[e],!(n.indexOf(a)>=0)&&(t[a]=r[a]);return t}function lt(r,n){if(r==null)return{};var t=ut(r,n),i,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);for(a=0;a<e.length;a++)i=e[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,i)||(t[i]=r[i]))}return t}var ct=require("popmotion"),ht={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},ft=function(r){"use strict";T(t,r);var n=D(t);function t(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,t);var e;return e=n.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ce,e.options=(0,O.Z)({},ht,a),e}var i=t.prototype;return i.create=function(){var e=this.options,o=e.nodes,c=e.duration,v=e.delay,m=e.onComplete,f=e.setPointWidth,y=lt(e,["nodes","duration","delay","onComplete","setPointWidth"]),_=this.pencil.getSize(),g=_.width,h=_.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,f);var u=new Be(j((0,O.Z)({},y),{resolution:new l.Vector2(g,h)}));this.material=u,this.createMesh(this.meshline,u)},i.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},i.animate=function(){var e=this.options,o=e.duration,c=e.delay,v=e.onComplete,m=this.material.uniforms.offset,f=c!=null?c:0,y=(0,ct.animate)({from:m.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-f,repeat:1/0,onComplete:v,onUpdate:function(_){m.value=_}});this.tween=y},i.dispose=function(){De(z(t.prototype),"dispose",this).call(this),this.tween.stop()},t}(re);function pt(r){if(Array.isArray(r))return r}function vt(){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 he(r,n){return pt(r)||ee(r,n)||J(r,n)||vt()}var Oe=require("d3-array"),dt=require("earcut"),Ge=N.n(dt),mt=require("@turf/boolean-clockwise"),gt=N.n(mt);function yt(r,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-r)*Math.PI/180;return[t*Math.sin(i)*Math.cos(a),t*Math.cos(i),t*Math.sin(i)*Math.sin(a)]}var bt=require("delaunator"),_t=N.n(bt),wt=require("@turf/boolean-point-in-polygon"),xt=N.n(wt),ke=require("d3-geo"),Mt=require("d3-geo-voronoi"),Xe=require("d3-scale");function St(r,n){return r.map(function(t){var i=[],a;return t.forEach(function(e){if(a){var o=(0,ke.geoDistance)(e,a)*180/Math.PI;if(o>n)for(var c=(0,ke.geoInterpolate)(a,e),v=1/Math.ceil(o/n),m=v;m<1;)i.push(c(m)),m+=v}i.push(a=e)}),i})}function Pt(r){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=n.minLng,i=n.maxLng,a=n.minLat,e=n.maxLat,o=Math.round(Math.pow(360/r,2)/Math.PI),c=(1+Math.sqrt(5))/2,v=function(s){return s/c*360%360-180},m=function(s){return Math.acos(2*s/o-1)/Math.PI*180-90},f=function(s){return o*(Math.cos((s+90)*Math.PI/180)+1)/2},y=[e!==void 0?Math.ceil(f(e)):0,a!==void 0?Math.floor(f(a)):o-1],_=t===void 0&&i===void 0?function(){return!0}:t===void 0?function(s){return s<=i}:i===void 0?function(s){return s>=t}:i>=t?function(s){return s>=t&&s<=i}:function(s){return s>=t||s<=i},g=[],h=y[0];h<=y[1];h++){var u=v(h);_(u)&&g.push([u,m(h)])}return g}function Ue(r,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t?(0,ke.geoContains)(n,r):xt()(r,n)}function Ot(r,n){var t={type:"Polygon",coordinates:r},i=he((0,ke.geoBounds)(t),2),a=he(i[0],2),e=a[0],o=a[1],c=he(i[1],2),v=c[0],m=c[1];if(Math.min(Math.abs(v-e),Math.abs(m-o))<n)return[];var f=e>v||m>=89||o<=-89;return Pt(n,{minLng:e,maxLng:v,minLat:o,maxLat:m}).filter(function(y){return Ue(y,t,f)})}function At(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=n.resolution,i=t===void 0?1/0:t,a=St(r,i),e=(0,Oe.merge)(a),o=Ot(r,i),c=q(e).concat(q(o)),v={type:"Polygon",coordinates:r},m=he((0,ke.geoBounds)(v),2),f=he(m[0],2),y=f[0],_=f[1],g=he(m[1],2),h=g[0],u=g[1],s=y>h||u>=89||_<=-89,x=[];if(s){var M=(0,Mt.geoVoronoi)(c).triangles(),L=new Map(c.map(function(oe,ye){var de=he(oe,2),se=de[0],Re=de[1];return["".concat(se,"-").concat(Re),ye]}));M.features.forEach(function(oe){var ye,de=oe.geometry.coordinates[0].slice(0,3).reverse(),se=[];if(de.forEach(function(Te){var fe=he(Te,2),Ze=fe[0],zt=fe[1],Qe="".concat(Ze,"-").concat(zt);L.has(Qe)&&se.push(L.get(Qe))}),se.length===3){if(se.some(function(Te){return Te<e.length})){var Re=oe.properties.circumcenter;if(!Ue(Re,v,s))return}(ye=x).push.apply(ye,q(se))}})}else if(o.length)for(var ge=function(oe,ye){var de,se=[2,1,0].map(function(fe){return we.triangles[oe+fe]}),Re=se.map(function(fe){return c[fe]});if(se.some(function(fe){return fe<e.length})){var Te=[0,1].map(function(fe){return(0,Oe.mean)(Re,function(Ze){return Ze[fe]})});if(!Ue(Te,v,s))return"continue"}(de=x).push.apply(de,q(se))},we=_t().from(c),Ce=0,Ee=we.triangles.length;Ce<Ee;Ce+=3)ge(Ce,Ee);else{var A=Ge().flatten(a),ae=A.vertices,Ae=A.holes,_e=Ae===void 0?[]:Ae;x=Ge()(ae,_e,2)}var Ne=(0,Xe.scaleLinear)((0,Oe.extent)(c,function(oe){return oe[0]}),[0,1]),Rt=(0,Xe.scaleLinear)((0,Oe.extent)(c,function(oe){return oe[1]}),[0,1]),Tt=c.map(function(oe){var ye=he(oe,2),de=ye[0],se=ye[1];return[Ne(de),Rt(se)]}),Wt={points:c,indices:x,uvs:Tt};return{contour:a,triangles:Wt}}var Ct=At,Ye=new l.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(r,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=r.map(function(a){return a.map(function(e){var o=he(e,2),c=o[0],v=o[1];return t?yt(c,v,n):[c,v,n]})});return Ge().flatten(i)}function $e(r,n,t){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(r,n,i),e=a.vertices,o=a.holes,c=Ie(r,t,i),v=c.vertices,m=(0,Oe.merge)([v,e]),f=Math.round(v.length/3),y=new Set(o),_=0,g=[],h=0;h<f;h++){var u=h+1;if(u===f)u=_;else if(y.has(u)){var s=u;u=_,_=s}g.push(h,h+f,u+f),g.push(u+f,u,h)}for(var x=[],M=1;M>=0;M--)for(var L=0;L<f;L+=1)x.push(L/(f-1),M);return{indices:g,vertices:m,uvs:x,topVerts:v}}function Ke(r,n,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?r.indices:r.indices.slice().reverse(),vertices:Ie([r.points],n,a).vertices,uvs:t}}var jt=function(r){"use strict";T(t,r);var n=D(t);function t(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,t);var e;e=n.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,O.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,c=o.startHeight,v=o.endHeight,m=o.closedBottom,f=o.closedTop,y=o.includeSides,_=o.curvatureResolution,g=o.cartesian,h=o.userDataRsoOffset;gt()(i[0])||i[0].reverse();var u=Ct(i,{resolution:_}),s=u.contour,x=u.triangles,M=(0,Oe.merge)(x.uvs),L=[],A=[],ae=[],Ae=0,_e=function(we){var Ce=Math.round(L.length/3),Ee=ae.length;L=L.concat(we.vertices),A=A.concat(we.uvs),ae=ae.concat(Ce?we.indices.map(function(Ne){return Ne+Ce}):we.indices),e.addGroup(Ee,ae.length-Ee,Ae++)};if(y){var ge=$e(s,c,v,g);_e(ge),e.userData.rso=h?$e(s,c,v+h,g):ge}return m&&_e(Ke(x,c,M,!1,g)),f&&_e(Ke(x,v,M,!0,g)),e.setIndex(ae),e[Ye]("position",new l.Float32BufferAttribute(L,3)),e[Ye]("uv",new l.Float32BufferAttribute(A,2)),e.computeVertexNormals(),e}return t}(l.BufferGeometry),Lt=function(r){"use strict";T(t,r);var n=D(t);function t(a){C(this,t);var e;return e=n.call(this),e.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var i=t.prototype;return i.create=function(){var e=this.options,o=e.startHeight,c=e.height,v=e.closedBottom,m=e.closedTop,f=e.curvatureResolution,y=e.userDataRsoOffset,_=e.cartesian,g=new jt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:v,closedTop:m,curvatureResolution:f,cartesian:_,userDataRsoOffset:y});this.createMesh(g,this.options.material)},t}(re),Fe=new Map,kt={generateTopUV:function(r,n,t,i,a){var e=n[t*3],o=n[t*3+1],c=n[i*3],v=n[i*3+1],m=n[a*3],f=n[a*3+1],y;if(Fe.has(r))y=Fe.get(r);else{var _,g,h,u,s=r.parameters.shapes.getPoints();y={minX:(_=Math).min.apply(_,q(s.map(function(L){var A=L.x;return A}))),maxX:(g=Math).max.apply(g,q(s.map(function(L){var A=L.x;return A}))),minY:(h=Math).min.apply(h,q(s.map(function(L){var A=L.y;return A}))),maxY:(u=Math).max.apply(u,q(s.map(function(L){var A=L.y;return A})))},Fe.set(r,y)}var x=y.maxX-y.minX,M=y.maxY-y.minY;return[new l.Vector2((e-y.minX)/x,1-(o-y.minY)/M),new l.Vector2((c-y.minX)/x,1-(v-y.minY)/M),new l.Vector2((m-y.minX)/x,1-(f-y.minY)/M)]},generateSideWallUV:function(r,n,t,i,a,e){var o=n[t*3],c=n[t*3+1],v=n[t*3+2],m=n[i*3],f=n[i*3+1],y=n[i*3+2],_=n[a*3],g=n[a*3+1],h=n[a*3+2],u=n[e*3],s=n[e*3+1],x=n[e*3+2];return Math.abs(c-f)<.01?[new l.Vector2(o,1-v),new l.Vector2(m,1-y),new l.Vector2(_,1-h),new l.Vector2(u,1-x)]:[new l.Vector2(c,1-v),new l.Vector2(f,1-y),new l.Vector2(g,1-h),new l.Vector2(s,1-x)]}},Et=function(r){"use strict";T(t,r);var n=D(t);function t(a){C(this,t);var e;return e=n.call(this),e.options=(0,O.Z)({},a),e}var i=t.prototype;return i.create=function(){var e=this.options,o=e.points,c=e.depth,v=e.material,m=new l.ExtrudeBufferGeometry(new l.Shape(o),{depth:c,bevelEnabled:!1,UVGenerator:kt});this.createMesh(m,v)},t}(re)})(),module.exports=ze})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import*as Je from"idb-keyval";import*as k from"three";import*as Vt from"three/examples/jsm/renderers/CSS2DRenderer";import*as Qe from"three/examples/jsm/renderers/CSS3DRenderer";import*as Wt from"popmotion";import*as Ie from"d3-array";import*as Gt from"earcut";import*as zt from"@turf/boolean-clockwise";import*as Ut from"delaunator";import*as Nt from"@turf/boolean-point-in-polygon";import*as Be from"d3-geo";import*as Ft from"d3-geo-voronoi";import*as It from"d3-scale";var Zt={666:function(O){var E=function(x){"use strict";var T=Object.prototype,A=T.hasOwnProperty,j,S=typeof Symbol=="function"?Symbol:{},z=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",V=S.toStringTag||"@@toStringTag";function B(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{B({},"")}catch(f){B=function(u,p,M){return u[p]=M}}function J(f,u,p,M){var y=u&&u.prototype instanceof U?u:U,N=Object.create(y.prototype),G=new Ce(M||[]);return N._invoke=ye(f,p,G),N}x.wrap=J;function Q(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(M){return{type:"throw",arg:M}}}var D="suspendedStart",s="suspendedYield",pe="executing",te="completed",X={};function U(){}function H(){}function L(){}var $={};B($,z,function(){return this});var K=Object.getPrototypeOf,ne=K&&K(K(Te([])));ne&&ne!==T&&A.call(ne,z)&&($=ne);var q=L.prototype=U.prototype=Object.create($);H.prototype=L,B(q,"constructor",L),B(L,"constructor",H),H.displayName=B(L,V,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(u){B(f,u,function(p){return this._invoke(u,p)})})}x.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===H||(u.displayName||u.name)==="GeneratorFunction":!1},x.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,L):(f.__proto__=L,B(f,V,"GeneratorFunction")),f.prototype=Object.create(q),f},x.awrap=function(f){return{__await:f}};function se(f,u){function p(N,G,ee,re){var Y=Q(f[N],f,G);if(Y.type==="throw")re(Y.arg);else{var be=Y.arg,we=be.value;return we&&typeof we=="object"&&A.call(we,"__await")?u.resolve(we.__await).then(function(ve){p("next",ve,ee,re)},function(ve){p("throw",ve,ee,re)}):u.resolve(we).then(function(ve){be.value=ve,ee(be)},function(ve){return p("throw",ve,ee,re)})}}var M;function y(N,G){function ee(){return new u(function(re,Y){p(N,G,re,Y)})}return M=M?M.then(ee,ee):ee()}this._invoke=y}I(se.prototype),B(se.prototype,Z,function(){return this}),x.AsyncIterator=se,x.async=function(f,u,p,M,y){y===void 0&&(y=Promise);var N=new se(J(f,u,p,M),y);return x.isGeneratorFunction(u)?N:N.next().then(function(G){return G.done?G.value:N.next()})};function ye(f,u,p){var M=D;return function(N,G){if(M===pe)throw new Error("Generator is already running");if(M===te){if(N==="throw")throw G;return Le()}for(p.method=N,p.arg=G;;){var ee=p.delegate;if(ee){var re=Oe(ee,p);if(re){if(re===X)continue;return re}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===D)throw M=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=pe;var Y=Q(f,u,p);if(Y.type==="normal"){if(M=p.done?te:s,Y.arg===X)continue;return{value:Y.arg,done:p.done}}else Y.type==="throw"&&(M=te,p.method="throw",p.arg=Y.arg)}}}function Oe(f,u){var p=f.iterator[u.method];if(p===j){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=j,Oe(f,u),u.method==="throw"))return X;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var M=Q(p,f.iterator,u.arg);if(M.type==="throw")return u.method="throw",u.arg=M.arg,u.delegate=null,X;var y=M.arg;if(!y)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,X;if(y.done)u[f.resultName]=y.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=j);else return y;return u.delegate=null,X}I(q),B(q,V,"Generator"),B(q,z,function(){return this}),B(q,"toString",function(){return"[object Generator]"});function ie(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function me(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function Ce(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(ie,this),this.reset(!0)}x.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function M(){for(;u.length;){var y=u.pop();if(y in f)return M.value=y,M.done=!1,M}return M.done=!0,M}};function Te(f){if(f){var u=f[z];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,M=function y(){for(;++p<f.length;)if(A.call(f,p))return y.value=f[p],y.done=!1,y;return y.value=j,y.done=!0,y};return M.next=M}}return{next:Le}}x.values=Te;function Le(){return{value:j,done:!0}}return Ce.prototype={constructor:Ce,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(me),!f)for(var u in this)u.charAt(0)==="t"&&A.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=j)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(re,Y){return N.type="throw",N.arg=f,u.next=re,Y&&(u.method="next",u.arg=j),!!Y}for(var M=this.tryEntries.length-1;M>=0;--M){var y=this.tryEntries[M],N=y.completion;if(y.tryLoc==="root")return p("end");if(y.tryLoc<=this.prev){var G=A.call(y,"catchLoc"),ee=A.call(y,"finallyLoc");if(G&&ee){if(this.prev<y.catchLoc)return p(y.catchLoc,!0);if(this.prev<y.finallyLoc)return p(y.finallyLoc)}else if(G){if(this.prev<y.catchLoc)return p(y.catchLoc,!0)}else if(ee){if(this.prev<y.finallyLoc)return p(y.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var y=M;break}}y&&(f==="break"||f==="continue")&&y.tryLoc<=u&&u<=y.finallyLoc&&(y=null);var N=y?y.completion:{};return N.type=f,N.arg=u,y?(this.method="next",this.next=y.finallyLoc,X):this.complete(N)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),X},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),me(p),X}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var M=p.completion;if(M.type==="throw"){var y=M.arg;me(p)}return y}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:Te(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=j),X}},x}(O.exports);try{regeneratorRuntime=E}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=E:Function("r","regeneratorRuntime = r")(E)}},182:function(O,E,x){x.d(E,{Z:function(){return T}});function T(A){if(A.geometry&&A.geometry.dispose(),A.material){var j=Array.isArray(A.material)?A.material:[A.material];j.forEach(function(S){var z,Z,V,B,J,Q,D,s,pe,te,X,U,H;(z=S.map)===null||z===void 0||z.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(V=S.bumpMap)===null||V===void 0||V.dispose(),(B=S.normalMap)===null||B===void 0||B.dispose(),(J=S.specularMap)===null||J===void 0||J.dispose(),(Q=S.envMap)===null||Q===void 0||Q.dispose(),(D=S.alphaMap)===null||D===void 0||D.dispose(),(s=S.aoMap)===null||s===void 0||s.dispose(),(pe=S.displacementMap)===null||pe===void 0||pe.dispose(),(te=S.emissiveMap)===null||te===void 0||te.dispose(),(X=S.gradientMap)===null||X===void 0||X.dispose(),(U=S.metalnessMap)===null||U===void 0||U.dispose(),(H=S.roughnessMap)===null||H===void 0||H.dispose(),S.dispose()})}}},175:function(O,E,x){x.d(E,{wf:function(){return S.Z}});var T=x(666),A=x.n(T),j=null,S=x(182),z=x(949);function Z(U){if(U.material){var H=Array.isArray(U.material)?U.material:[U.material];H.forEach(function(L){var $,K;($=L.color)===null||$===void 0||$.convertSRGBToLinear(),(K=L.emissive)===null||K===void 0||K.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var V=x(568),B=x(924),J=U=>{var H={};return x.d(H,U),H},Q=U=>()=>U,D=J({get:()=>Je.get,set:()=>Je.set}),s=x(620),pe=null,te=null,X=function(){var U=(0,V.Z)(A().mark(function H(L,$){var K,ne,q,I,se,ye;return A().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return K=$.version,ie.next=4,(0,D.get)(L);case 4:if(q=ie.sent,!(q&&q[K])){ie.next=9;break}ne=q[K],ie.next=15;break;case 9:return ie.next=11,(0,s.Z)(fetch(L).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:I=ie.sent,se=I.res,ye=I.err,ye||(ne=se,(0,D.set)(L,(0,B.Z)({},K,se)));case 15:return ie.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:L});case 16:case"end":return ie.stop()}},H)}));return function(L,$){return U.apply(this,arguments)}}()},620:function(O,E,x){x.d(E,{Z:function(){return A}});var T=x(42);function A(j){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(z){return(0,T.Z)({err:null,res:z},S)}).catch(function(z){return(0,T.Z)({err:z,res:void 0},S)})}},949:function(O,E,x){var T=j=>{var S={};return x.d(S,j),S},A=j=>()=>j;O.exports=T({Box3:()=>k.Box3,BufferAttribute:()=>k.BufferAttribute,BufferGeometry:()=>k.BufferGeometry,CanvasTexture:()=>k.CanvasTexture,Color:()=>k.Color,DoubleSide:()=>k.DoubleSide,ExtrudeBufferGeometry:()=>k.ExtrudeBufferGeometry,Float32BufferAttribute:()=>k.Float32BufferAttribute,Group:()=>k.Group,LineSegments:()=>k.LineSegments,Matrix4:()=>k.Matrix4,Mesh:()=>k.Mesh,MeshBasicMaterial:()=>k.MeshBasicMaterial,NormalBlending:()=>k.NormalBlending,PlaneBufferGeometry:()=>k.PlaneBufferGeometry,PlaneGeometry:()=>k.PlaneGeometry,Points:()=>k.Points,RGBAFormat:()=>k.RGBAFormat,Ray:()=>k.Ray,ShaderChunk:()=>k.ShaderChunk,ShaderMaterial:()=>k.ShaderMaterial,Shape:()=>k.Shape,Sphere:()=>k.Sphere,Sprite:()=>k.Sprite,SpriteMaterial:()=>k.SpriteMaterial,Texture:()=>k.Texture,TextureLoader:()=>k.TextureLoader,UniformsLib:()=>k.UniformsLib,Vector2:()=>k.Vector2,Vector3:()=>k.Vector3,VideoTexture:()=>k.VideoTexture})},568:function(O,E,x){x.d(E,{Z:function(){return A}});function T(j,S,z,Z,V,B,J){try{var Q=j[B](J),D=Q.value}catch(s){z(s);return}Q.done?S(D):Promise.resolve(D).then(Z,V)}function A(j){return function(){var S=this,z=arguments;return new Promise(function(Z,V){var B=j.apply(S,z);function J(D){T(B,Z,V,J,Q,"next",D)}function Q(D){T(B,Z,V,J,Q,"throw",D)}J(void 0)})}}},924:function(O,E,x){x.d(E,{Z:function(){return T}});function T(A,j,S){return j in A?Object.defineProperty(A,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):A[j]=S,A}},42:function(O,E,x){x.d(E,{Z:function(){return A}});var T=x(924);function A(j){for(var S=1;S<arguments.length;S++){var z=arguments[S]!=null?arguments[S]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(V){return Object.getOwnPropertyDescriptor(z,V).enumerable}))),Z.forEach(function(V){(0,T.Z)(j,V,z[V])})}return j}}},qe={};function W(O){var E=qe[O];if(E!==void 0)return E.exports;var x=qe[O]={exports:{}};return Zt[O](x,x.exports,W),x.exports}(function(){W.n=function(O){var E=O&&O.__esModule?function(){return O.default}:function(){return O};return W.d(E,{a:E}),E}})(),function(){W.d=function(O,E){for(var x in E)W.o(E,x)&&!W.o(O,x)&&Object.defineProperty(O,x,{enumerable:!0,get:E[x]})}}(),function(){W.o=function(O,E){return Object.prototype.hasOwnProperty.call(O,E)}}();var ue={};(function(){W.d(ue,{Ei:function(){return Et},Yo:function(){return Rt},Ee:function(){return ee},x1:function(){return ut},VJ:function(){return ce},r7:function(){return Ve},XA:function(){return Ze},NB:function(){return et},xv:function(){return M},nk:function(){return we}});function O(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function E(e,n){return E=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},E(e,n)}function x(e,n){return E(e,n)}function T(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&x(e,n)}var A=W(42);function j(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function S(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function z(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function V(e){return Z(e)}function B(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Q(e,n){return n&&(J(n)==="object"||typeof n=="function")?n:B(e)}function D(e){var n=z();return function(){var i=V(e),a;if(n){var t=V(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return Q(this,a)}}var s=W(949);function pe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function te(e,n,r){return pe()?te=Reflect.construct:te=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&x(v,o.prototype),v},te.apply(null,arguments)}function X(e,n,r){return te.apply(null,arguments)}function U(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function H(e,n,r){return n&&U(e.prototype,n),r&&U(e,r),e}function L(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function $(e){if(Array.isArray(e))return L(e)}function K(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ne(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(e,n){if(!!e){if(typeof e=="string")return L(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(e,n)}}function I(e){return $(e)||K(e)||q(e)||ne()}var se=W(620);function ye(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,se.Z)(r.promise,n)),r}var Oe=e=>{var n={};return W.d(n,e),n},ie=e=>()=>e,me=Oe({CSS2DObject:()=>Vt.CSS2DObject}),Ce=e=>{var n={};return W.d(n,e),n},Te=e=>()=>e,Le=Ce({CSS3DObject:()=>Qe.CSS3DObject,CSS3DSprite:()=>Qe.CSS3DSprite}),f=W(175),u=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){O(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ye(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=X(s.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=X(s.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new me.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Le.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Le.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},H(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),M=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,m=t.sizeAttenuation;if(h){var d=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=d}else{var _=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,_)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,A.Z)(S((0,A.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,m=c.fontFamily,d=c.fontWeight,_=c.flipX,b=c.scale,g=this.canvas;g.width=v*h.length*2,g.height=v;var w=g.getContext("2d");w.font="".concat(d," ").concat(v,"px/1 ").concat(m);var l=w.measureText(h).width;g.width=l,this.width=l,w=g.getContext("2d"),w.clearRect(0,0,g.width,g.height),_&&w.scale(-1,1),w.font="".concat(d," ").concat(v,"px/1 ").concat(m),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,_?l*-1:0,g.height/2),w.restore();var P=new s.Texture(g);P.anisotropy=16,P.needsUpdate=!0;var C=this.object3d;C.material.map&&C.material.map.dispose(),C.material.map=P,C.material.needsUpdate=!0,C.scale.set(P.image.width*b,P.image.height*b,1)},r}(p),y=W(568),N=W(666),G=W.n(N),ee=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,y.Z)(G().mark(function o(){var c,h,v,m,d,_,b,g,w,l;return G().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return c=t.options,h=c.transparent,v=c.blending,m=c.src,d=c.depthWrite,_=c.alphaTest,b=c.sprite,g=c.sizeAttenuation,C.next=3,new s.TextureLoader().loadAsync(m);case 3:return w=C.sent,l=b?new s.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:_!=null?_:0,sizeAttenuation:g!=null?g:!0}):new s.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:_!=null?_:0}),C.abrupt("return",l);case 6:case"end":return C.stop()}},o)}))()},i.create=function(){var t=this;return(0,y.Z)(G().mark(function o(){var c,h,v,m,d,_,b,g;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,m=c.src,d=c.cache,_=c.sprite,!(d&&!d.get(m))){l.next=7;break}return d.init(m),l.next=5,t.getMaterial();case 5:b=l.sent,d.set(m,b);case 7:if(!d){l.next=13;break}return l.next=10,d.get(m);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:g=l.t0,t.texture=g.map,_?t.createSprite(g):t.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function re(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=V(e),e!==null););return e}function Y(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?Y=Reflect.get:Y=function(a,t,o){var c=re(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},Y(e,n,r)}function be(e,n,r){return Y(e,n,r)}var we=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,m=t.format,d=t.autoPlay,_=t.loop,b=t.alphaTest,g=t.sprite,w=ye(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var P=new s.VideoTexture(l);P.format=m!=null?m:s.RGBAFormat,P.needsUpdate=!0;var C=g?new s.SpriteMaterial({map:P,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:P,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});w.resolve(C)},!1),l.src=o,l.muted=!0,l.autoplay=d,l.loop=_,l.preload="auto",w.promise},i.create=function(){var t=this;return(0,y.Z)(G().mark(function o(){var c,h,v,m,d,_,b,g;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,m=c.src,d=c.cache,_=c.sprite,!(d&&!d.get(m))){l.next=7;break}return d.init(m),l.next=5,t.getMaterial();case 5:b=l.sent,d.set(m,b);case 7:if(!d){l.next=13;break}return l.next=10,d.get(m);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:g=l.t0,t.video=g.map.image,_?t.createSprite(g):t.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),be(V(r.prototype),"dispose",this).call(this)},r}(p),ve=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,m=document.createElement("div");m.appendChild(c),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&m.addEventListener("click",h),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,y.Z)(G().mark(function o(){var c,h,v,m;return G().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),m=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",m);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,m=t.position,d=m===void 0?new s.Vector3(0,0,0):m,_=t.cache,b=this;return(0,y.Z)(G().mark(function g(){var w,l,P,C;return G().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(w="node-create-pick-object",!(_&&!_.get(w))){R.next=7;break}return _.init(w),R.next=5,b.getMaterial(c);case 5:l=R.sent,_.set(w,l);case 7:if(!_){R.next=13;break}return R.next=10,_.get(w);case 10:R.t0=R.sent,R.next=16;break;case 13:return R.next=15,b.getMaterial(c);case 15:R.t0=R.sent;case 16:P=R.t0,C=new s.Sprite(P),C.scale.set(P.map.image.width*v.x,P.map.image.height*v.y,1),C.position.copy(d),b.add(C),b.pickObject=C;case 22:case"end":return R.stop()}},g)}))()},i.dispose=function(){var t=this.options.onClick;if(t){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",t)}be(V(r.prototype),"dispose",this).call(this)},r}(p),et=ve,tt=`
|
|
2
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
import*as tt from"idb-keyval";import*as T from"three";import*as Zt from"popmotion";import*as Ke from"d3-array";import*as Xt from"earcut";import*as Ht from"@turf/boolean-clockwise";import*as Kt from"delaunator";import*as Yt from"@turf/boolean-point-in-polygon";import*as Ve from"d3-geo";import*as $t from"d3-geo-voronoi";import*as Qt from"d3-scale";var qt={666:function(E){var j=function(S){"use strict";var B=Object.prototype,O=B.hasOwnProperty,R,P=typeof Symbol=="function"?Symbol:{},G=P.iterator||"@@iterator",X=P.asyncIterator||"@@asyncIterator",V=P.toStringTag||"@@toStringTag";function D(d,p,_){return Object.defineProperty(d,p,{value:_,enumerable:!0,configurable:!0,writable:!0}),d[p]}try{D({},"")}catch(d){D=function(p,_,A){return p[_]=A}}function Q(d,p,_,A){var w=p&&p.prototype instanceof F?p:F,N=Object.create(w.prototype),z=new Ae(A||[]);return N._invoke=we(d,_,z),N}S.wrap=Q;function q(d,p,_){try{return{type:"normal",arg:d.call(p,_)}}catch(A){return{type:"throw",arg:A}}}var W="suspendedStart",l="suspendedYield",de="executing",re="completed",H={};function F(){}function K(){}function L(){}var $={};D($,G,function(){return this});var Y=Object.getPrototypeOf,ne=Y&&Y(Y(Pe([])));ne&&ne!==B&&O.call(ne,G)&&($=ne);var J=L.prototype=F.prototype=Object.create($);K.prototype=L,D(J,"constructor",L),D(L,"constructor",K),K.displayName=D(L,V,"GeneratorFunction");function I(d){["next","throw","return"].forEach(function(p){D(d,p,function(_){return this._invoke(p,_)})})}S.isGeneratorFunction=function(d){var p=typeof d=="function"&&d.constructor;return p?p===K||(p.displayName||p.name)==="GeneratorFunction":!1},S.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,L):(d.__proto__=L,D(d,V,"GeneratorFunction")),d.prototype=Object.create(J),d},S.awrap=function(d){return{__await:d}};function le(d,p){function _(N,z,ee,ie){var te=q(d[N],d,z);if(te.type==="throw")ie(te.arg);else{var Oe=te.arg,ae=Oe.value;return ae&&typeof ae=="object"&&O.call(ae,"__await")?p.resolve(ae.__await).then(function(ge){_("next",ge,ee,ie)},function(ge){_("throw",ge,ee,ie)}):p.resolve(ae).then(function(ge){Oe.value=ge,ee(Oe)},function(ge){return _("throw",ge,ee,ie)})}}var A;function w(N,z){function ee(){return new p(function(ie,te){_(N,z,ie,te)})}return A=A?A.then(ee,ee):ee()}this._invoke=w}I(le.prototype),D(le.prototype,X,function(){return this}),S.AsyncIterator=le,S.async=function(d,p,_,A,w){w===void 0&&(w=Promise);var N=new le(Q(d,p,_,A),w);return S.isGeneratorFunction(p)?N:N.next().then(function(z){return z.done?z.value:N.next()})};function we(d,p,_){var A=W;return function(N,z){if(A===de)throw new Error("Generator is already running");if(A===re){if(N==="throw")throw z;return ke()}for(_.method=N,_.arg=z;;){var ee=_.delegate;if(ee){var ie=Se(ee,_);if(ie){if(ie===H)continue;return ie}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(A===W)throw A=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);A=de;var te=q(d,p,_);if(te.type==="normal"){if(A=_.done?re:l,te.arg===H)continue;return{value:te.arg,done:_.done}}else te.type==="throw"&&(A=re,_.method="throw",_.arg=te.arg)}}}function Se(d,p){var _=d.iterator[p.method];if(_===R){if(p.delegate=null,p.method==="throw"){if(d.iterator.return&&(p.method="return",p.arg=R,Se(d,p),p.method==="throw"))return H;p.method="throw",p.arg=new TypeError("The iterator does not provide a 'throw' method")}return H}var A=q(_,d.iterator,p.arg);if(A.type==="throw")return p.method="throw",p.arg=A.arg,p.delegate=null,H;var w=A.arg;if(!w)return p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,H;if(w.done)p[d.resultName]=w.value,p.next=d.nextLoc,p.method!=="return"&&(p.method="next",p.arg=R);else return w;return p.delegate=null,H}I(J),D(J,V,"Generator"),D(J,G,function(){return this}),D(J,"toString",function(){return"[object Generator]"});function Z(d){var p={tryLoc:d[0]};1 in d&&(p.catchLoc=d[1]),2 in d&&(p.finallyLoc=d[2],p.afterLoc=d[3]),this.tryEntries.push(p)}function me(d){var p=d.completion||{};p.type="normal",delete p.arg,d.completion=p}function Ae(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(Z,this),this.reset(!0)}S.keys=function(d){var p=[];for(var _ in d)p.push(_);return p.reverse(),function A(){for(;p.length;){var w=p.pop();if(w in d)return A.value=w,A.done=!1,A}return A.done=!0,A}};function Pe(d){if(d){var p=d[G];if(p)return p.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var _=-1,A=function w(){for(;++_<d.length;)if(O.call(d,_))return w.value=d[_],w.done=!1,w;return w.value=R,w.done=!0,w};return A.next=A}}return{next:ke}}S.values=Pe;function ke(){return{value:R,done:!0}}return Ae.prototype={constructor:Ae,reset:function(d){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(me),!d)for(var p in this)p.charAt(0)==="t"&&O.call(this,p)&&!isNaN(+p.slice(1))&&(this[p]=R)},stop:function(){this.done=!0;var d=this.tryEntries[0],p=d.completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var p=this;function _(ie,te){return N.type="throw",N.arg=d,p.next=ie,te&&(p.method="next",p.arg=R),!!te}for(var A=this.tryEntries.length-1;A>=0;--A){var w=this.tryEntries[A],N=w.completion;if(w.tryLoc==="root")return _("end");if(w.tryLoc<=this.prev){var z=O.call(w,"catchLoc"),ee=O.call(w,"finallyLoc");if(z&&ee){if(this.prev<w.catchLoc)return _(w.catchLoc,!0);if(this.prev<w.finallyLoc)return _(w.finallyLoc)}else if(z){if(this.prev<w.catchLoc)return _(w.catchLoc,!0)}else if(ee){if(this.prev<w.finallyLoc)return _(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(d,p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.tryLoc<=this.prev&&O.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var w=A;break}}w&&(d==="break"||d==="continue")&&w.tryLoc<=p&&p<=w.finallyLoc&&(w=null);var N=w?w.completion:{};return N.type=d,N.arg=p,w?(this.method="next",this.next=w.finallyLoc,H):this.complete(N)},complete:function(d,p){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&p&&(this.next=p),H},finish:function(d){for(var p=this.tryEntries.length-1;p>=0;--p){var _=this.tryEntries[p];if(_.finallyLoc===d)return this.complete(_.completion,_.afterLoc),me(_),H}},catch:function(d){for(var p=this.tryEntries.length-1;p>=0;--p){var _=this.tryEntries[p];if(_.tryLoc===d){var A=_.completion;if(A.type==="throw"){var w=A.arg;me(_)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(d,p,_){return this.delegate={iterator:Pe(d),resultName:p,nextLoc:_},this.method==="next"&&(this.arg=R),H}},S}(E.exports);try{regeneratorRuntime=j}catch(S){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},182:function(E,j,S){S.d(j,{Z:function(){return B}});function B(O){if(O.geometry&&O.geometry.dispose(),O.material){var R=Array.isArray(O.material)?O.material:[O.material];R.forEach(function(P){var G,X,V,D,Q,q,W,l,de,re,H,F,K;(G=P.map)===null||G===void 0||G.dispose(),(X=P.lightMap)===null||X===void 0||X.dispose(),(V=P.bumpMap)===null||V===void 0||V.dispose(),(D=P.normalMap)===null||D===void 0||D.dispose(),(Q=P.specularMap)===null||Q===void 0||Q.dispose(),(q=P.envMap)===null||q===void 0||q.dispose(),(W=P.alphaMap)===null||W===void 0||W.dispose(),(l=P.aoMap)===null||l===void 0||l.dispose(),(de=P.displacementMap)===null||de===void 0||de.dispose(),(re=P.emissiveMap)===null||re===void 0||re.dispose(),(H=P.gradientMap)===null||H===void 0||H.dispose(),(F=P.metalnessMap)===null||F===void 0||F.dispose(),(K=P.roughnessMap)===null||K===void 0||K.dispose(),P.dispose()})}}},175:function(E,j,S){S.d(j,{wf:function(){return P.Z}});var B=S(666),O=S.n(B),R=null,P=S(182),G=S(949);function X(F){if(F.material){var K=Array.isArray(F.material)?F.material:[F.material];K.forEach(function(L){var $,Y;($=L.color)===null||$===void 0||$.convertSRGBToLinear(),(Y=L.emissive)===null||Y===void 0||Y.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var V=S(568),D=S(924),Q=F=>{var K={};return S.d(K,F),K},q=F=>()=>F,W=Q({get:()=>tt.get,set:()=>tt.set}),l=S(620),de=null,re=null,H=function(){var F=(0,V.Z)(O().mark(function K(L,$){var Y,ne,J,I,le,we;return O().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Y=$.version,Z.next=4,(0,W.get)(L);case 4:if(J=Z.sent,!(J&&J[Y])){Z.next=9;break}ne=J[Y],Z.next=15;break;case 9:return Z.next=11,(0,l.Z)(fetch(L).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:I=Z.sent,le=I.res,we=I.err,we||(ne=le,(0,W.set)(L,(0,D.Z)({},Y,le)));case 15:return Z.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:L});case 16:case"end":return Z.stop()}},K)}));return function(L,$){return F.apply(this,arguments)}}()},620:function(E,j,S){S.d(j,{Z:function(){return O}});var B=S(42);function O(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(G){return(0,B.Z)({err:null,res:G},P)}).catch(function(G){return(0,B.Z)({err:G,res:void 0},P)})}},949:function(E,j,S){var B=R=>{var P={};return S.d(P,R),P},O=R=>()=>R;E.exports=B({Box3:()=>T.Box3,BufferAttribute:()=>T.BufferAttribute,BufferGeometry:()=>T.BufferGeometry,CanvasTexture:()=>T.CanvasTexture,Color:()=>T.Color,DoubleSide:()=>T.DoubleSide,ExtrudeBufferGeometry:()=>T.ExtrudeBufferGeometry,Float32BufferAttribute:()=>T.Float32BufferAttribute,Group:()=>T.Group,LineSegments:()=>T.LineSegments,Matrix4:()=>T.Matrix4,Mesh:()=>T.Mesh,MeshBasicMaterial:()=>T.MeshBasicMaterial,NormalBlending:()=>T.NormalBlending,Object3D:()=>T.Object3D,PlaneBufferGeometry:()=>T.PlaneBufferGeometry,PlaneGeometry:()=>T.PlaneGeometry,Points:()=>T.Points,Quaternion:()=>T.Quaternion,RGBAFormat:()=>T.RGBAFormat,Ray:()=>T.Ray,ShaderChunk:()=>T.ShaderChunk,ShaderMaterial:()=>T.ShaderMaterial,Shape:()=>T.Shape,Sphere:()=>T.Sphere,Sprite:()=>T.Sprite,SpriteMaterial:()=>T.SpriteMaterial,Texture:()=>T.Texture,TextureLoader:()=>T.TextureLoader,UniformsLib:()=>T.UniformsLib,Vector2:()=>T.Vector2,Vector3:()=>T.Vector3,VideoTexture:()=>T.VideoTexture})},568:function(E,j,S){S.d(j,{Z:function(){return O}});function B(R,P,G,X,V,D,Q){try{var q=R[D](Q),W=q.value}catch(l){G(l);return}q.done?P(W):Promise.resolve(W).then(X,V)}function O(R){return function(){var P=this,G=arguments;return new Promise(function(X,V){var D=R.apply(P,G);function Q(W){B(D,X,V,Q,q,"next",W)}function q(W){B(D,X,V,Q,q,"throw",W)}Q(void 0)})}}},924:function(E,j,S){S.d(j,{Z:function(){return B}});function B(O,R,P){return R in O?Object.defineProperty(O,R,{value:P,enumerable:!0,configurable:!0,writable:!0}):O[R]=P,O}},42:function(E,j,S){S.d(j,{Z:function(){return O}});var B=S(924);function O(R){for(var P=1;P<arguments.length;P++){var G=arguments[P]!=null?arguments[P]:{},X=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(G).filter(function(V){return Object.getOwnPropertyDescriptor(G,V).enumerable}))),X.forEach(function(V){(0,B.Z)(R,V,G[V])})}return R}}},rt={};function U(E){var j=rt[E];if(j!==void 0)return j.exports;var S=rt[E]={exports:{}};return qt[E](S,S.exports,U),S.exports}(function(){U.n=function(E){var j=E&&E.__esModule?function(){return E.default}:function(){return E};return U.d(j,{a:j}),j}})(),function(){U.d=function(E,j){for(var S in j)U.o(j,S)&&!U.o(E,S)&&Object.defineProperty(E,S,{enumerable:!0,get:j[S]})}}(),function(){U.o=function(E,j){return Object.prototype.hasOwnProperty.call(E,j)}}();var ce={};(function(){U.d(ce,{Ei:function(){return Vt},Yo:function(){return Gt},Ee:function(){return it},x1:function(){return mt},VJ:function(){return he},r7:function(){return Ue},XA:function(){return Ye},NB:function(){return ut},xv:function(){return ge},nk:function(){return ot}});function E(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function S(e,n){return j(e,n)}function B(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&S(e,n)}var O=U(42);function R(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function P(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function G(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},X(e)}function V(e){return X(e)}function D(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q(e){return e&&e.constructor===Symbol?"symbol":typeof e}function q(e,n){return n&&(Q(n)==="object"||typeof n=="function")?n:D(e)}function W(e){var n=G();return function(){var i=V(e),a;if(n){var t=V(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return q(this,a)}}var l=U(949);function de(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function re(e,n,r){return de()?re=Reflect.construct:re=function(a,t,o){var c=[null];c.push.apply(c,t);var v=Function.bind.apply(a,c),m=new v;return o&&S(m,o.prototype),m},re.apply(null,arguments)}function H(e,n,r){return re.apply(null,arguments)}function F(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function K(e,n,r){return n&&F(e.prototype,n),r&&F(e,r),e}function L(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function $(e){if(Array.isArray(e))return L(e)}function Y(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ne(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,n){if(!!e){if(typeof e=="string")return L(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(e,n)}}function I(e){return $(e)||Y(e)||J(e)||ne()}var le=U(620);function we(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,le.Z)(r.promise,n)),r}class Se extends l.Object3D{constructor(n=document.createElement("div")){super(),this.element=n,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(r){r.element instanceof Element&&r.element.parentNode!==null&&r.element.parentNode.removeChild(r.element)})})}copy(n,r){return super.copy(n,r),this.element=n.element.cloneNode(!0),this}}Se.prototype.isCSS2DObject=!0;const Z=new l.Vector3,me=new l.Matrix4,Ae=new l.Matrix4,Pe=new l.Vector3,ke=new l.Vector3;class d{constructor(n={}){const r=this;let i,a,t,o;const c={objects:new WeakMap},v=n.element!==void 0?n.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v,this.getSize=function(){return{width:i,height:a}},this.render=function(g,f){g.autoUpdate===!0&&g.updateMatrixWorld(),f.parent===null&&f.updateMatrixWorld(),me.copy(f.matrixWorldInverse),Ae.multiplyMatrices(f.projectionMatrix,me),m(g,g,f),b(g)},this.setSize=function(g,f){i=g,a=f,t=i/2,o=a/2,v.style.width=g+"px",v.style.height=f+"px"};function m(g,f,u){if(g.isCSS2DObject){g.onBeforeRender(r,f,u),Z.setFromMatrixPosition(g.matrixWorld),Z.applyMatrix4(Ae);const s=g.element;/apple/i.test(navigator.vendor)?s.style.transform="translate(-50%,-50%) translate("+Math.round(Z.x*t+t)+"px,"+Math.round(-Z.y*o+o)+"px)":s.style.transform="translate(-50%,-50%) translate("+(Z.x*t+t)+"px,"+(-Z.y*o+o)+"px)",s.style.display=g.visible&&Z.z>=-1&&Z.z<=1?"":"none";const x={distanceToCameraSquared:h(u,g)};c.objects.set(g,x),s.parentNode!==v&&v.appendChild(s),g.onAfterRender(r,f,u)}for(let s=0,x=g.children.length;s<x;s++)m(g.children[s],f,u)}function h(g,f){return Pe.setFromMatrixPosition(g.matrixWorld),ke.setFromMatrixPosition(f.matrixWorld),Pe.distanceToSquared(ke)}function y(g){const f=[];return g.traverse(function(u){u.isCSS2DObject&&f.push(u)}),f}function b(g){const f=y(g).sort(function(s,x){const M=c.objects.get(s).distanceToCameraSquared,k=c.objects.get(x).distanceToCameraSquared;return M-k}),u=f.length;for(let s=0,x=f.length;s<x;s++)f[s].element.style.zIndex=u-s}}}const p=new l.Vector3,_=new l.Quaternion,A=new l.Vector3;class w extends l.Object3D{constructor(n=document.createElement("div")){super(),this.element=n,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(r){r.element instanceof Element&&r.element.parentNode!==null&&r.element.parentNode.removeChild(r.element)})})}copy(n,r){return super.copy(n,r),this.element=n.element.cloneNode(!0),this}}w.prototype.isCSS3DObject=!0;class N extends w{constructor(n){super(n),this.rotation2D=0}copy(n,r){return super.copy(n,r),this.rotation2D=n.rotation2D,this}}N.prototype.isCSS3DSprite=!0;const z=new l.Matrix4,ee=new l.Matrix4;class ie{constructor(n={}){const r=this;let i,a,t,o;const c={camera:{fov:0,style:""},objects:new WeakMap},v=n.element!==void 0?n.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v;const m=document.createElement("div");m.style.transformStyle="preserve-3d",m.style.pointerEvents="none",v.appendChild(m),this.getSize=function(){return{width:i,height:a}},this.render=function(f,u){const s=u.projectionMatrix.elements[5]*o;c.camera.fov!==s&&(v.style.perspective=u.isPerspectiveCamera?s+"px":"",c.camera.fov=s),f.autoUpdate===!0&&f.updateMatrixWorld(),u.parent===null&&u.updateMatrixWorld();let x,M;u.isOrthographicCamera&&(x=-(u.right+u.left)/2,M=(u.top+u.bottom)/2);const k=u.isOrthographicCamera?"scale("+s+")translate("+h(x)+"px,"+h(M)+"px)"+y(u.matrixWorldInverse):"translateZ("+s+"px)"+y(u.matrixWorldInverse),C=k+"translate("+t+"px,"+o+"px)";c.camera.style!==C&&(m.style.transform=C,c.camera.style=C),g(f,f,u,k)},this.setSize=function(f,u){i=f,a=u,t=i/2,o=a/2,v.style.width=f+"px",v.style.height=u+"px",m.style.width=f+"px",m.style.height=u+"px"};function h(f){return Math.abs(f)<1e-10?0:f}function y(f){const u=f.elements;return"matrix3d("+h(u[0])+","+h(-u[1])+","+h(u[2])+","+h(u[3])+","+h(u[4])+","+h(-u[5])+","+h(u[6])+","+h(u[7])+","+h(u[8])+","+h(-u[9])+","+h(u[10])+","+h(u[11])+","+h(u[12])+","+h(-u[13])+","+h(u[14])+","+h(u[15])+")"}function b(f){const u=f.elements,s="matrix3d("+h(u[0])+","+h(u[1])+","+h(u[2])+","+h(u[3])+","+h(-u[4])+","+h(-u[5])+","+h(-u[6])+","+h(-u[7])+","+h(u[8])+","+h(u[9])+","+h(u[10])+","+h(u[11])+","+h(u[12])+","+h(u[13])+","+h(u[14])+","+h(u[15])+")";return"translate(-50%,-50%)"+s}function g(f,u,s,x){if(f.isCSS3DObject){f.onBeforeRender(r,u,s);let M;f.isCSS3DSprite?(z.copy(s.matrixWorldInverse),z.transpose(),f.rotation2D!==0&&z.multiply(ee.makeRotationZ(f.rotation2D)),f.matrixWorld.decompose(p,_,A),z.setPosition(p),z.scale(A),z.elements[3]=0,z.elements[7]=0,z.elements[11]=0,z.elements[15]=1,M=b(z)):M=b(f.matrixWorld);const k=f.element,C=c.objects.get(f);if(C===void 0||C.style!==M){k.style.transform=M;const oe={style:M};c.objects.set(f,oe)}k.style.display=f.visible?"":"none",k.parentNode!==m&&m.appendChild(k),f.onAfterRender(r,u,s)}for(let M=0,k=f.children.length;M<k;M++)g(f.children[M],u,s,x)}}}var te=U(175),Oe=function(e){e&&((0,te.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||Oe(n)}))},ae=function(){"use strict";function e(){E(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=we(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=H(l.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=H(l.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new Se(i),this},n.createCSS3DObject=function(i){return this.object3d=new w(i),this},n.createCSS3DSprite=function(i){return this.object3d=new N(i),this},n.createSprite=function(i){return this.object3d=new l.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new l.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new l.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){Oe(this.object3d)},K(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),ge=function(e){"use strict";B(r,e);var n=W(r);function r(a){E(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,O.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,v=t.sprite,m=t.text,h=t.sizeAttenuation;if(v){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:h}));this.object3d=y}else{var b=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),g=new l.PlaneGeometry(1,1,1,1);this.createMesh(g,b)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(m)},i.setText=function(t,o){var c=(0,O.Z)(P((0,O.Z)({},this.options),{text:t}),o||{}),v=c.text,m=c.fontSize,h=c.fontFamily,y=c.fontWeight,b=c.flipX,g=c.scale,f=this.canvas;f.width=m*v.length*2,f.height=m;var u=f.getContext("2d");u.font="".concat(y," ").concat(m,"px/1 ").concat(h);var s=u.measureText(v).width;f.width=s,this.width=s,u=f.getContext("2d"),u.clearRect(0,0,f.width,f.height),b&&u.scale(-1,1),u.font="".concat(y," ").concat(m,"px/1 ").concat(h),u.textBaseline="middle",u.fillStyle="#ffffff",u.fillText(v,b?s*-1:0,f.height/2),u.restore();var x=new l.Texture(f);x.anisotropy=16,x.needsUpdate=!0;var M=this.object3d;M.material.map&&M.material.map.dispose(),M.material.map=x,M.material.needsUpdate=!0,M.scale.set(x.image.width*g,x.image.height*g,1)},r}(ae),je=U(568),nt=U(666),fe=U.n(nt),it=function(e){"use strict";B(r,e);var n=W(r);function r(a){E(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,je.Z)(fe().mark(function o(){var c,v,m,h,y,b,g,f,u,s;return fe().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return c=t.options,v=c.transparent,m=c.blending,h=c.src,y=c.depthWrite,b=c.alphaTest,g=c.sprite,f=c.sizeAttenuation,M.next=3,new l.TextureLoader().loadAsync(h);case 3:return u=M.sent,s=g?new l.SpriteMaterial({map:u,transparent:v!=null?v:!1,blending:m!=null?m:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:b!=null?b:0,sizeAttenuation:f!=null?f:!0}):new l.MeshBasicMaterial({map:u,transparent:v!=null?v:!1,blending:m!=null?m:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:b!=null?b:0}),M.abrupt("return",s);case 6:case"end":return M.stop()}},o)}))()},i.create=function(){var t=this;return(0,je.Z)(fe().mark(function o(){var c,v,m,h,y,b,g,f;return fe().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(c=t.options,v=c.scale,m=c.position,h=c.src,y=c.cache,b=c.sprite,!(y&&!y.get(h))){s.next=7;break}return y.init(h),s.next=5,t.getMaterial();case 5:g=s.sent,y.set(h,g);case 7:if(!y){s.next=13;break}return s.next=10,y.get(h);case 10:s.t0=s.sent,s.next=16;break;case 13:return s.next=15,t.getMaterial();case 15:s.t0=s.sent;case 16:f=s.t0,t.texture=f.map,b?t.createSprite(f):t.createMesh(new l.PlaneBufferGeometry(1,1),f),v&&t.setScale(v),m&&t.object3d.position.copy(m);case 21:case"end":return s.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(ae);function at(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=V(e),e!==null););return e}function We(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?We=Reflect.get:We=function(a,t,o){var c=at(a,t);if(!!c){var v=Object.getOwnPropertyDescriptor(c,t);return v.get?v.get.call(o||a):v.value}},We(e,n,r)}function ze(e,n,r){return We(e,n,r)}var ot=function(e){"use strict";B(r,e);var n=W(r);function r(a){E(this,r);var t;return t=n.call(this),t.options=(0,O.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,v=t.blending,m=t.depthWrite,h=t.format,y=t.autoPlay,b=t.loop,g=t.alphaTest,f=t.sprite,u=we(),s=document.createElement("video");return s.addEventListener("loadedmetadata",function(){var x=new l.VideoTexture(s);x.format=h!=null?h:l.RGBAFormat,x.needsUpdate=!0;var M=f?new l.SpriteMaterial({map:x,transparent:c!=null?c:!1,blending:v!=null?v:l.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}):new l.MeshBasicMaterial({map:x,transparent:c!=null?c:!1,blending:v!=null?v:l.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0});u.resolve(M)},!1),s.src=o,s.muted=!0,s.autoplay=y,s.loop=b,s.preload="auto",u.promise},i.create=function(){var t=this;return(0,je.Z)(fe().mark(function o(){var c,v,m,h,y,b,g,f;return fe().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(c=t.options,v=c.scale,m=c.position,h=c.src,y=c.cache,b=c.sprite,!(y&&!y.get(h))){s.next=7;break}return y.init(h),s.next=5,t.getMaterial();case 5:g=s.sent,y.set(h,g);case 7:if(!y){s.next=13;break}return s.next=10,y.get(h);case 10:s.t0=s.sent,s.next=16;break;case 13:return s.next=15,t.getMaterial();case 15:s.t0=s.sent;case 16:f=s.t0,t.video=f.map.image,b?t.createSprite(f):t.createMesh(new l.PlaneBufferGeometry(1,1),f),v&&t.setScale(v),m&&t.object3d.position.copy(m);case 21:case"end":return s.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),ze(V(r.prototype),"dispose",this).call(this)},r}(ae),st=function(e){"use strict";B(r,e);var n=W(r);function r(a){E(this,r);var t;return t=n.call(this),t.options=(0,O.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.children,v=t.onClick,m=t.zIndexFix,h=document.createElement("div");h.appendChild(c),this.createCSS2DObject(h),o&&this.object3d.position.copy(o),v&&h.addEventListener("click",v),m&&(this.object3d.userData.zIndexFix=m)},i.getMaterial=function(t){return(0,je.Z)(fe().mark(function o(){var c,v,m,h;return fe().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,v=c.getContext("2d"),v.fillStyle="#ff0000",v.fillRect(0,0,256,256),m=new l.CanvasTexture(c),h=new l.SpriteMaterial({map:m,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),b.abrupt("return",h);case 9:case"end":return b.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,v=t.scale,m=v===void 0?new l.Vector3(1,1,1):v,h=t.position,y=h===void 0?new l.Vector3(0,0,0):h,b=t.cache,g=this;return(0,je.Z)(fe().mark(function f(){var u,s,x,M;return fe().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:if(u="node-create-pick-object",!(b&&!b.get(u))){C.next=7;break}return b.init(u),C.next=5,g.getMaterial(c);case 5:s=C.sent,b.set(u,s);case 7:if(!b){C.next=13;break}return C.next=10,b.get(u);case 10:C.t0=C.sent,C.next=16;break;case 13:return C.next=15,g.getMaterial(c);case 15:C.t0=C.sent;case 16:x=C.t0,M=new l.Sprite(x),M.scale.set(x.map.image.width*m.x,x.map.image.height*m.y,1),M.position.copy(y),g.add(M),g.pickObject=M;case 22:case"end":return C.stop()}},f)}))()},i.dispose=function(){var t=this.options.onClick;if(t){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",t)}ze(V(r.prototype),"dispose",this).call(this)},r}(ae),ut=st,lt=`
|
|
2
|
+
`.concat(l.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(l.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@ import*as Je from"idb-keyval";import*as k from"three";import*as Vt from"three/ex
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(l.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(l.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),ct=`
|
|
99
|
+
`.concat(l.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(l.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(l.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(l.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),ce=function(e){"use strict";T(r,e);var n=D(r);function r(){O(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(B(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(s.BufferGeometry);ce.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ce.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ce.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ze(e,n){var r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,m=this instanceof s.LineSegments?2:1,d=o.index,_=o.attributes;if(d!==null)for(var b=d.array,g=_.position.array,w=_.width.array,l=0,P=b.length-1;l<P;l+=m){var C=b[l],F=b[l+1];c.fromArray(g,C*3),h.fromArray(g,F*3);var R=w[Math.floor(l/3)]!==void 0?w[Math.floor(l/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*R/2,Ae=fe*fe,xe=i.distanceSqToSegment(c,h,t,v);if(!(xe>Ae)){t.applyMatrix4(this.matrixWorld);var _e=e.ray.origin.distanceTo(t);_e<e.near||_e>e.far||(n.push({distance:_e,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=P)}}}}ce.prototype.raycast=Ze,ce.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ce.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ce.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function De(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ce.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;De(n,0,r,0,a),De(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,De(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=tt,s.ShaderChunk.meshline_frag=rt;var Ve=function(e){"use strict";T(r,e);var n=D(r);function r(i){O(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(B(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(s.ShaderMaterial);Ve.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function nt(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function it(e,n){if(e==null)return{};var r=nt(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var at=e=>{var n={};return W.d(n,e),n},rr=e=>()=>e,ot=at({animate:()=>Wt.animate}),st={nodes:[],color:new s.Color("red"),lineWidth:3,sizeAttenuation:0},ut=function(e){"use strict";T(r,e);var n=D(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};O(this,r);var t;return t=n.call(this),t.geometry=new s.BufferGeometry,t.meshline=new ce,t.options=(0,A.Z)({},st,a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,c=t.duration,h=t.delay,v=t.onComplete,m=t.setPointWidth,d=it(t,["nodes","duration","delay","onComplete","setPointWidth"]),_=this.pencil.getSize(),b=_.width,g=_.height;delete d.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,m);var w=new Ve(S((0,A.Z)({},d),{resolution:new s.Vector2(b,g)}));this.material=w,this.createMesh(this.meshline,w)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,m=c!=null?c:0,d=(0,ot.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-m,repeat:1/0,onComplete:h,onUpdate:function(_){v.value=_}});this.tween=d},i.dispose=function(){be(V(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(p);function ct(e){if(Array.isArray(e))return e}function lt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function le(e,n){return ct(e)||K(e,n)||q(e,n)||lt()}var ft=e=>{var n={};return W.d(n,e),n},nr=e=>()=>e,Se=ft({extent:()=>Ie.extent,mean:()=>Ie.mean,merge:()=>Ie.merge}),ht=e=>{var n={};return W.d(n,e),n},ir=e=>()=>e,We=ht({default:()=>Gt.default}),pt=e=>{var n={};return W.d(n,e),n},ar=e=>()=>e,vt=pt({default:()=>zt.default});function dt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var mt=e=>{var n={};return W.d(n,e),n},or=e=>()=>e,_t=mt({default:()=>Ut.default}),gt=e=>{var n={};return W.d(n,e),n},sr=e=>()=>e,yt=gt({default:()=>Nt.default}),bt=e=>{var n={};return W.d(n,e),n},ur=e=>()=>e,Ee=bt({geoBounds:()=>Be.geoBounds,geoContains:()=>Be.geoContains,geoDistance:()=>Be.geoDistance,geoInterpolate:()=>Be.geoInterpolate}),wt=e=>{var n={};return W.d(n,e),n},cr=e=>()=>e,xt=wt({geoVoronoi:()=>Ft.geoVoronoi}),Mt=e=>{var n={};return W.d(n,e),n},lr=e=>()=>e,Xe=Mt({scaleLinear:()=>It.scaleLinear});function St(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Ee.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Ee.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function At(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(l){return l/c*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},m=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(m(t)):0,a!==void 0?Math.floor(m(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],g=d[0];g<=d[1];g++){var w=h(g);_(w)&&b.push([w,v(g)])}return b}function Ge(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(n,e):(0,yt.default)(e,n)}function Pt(e,n){var r={type:"Polygon",coordinates:e},i=le((0,Ee.geoBounds)(r),2),a=le(i[0],2),t=a[0],o=a[1],c=le(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var m=t>h||v>=89||o<=-89;return At(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(d){return Ge(d,r,m)})}function Ot(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=St(e,i),t=(0,Se.merge)(a),o=Pt(e,i),c=I(t).concat(I(o)),h={type:"Polygon",coordinates:e},v=le((0,Ee.geoBounds)(h),2),m=le(v[0],2),d=m[0],_=m[1],b=le(v[1],2),g=b[0],w=b[1],l=d>g||w>=89||_<=-89,P=[];if(l){var C=(0,xt.geoVoronoi)(c).triangles(),F=new Map(c.map(function(ae,ge){var de=le(ae,2),oe=de[0],Re=de[1];return["".concat(oe,"-").concat(Re),ge]}));C.features.forEach(function(ae){var ge,de=ae.geometry.coordinates[0].slice(0,3).reverse(),oe=[];if(de.forEach(function(ke){var he=le(ke,2),Fe=he[0],Dt=he[1],$e="".concat(Fe,"-").concat(Dt);F.has($e)&&oe.push(F.get($e))}),oe.length===3){if(oe.some(function(ke){return ke<t.length})){var Re=ae.properties.circumcenter;if(!Ge(Re,h,l))return}(ge=P).push.apply(ge,I(oe))}})}else if(o.length)for(var _e=function(ae,ge){var de,oe=[2,1,0].map(function(he){return Me.triangles[ae+he]}),Re=oe.map(function(he){return c[he]});if(oe.some(function(he){return he<t.length})){var ke=[0,1].map(function(he){return(0,Se.mean)(Re,function(Fe){return Fe[he]})});if(!Ge(ke,h,l))return"continue"}(de=P).push.apply(de,I(oe))},Me=_t.default.from(c),Pe=0,je=Me.triangles.length;Pe<je;Pe+=3)_e(Pe,je);else{var R=We.default.flatten(a),fe=R.vertices,Ae=R.holes,xe=Ae===void 0?[]:Ae;P=(0,We.default)(fe,xe,2)}var Ne=(0,Xe.scaleLinear)((0,Se.extent)(c,function(ae){return ae[0]}),[0,1]),kt=(0,Xe.scaleLinear)((0,Se.extent)(c,function(ae){return ae[1]}),[0,1]),Tt=c.map(function(ae){var ge=le(ae,2),de=ge[0],oe=ge[1];return[Ne(de),kt(oe)]}),Bt={points:c,indices:P,uvs:Tt};return{contour:a,triangles:Bt}}var Ct=Ot,He=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ze(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=le(t,2),c=o[0],h=o[1];return r?dt(c,h,n):[c,h,n]})});return We.default.flatten(i)}function Ke(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=ze(e,n,i),t=a.vertices,o=a.holes,c=ze(e,r,i),h=c.vertices,v=(0,Se.merge)([h,t]),m=Math.round(h.length/3),d=new Set(o),_=0,b=[],g=0;g<m;g++){var w=g+1;if(w===m)w=_;else if(d.has(w)){var l=w;w=_,_=l}b.push(g,g+m,w+m),b.push(w+m,w,g)}for(var P=[],C=1;C>=0;C--)for(var F=0;F<m;F+=1)P.push(F/(m-1),C);return{indices:b,vertices:v,uvs:P,topVerts:h}}function Ye(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:ze([e.points],n,a).vertices,uvs:r}}var Lt=function(e){"use strict";T(r,e);var n=D(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,A.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,m=o.closedTop,d=o.includeSides,_=o.curvatureResolution,b=o.cartesian,g=o.userDataRsoOffset;(0,vt.default)(i[0])||i[0].reverse();var w=Ct(i,{resolution:_}),l=w.contour,P=w.triangles,C=(0,Se.merge)(P.uvs),F=[],R=[],fe=[],Ae=0,xe=function(Me){var Pe=Math.round(F.length/3),je=fe.length;F=F.concat(Me.vertices),R=R.concat(Me.uvs),fe=fe.concat(Pe?Me.indices.map(function(Ne){return Ne+Pe}):Me.indices),t.addGroup(je,fe.length-je,Ae++)};if(d){var _e=Ke(l,c,h,b);xe(_e),t.userData.rso=g?Ke(l,c,h+g,b):_e}return v&&xe(Ye(P,c,C,!1,b)),m&&xe(Ye(P,h,C,!0,b)),t.setIndex(fe),t[He]("position",new s.Float32BufferAttribute(F,3)),t[He]("uv",new s.Float32BufferAttribute(R,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Et=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,m=t.curvatureResolution,d=t.userDataRsoOffset,_=t.cartesian,b=new Lt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:m,cartesian:_,userDataRsoOffset:d});this.createMesh(b,this.options.material)},r}(p),Ue=new Map,jt={generateTopUV:function(e,n,r,i,a){var t=n[r*3],o=n[r*3+1],c=n[i*3],h=n[i*3+1],v=n[a*3],m=n[a*3+1],d;if(Ue.has(e))d=Ue.get(e);else{var _,b,g,w,l=e.parameters.shapes.getPoints();d={minX:(_=Math).min.apply(_,I(l.map(function(F){var R=F.x;return R}))),maxX:(b=Math).max.apply(b,I(l.map(function(F){var R=F.x;return R}))),minY:(g=Math).min.apply(g,I(l.map(function(F){var R=F.y;return R}))),maxY:(w=Math).max.apply(w,I(l.map(function(F){var R=F.y;return R})))},Ue.set(e,d)}var P=d.maxX-d.minX,C=d.maxY-d.minY;return[new s.Vector2((t-d.minX)/P,1-(o-d.minY)/C),new s.Vector2((c-d.minX)/P,1-(h-d.minY)/C),new s.Vector2((v-d.minX)/P,1-(m-d.minY)/C)]},generateSideWallUV:function(e,n,r,i,a,t){var o=n[r*3],c=n[r*3+1],h=n[r*3+2],v=n[i*3],m=n[i*3+1],d=n[i*3+2],_=n[a*3],b=n[a*3+1],g=n[a*3+2],w=n[t*3],l=n[t*3+1],P=n[t*3+2];return Math.abs(c-m)<.01?[new s.Vector2(o,1-h),new s.Vector2(v,1-d),new s.Vector2(_,1-g),new s.Vector2(w,1-P)]:[new s.Vector2(c,1-h),new s.Vector2(m,1-d),new s.Vector2(b,1-g),new s.Vector2(l,1-P)]}},Rt=function(e){"use strict";T(r,e);var n=D(r);function r(a){O(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.points,c=t.depth,h=t.material,v=new s.ExtrudeBufferGeometry(new s.Shape(o),{depth:c,bevelEnabled:!1,UVGenerator:jt});this.createMesh(v,h)},r}(p)})();var Xt=ue.Ei,Ht=ue.Yo,Kt=ue.Ee,Yt=ue.x1,$t=ue.VJ,Jt=ue.r7,Qt=ue.XA,qt=ue.NB,er=ue.xv,tr=ue.nk;export{Xt as ConicPolygon,Ht as ExtrudePolygon,Kt as Image,Yt as Line,$t as MeshLine,Jt as MeshLineMaterial,Qt as MeshLineRaycast,qt as Node,er as Text,tr as Video};
|
|
132
|
+
`),he=function(e){"use strict";B(r,e);var n=W(r);function r(){E(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new l.Matrix4,Object.defineProperties(D(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(l.BufferGeometry);he.prototype.setMatrixWorld=function(e){this.matrixWorld=e},he.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},he.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof l.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ye(e,n){var r=new l.Matrix4,i=new l.Ray,a=new l.Sphere,t=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new l.Vector3,v=new l.Vector3,m=new l.Vector3,h=this instanceof l.LineSegments?2:1,y=o.index,b=o.attributes;if(y!==null)for(var g=y.array,f=b.position.array,u=b.width.array,s=0,x=g.length-1;s<x;s+=h){var M=g[s],k=g[s+1];c.fromArray(f,M*3),v.fromArray(f,k*3);var C=u[Math.floor(s/3)]!==void 0?u[Math.floor(s/3)]:1,oe=e.params.Line.threshold+this.material.lineWidth*C/2,Ee=oe*oe,xe=i.distanceSqToSegment(c,v,t,m);if(!(xe>Ee)){t.applyMatrix4(this.matrixWorld);var _e=e.ray.origin.distanceTo(t);_e<e.near||_e>e.far||(n.push({distance:_e,point:m.clone().applyMatrix4(this.matrixWorld),index:s,face:null,faceIndex:null,object:this}),s=x)}}}}he.prototype.raycast=Ye,he.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},he.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},he.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ge(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}he.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ge(n,0,r,0,a),Ge(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,Ge(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=lt,l.ShaderChunk.meshline_frag=ct;var Ue=function(e){"use strict";B(r,e);var n=W(r);function r(i){E(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(D(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(l.ShaderMaterial);Ue.prototype.copy=function(e){return l.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ft(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ht(e,n){if(e==null)return{};var r=ft(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var pt=e=>{var n={};return U.d(n,e),n},lr=e=>()=>e,vt=pt({animate:()=>Zt.animate}),dt={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},mt=function(e){"use strict";B(r,e);var n=W(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};E(this,r);var t;return t=n.call(this),t.geometry=new l.BufferGeometry,t.meshline=new he,t.options=(0,O.Z)({},dt,a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,c=t.duration,v=t.delay,m=t.onComplete,h=t.setPointWidth,y=ht(t,["nodes","duration","delay","onComplete","setPointWidth"]),b=this.pencil.getSize(),g=b.width,f=b.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,h);var u=new Ue(P((0,O.Z)({},y),{resolution:new l.Vector2(g,f)}));this.material=u,this.createMesh(this.meshline,u)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,v=t.onComplete,m=this.material.uniforms.offset,h=c!=null?c:0,y=(0,vt.animate)({from:m.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-h,repeat:1/0,onComplete:v,onUpdate:function(b){m.value=b}});this.tween=y},i.dispose=function(){ze(V(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(ae);function gt(e){if(Array.isArray(e))return e}function yt(){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(e,n){return gt(e)||Y(e,n)||J(e,n)||yt()}var _t=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,Ce=_t({extent:()=>Ke.extent,mean:()=>Ke.mean,merge:()=>Ke.merge}),bt=e=>{var n={};return U.d(n,e),n},fr=e=>()=>e,Ne=bt({default:()=>Xt.default}),wt=e=>{var n={};return U.d(n,e),n},hr=e=>()=>e,xt=wt({default:()=>Ht.default});function Mt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var St=e=>{var n={};return U.d(n,e),n},pr=e=>()=>e,At=St({default:()=>Kt.default}),Pt=e=>{var n={};return U.d(n,e),n},vr=e=>()=>e,Ot=Pt({default:()=>Yt.default}),Ct=e=>{var n={};return U.d(n,e),n},dr=e=>()=>e,Te=Ct({geoBounds:()=>Ve.geoBounds,geoContains:()=>Ve.geoContains,geoDistance:()=>Ve.geoDistance,geoInterpolate:()=>Ve.geoInterpolate}),Et=e=>{var n={};return U.d(n,e),n},mr=e=>()=>e,Lt=Et({geoVoronoi:()=>$t.geoVoronoi}),kt=e=>{var n={};return U.d(n,e),n},gr=e=>()=>e,$e=kt({scaleLinear:()=>Qt.scaleLinear});function jt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Te.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Te.geoInterpolate)(a,t),v=1/Math.ceil(o/n),m=v;m<1;)i.push(c(m)),m+=v}i.push(a=t)}),i})}function Tt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,v=function(s){return s/c*360%360-180},m=function(s){return Math.acos(2*s/o-1)/Math.PI*180-90},h=function(s){return o*(Math.cos((s+90)*Math.PI/180)+1)/2},y=[t!==void 0?Math.ceil(h(t)):0,a!==void 0?Math.floor(h(a)):o-1],b=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(s){return s<=i}:i===void 0?function(s){return s>=r}:i>=r?function(s){return s>=r&&s<=i}:function(s){return s>=r||s<=i},g=[],f=y[0];f<=y[1];f++){var u=v(f);b(u)&&g.push([u,m(f)])}return g}function Fe(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Te.geoContains)(n,e):(0,Ot.default)(e,n)}function Rt(e,n){var r={type:"Polygon",coordinates:e},i=pe((0,Te.geoBounds)(r),2),a=pe(i[0],2),t=a[0],o=a[1],c=pe(i[1],2),v=c[0],m=c[1];if(Math.min(Math.abs(v-t),Math.abs(m-o))<n)return[];var h=t>v||m>=89||o<=-89;return Tt(n,{minLng:t,maxLng:v,minLat:o,maxLat:m}).filter(function(y){return Fe(y,r,h)})}function Bt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=jt(e,i),t=(0,Ce.merge)(a),o=Rt(e,i),c=I(t).concat(I(o)),v={type:"Polygon",coordinates:e},m=pe((0,Te.geoBounds)(v),2),h=pe(m[0],2),y=h[0],b=h[1],g=pe(m[1],2),f=g[0],u=g[1],s=y>f||u>=89||b<=-89,x=[];if(s){var M=(0,Lt.geoVoronoi)(c).triangles(),k=new Map(c.map(function(se,be){var ye=pe(se,2),ue=ye[0],Be=ye[1];return["".concat(ue,"-").concat(Be),be]}));M.features.forEach(function(se){var be,ye=se.geometry.coordinates[0].slice(0,3).reverse(),ue=[];if(ye.forEach(function(De){var ve=pe(De,2),He=ve[0],It=ve[1],et="".concat(He,"-").concat(It);k.has(et)&&ue.push(k.get(et))}),ue.length===3){if(ue.some(function(De){return De<t.length})){var Be=se.properties.circumcenter;if(!Fe(Be,v,s))return}(be=x).push.apply(be,I(ue))}})}else if(o.length)for(var _e=function(se,be){var ye,ue=[2,1,0].map(function(ve){return Me.triangles[se+ve]}),Be=ue.map(function(ve){return c[ve]});if(ue.some(function(ve){return ve<t.length})){var De=[0,1].map(function(ve){return(0,Ce.mean)(Be,function(He){return He[ve]})});if(!Fe(De,v,s))return"continue"}(ye=x).push.apply(ye,I(ue))},Me=At.default.from(c),Le=0,Re=Me.triangles.length;Le<Re;Le+=3)_e(Le,Re);else{var C=Ne.default.flatten(a),oe=C.vertices,Ee=C.holes,xe=Ee===void 0?[]:Ee;x=(0,Ne.default)(oe,xe,2)}var Xe=(0,$e.scaleLinear)((0,Ce.extent)(c,function(se){return se[0]}),[0,1]),Ut=(0,$e.scaleLinear)((0,Ce.extent)(c,function(se){return se[1]}),[0,1]),Nt=c.map(function(se){var be=pe(se,2),ye=be[0],ue=be[1];return[Xe(ye),Ut(ue)]}),Ft={points:c,indices:x,uvs:Nt};return{contour:a,triangles:Ft}}var Dt=Bt,Qe=new l.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=pe(t,2),c=o[0],v=o[1];return r?Mt(c,v,n):[c,v,n]})});return Ne.default.flatten(i)}function qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,c=Ie(e,r,i),v=c.vertices,m=(0,Ce.merge)([v,t]),h=Math.round(v.length/3),y=new Set(o),b=0,g=[],f=0;f<h;f++){var u=f+1;if(u===h)u=b;else if(y.has(u)){var s=u;u=b,b=s}g.push(f,f+h,u+h),g.push(u+h,u,f)}for(var x=[],M=1;M>=0;M--)for(var k=0;k<h;k+=1)x.push(k/(h-1),M);return{indices:g,vertices:m,uvs:x,topVerts:v}}function Je(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Wt=function(e){"use strict";B(r,e);var n=W(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};E(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,O.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,v=o.endHeight,m=o.closedBottom,h=o.closedTop,y=o.includeSides,b=o.curvatureResolution,g=o.cartesian,f=o.userDataRsoOffset;(0,xt.default)(i[0])||i[0].reverse();var u=Dt(i,{resolution:b}),s=u.contour,x=u.triangles,M=(0,Ce.merge)(x.uvs),k=[],C=[],oe=[],Ee=0,xe=function(Me){var Le=Math.round(k.length/3),Re=oe.length;k=k.concat(Me.vertices),C=C.concat(Me.uvs),oe=oe.concat(Le?Me.indices.map(function(Xe){return Xe+Le}):Me.indices),t.addGroup(Re,oe.length-Re,Ee++)};if(y){var _e=qe(s,c,v,g);xe(_e),t.userData.rso=f?qe(s,c,v+f,g):_e}return m&&xe(Je(x,c,M,!1,g)),h&&xe(Je(x,v,M,!0,g)),t.setIndex(oe),t[Qe]("position",new l.Float32BufferAttribute(k,3)),t[Qe]("uv",new l.Float32BufferAttribute(C,2)),t.computeVertexNormals(),t}return r}(l.BufferGeometry),Vt=function(e){"use strict";B(r,e);var n=W(r);function r(a){E(this,r);var t;return t=n.call(this),t.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,v=t.closedBottom,m=t.closedTop,h=t.curvatureResolution,y=t.userDataRsoOffset,b=t.cartesian,g=new Wt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:v,closedTop:m,curvatureResolution:h,cartesian:b,userDataRsoOffset:y});this.createMesh(g,this.options.material)},r}(ae),Ze=new Map,zt={generateTopUV:function(e,n,r,i,a){var t=n[r*3],o=n[r*3+1],c=n[i*3],v=n[i*3+1],m=n[a*3],h=n[a*3+1],y;if(Ze.has(e))y=Ze.get(e);else{var b,g,f,u,s=e.parameters.shapes.getPoints();y={minX:(b=Math).min.apply(b,I(s.map(function(k){var C=k.x;return C}))),maxX:(g=Math).max.apply(g,I(s.map(function(k){var C=k.x;return C}))),minY:(f=Math).min.apply(f,I(s.map(function(k){var C=k.y;return C}))),maxY:(u=Math).max.apply(u,I(s.map(function(k){var C=k.y;return C})))},Ze.set(e,y)}var x=y.maxX-y.minX,M=y.maxY-y.minY;return[new l.Vector2((t-y.minX)/x,1-(o-y.minY)/M),new l.Vector2((c-y.minX)/x,1-(v-y.minY)/M),new l.Vector2((m-y.minX)/x,1-(h-y.minY)/M)]},generateSideWallUV:function(e,n,r,i,a,t){var o=n[r*3],c=n[r*3+1],v=n[r*3+2],m=n[i*3],h=n[i*3+1],y=n[i*3+2],b=n[a*3],g=n[a*3+1],f=n[a*3+2],u=n[t*3],s=n[t*3+1],x=n[t*3+2];return Math.abs(c-h)<.01?[new l.Vector2(o,1-v),new l.Vector2(m,1-y),new l.Vector2(b,1-f),new l.Vector2(u,1-x)]:[new l.Vector2(c,1-v),new l.Vector2(h,1-y),new l.Vector2(g,1-f),new l.Vector2(s,1-x)]}},Gt=function(e){"use strict";B(r,e);var n=W(r);function r(a){E(this,r);var t;return t=n.call(this),t.options=(0,O.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.points,c=t.depth,v=t.material,m=new l.ExtrudeBufferGeometry(new l.Shape(o),{depth:c,bevelEnabled:!1,UVGenerator:zt});this.createMesh(m,v)},r}(ae)})();var Jt=ce.Ei,er=ce.Yo,tr=ce.Ee,rr=ce.x1,nr=ce.VJ,ir=ce.r7,ar=ce.XA,or=ce.NB,sr=ce.xv,ur=ce.nk;export{Jt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
|