gl-draw 0.2.4 → 0.2.5

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