gl-draw 0.8.4 → 0.8.6

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.
@@ -1,4 +1,4 @@
1
- (function(){var rt={666:function(L){var G=function(x){"use strict";var C=Object.prototype,j=C.hasOwnProperty,R,k=typeof Symbol=="function"?Symbol:{},N=k.iterator||"@@iterator",I=k.asyncIterator||"@@asyncIterator",V=k.toStringTag||"@@toStringTag";function M(h,l,d){return Object.defineProperty(h,l,{value:d,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{M({},"")}catch(h){M=function(l,d,O){return l[d]=O}}function K(h,l,d,O){var A=l&&l.prototype instanceof ee?l:ee,Y=Object.create(A.prototype),ue=new z(O||[]);return Y._invoke=ae(h,d,ue),Y}x.wrap=K;function $(h,l,d){try{return{type:"normal",arg:h.call(l,d)}}catch(O){return{type:"throw",arg:O}}}var B="suspendedStart",c="suspendedYield",fe="executing",te="completed",W={};function ee(){}function E(){}function T(){}var q={};M(q,N,function(){return this});var se=Object.getPrototypeOf,re=se&&se(se(le([])));re&&re!==C&&j.call(re,N)&&(q=re);var H=T.prototype=ee.prototype=Object.create(q);E.prototype=T,M(H,"constructor",T),M(T,"constructor",E),E.displayName=M(T,V,"GeneratorFunction");function D(h){["next","throw","return"].forEach(function(l){M(h,l,function(d){return this._invoke(l,d)})})}x.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return l?l===E||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,T):(h.__proto__=T,M(h,V,"GeneratorFunction")),h.prototype=Object.create(H),h},x.awrap=function(h){return{__await:h}};function ne(h,l){function d(Y,ue,ce,oe){var ie=$(h[Y],h,ue);if(ie.type==="throw")oe(ie.arg);else{var Le=ie.arg,Se=Le.value;return Se&&typeof Se=="object"&&j.call(Se,"__await")?l.resolve(Se.__await).then(function(Ae){d("next",Ae,ce,oe)},function(Ae){d("throw",Ae,ce,oe)}):l.resolve(Se).then(function(Ae){Le.value=Ae,ce(Le)},function(Ae){return d("throw",Ae,ce,oe)})}}var O;function A(Y,ue){function ce(){return new l(function(oe,ie){d(Y,ue,oe,ie)})}return O=O?O.then(ce,ce):ce()}this._invoke=A}D(ne.prototype),M(ne.prototype,I,function(){return this}),x.AsyncIterator=ne,x.async=function(h,l,d,O,A){A===void 0&&(A=Promise);var Y=new ne(K(h,l,d,O),A);return x.isGeneratorFunction(l)?Y:Y.next().then(function(ue){return ue.done?ue.value:Y.next()})};function ae(h,l,d){var O=B;return function(Y,ue){if(O===fe)throw new Error("Generator is already running");if(O===te){if(Y==="throw")throw ue;return ze()}for(d.method=Y,d.arg=ue;;){var ce=d.delegate;if(ce){var oe=he(ce,d);if(oe){if(oe===W)continue;return oe}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(O===B)throw O=te,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);O=fe;var ie=$(h,l,d);if(ie.type==="normal"){if(O=d.done?te:c,ie.arg===W)continue;return{value:ie.arg,done:d.done}}else ie.type==="throw"&&(O=te,d.method="throw",d.arg=ie.arg)}}}function he(h,l){var d=h.iterator[l.method];if(d===R){if(l.delegate=null,l.method==="throw"){if(h.iterator.return&&(l.method="return",l.arg=R,he(h,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var O=$(d,h.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,W;var A=O.arg;if(!A)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(A.done)l[h.resultName]=A.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=R);else return A;return l.delegate=null,W}D(H),M(H,V,"Generator"),M(H,N,function(){return this}),M(H,"toString",function(){return"[object Generator]"});function be(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function X(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function z(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(be,this),this.reset(!0)}x.keys=function(h){var l=[];for(var d in h)l.push(d);return l.reverse(),function O(){for(;l.length;){var A=l.pop();if(A in h)return O.value=A,O.done=!1,O}return O.done=!0,O}};function le(h){if(h){var l=h[N];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var d=-1,O=function A(){for(;++d<h.length;)if(j.call(h,d))return A.value=h[d],A.done=!1,A;return A.value=R,A.done=!0,A};return O.next=O}}return{next:ze}}x.values=le;function ze(){return{value:R,done:!0}}return z.prototype={constructor:z,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(X),!h)for(var l in this)l.charAt(0)==="t"&&j.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=R)},stop:function(){this.done=!0;var h=this.tryEntries[0],l=h.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function d(oe,ie){return Y.type="throw",Y.arg=h,l.next=oe,ie&&(l.method="next",l.arg=R),!!ie}for(var O=this.tryEntries.length-1;O>=0;--O){var A=this.tryEntries[O],Y=A.completion;if(A.tryLoc==="root")return d("end");if(A.tryLoc<=this.prev){var ue=j.call(A,"catchLoc"),ce=j.call(A,"finallyLoc");if(ue&&ce){if(this.prev<A.catchLoc)return d(A.catchLoc,!0);if(this.prev<A.finallyLoc)return d(A.finallyLoc)}else if(ue){if(this.prev<A.catchLoc)return d(A.catchLoc,!0)}else if(ce){if(this.prev<A.finallyLoc)return d(A.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(h,l){for(var d=this.tryEntries.length-1;d>=0;--d){var O=this.tryEntries[d];if(O.tryLoc<=this.prev&&j.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var A=O;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var Y=A?A.completion:{};return Y.type=h,Y.arg=l,A?(this.method="next",this.next=A.finallyLoc,W):this.complete(Y)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),W},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var d=this.tryEntries[l];if(d.finallyLoc===h)return this.complete(d.completion,d.afterLoc),X(d),W}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var d=this.tryEntries[l];if(d.tryLoc===h){var O=d.completion;if(O.type==="throw"){var A=O.arg;X(d)}return A}}throw new Error("illegal catch attempt")},delegateYield:function(h,l,d){return this.delegate={iterator:le(h),resultName:l,nextLoc:d},this.method==="next"&&(this.arg=R),W}},x}(L.exports);try{regeneratorRuntime=G}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=G:Function("r","regeneratorRuntime = r")(G)}},695:function(L,G,x){"use strict";x.d(G,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var R=Array.isArray(j.material)?j.material:[j.material];R.forEach(function(k){var N,I,V,M,K,$,B,c,fe,te,W,ee,E;(N=k.map)===null||N===void 0||N.dispose(),(I=k.lightMap)===null||I===void 0||I.dispose(),(V=k.bumpMap)===null||V===void 0||V.dispose(),(M=k.normalMap)===null||M===void 0||M.dispose(),(K=k.specularMap)===null||K===void 0||K.dispose(),($=k.envMap)===null||$===void 0||$.dispose(),(B=k.alphaMap)===null||B===void 0||B.dispose(),(c=k.aoMap)===null||c===void 0||c.dispose(),(fe=k.displacementMap)===null||fe===void 0||fe.dispose(),(te=k.emissiveMap)===null||te===void 0||te.dispose(),(W=k.gradientMap)===null||W===void 0||W.dispose(),(ee=k.metalnessMap)===null||ee===void 0||ee.dispose(),(E=k.roughnessMap)===null||E===void 0||E.dispose(),k.dispose()})}}},584:function(L,G,x){"use strict";x.d(G,{disposeMesh:function(){return k.Z}});var C=x(666),j=x.n(C),R=null,k=x(695),N=x(644);function I(W){if(W.material){var ee=Array.isArray(W.material)?W.material:[W.material];ee.forEach(function(E){var T,q;(T=E.color)===null||T===void 0||T.convertSRGBToLinear(),(q=E.emissive)===null||q===void 0||q.convertSRGBToLinear(),E.map&&(E.map.encoding=THREE.sRGBEncoding),E.emissiveMap&&(E.emissiveMap.encoding=THREE.sRGBEncoding)})}}var V=x(568),M=x(924),K=x(360),$=x(484),B=null,c=null,fe=function(){var W=(0,V.Z)(j().mark(function ee(E,T){var q,se,re,H,D,ne,ae,he,be;return j().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return q=T.type,se=q===void 0?"blob":q,re=T.version,H=re===void 0?"1":re,z.next=4,(0,K.get)(E);case 4:if(ne=z.sent,!(ne&&ne[H])){z.next=9;break}D=ne[H],z.next=15;break;case 9:return z.next=11,(0,$.Z)(fetch(E).then(function(le){if(le.ok)return le[se]();throw new Error}));case 11:ae=z.sent,he=ae.res,be=ae.err,be||(D=he,(0,K.set)(E,(0,M.Z)({},H,he)));case 15:return z.abrupt("return",D?{url:se==="json"?E:URL.createObjectURL(D),store:D}:{url:E});case 16:case"end":return z.stop()}},ee)}));return function(E,T){return W.apply(this,arguments)}}(),te=x(705)},484:function(L,G,x){"use strict";x.d(G,{Z:function(){return j}});var C=x(42);function j(R){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(N){return(0,C.Z)({err:null,res:N},k)}).catch(function(N){return(0,C.Z)({err:N,res:void 0},k)})}},705:function(L,G,x){"use strict";x.d(G,{C:function(){return N},y:function(){return k}});var C=x(644),j=x.n(C),R=new Map,k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(V,M,K,$,B){var c=M[K*3],fe=M[K*3+1],te=M[$*3],W=M[$*3+1],ee=M[B*3],E=M[B*3+1],T;if(R.has(V))T=R.get(V);else{var q=I.box3||new C.Box3;if(!I.box3){var se=V.parameters.shapes.getPoints();q.setFromArray(se.map(function(ae){return[ae.x,ae.y,0]}).flat())}var re=q.getSize(new C.Vector3);I.split&&(re.y/=I.split),T={box:q,size:re},R.set(V,T)}var H=T.box,D=T.size,ne=I.split?1-I.split:0;return[new C.Vector2((c-H.min.x)/D.x,(fe-H.min.y)/D.y+ne),new C.Vector2((te-H.min.x)/D.x,(W-H.min.y)/D.y+ne),new C.Vector2((ee-H.min.x)/D.x,(E-H.min.y)/D.y+ne)]},generateSideWallUV:function(V,M,K,$,B,c){var fe=M[K*3],te=M[K*3+1],W=M[K*3+2],ee=M[$*3],E=M[$*3+1],T=M[$*3+2],q=M[B*3],se=M[B*3+1],re=M[B*3+2],H=M[c*3],D=M[c*3+1],ne=M[c*3+2],ae;if(R.has(M))ae=R.get(M);else{var he=new C.Box3;he.setFromArray(M);var be=he.getSize(new C.Vector3);I.split&&(be.z/=1-I.split),ae={box:he,size:be},R.set(M,ae)}var X=ae.box,z=ae.size;return Math.abs(te-E)<Math.abs(fe-ee)?[new C.Vector2((fe-X.min.x)/z.x,(W-X.min.z)/z.z),new C.Vector2((ee-X.min.x)/z.x,(T-X.min.z)/z.z),new C.Vector2((q-X.min.x)/z.x,(re-X.min.z)/z.z),new C.Vector2((H-X.min.x)/z.x,(ne-X.min.z)/z.z)]:[new C.Vector2((te-X.min.y)/z.y,(W-X.min.z)/z.z),new C.Vector2((E-X.min.y)/z.y,(T-X.min.z)/z.z),new C.Vector2((se-X.min.y)/z.y,(re-X.min.z)/z.z),new C.Vector2((D-X.min.y)/z.y,(ne-X.min.z)/z.z)]}}},N=function(){R.clear()}},360:function(L){"use strict";L.exports=require("idb-keyval")},644:function(L){"use strict";L.exports=require("three")},568:function(L,G,x){"use strict";x.d(G,{Z:function(){return j}});function C(R,k,N,I,V,M,K){try{var $=R[M](K),B=$.value}catch(c){N(c);return}$.done?k(B):Promise.resolve(B).then(I,V)}function j(R){return function(){var k=this,N=arguments;return new Promise(function(I,V){var M=R.apply(k,N);function K(B){C(M,I,V,K,$,"next",B)}function $(B){C(M,I,V,K,$,"throw",B)}K(void 0)})}}},924:function(L,G,x){"use strict";x.d(G,{Z:function(){return C}});function C(j,R,k){return R in j?Object.defineProperty(j,R,{value:k,enumerable:!0,configurable:!0,writable:!0}):j[R]=k,j}},42:function(L,G,x){"use strict";x.d(G,{Z:function(){return j}});var C=x(924);function j(R){for(var k=1;k<arguments.length;k++){var N=arguments[k]!=null?arguments[k]:{},I=Object.keys(N);typeof Object.getOwnPropertySymbols=="function"&&(I=I.concat(Object.getOwnPropertySymbols(N).filter(function(V){return Object.getOwnPropertyDescriptor(N,V).enumerable}))),I.forEach(function(V){(0,C.Z)(R,V,N[V])})}return R}}},Fe={};function J(L){var G=Fe[L];if(G!==void 0)return G.exports;var x=Fe[L]={exports:{}};return rt[L](x,x.exports,J),x.exports}(function(){J.n=function(L){var G=L&&L.__esModule?function(){return L.default}:function(){return L};return J.d(G,{a:G}),G}})(),function(){J.d=function(L,G){for(var x in G)J.o(G,x)&&!J.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:G[x]})}}(),function(){J.o=function(L,G){return Object.prototype.hasOwnProperty.call(L,G)}}(),function(){J.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";J.r(Be),J.d(Be,{ConicPolygon:function(){return Ct},ExtrudePolygon:function(){return jt},Group:function(){return nt},Image:function(){return ue},Line:function(){return ft},MeshLine:function(){return we},MeshLineMaterial:function(){return We},MeshLineRaycast:function(){return Ne},Node:function(){return Ae},Text:function(){return ze},Video:function(){return Le},getExtrudePolygonGeometry:function(){return Lt},getLineGeometry:function(){return ht}});function L(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function G(t,i){return G=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},G(t,i)}function x(t,i){return G(t,i)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var j=J(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function k(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function N(){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 I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},I(t)}function V(t){return I(t)}function M(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function K(t){return t&&t.constructor===Symbol?"symbol":typeof t}function $(t,i){return i&&(K(i)==="object"||typeof i=="function")?i:M(t)}function B(t){var i=N();return function(){var n=V(t),a;if(i){var e=V(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return $(this,a)}}var c=J(644);function fe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function te(t,i,r){return fe()?te=Reflect.construct:te=function(a,e,o){var s=[null];s.push.apply(s,e);var f=Function.bind.apply(a,s),p=new f;return o&&x(p,o.prototype),p},te.apply(null,arguments)}function W(t,i,r){return te.apply(null,arguments)}function ee(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 E(t,i,r){return i&&ee(t.prototype,i),r&&ee(t,r),t}function T(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 q(t){if(Array.isArray(t))return T(t)}function se(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function re(){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 T(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 T(t,i)}}function D(t){return q(t)||se(t)||H(t)||re()}var ne=J(484);function ae(){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 he=require("three/examples/jsm/renderers/CSS2DRenderer"),be=require("three/examples/jsm/renderers/CSS3DRenderer"),X=J(584),z=function(t){t&&((0,X.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||z(i)}))},le=function(){"use strict";function t(){L(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=ae(),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=W(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=W(c.Points,D(a)),this},i.createCSS2DObject=function(n){return this.object3d=new he.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new be.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new be.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(){z(this.object3d)},E(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";C(r,t);var i=B(r);function r(a){L(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,j.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,p=e.text,v=e.sizeAttenuation;if(f){var m=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:v}));this.object3d=m}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),w=new c.PlaneGeometry(1,1,1,1);this.createMesh(w,g)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},n.setText=function(e,o){var s=(0,j.Z)(k((0,j.Z)({},this.options),{text:e}),o||{}),f=s.text,p=s.fontSize,v=s.fontFamily,m=s.fontWeight,g=s.flipX,w=s.scale,b=this.canvas;b.width=p*f.length*2,b.height=p;var y=b.getContext("2d");y.font="".concat(m," ").concat(p,"px/1 ").concat(v);var u=y.measureText(f).width;b.width=u,this.width=u,y=b.getContext("2d"),y.clearRect(0,0,b.width,b.height),g&&y.scale(-1,1),y.font="".concat(m," ").concat(p,"px/1 ").concat(v),y.textBaseline="middle",y.fillStyle="#ffffff",y.fillText(f,g?u*-1:0,b.height/2),y.restore();var S=new c.Texture(b);S.anisotropy=16,S.needsUpdate=!0;var P=this.object3d;P.material.map&&P.material.map.dispose(),P.material.map=S,P.material.needsUpdate=!0,P.scale.set(S.image.width*w,S.image.height*w,1)},r}(le),h=J(568),l=J(666),d=J.n(l),O=+c.REVISION<144,A=O?"ExtrudeBufferGeometry":"ExtrudeGeometry",Y=O?"PlaneBufferGeometry":"PlaneGeometry",ue=function(t){"use strict";C(r,t);var i=B(r);function r(a){L(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,h.Z)(d().mark(function o(){var s,f,p,v,m,g,w,b,y,u;return d().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return s=e.options,f=s.transparent,p=s.blending,v=s.src,m=s.depthWrite,g=s.alphaTest,w=s.sprite,b=s.sizeAttenuation,P.next=3,new c.TextureLoader().loadAsync(v);case 3:return y=P.sent,u=w?new c.SpriteMaterial({map:y,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:b!=null?b:!0}):new c.MeshBasicMaterial({map:y,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),P.abrupt("return",u);case 6:case"end":return P.stop()}},o)}))()},n.create=function(){var e=this;return(0,h.Z)(d().mark(function o(){var s,f,p,v,m,g,w,b;return d().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,f=s.scale,p=s.position,v=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(v))){u.next=7;break}return m.init(v),u.next=5,e.getMaterial();case 5:w=u.sent,m.set(v,w);case 7:if(!m){u.next=13;break}return u.next=10,m.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:b=u.t0,e.texture=b.map,g?e.createSprite(b):e.createMesh(new c[Y](1,1),b),f&&e.setScale(f),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(le);function ce(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=V(t),t!==null););return t}function oe(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?oe=Reflect.get:oe=function(a,e,o){var s=ce(a,e);if(!!s){var f=Object.getOwnPropertyDescriptor(s,e);return f.get?f.get.call(o||a):f.value}},oe(t,i,r)}function ie(t,i,r){return oe(t,i,r)}var Le=function(t){"use strict";C(r,t);var i=B(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.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,p=e.depthWrite,v=e.format,m=e.autoPlay,g=e.loop,w=e.alphaTest,b=e.sprite,y=ae(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var S=new c.VideoTexture(u);S.format=v!=null?v:c.RGBAFormat,S.needsUpdate=!0;var P=b?new c.SpriteMaterial({map:S,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:w!=null?w:0}):new c.MeshBasicMaterial({map:S,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:w!=null?w:0});y.resolve(P)},!1),u.src=o,u.muted=!0,u.autoplay=m,u.loop=g,u.preload="auto",y.promise},n.create=function(){var e=this;return(0,h.Z)(d().mark(function o(){var s,f,p,v,m,g,w,b;return d().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,f=s.scale,p=s.position,v=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(v))){u.next=7;break}return m.init(v),u.next=5,e.getMaterial();case 5:w=u.sent,m.set(v,w);case 7:if(!m){u.next=13;break}return u.next=10,m.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:b=u.t0,e.video=b.map.image,g?e.createSprite(b):e.createMesh(new c[Y](1,1),b),f&&e.setScale(f),p&&e.object3d.position.copy(p);case 21:case"end":return u.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(),ie(V(r.prototype),"dispose",this).call(this)},r}(le),Se=function(t){"use strict";C(r,t);var i=B(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{event:"click"},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,f=e.handler,p=e.event,v=e.zIndexFix,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),f&&p&&this.clickTarge.forEach(function(g){g.addEventListener(p,f)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,h.Z)(d().mark(function o(){var s,f,p,v;return d().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),p=new c.CanvasTexture(s),v=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",v);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,p=f===void 0?new c.Vector3(1,1,1):f,v=e.position,m=v===void 0?new c.Vector3(0,0,0):v,g=e.cache,w=this;return(0,h.Z)(d().mark(function b(){var y,u,S,P;return d().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(y="node-create-pick-object",!(g&&!g.get(y))){_.next=7;break}return g.init(y),_.next=5,w.getMaterial(s);case 5:u=_.sent,g.set(y,u);case 7:if(!g){_.next=13;break}return _.next=10,g.get(y);case 10:_.t0=_.sent,_.next=16;break;case 13:return _.next=15,w.getMaterial(s);case 15:_.t0=_.sent;case 16:S=_.t0,P=new c.Sprite(S),P.scale.set(S.map.image.width*p.x,S.map.image.height*p.y,1),P.position.copy(m),w.add(P),w.pickObject=P;case 22:case"end":return _.stop()}},b)}))()},n.dispose=function(){var e=this.options,o=e.handler,s=e.event;o&&s&&this.clickTarge.forEach(function(f){f.removeEventListener(s,o)}),ie(V(r.prototype),"dispose",this).call(this)},E(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return D(e.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(le),Ae=Se,nt=function(t){"use strict";C(r,t);var i=B(r);function r(){return L(this,r),i.apply(this,arguments)}var n=r.prototype;return n.create=function(){this.createGroup()},r}(le),it=`
1
+ (function(){var rt={666:function(k){var G=function(P){"use strict";var C=Object.prototype,j=C.hasOwnProperty,R,L=typeof Symbol=="function"?Symbol:{},F=L.iterator||"@@iterator",Z=L.asyncIterator||"@@asyncIterator",W=L.toStringTag||"@@toStringTag";function A(h,l,v){return Object.defineProperty(h,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{A({},"")}catch(h){A=function(l,v,O){return l[v]=O}}function H(h,l,v,O){var S=l&&l.prototype instanceof J?l:J,Y=Object.create(S.prototype),fe=new z(O||[]);return Y._invoke=se(h,v,fe),Y}P.wrap=H;function K(h,l,v){try{return{type:"normal",arg:h.call(l,v)}}catch(O){return{type:"throw",arg:O}}}var V="suspendedStart",c="suspendedYield",de="executing",ne="completed",D={};function J(){}function E(){}function T(){}var q={};A(q,F,function(){return this});var le=Object.getPrototypeOf,ie=le&&le(le(ve([])));ie&&ie!==C&&j.call(ie,F)&&(q=ie);var N=T.prototype=J.prototype=Object.create(q);E.prototype=T,A(N,"constructor",T),A(T,"constructor",E),E.displayName=A(T,W,"GeneratorFunction");function U(h){["next","throw","return"].forEach(function(l){A(h,l,function(v){return this._invoke(l,v)})})}P.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return l?l===E||(l.displayName||l.name)==="GeneratorFunction":!1},P.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,T):(h.__proto__=T,A(h,W,"GeneratorFunction")),h.prototype=Object.create(N),h},P.awrap=function(h){return{__await:h}};function ae(h,l){function v(Y,fe,he,ue){var oe=K(h[Y],h,fe);if(oe.type==="throw")ue(oe.arg);else{var Le=oe.arg,Oe=Le.value;return Oe&&typeof Oe=="object"&&j.call(Oe,"__await")?l.resolve(Oe.__await).then(function(Pe){v("next",Pe,he,ue)},function(Pe){v("throw",Pe,he,ue)}):l.resolve(Oe).then(function(Pe){Le.value=Pe,he(Le)},function(Pe){return v("throw",Pe,he,ue)})}}var O;function S(Y,fe){function he(){return new l(function(ue,oe){v(Y,fe,ue,oe)})}return O=O?O.then(he,he):he()}this._invoke=S}U(ae.prototype),A(ae.prototype,Z,function(){return this}),P.AsyncIterator=ae,P.async=function(h,l,v,O,S){S===void 0&&(S=Promise);var Y=new ae(H(h,l,v,O),S);return P.isGeneratorFunction(l)?Y:Y.next().then(function(fe){return fe.done?fe.value:Y.next()})};function se(h,l,v){var O=V;return function(Y,fe){if(O===de)throw new Error("Generator is already running");if(O===ne){if(Y==="throw")throw fe;return ze()}for(v.method=Y,v.arg=fe;;){var he=v.delegate;if(he){var ue=ge(he,v);if(ue){if(ue===D)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===V)throw O=ne,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=de;var oe=K(h,l,v);if(oe.type==="normal"){if(O=v.done?ne:c,oe.arg===D)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(O=ne,v.method="throw",v.arg=oe.arg)}}}function ge(h,l){var v=h.iterator[l.method];if(v===R){if(l.delegate=null,l.method==="throw"){if(h.iterator.return&&(l.method="return",l.arg=R,ge(h,l),l.method==="throw"))return D;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var O=K(v,h.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,D;var S=O.arg;if(!S)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,D;if(S.done)l[h.resultName]=S.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=R);else return S;return l.delegate=null,D}U(N),A(N,W,"Generator"),A(N,F,function(){return this}),A(N,"toString",function(){return"[object Generator]"});function _e(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function X(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function z(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(_e,this),this.reset(!0)}P.keys=function(h){var l=[];for(var v in h)l.push(v);return l.reverse(),function O(){for(;l.length;){var S=l.pop();if(S in h)return O.value=S,O.done=!1,O}return O.done=!0,O}};function ve(h){if(h){var l=h[F];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var v=-1,O=function S(){for(;++v<h.length;)if(j.call(h,v))return S.value=h[v],S.done=!1,S;return S.value=R,S.done=!0,S};return O.next=O}}return{next:ze}}P.values=ve;function ze(){return{value:R,done:!0}}return z.prototype={constructor:z,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(X),!h)for(var l in this)l.charAt(0)==="t"&&j.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=R)},stop:function(){this.done=!0;var h=this.tryEntries[0],l=h.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function v(ue,oe){return Y.type="throw",Y.arg=h,l.next=ue,oe&&(l.method="next",l.arg=R),!!oe}for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O],Y=S.completion;if(S.tryLoc==="root")return v("end");if(S.tryLoc<=this.prev){var fe=j.call(S,"catchLoc"),he=j.call(S,"finallyLoc");if(fe&&he){if(this.prev<S.catchLoc)return v(S.catchLoc,!0);if(this.prev<S.finallyLoc)return v(S.finallyLoc)}else if(fe){if(this.prev<S.catchLoc)return v(S.catchLoc,!0)}else if(he){if(this.prev<S.finallyLoc)return v(S.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(h,l){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&j.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var S=O;break}}S&&(h==="break"||h==="continue")&&S.tryLoc<=l&&l<=S.finallyLoc&&(S=null);var Y=S?S.completion:{};return Y.type=h,Y.arg=l,S?(this.method="next",this.next=S.finallyLoc,D):this.complete(Y)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),D},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===h)return this.complete(v.completion,v.afterLoc),X(v),D}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===h){var O=v.completion;if(O.type==="throw"){var S=O.arg;X(v)}return S}}throw new Error("illegal catch attempt")},delegateYield:function(h,l,v){return this.delegate={iterator:ve(h),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=R),D}},P}(k.exports);try{regeneratorRuntime=G}catch(P){typeof globalThis=="object"?globalThis.regeneratorRuntime=G:Function("r","regeneratorRuntime = r")(G)}},695:function(k,G,P){"use strict";P.d(G,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var R=Array.isArray(j.material)?j.material:[j.material];R.forEach(function(L){var F,Z,W,A,H,K,V,c,de,ne,D,J,E;(F=L.map)===null||F===void 0||F.dispose(),(Z=L.lightMap)===null||Z===void 0||Z.dispose(),(W=L.bumpMap)===null||W===void 0||W.dispose(),(A=L.normalMap)===null||A===void 0||A.dispose(),(H=L.specularMap)===null||H===void 0||H.dispose(),(K=L.envMap)===null||K===void 0||K.dispose(),(V=L.alphaMap)===null||V===void 0||V.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(de=L.displacementMap)===null||de===void 0||de.dispose(),(ne=L.emissiveMap)===null||ne===void 0||ne.dispose(),(D=L.gradientMap)===null||D===void 0||D.dispose(),(J=L.metalnessMap)===null||J===void 0||J.dispose(),(E=L.roughnessMap)===null||E===void 0||E.dispose(),L.dispose()})}}},584:function(k,G,P){"use strict";P.d(G,{disposeMesh:function(){return L.Z}});var C=P(666),j=P.n(C),R=null,L=P(695),F=P(644);function Z(D){if(D.material){var J=Array.isArray(D.material)?D.material:[D.material];J.forEach(function(E){var T,q;(T=E.color)===null||T===void 0||T.convertSRGBToLinear(),(q=E.emissive)===null||q===void 0||q.convertSRGBToLinear(),E.map&&(E.map.encoding=THREE.sRGBEncoding),E.emissiveMap&&(E.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=P(568),A=P(924),H=P(360),K=P(484),V=null,c=null,de=function(){var D=(0,W.Z)(j().mark(function J(E,T){var q,le,ie,N,U,ae,se,ge,_e;return j().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return q=T.type,le=q===void 0?"blob":q,ie=T.version,N=ie===void 0?"1":ie,z.next=4,(0,H.get)(E);case 4:if(ae=z.sent,!(ae&&ae[N])){z.next=9;break}U=ae[N],z.next=15;break;case 9:return z.next=11,(0,K.Z)(fetch(E).then(function(ve){if(ve.ok)return ve[le]();throw new Error}));case 11:se=z.sent,ge=se.res,_e=se.err,_e||(U=ge,(0,H.set)(E,(0,A.Z)({},N,ge)));case 15:return z.abrupt("return",U?{url:le==="json"?E:URL.createObjectURL(U),store:U}:{url:E});case 16:case"end":return z.stop()}},J)}));return function(E,T){return D.apply(this,arguments)}}(),ne=P(705)},484:function(k,G,P){"use strict";P.d(G,{Z:function(){return j}});var C=P(42);function j(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(F){return(0,C.Z)({err:null,res:F},L)}).catch(function(F){return(0,C.Z)({err:F,res:void 0},L)})}},705:function(k,G,P){"use strict";P.d(G,{C:function(){return F},y:function(){return L}});var C=P(644),j=P.n(C),R=new Map,L=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(W,A,H,K,V){var c=A[H*3],de=A[H*3+1],ne=A[K*3],D=A[K*3+1],J=A[V*3],E=A[V*3+1],T;if(R.has(W))T=R.get(W);else{var q=Z.box3||new C.Box3;if(!Z.box3){var le=W.parameters.shapes.getPoints();q.setFromArray(le.map(function(se){return[se.x,se.y,0]}).flat())}var ie=q.getSize(new C.Vector3);Z.split&&(ie.y/=Z.split),T={box:q,size:ie},R.set(W,T)}var N=T.box,U=T.size,ae=Z.split?1-Z.split:0;return[new C.Vector2((c-N.min.x)/U.x,(de-N.min.y)/U.y+ae),new C.Vector2((ne-N.min.x)/U.x,(D-N.min.y)/U.y+ae),new C.Vector2((J-N.min.x)/U.x,(E-N.min.y)/U.y+ae)]},generateSideWallUV:function(W,A,H,K,V,c){var de=A[H*3],ne=A[H*3+1],D=A[H*3+2],J=A[K*3],E=A[K*3+1],T=A[K*3+2],q=A[V*3],le=A[V*3+1],ie=A[V*3+2],N=A[c*3],U=A[c*3+1],ae=A[c*3+2],se;if(R.has(A))se=R.get(A);else{var ge=new C.Box3;ge.setFromArray(A);var _e=ge.getSize(new C.Vector3);Z.split&&(_e.z/=1-Z.split),se={box:ge,size:_e},R.set(A,se)}var X=se.box,z=se.size;return Math.abs(ne-E)<Math.abs(de-J)?[new C.Vector2((de-X.min.x)/z.x,(D-X.min.z)/z.z),new C.Vector2((J-X.min.x)/z.x,(T-X.min.z)/z.z),new C.Vector2((q-X.min.x)/z.x,(ie-X.min.z)/z.z),new C.Vector2((N-X.min.x)/z.x,(ae-X.min.z)/z.z)]:[new C.Vector2((ne-X.min.y)/z.y,(D-X.min.z)/z.z),new C.Vector2((E-X.min.y)/z.y,(T-X.min.z)/z.z),new C.Vector2((le-X.min.y)/z.y,(ie-X.min.z)/z.z),new C.Vector2((U-X.min.y)/z.y,(ae-X.min.z)/z.z)]}}},F=function(){R.clear()}},360:function(k){"use strict";k.exports=require("idb-keyval")},644:function(k){"use strict";k.exports=require("three")},568:function(k,G,P){"use strict";P.d(G,{Z:function(){return j}});function C(R,L,F,Z,W,A,H){try{var K=R[A](H),V=K.value}catch(c){F(c);return}K.done?L(V):Promise.resolve(V).then(Z,W)}function j(R){return function(){var L=this,F=arguments;return new Promise(function(Z,W){var A=R.apply(L,F);function H(V){C(A,Z,W,H,K,"next",V)}function K(V){C(A,Z,W,H,K,"throw",V)}H(void 0)})}}},924:function(k,G,P){"use strict";P.d(G,{Z:function(){return C}});function C(j,R,L){return R in j?Object.defineProperty(j,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[R]=L,j}},42:function(k,G,P){"use strict";P.d(G,{Z:function(){return j}});var C=P(924);function j(R){for(var L=1;L<arguments.length;L++){var F=arguments[L]!=null?arguments[L]:{},Z=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(F).filter(function(W){return Object.getOwnPropertyDescriptor(F,W).enumerable}))),Z.forEach(function(W){(0,C.Z)(R,W,F[W])})}return R}}},Fe={};function Q(k){var G=Fe[k];if(G!==void 0)return G.exports;var P=Fe[k]={exports:{}};return rt[k](P,P.exports,Q),P.exports}(function(){Q.n=function(k){var G=k&&k.__esModule?function(){return k.default}:function(){return k};return Q.d(G,{a:G}),G}})(),function(){Q.d=function(k,G){for(var P in G)Q.o(G,P)&&!Q.o(k,P)&&Object.defineProperty(k,P,{enumerable:!0,get:G[P]})}}(),function(){Q.o=function(k,G){return Object.prototype.hasOwnProperty.call(k,G)}}(),function(){Q.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";Q.r(Be),Q.d(Be,{ConicPolygon:function(){return Ct},ExtrudePolygon:function(){return jt},Group:function(){return nt},Image:function(){return fe},Line:function(){return ft},MeshLine:function(){return Me},MeshLineMaterial:function(){return We},MeshLineRaycast:function(){return Ne},Node:function(){return Pe},Text:function(){return ze},Video:function(){return Le},getExtrudePolygonGeometry:function(){return kt},getLineGeometry:function(){return ht}});function k(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function G(t,i){return G=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},G(t,i)}function P(t,i){return G(t,i)}function C(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&&P(t,i)}var j=Q(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function L(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function F(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function W(t){return Z(t)}function A(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H(t){return t&&t.constructor===Symbol?"symbol":typeof t}function K(t,i){return i&&(H(i)==="object"||typeof i=="function")?i:A(t)}function V(t){var i=F();return function(){var n=W(t),a;if(i){var e=W(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return K(this,a)}}var c=Q(644);function de(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function ne(t,i,r){return de()?ne=Reflect.construct:ne=function(a,e,o){var s=[null];s.push.apply(s,e);var f=Function.bind.apply(a,s),p=new f;return o&&P(p,o.prototype),p},ne.apply(null,arguments)}function D(t,i,r){return ne.apply(null,arguments)}function J(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function E(t,i,r){return i&&J(t.prototype,i),r&&J(t,r),t}function T(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 q(t){if(Array.isArray(t))return T(t)}function le(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ie(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,i){if(!!t){if(typeof t=="string")return T(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 T(t,i)}}function U(t){return q(t)||le(t)||N(t)||ie()}var ae=Q(484);function se(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,ae.Z)(r.promise,i)),r}var ge=require("three/examples/jsm/renderers/CSS2DRenderer"),_e=require("three/examples/jsm/renderers/CSS3DRenderer"),X=Q(584),z=function(t){t&&((0,X.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||z(i)}))},ve=function(){"use strict";function t(){k(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=se(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=D(c.Mesh,U(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=D(c.Points,U(a)),this},i.createCSS2DObject=function(n){return this.object3d=new ge.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new _e.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new _e.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,U(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,U(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(){z(this.object3d)},E(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,j.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,p=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}),y=new c.PlaneGeometry(1,1,1,1);this.createMesh(y,g)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},n.setText=function(e,o){var s=(0,j.Z)(L((0,j.Z)({},this.options),{text:e}),o||{}),f=s.text,p=s.fontSize,d=s.fontFamily,m=s.fontWeight,g=s.flipX,y=s.scale,w=this.canvas;w.width=p*f.length*2,w.height=p;var b=w.getContext("2d");b.font="".concat(m," ").concat(p,"px/1 ").concat(d);var u=b.measureText(f).width;w.width=u,this.width=u,b=w.getContext("2d"),b.clearRect(0,0,w.width,w.height),g&&b.scale(-1,1),b.font="".concat(m," ").concat(p,"px/1 ").concat(d),b.textBaseline="middle",b.fillStyle="#ffffff",b.fillText(f,g?u*-1:0,w.height/2),b.restore();var _=new c.Texture(w);_.anisotropy=16,_.needsUpdate=!0;var M=this.object3d;M.material.map&&M.material.map.dispose(),M.material.map=_,M.material.needsUpdate=!0,M.scale.set(_.image.width*y,_.image.height*y,1)},r}(ve),h=Q(568),l=Q(666),v=Q.n(l),O=+c.REVISION<144,S=O?"ExtrudeBufferGeometry":"ExtrudeGeometry",Y=O?"PlaneBufferGeometry":"PlaneGeometry",fe=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(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,h.Z)(v().mark(function o(){var s,f,p,d,m,g,y,w,b,u;return v().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=e.options,f=s.transparent,p=s.blending,d=s.src,m=s.depthWrite,g=s.alphaTest,y=s.sprite,w=s.sizeAttenuation,M.next=3,new c.TextureLoader().loadAsync(d);case 3:return b=M.sent,u=y?new c.SpriteMaterial({map:b,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new c.MeshBasicMaterial({map:b,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),M.abrupt("return",u);case 6:case"end":return M.stop()}},o)}))()},n.create=function(){var e=this;return(0,h.Z)(v().mark(function o(){var s,f,p,d,m,g,y,w;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,f=s.scale,p=s.position,d=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,e.getMaterial();case 5:y=u.sent,m.set(d,y);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:w=u.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new c[Y](1,1),w),f&&e.setScale(f),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ve);function he(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=W(t),t!==null););return t}function ue(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ue=Reflect.get:ue=function(a,e,o){var s=he(a,e);if(!!s){var f=Object.getOwnPropertyDescriptor(s,e);return f.get?f.get.call(o||a):f.value}},ue(t,i,r)}function oe(t,i,r){return ue(t,i,r)}var Le=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.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,p=e.depthWrite,d=e.format,m=e.autoPlay,g=e.loop,y=e.alphaTest,w=e.sprite,b=se(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var _=new c.VideoTexture(u);_.format=d!=null?d:c.RGBAFormat,_.needsUpdate=!0;var M=w?new c.SpriteMaterial({map:_,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:y!=null?y:0}):new c.MeshBasicMaterial({map:_,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:y!=null?y:0});b.resolve(M)},!1),u.src=o,u.muted=!0,u.autoplay=m,u.loop=g,u.preload="auto",b.promise},n.create=function(){var e=this;return(0,h.Z)(v().mark(function o(){var s,f,p,d,m,g,y,w;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,f=s.scale,p=s.position,d=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,e.getMaterial();case 5:y=u.sent,m.set(d,y);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:w=u.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new c[Y](1,1),w),f&&e.setScale(f),p&&e.object3d.position.copy(p);case 21:case"end":return u.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(),oe(W(r.prototype),"dispose",this).call(this)},r}(ve),Oe=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{event:"click"},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,f=e.handler,p=e.event,d=e.zIndexFix,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),f&&p&&this.clickTarge.forEach(function(g){g.addEventListener(p,f)}),d&&(this.object3d.userData.zIndexFix=d)},n.getMaterial=function(e){return(0,h.Z)(v().mark(function o(){var s,f,p,d;return v().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),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,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,p=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,y=this;return(0,h.Z)(v().mark(function w(){var b,u,_,M;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(b="node-create-pick-object",!(g&&!g.get(b))){x.next=7;break}return g.init(b),x.next=5,y.getMaterial(s);case 5:u=x.sent,g.set(b,u);case 7:if(!g){x.next=13;break}return x.next=10,g.get(b);case 10:x.t0=x.sent,x.next=16;break;case 13:return x.next=15,y.getMaterial(s);case 15:x.t0=x.sent;case 16:_=x.t0,M=new c.Sprite(_),M.scale.set(_.map.image.width*p.x,_.map.image.height*p.y,1),M.position.copy(m),y.add(M),y.pickObject=M;case 22:case"end":return x.stop()}},w)}))()},n.dispose=function(){var e=this.options,o=e.handler,s=e.event;o&&s&&this.clickTarge.forEach(function(f){f.removeEventListener(s,o)}),oe(W(r.prototype),"dispose",this).call(this)},E(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return U(e.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(ve),Pe=Oe,nt=function(t){"use strict";C(r,t);var i=V(r);function r(){return k(this,r),i.apply(this,arguments)}var n=r.prototype;return n.create=function(){this.createGroup()},r}(ve),it=`
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
- `),we=function(t){"use strict";C(r,t);var i=B(r);function r(){L(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(M(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);we.prototype.setMatrixWorld=function(t){this.matrixWorld=t},we.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},we.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 Ne(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,p=new c.Vector3,v=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var w=m.array,b=g.position.array,y=g.width.array,u=0,S=w.length-1;u<S;u+=v){var P=w[u],Z=w[u+1];s.fromArray(b,P*3),f.fromArray(b,Z*3);var _=y[Math.floor(u/3)]!==void 0?y[Math.floor(u/3)]:1,F=t.params.Line.threshold+this.material.lineWidth*_/2,Q=F*F,ve=n.distanceSqToSegment(s,f,e,p);if(!(ve>Q)){e.applyMatrix4(this.matrixWorld);var ye=t.ray.origin.distanceTo(e);ye<t.near||ye>t.far||(i.push({distance:ye,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=S)}}}}we.prototype.raycast=Ne,we.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]},we.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},we.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 Ve(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}we.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ve(i,0,r,0,a),Ve(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,Ve(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=it,c.ShaderChunk.meshline_frag=at;var We=function(t){"use strict";C(r,t);var i=B(r);function r(n){L(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(M(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);We.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function ot(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 st(t,i){if(t==null)return{};var r=ot(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}function ut(t){if(Array.isArray(t))return t}function ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(t,i){return ut(t)||se(t,i)||H(t,i)||ct()}var He=require("popmotion"),Ce=require("three/examples/jsm//utils/BufferGeometryUtils");function Ke(t){var i=t.setPointWidth,r=t.nodes,n=new c.BufferGeometry,a=new we;return n.setFromPoints(r),a.setGeometry(n,i),a}var lt={color:new c.Color("#ffffff"),lineWidth:1},ft=function(t){"use strict";C(r,t);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},lt,a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.duration,s=e.delay,f=e.onComplete,p=e.setPointWidth,v=e.key,m=e.nodes,g=e.nodesArr,w=e.geometry,b=e.geometryArr,y=e.useGroups,u=st(e,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups"]),S=this.pencil.getSize(),P=S.width,Z=S.height,_=new We(k((0,j.Z)({},u),{resolution:new c.Vector2(P,Z)}));this.material=_;var F=w;if(!F&&m)F=Ke({nodes:m,setPointWidth:p});else if(!F&&g)F=Ce.mergeBufferGeometries(g.map(function(ve){return Ke({nodes:ve,setPointWidth:p})}),y!=null?y:!1);else if(!F&&b&&b.length>1)F=Ce.mergeBufferGeometries(b,y!=null?y:!1);else if(!F&&b&&b.length===1){var Q;Q=pe(b,1),F=Q[0]}this.createMesh(F,_)},n.addGeometries=function(e){var o=this.object3d,s=Ce.mergeBufferGeometries([o.geometry].concat(D(e)),!1);o.geometry=s},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,p=this.material.uniforms.offset,v=s!=null?s:0,m=(0,He.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:f,ease:He.linear,onUpdate:function(g){p.value.x=g.x}});this.tween=m},n.dispose=function(){var e;ie(V(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(le);function ht(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.lineWidth,e=t.projection,o=t.cacheVersion;return new Promise(function(s,f){i.postMessage({coordinatesArr:n,lineWidth:a,projection:e,workerKey:r},{cb:function(p){try{var v=new c.BufferGeometry;Object.keys(p).forEach(function(m){m==="index"?v.setIndex(new c.BufferAttribute(p[m].array,p[m].itemSize)):v.setAttribute(m,new c.BufferAttribute(p[m].array,p[m].itemSize))}),s(v)}catch(m){i.postMessage({delCache:!0,workerKey:r},{cb:f,cacheVersion:o})}},cacheVersion:o})})}var je=require("d3-array"),pt=require("earcut"),De=J.n(pt),vt=require("@turf/boolean-clockwise"),dt=J.n(vt);function mt(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 gt=require("delaunator"),yt=J.n(gt),bt=require("@turf/boolean-point-in-polygon"),wt=J.n(bt),ke=require("d3-geo"),_t=require("d3-geo-voronoi"),$e=require("d3-scale");function Mt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,ke.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,ke.geoInterpolate)(a,e),f=1/Math.ceil(o/i),p=f;p<1;)n.push(s(p)),p+=f}n.push(a=e)}),n})}function xt(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(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},v=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(v(e)):0,a!==void 0?Math.floor(v(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},w=[],b=m[0];b<=m[1];b++){var y=f(b);g(y)&&w.push([y,p(b)])}return w}function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,ke.geoContains)(i,t):wt()(t,i)}function At(t,i){var r={type:"Polygon",coordinates:t},n=pe((0,ke.geoBounds)(r),2),a=pe(n[0],2),e=a[0],o=a[1],s=pe(n[1],2),f=s[0],p=s[1];if(Math.min(Math.abs(f-e),Math.abs(p-o))<i)return[];var v=e>f||p>=89||o<=-89;return xt(i,{minLng:e,maxLng:f,minLat:o,maxLat:p}).filter(function(m){return Ue(m,r,v)})}function Pt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=Mt(t,n),e=(0,je.merge)(a),o=At(t,n),s=D(e).concat(D(o)),f={type:"Polygon",coordinates:t},p=pe((0,ke.geoBounds)(f),2),v=pe(p[0],2),m=v[0],g=v[1],w=pe(p[1],2),b=w[0],y=w[1],u=m>b||y>=89||g<=-89,S=[];if(u){var P=(0,_t.geoVoronoi)(s).triangles(),Z=new Map(s.map(function(U,Me){var me=pe(U,2),ge=me[0],Ge=me[1];return["".concat(ge,"-").concat(Ge),Me]}));P.features.forEach(function(U){var Me,me=U.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(me.forEach(function(Te){var xe=pe(Te,2),Ze=xe[0],kt=xe[1],tt="".concat(Ze,"-").concat(kt);Z.has(tt)&&ge.push(Z.get(tt))}),ge.length===3){if(ge.some(function(Te){return Te<e.length})){var Ge=U.properties.circumcenter;if(!Ue(Ge,f,u))return}(Me=S).push.apply(Me,D(ge))}})}else if(o.length)for(var ye=function(U,Me){var me,ge=[2,1,0].map(function(xe){return _e.triangles[U+xe]}),Ge=ge.map(function(xe){return s[xe]});if(ge.some(function(xe){return xe<e.length})){var Te=[0,1].map(function(xe){return(0,je.mean)(Ge,function(Ze){return Ze[xe]})});if(!Ue(Te,f,u))return"continue"}(me=S).push.apply(me,D(ge))},_e=yt().from(s),de=0,Pe=_e.triangles.length;de<Pe;de+=3)ye(de,Pe);else{var _=De().flatten(a),F=_.vertices,Q=_.holes,ve=Q===void 0?[]:Q;S=De()(F,ve,2)}var Oe=(0,$e.scaleLinear)((0,je.extent)(s,function(U){return U[0]}),[0,1]),Ee=(0,$e.scaleLinear)((0,je.extent)(s,function(U){return U[1]}),[0,1]),Re=s.map(function(U){var Me=pe(U,2),me=Me[0],ge=Me[1];return[Oe(me),Ee(ge)]}),et={points:s,indices:S,uvs:Re};return{contour:a,triangles:et}}var St=Pt,qe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=pe(e,2),s=o[0],f=o[1];return r?mt(s,f,i):[s,f,i]})});return De().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(t,i,n),e=a.vertices,o=a.holes,s=Ie(t,r,n),f=s.vertices,p=(0,je.merge)([f,e]),v=Math.round(f.length/3),m=new Set(o),g=0,w=[],b=0;b<v;b++){var y=b+1;if(y===v)y=g;else if(m.has(y)){var u=y;y=g,g=u}w.push(b,b+v,y+v),w.push(y+v,y,b)}for(var S=[],P=1;P>=0;P--)for(var Z=0;Z<v;Z+=1)S.push(Z/(v-1),P);return{indices:w,vertices:p,uvs:S,topVerts:f}}function Ye(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:Ie([t.points],i,a).vertices,uvs:r}}var Ot=function(t){"use strict";C(r,t);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,j.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,p=o.closedBottom,v=o.closedTop,m=o.includeSides,g=o.curvatureResolution,w=o.cartesian,b=o.userDataRsoOffset;dt()(n[0])||n[0].reverse();var y=St(n,{resolution:g}),u=y.contour,S=y.triangles,P=(0,je.merge)(S.uvs),Z=[],_=[],F=[],Q=0,ve=function(_e){var de=Math.round(Z.length/3),Pe=F.length;Z=Z.concat(_e.vertices),_=_.concat(_e.uvs),F=F.concat(de?_e.indices.map(function(Oe){return Oe+de}):_e.indices),e.addGroup(Pe,F.length-Pe,Q++)};if(m){var ye=Xe(u,s,f,w);ve(ye),e.userData.rso=b?Xe(u,s,f+b,w):ye}return p&&ve(Ye(S,s,P,!1,w)),v&&ve(Ye(S,f,P,!0,w)),e.setIndex(F),e[qe]("position",new c.Float32BufferAttribute(Z,3)),e[qe]("uv",new c.Float32BufferAttribute(_,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),Ct=function(t){"use strict";C(r,t);var i=B(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.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,p=e.closedTop,v=e.curvatureResolution,m=e.userDataRsoOffset,g=e.cartesian,w=new Ot(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:p,curvatureResolution:v,cartesian:g,userDataRsoOffset:m});this.createMesh(w,this.options.material)},r}(le),Qe=J(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=t.box3,e=new c[A](new c.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i,box3:a})});return(0,Qe.C)(),e}var jt=function(t){"use strict";C(r,t);var i=B(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=k((0,j.Z)({depth:1},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,h.Z)(d().mark(function o(){var s,f,p,v,m,g,w,b,y,u,S,P,Z,_,F,Q,ve,ye,_e,de,Pe,Oe,Ee,Re;return d().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(s=e.options,f=s.points,p=s.pointsArr,v=s.useGroups,m=s.depth,g=s.geometry,w=s.geometryArr,b=s.material,y=s.materialOptions,u=s.cache,S=s.box3,P=0,Z=Array.isArray(m)?m:[m],_=Array.isArray(S)?S:[S],F=b,Q=g,!(!F&&y)){U.next=26;break}if(P=y.split,ve=y.topColor,ye=y.sideColor,_e=y.sideMap,de="ExtrudePolygonMaterial:".concat(ye||_e).concat(ve||""),!(u&&!u.get(de))){U.next=16;break}return u.init(de),U.next=14,e.getMaterial(y);case 14:Pe=U.sent,u.set(de,Pe);case 16:if(!u){U.next=22;break}return U.next=19,u.get(de);case 19:U.t0=U.sent,U.next=25;break;case 22:return U.next=24,e.getMaterial(y);case 24:U.t0=U.sent;case 25:F=U.t0;case 26:!Q&&f?Q=Je({points:f,depth:Z[0],split:P,box3:_[0]}):!Q&&p?Q=Ce.mergeBufferGeometries(p.map(function(Me,me){return Je({points:Me,depth:(Oe=Z[me])!==null&&Oe!==void 0?Oe:Z[0],split:P,box3:(Ee=_[me])!==null&&Ee!==void 0?Ee:_[0]})}),v!=null?v:!1):!Q&&w&&w.length>1?Q=Ce.mergeBufferGeometries(w,v!=null?v:!1):!Q&&w&&w.length===1&&(Re=pe(w,1),Q=Re[0]),e.createMesh(Q,F);case 28:case"end":return U.stop()}},o)}))()},n.addGeometries=function(e){var o=this.object3d,s=Ce.mergeBufferGeometries([o.geometry].concat(D(e)),!1);o.geometry=s},n.getMaterial=function(e){var o=this,s=e.topColor,f=e.sideColor,p=e.sideMap,v=e.type,m=e.parameters,g=e.createCanvasObjectURL,w=e.split,b=e.maxAnisotropy;return new Promise(function(y){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var S=w,P=document.createElement("canvas"),Z=P.getContext("2d");P.height=u.height/(1-S),P.width=u.width,S&&s&&(Z.fillStyle=s,Z.fillRect(0,0,u.width,P.height*S)),p&&u instanceof HTMLImageElement?Z.drawImage(u,0,P.height*S,u.width,u.height):f&&(Z.fillStyle=f,Z.fillRect(0,P.height*S,u.width,u.height)),g&&P.toBlob(function(Q){console.log(URL.createObjectURL(Q))});var _=new c.CanvasTexture(P);_.anisotropy=b||o.pencil.renderer.capabilities.getMaxAnisotropy();var F=new c[v||"MeshBasicMaterial"]((0,j.Z)({map:_},m||{}));y(F)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,h.Z)(d().mark(function s(){var f,p,v,m,g,w,b,y,u,S,P;return d().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(f=o.options,p=f.materialOptions,v=f.cache,m=p.sideColor,g=p.sideMap,w=p.topColor,b=e.sideColor,y=e.topColor,!(y||b)){_.next=22;break}if(u="ExtrudePolygonMaterial:".concat(b||m||g||"").concat(y||w||""),!(v&&!v.get(u))){_.next=11;break}return v.init(u),_.next=9,o.getMaterial((0,j.Z)({},p,e));case 9:S=_.sent,v.set(u,S);case 11:if(!v){_.next=17;break}return _.next=14,v.get(u);case 14:_.t0=_.sent,_.next=20;break;case 17:return _.next=19,o.getMaterial((0,j.Z)({},p,e));case 19:_.t0=_.sent;case 20:P=_.t0,o.object3d.material=P;case 22:case"end":return _.stop()}},s)}))()},r}(le);function Lt(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.depth,e=t.split,o=t.projection,s=t.cacheVersion;return new Promise(function(f,p){i.postMessage({coordinatesArr:n,depth:a,split:e!=null?e:.1,projection:o,workerKey:r},{cb:function(v){try{var m=new c.BufferGeometry;Object.keys(v).forEach(function(g){m.setAttribute(g,new c.BufferAttribute(v[g].array,v[g].itemSize))}),f(m)}catch(g){i.postMessage({delCache:!0,workerKey:r},{cb:p,cacheVersion:s})}},cacheVersion:s})})}})(),module.exports=Be})();
132
+ `),Me=function(t){"use strict";C(r,t);var i=V(r);function r(){k(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(A(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);Me.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Me.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},Me.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 Ne(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,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var y=m.array,w=g.position.array,b=g.width.array,u=0,_=y.length-1;u<_;u+=d){var M=y[u],B=y[u+1];s.fromArray(w,M*3),f.fromArray(w,B*3);var x=b[Math.floor(u/3)]!==void 0?b[Math.floor(u/3)]:1,ee=t.params.Line.threshold+this.material.lineWidth*x/2,$=ee*ee,te=n.distanceSqToSegment(s,f,e,p);if(!(te>$)){e.applyMatrix4(this.matrixWorld);var ce=t.ray.origin.distanceTo(e);ce<t.near||ce>t.far||(i.push({distance:ce,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=_)}}}}Me.prototype.raycast=Ne,Me.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]},Me.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},Me.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 Ve(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}Me.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ve(i,0,r,0,a),Ve(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,Ve(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=it,c.ShaderChunk.meshline_frag=at;var We=function(t){"use strict";C(r,t);var i=V(r);function r(n){k(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(A(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);We.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function ot(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 st(t,i){if(t==null)return{};var r=ot(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}function ut(t){if(Array.isArray(t))return t}function ct(){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 ye(t,i){return ut(t)||le(t,i)||N(t,i)||ct()}var He=require("popmotion"),je=require("three/examples/jsm//utils/BufferGeometryUtils");function Ke(t){var i=t.setPointWidth,r=t.nodes,n=new c.BufferGeometry,a=new Me;return n.setFromPoints(r),a.setGeometry(n,i),a}var lt={color:new c.Color("#ffffff"),lineWidth:1},ft=function(t){"use strict";C(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},lt,a),e}var n=r.prototype;return n.create=function(){var e=this;return(0,h.Z)(v().mark(function o(){var s,f,p,d,m,g,y,w,b,u,_,M,B,x,ee,$,te,ce,me,pe;return v().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:if(s=e.options,f=s.duration,p=s.delay,d=s.onComplete,m=s.setPointWidth,g=s.key,y=s.nodes,w=s.nodesArr,b=s.geometry,u=s.geometryArr,_=s.useGroups,M=s.material,B=s.cache,x=s.cacheKey,ee=st(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),$=M,te=b,$){re.next=16;break}if(ce="LineMaterial:".concat(x),B&&!B.get(ce)&&(B.init(ce),me=e.getMaterial((0,j.Z)({},ee)),B.set(ce,me)),!B){re.next=12;break}return re.next=9,B.get(ce);case 9:re.t0=re.sent,re.next=15;break;case 12:return re.next=14,e.getMaterial(ee);case 14:re.t0=re.sent;case 15:$=re.t0;case 16:e.material=$,!te&&y?te=Ke({nodes:y,setPointWidth:m}):!te&&w?te=je.mergeBufferGeometries(w.map(function(Ce){return Ke({nodes:Ce,setPointWidth:m})}),_!=null?_:!1):!te&&u&&u.length>1?te=je.mergeBufferGeometries(u,_!=null?_:!1):!te&&u&&u.length===1&&(pe=ye(u,1),te=pe[0]),e.createMesh(te,M);case 19:case"end":return re.stop()}},o)}))()},n.getMaterial=function(e){var o=this.pencil.getSize(),s=o.width,f=o.height,p=new We(L((0,j.Z)({},e),{resolution:new c.Vector2(s,f)}));return p},n.addGeometries=function(e){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(U(e)),!1);o.geometry=s},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,p=this.material.uniforms.offset,d=s!=null?s:0,m=(0,He.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,ease:He.linear,onUpdate:function(g){p.value.x=g.x}});this.tween=m},n.dispose=function(){var e;oe(W(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ve);function ht(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.lineWidth,e=t.projection,o=t.cacheVersion;return new Promise(function(s,f){i.postMessage({coordinatesArr:n,lineWidth:a,projection:e,workerKey:r},{cb:function(p){try{var d=new c.BufferGeometry;Object.keys(p).forEach(function(m){m==="index"?d.setIndex(new c.BufferAttribute(p[m].array,p[m].itemSize)):d.setAttribute(m,new c.BufferAttribute(p[m].array,p[m].itemSize))}),s(d)}catch(m){i.postMessage({delCache:!0,workerKey:r},{cb:f,cacheVersion:o})}},cacheVersion:o})})}var ke=require("d3-array"),pt=require("earcut"),De=Q.n(pt),vt=require("@turf/boolean-clockwise"),dt=Q.n(vt);function mt(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 gt=require("delaunator"),yt=Q.n(gt),bt=require("@turf/boolean-point-in-polygon"),wt=Q.n(bt),Ee=require("d3-geo"),_t=require("d3-geo-voronoi"),$e=require("d3-scale");function Mt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Ee.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Ee.geoInterpolate)(a,e),f=1/Math.ceil(o/i),p=f;p<1;)n.push(s(p)),p+=f}n.push(a=e)}),n})}function xt(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(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+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(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},y=[],w=m[0];w<=m[1];w++){var b=f(w);g(b)&&y.push([b,p(w)])}return y}function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(i,t):wt()(t,i)}function At(t,i){var r={type:"Polygon",coordinates:t},n=ye((0,Ee.geoBounds)(r),2),a=ye(n[0],2),e=a[0],o=a[1],s=ye(n[1],2),f=s[0],p=s[1];if(Math.min(Math.abs(f-e),Math.abs(p-o))<i)return[];var d=e>f||p>=89||o<=-89;return xt(i,{minLng:e,maxLng:f,minLat:o,maxLat:p}).filter(function(m){return Ue(m,r,d)})}function Pt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=Mt(t,n),e=(0,ke.merge)(a),o=At(t,n),s=U(e).concat(U(o)),f={type:"Polygon",coordinates:t},p=ye((0,Ee.geoBounds)(f),2),d=ye(p[0],2),m=d[0],g=d[1],y=ye(p[1],2),w=y[0],b=y[1],u=m>w||b>=89||g<=-89,_=[];if(u){var M=(0,_t.geoVoronoi)(s).triangles(),B=new Map(s.map(function(I,xe){var be=ye(I,2),we=be[0],Ge=be[1];return["".concat(we,"-").concat(Ge),xe]}));M.features.forEach(function(I){var xe,be=I.geometry.coordinates[0].slice(0,3).reverse(),we=[];if(be.forEach(function(Te){var Ae=ye(Te,2),Ze=Ae[0],Lt=Ae[1],tt="".concat(Ze,"-").concat(Lt);B.has(tt)&&we.push(B.get(tt))}),we.length===3){if(we.some(function(Te){return Te<e.length})){var Ge=I.properties.circumcenter;if(!Ue(Ge,f,u))return}(xe=_).push.apply(xe,U(we))}})}else if(o.length)for(var ce=function(I,xe){var be,we=[2,1,0].map(function(Ae){return me.triangles[I+Ae]}),Ge=we.map(function(Ae){return s[Ae]});if(we.some(function(Ae){return Ae<e.length})){var Te=[0,1].map(function(Ae){return(0,ke.mean)(Ge,function(Ze){return Ze[Ae]})});if(!Ue(Te,f,u))return"continue"}(be=_).push.apply(be,U(we))},me=yt().from(s),pe=0,Se=me.triangles.length;pe<Se;pe+=3)ce(pe,Se);else{var x=De().flatten(a),ee=x.vertices,$=x.holes,te=$===void 0?[]:$;_=De()(ee,te,2)}var re=(0,$e.scaleLinear)((0,ke.extent)(s,function(I){return I[0]}),[0,1]),Ce=(0,$e.scaleLinear)((0,ke.extent)(s,function(I){return I[1]}),[0,1]),Re=s.map(function(I){var xe=ye(I,2),be=xe[0],we=xe[1];return[re(be),Ce(we)]}),et={points:s,indices:_,uvs:Re};return{contour:a,triangles:et}}var St=Pt,qe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(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=ye(e,2),s=o[0],f=o[1];return r?mt(s,f,i):[s,f,i]})});return De().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(t,i,n),e=a.vertices,o=a.holes,s=Ie(t,r,n),f=s.vertices,p=(0,ke.merge)([f,e]),d=Math.round(f.length/3),m=new Set(o),g=0,y=[],w=0;w<d;w++){var b=w+1;if(b===d)b=g;else if(m.has(b)){var u=b;b=g,g=u}y.push(w,w+d,b+d),y.push(b+d,b,w)}for(var _=[],M=1;M>=0;M--)for(var B=0;B<d;B+=1)_.push(B/(d-1),M);return{indices:y,vertices:p,uvs:_,topVerts:f}}function Ye(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:Ie([t.points],i,a).vertices,uvs:r}}var Ot=function(t){"use strict";C(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,j.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,p=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,y=o.cartesian,w=o.userDataRsoOffset;dt()(n[0])||n[0].reverse();var b=St(n,{resolution:g}),u=b.contour,_=b.triangles,M=(0,ke.merge)(_.uvs),B=[],x=[],ee=[],$=0,te=function(me){var pe=Math.round(B.length/3),Se=ee.length;B=B.concat(me.vertices),x=x.concat(me.uvs),ee=ee.concat(pe?me.indices.map(function(re){return re+pe}):me.indices),e.addGroup(Se,ee.length-Se,$++)};if(m){var ce=Xe(u,s,f,y);te(ce),e.userData.rso=w?Xe(u,s,f+w,y):ce}return p&&te(Ye(_,s,M,!1,y)),d&&te(Ye(_,f,M,!0,y)),e.setIndex(ee),e[qe]("position",new c.Float32BufferAttribute(B,3)),e[qe]("uv",new c.Float32BufferAttribute(x,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),Ct=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.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,p=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,g=e.cartesian,y=new Ot(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:p,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(y,this.options.material)},r}(ve),Qe=Q(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=t.box3,e=new c[S](new c.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i,box3:a})});return(0,Qe.C)(),e}var jt=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=L((0,j.Z)({depth:1},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,h.Z)(v().mark(function o(){var s,f,p,d,m,g,y,w,b,u,_,M,B,x,ee,$,te,ce,me,pe,Se,re,Ce,Re;return v().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(s=e.options,f=s.points,p=s.pointsArr,d=s.useGroups,m=s.depth,g=s.geometry,y=s.geometryArr,w=s.material,b=s.materialOptions,u=s.cache,_=s.box3,M=0,B=Array.isArray(m)?m:[m],x=Array.isArray(_)?_:[_],ee=w,$=g,!(!ee&&b)){I.next=26;break}if(M=b.split,te=b.topColor,ce=b.sideColor,me=b.sideMap,pe="ExtrudePolygonMaterial:".concat(ce||me).concat(te||""),!(u&&!u.get(pe))){I.next=16;break}return u.init(pe),I.next=14,e.getMaterial(b);case 14:Se=I.sent,u.set(pe,Se);case 16:if(!u){I.next=22;break}return I.next=19,u.get(pe);case 19:I.t0=I.sent,I.next=25;break;case 22:return I.next=24,e.getMaterial(b);case 24:I.t0=I.sent;case 25:ee=I.t0;case 26:!$&&f?$=Je({points:f,depth:B[0],split:M,box3:x[0]}):!$&&p?$=je.mergeBufferGeometries(p.map(function(xe,be){return Je({points:xe,depth:(re=B[be])!==null&&re!==void 0?re:B[0],split:M,box3:(Ce=x[be])!==null&&Ce!==void 0?Ce:x[0]})}),d!=null?d:!1):!$&&y&&y.length>1?$=je.mergeBufferGeometries(y,d!=null?d:!1):!$&&y&&y.length===1&&(Re=ye(y,1),$=Re[0]),e.createMesh($,ee);case 28:case"end":return I.stop()}},o)}))()},n.addGeometries=function(e){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(U(e)),!1);o.geometry=s},n.getMaterial=function(e){var o=this,s=e.topColor,f=e.sideColor,p=e.sideMap,d=e.type,m=e.parameters,g=e.createCanvasObjectURL,y=e.split,w=e.maxAnisotropy;return new Promise(function(b){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var _=y,M=document.createElement("canvas"),B=M.getContext("2d");M.height=u.height/(1-_),M.width=u.width,_&&s&&(B.fillStyle=s,B.fillRect(0,0,u.width,M.height*_)),p&&u instanceof HTMLImageElement?B.drawImage(u,0,M.height*_,u.width,u.height):f&&(B.fillStyle=f,B.fillRect(0,M.height*_,u.width,u.height)),g&&M.toBlob(function($){console.log(URL.createObjectURL($))});var x=new c.CanvasTexture(M);x.anisotropy=w||o.pencil.renderer.capabilities.getMaxAnisotropy();var ee=new c[d||"MeshBasicMaterial"]((0,j.Z)({map:x},m||{}));b(ee)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,h.Z)(v().mark(function s(){var f,p,d,m,g,y,w,b,u,_,M;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(f=o.options,p=f.materialOptions,d=f.cache,m=p.sideColor,g=p.sideMap,y=p.topColor,w=e.sideColor,b=e.topColor,!(b||w)){x.next=22;break}if(u="ExtrudePolygonMaterial:".concat(w||m||g||"").concat(b||y||""),!(d&&!d.get(u))){x.next=11;break}return d.init(u),x.next=9,o.getMaterial((0,j.Z)({},p,e));case 9:_=x.sent,d.set(u,_);case 11:if(!d){x.next=17;break}return x.next=14,d.get(u);case 14:x.t0=x.sent,x.next=20;break;case 17:return x.next=19,o.getMaterial((0,j.Z)({},p,e));case 19:x.t0=x.sent;case 20:M=x.t0,o.object3d.material=M;case 22:case"end":return x.stop()}},s)}))()},r}(ve);function kt(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.depth,e=t.split,o=t.projection,s=t.cacheVersion;return new Promise(function(f,p){i.postMessage({coordinatesArr:n,depth:a,split:e!=null?e:.1,projection:o,workerKey:r},{cb:function(d){try{var m=new c.BufferGeometry;Object.keys(d).forEach(function(g){m.setAttribute(g,new c.BufferAttribute(d[g].array,d[g].itemSize))}),f(m)}catch(g){i.postMessage({delCache:!0,workerKey:r},{cb:p,cacheVersion:s})}},cacheVersion:s})})}})(),module.exports=Be})();
@@ -1,4 +1,4 @@
1
- import*as it from"idb-keyval";import*as Kt from"three";import*as Xt from"three/examples/jsm/renderers/CSS2DRenderer";import*as at from"three/examples/jsm/renderers/CSS3DRenderer";import*as ot from"popmotion";import*as Ht from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ke from"d3-array";import*as $t from"earcut";import*as Yt from"@turf/boolean-clockwise";import*as Jt from"delaunator";import*as Qt from"@turf/boolean-point-in-polygon";import*as We from"d3-geo";import*as qt from"d3-geo-voronoi";import*as er from"d3-scale";var tr={666:function(k){var R=function(A){"use strict";var P=Object.prototype,x=P.hasOwnProperty,T,L=typeof Symbol=="function"?Symbol:{},G=L.iterator||"@@iterator",K=L.asyncIterator||"@@asyncIterator",S=L.toStringTag||"@@toStringTag";function B(p,l,m){return Object.defineProperty(p,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{B({},"")}catch(p){B=function(l,m,E){return l[m]=E}}function H(p,l,m,E){var w=l&&l.prototype instanceof ee?l:ee,q=Object.create(w.prototype),V=new ue(E||[]);return q._invoke=he(p,m,V),q}A.wrap=H;function $(p,l,m){try{return{type:"normal",arg:p.call(l,m)}}catch(E){return{type:"throw",arg:E}}}var z="suspendedStart",c="suspendedYield",ce="executing",ie="completed",W={};function ee(){}function j(){}function D(){}var te={};B(te,G,function(){return this});var ae=Object.getPrototypeOf,re=ae&&ae(ae(Se([])));re&&re!==P&&x.call(re,G)&&(te=re);var X=D.prototype=ee.prototype=Object.create(te);j.prototype=D,B(X,"constructor",D),B(D,"constructor",j),j.displayName=B(D,S,"GeneratorFunction");function I(p){["next","throw","return"].forEach(function(l){B(p,l,function(m){return this._invoke(l,m)})})}A.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===j||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,D):(p.__proto__=D,B(p,S,"GeneratorFunction")),p.prototype=Object.create(X),p},A.awrap=function(p){return{__await:p}};function ne(p,l){function m(q,V,oe,le){var se=$(p[q],p,V);if(se.type==="throw")le(se.arg);else{var ke=se.arg,Ce=ke.value;return Ce&&typeof Ce=="object"&&x.call(Ce,"__await")?l.resolve(Ce.__await).then(function(pe){m("next",pe,oe,le)},function(pe){m("throw",pe,oe,le)}):l.resolve(Ce).then(function(pe){ke.value=pe,oe(ke)},function(pe){return m("throw",pe,oe,le)})}}var E;function w(q,V){function oe(){return new l(function(le,se){m(q,V,le,se)})}return E=E?E.then(oe,oe):oe()}this._invoke=w}I(ne.prototype),B(ne.prototype,K,function(){return this}),A.AsyncIterator=ne,A.async=function(p,l,m,E,w){w===void 0&&(w=Promise);var q=new ne(H(p,l,m,E),w);return A.isGeneratorFunction(l)?q:q.next().then(function(V){return V.done?V.value:q.next()})};function he(p,l,m){var E=z;return function(q,V){if(E===ce)throw new Error("Generator is already running");if(E===ie){if(q==="throw")throw V;return je()}for(m.method=q,m.arg=V;;){var oe=m.delegate;if(oe){var le=ye(oe,m);if(le){if(le===W)continue;return le}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(E===z)throw E=ie,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);E=ce;var se=$(p,l,m);if(se.type==="normal"){if(E=m.done?ie:c,se.arg===W)continue;return{value:se.arg,done:m.done}}else se.type==="throw"&&(E=ie,m.method="throw",m.arg=se.arg)}}}function ye(p,l){var m=p.iterator[l.method];if(m===T){if(l.delegate=null,l.method==="throw"){if(p.iterator.return&&(l.method="return",l.arg=T,ye(p,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var E=$(m,p.iterator,l.arg);if(E.type==="throw")return l.method="throw",l.arg=E.arg,l.delegate=null,W;var w=E.arg;if(!w)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(w.done)l[p.resultName]=w.value,l.next=p.nextLoc,l.method!=="return"&&(l.method="next",l.arg=T);else return w;return l.delegate=null,W}I(X),B(X,S,"Generator"),B(X,G,function(){return this}),B(X,"toString",function(){return"[object Generator]"});function Q(p){var l={tryLoc:p[0]};1 in p&&(l.catchLoc=p[1]),2 in p&&(l.finallyLoc=p[2],l.afterLoc=p[3]),this.tryEntries.push(l)}function Y(p){var l=p.completion||{};l.type="normal",delete l.arg,p.completion=l}function ue(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(Q,this),this.reset(!0)}A.keys=function(p){var l=[];for(var m in p)l.push(m);return l.reverse(),function E(){for(;l.length;){var w=l.pop();if(w in p)return E.value=w,E.done=!1,E}return E.done=!0,E}};function Se(p){if(p){var l=p[G];if(l)return l.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var m=-1,E=function w(){for(;++m<p.length;)if(x.call(p,m))return w.value=p[m],w.done=!1,w;return w.value=T,w.done=!0,w};return E.next=E}}return{next:je}}A.values=Se;function je(){return{value:T,done:!0}}return ue.prototype={constructor:ue,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(Y),!p)for(var l in this)l.charAt(0)==="t"&&x.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=T)},stop:function(){this.done=!0;var p=this.tryEntries[0],l=p.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var l=this;function m(le,se){return q.type="throw",q.arg=p,l.next=le,se&&(l.method="next",l.arg=T),!!se}for(var E=this.tryEntries.length-1;E>=0;--E){var w=this.tryEntries[E],q=w.completion;if(w.tryLoc==="root")return m("end");if(w.tryLoc<=this.prev){var V=x.call(w,"catchLoc"),oe=x.call(w,"finallyLoc");if(V&&oe){if(this.prev<w.catchLoc)return m(w.catchLoc,!0);if(this.prev<w.finallyLoc)return m(w.finallyLoc)}else if(V){if(this.prev<w.catchLoc)return m(w.catchLoc,!0)}else if(oe){if(this.prev<w.finallyLoc)return m(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var m=this.tryEntries.length-1;m>=0;--m){var E=this.tryEntries[m];if(E.tryLoc<=this.prev&&x.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var w=E;break}}w&&(p==="break"||p==="continue")&&w.tryLoc<=l&&l<=w.finallyLoc&&(w=null);var q=w?w.completion:{};return q.type=p,q.arg=l,w?(this.method="next",this.next=w.finallyLoc,W):this.complete(q)},complete:function(p,l){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&l&&(this.next=l),W},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===p)return this.complete(m.completion,m.afterLoc),Y(m),W}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===p){var E=m.completion;if(E.type==="throw"){var w=E.arg;Y(m)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,m){return this.delegate={iterator:Se(p),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=T),W}},A}(k.exports);try{regeneratorRuntime=R}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(k,R,A){A.d(R,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var T=Array.isArray(x.material)?x.material:[x.material];T.forEach(function(L){var G,K,S,B,H,$,z,c,ce,ie,W,ee,j;(G=L.map)===null||G===void 0||G.dispose(),(K=L.lightMap)===null||K===void 0||K.dispose(),(S=L.bumpMap)===null||S===void 0||S.dispose(),(B=L.normalMap)===null||B===void 0||B.dispose(),(H=L.specularMap)===null||H===void 0||H.dispose(),($=L.envMap)===null||$===void 0||$.dispose(),(z=L.alphaMap)===null||z===void 0||z.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(ce=L.displacementMap)===null||ce===void 0||ce.dispose(),(ie=L.emissiveMap)===null||ie===void 0||ie.dispose(),(W=L.gradientMap)===null||W===void 0||W.dispose(),(ee=L.metalnessMap)===null||ee===void 0||ee.dispose(),(j=L.roughnessMap)===null||j===void 0||j.dispose(),L.dispose()})}}},584:function(k,R,A){A.d(R,{wf:function(){return L.Z}});var P=A(666),x=A.n(P),T=null,L=A(695),G=A(949);function K(W){if(W.material){var ee=Array.isArray(W.material)?W.material:[W.material];ee.forEach(function(j){var D,te;(D=j.color)===null||D===void 0||D.convertSRGBToLinear(),(te=j.emissive)===null||te===void 0||te.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var S=A(568),B=A(924),H=A(77),$=A(484),z=null,c=null,ce=function(){var W=(0,S.Z)(x().mark(function ee(j,D){var te,ae,re,X,I,ne,he,ye,Q;return x().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return te=D.type,ae=te===void 0?"blob":te,re=D.version,X=re===void 0?"1":re,ue.next=4,(0,H.get)(j);case 4:if(ne=ue.sent,!(ne&&ne[X])){ue.next=9;break}I=ne[X],ue.next=15;break;case 9:return ue.next=11,(0,$.Z)(fetch(j).then(function(Se){if(Se.ok)return Se[ae]();throw new Error}));case 11:he=ue.sent,ye=he.res,Q=he.err,Q||(I=ye,(0,H.set)(j,(0,B.Z)({},X,ye)));case 15:return ue.abrupt("return",I?{url:ae==="json"?j:URL.createObjectURL(I),store:I}:{url:j});case 16:case"end":return ue.stop()}},ee)}));return function(j,D){return W.apply(this,arguments)}}(),ie=A(705)},484:function(k,R,A){A.d(R,{Z:function(){return x}});var P=A(42);function x(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(G){return(0,P.Z)({err:null,res:G},L)}).catch(function(G){return(0,P.Z)({err:G,res:void 0},L)})}},705:function(k,R,A){A.d(R,{C:function(){return L},y:function(){return T}});var P=A(949),x=new Map,T=function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(K,S,B,H,$){var z=S[B*3],c=S[B*3+1],ce=S[H*3],ie=S[H*3+1],W=S[$*3],ee=S[$*3+1],j;if(x.has(K))j=x.get(K);else{var D=G.box3||new P.Box3;if(!G.box3){var te=K.parameters.shapes.getPoints();D.setFromArray(te.map(function(ne){return[ne.x,ne.y,0]}).flat())}var ae=D.getSize(new P.Vector3);G.split&&(ae.y/=G.split),j={box:D,size:ae},x.set(K,j)}var re=j.box,X=j.size,I=G.split?1-G.split:0;return[new P.Vector2((z-re.min.x)/X.x,(c-re.min.y)/X.y+I),new P.Vector2((ce-re.min.x)/X.x,(ie-re.min.y)/X.y+I),new P.Vector2((W-re.min.x)/X.x,(ee-re.min.y)/X.y+I)]},generateSideWallUV:function(K,S,B,H,$,z){var c=S[B*3],ce=S[B*3+1],ie=S[B*3+2],W=S[H*3],ee=S[H*3+1],j=S[H*3+2],D=S[$*3],te=S[$*3+1],ae=S[$*3+2],re=S[z*3],X=S[z*3+1],I=S[z*3+2],ne;if(x.has(S))ne=x.get(S);else{var he=new P.Box3;he.setFromArray(S);var ye=he.getSize(new P.Vector3);G.split&&(ye.z/=1-G.split),ne={box:he,size:ye},x.set(S,ne)}var Q=ne.box,Y=ne.size;return Math.abs(ce-ee)<Math.abs(c-W)?[new P.Vector2((c-Q.min.x)/Y.x,(ie-Q.min.z)/Y.z),new P.Vector2((W-Q.min.x)/Y.x,(j-Q.min.z)/Y.z),new P.Vector2((D-Q.min.x)/Y.x,(ae-Q.min.z)/Y.z),new P.Vector2((re-Q.min.x)/Y.x,(I-Q.min.z)/Y.z)]:[new P.Vector2((ce-Q.min.y)/Y.y,(ie-Q.min.z)/Y.z),new P.Vector2((ee-Q.min.y)/Y.y,(j-Q.min.z)/Y.z),new P.Vector2((te-Q.min.y)/Y.y,(ae-Q.min.z)/Y.z),new P.Vector2((X-Q.min.y)/Y.y,(I-Q.min.z)/Y.z)]}}},L=function(){x.clear()}},77:function(k,R,A){var P=T=>{var L={};return A.d(L,T),L},x=T=>()=>T;k.exports=P({get:()=>it.get,set:()=>it.set})},949:function(k){var R=P=>{var x={};return N.d(x,P),x},A=P=>()=>P;k.exports=Kt},568:function(k,R,A){A.d(R,{Z:function(){return x}});function P(T,L,G,K,S,B,H){try{var $=T[B](H),z=$.value}catch(c){G(c);return}$.done?L(z):Promise.resolve(z).then(K,S)}function x(T){return function(){var L=this,G=arguments;return new Promise(function(K,S){var B=T.apply(L,G);function H(z){P(B,K,S,H,$,"next",z)}function $(z){P(B,K,S,H,$,"throw",z)}H(void 0)})}}},924:function(k,R,A){A.d(R,{Z:function(){return P}});function P(x,T,L){return T in x?Object.defineProperty(x,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):x[T]=L,x}},42:function(k,R,A){A.d(R,{Z:function(){return x}});var P=A(924);function x(T){for(var L=1;L<arguments.length;L++){var G=arguments[L]!=null?arguments[L]:{},K=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(K=K.concat(Object.getOwnPropertySymbols(G).filter(function(S){return Object.getOwnPropertyDescriptor(G,S).enumerable}))),K.forEach(function(S){(0,P.Z)(T,S,G[S])})}return T}}},st={};function N(k){var R=st[k];if(R!==void 0)return R.exports;var A=st[k]={exports:{}};return tr[k](A,A.exports,N),A.exports}(function(){N.n=function(k){var R=k&&k.__esModule?function(){return k.default}:function(){return k};return N.d(R,{a:R}),R}})(),function(){N.d=function(k,R){for(var A in R)N.o(R,A)&&!N.o(k,A)&&Object.defineProperty(k,A,{enumerable:!0,get:R[A]})}}(),function(){N.o=function(k,R){return Object.prototype.hasOwnProperty.call(k,R)}}();var fe={};(function(){N.d(fe,{Ei:function(){return Nt},Yo:function(){return It},ZA:function(){return ft},Ee:function(){return ke},x1:function(){return wt},VJ:function(){return we},r7:function(){return Ue},XA:function(){return Xe},NB:function(){return lt},xv:function(){return E},nk:function(){return ut},JX:function(){return Zt},TQ:function(){return xt}});function k(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function R(e,n){return R=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},R(e,n)}function A(e,n){return R(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&&A(e,n)}var x=N(42);function T(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 L(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function G(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},K(e)}function S(e){return K(e)}function B(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(e){return e&&e.constructor===Symbol?"symbol":typeof e}function $(e,n){return n&&(H(n)==="object"||typeof n=="function")?n:B(e)}function z(e){var n=G();return function(){var i=S(e),a;if(n){var t=S(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return $(this,a)}}var c=N(949);function ce(){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 ie(e,n,r){return ce()?ie=Reflect.construct:ie=function(a,t,o){var s=[null];s.push.apply(s,t);var f=Function.bind.apply(a,s),h=new f;return o&&A(h,o.prototype),h},ie.apply(null,arguments)}function W(e,n,r){return ie.apply(null,arguments)}function ee(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 j(e,n,r){return n&&ee(e.prototype,n),r&&ee(e,r),e}function D(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 te(e){if(Array.isArray(e))return D(e)}function ae(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function re(){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 X(e,n){if(!!e){if(typeof e=="string")return D(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 D(e,n)}}function I(e){return te(e)||ae(e)||X(e)||re()}var ne=N(484);function he(){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,ne.Z)(r.promise,n)),r}var ye=e=>{var n={};return N.d(n,e),n},Q=e=>()=>e,Y=ye({CSS2DObject:()=>Xt.CSS2DObject}),ue=e=>{var n={};return N.d(n,e),n},Se=e=>()=>e,je=ue({CSS3DObject:()=>at.CSS3DObject,CSS3DSprite:()=>at.CSS3DSprite}),p=N(584),l=function(e){e&&((0,p.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||l(n)}))},m=function(){"use strict";function e(){k(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=he(),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=W(c.Mesh,I(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=W(c.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new Y.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new je.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new je.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,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new 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(){l(this.object3d)},j(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}(),E=function(e){"use strict";P(r,e);var n=z(r);function r(a){k(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.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,h=t.text,v=t.sizeAttenuation;if(f){var d=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:v}));this.object3d=d}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),b=new c.PlaneGeometry(1,1,1,1);this.createMesh(b,g)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(h)},i.setText=function(t,o){var s=(0,x.Z)(L((0,x.Z)({},this.options),{text:t}),o||{}),f=s.text,h=s.fontSize,v=s.fontFamily,d=s.fontWeight,g=s.flipX,b=s.scale,y=this.canvas;y.width=h*f.length*2,y.height=h;var _=y.getContext("2d");_.font="".concat(d," ").concat(h,"px/1 ").concat(v);var u=_.measureText(f).width;y.width=u,this.width=u,_=y.getContext("2d"),_.clearRect(0,0,y.width,y.height),g&&_.scale(-1,1),_.font="".concat(d," ").concat(h,"px/1 ").concat(v),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(f,g?u*-1:0,y.height/2),_.restore();var O=new c.Texture(y);O.anisotropy=16,O.needsUpdate=!0;var C=this.object3d;C.material.map&&C.material.map.dispose(),C.material.map=O,C.material.needsUpdate=!0,C.scale.set(O.image.width*b,O.image.height*b,1)},r}(m),w=N(568),q=N(666),V=N.n(q),oe=+c.REVISION<144,le=oe?"ExtrudeBufferGeometry":"ExtrudeGeometry",se=oe?"PlaneBufferGeometry":"PlaneGeometry",ke=function(e){"use strict";P(r,e);var n=z(r);function r(a){k(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,w.Z)(V().mark(function o(){var s,f,h,v,d,g,b,y,_,u;return V().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return s=t.options,f=s.transparent,h=s.blending,v=s.src,d=s.depthWrite,g=s.alphaTest,b=s.sprite,y=s.sizeAttenuation,C.next=3,new c.TextureLoader().loadAsync(v);case 3:return _=C.sent,u=b?new c.SpriteMaterial({map:_,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0,sizeAttenuation:y!=null?y:!0}):new c.MeshBasicMaterial({map:_,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0}),C.abrupt("return",u);case 6:case"end":return C.stop()}},o)}))()},i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,h,v,d,g,b,y;return V().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,t.getMaterial();case 5:b=u.sent,d.set(v,b);case 7:if(!d){u.next=13;break}return u.next=10,d.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:y=u.t0,t.texture=y.map,g?t.createSprite(y):t.createMesh(new c[se](1,1),y),f&&t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return u.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(m);function Ce(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=S(e),e!==null););return e}function pe(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?pe=Reflect.get:pe=function(a,t,o){var s=Ce(a,t);if(!!s){var f=Object.getOwnPropertyDescriptor(s,t);return f.get?f.get.call(o||a):f.value}},pe(e,n,r)}function De(e,n,r){return pe(e,n,r)}var ut=function(e){"use strict";P(r,e);var n=z(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.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,h=t.depthWrite,v=t.format,d=t.autoPlay,g=t.loop,b=t.alphaTest,y=t.sprite,_=he(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var O=new c.VideoTexture(u);O.format=v!=null?v:c.RGBAFormat,O.needsUpdate=!0;var C=y?new c.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:b!=null?b:0}):new c.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:b!=null?b:0});_.resolve(C)},!1),u.src=o,u.muted=!0,u.autoplay=d,u.loop=g,u.preload="auto",_.promise},i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,h,v,d,g,b,y;return V().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,t.getMaterial();case 5:b=u.sent,d.set(v,b);case 7:if(!d){u.next=13;break}return u.next=10,d.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:y=u.t0,t.video=y.map.image,g?t.createSprite(y):t.createMesh(new c[se](1,1),y),f&&t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return u.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(),De(S(r.prototype),"dispose",this).call(this)},r}(m),ct=function(e){"use strict";P(r,e);var n=z(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{event:"click"},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,f=t.handler,h=t.event,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),f&&h&&this.clickTarge.forEach(function(g){g.addEventListener(h,f)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,w.Z)(V().mark(function o(){var s,f,h,v;return V().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),h=new c.CanvasTexture(s),v=new c.SpriteMaterial({map:h,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",v);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,h=f===void 0?new c.Vector3(1,1,1):f,v=t.position,d=v===void 0?new c.Vector3(0,0,0):v,g=t.cache,b=this;return(0,w.Z)(V().mark(function y(){var _,u,O,C;return V().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(_="node-create-pick-object",!(g&&!g.get(_))){M.next=7;break}return g.init(_),M.next=5,b.getMaterial(s);case 5:u=M.sent,g.set(_,u);case 7:if(!g){M.next=13;break}return M.next=10,g.get(_);case 10:M.t0=M.sent,M.next=16;break;case 13:return M.next=15,b.getMaterial(s);case 15:M.t0=M.sent;case 16:O=M.t0,C=new c.Sprite(O),C.scale.set(O.map.image.width*h.x,O.map.image.height*h.y,1),C.position.copy(d),b.add(C),b.pickObject=C;case 22:case"end":return M.stop()}},y)}))()},i.dispose=function(){var t=this.options,o=t.handler,s=t.event;o&&s&&this.clickTarge.forEach(function(f){f.removeEventListener(s,o)}),De(S(r.prototype),"dispose",this).call(this)},j(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return I(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(m),lt=ct,ft=function(e){"use strict";P(r,e);var n=z(r);function r(){return k(this,r),n.apply(this,arguments)}var i=r.prototype;return i.create=function(){this.createGroup()},r}(m),ht=`
1
+ import*as it from"idb-keyval";import*as Kt from"three";import*as Xt from"three/examples/jsm/renderers/CSS2DRenderer";import*as at from"three/examples/jsm/renderers/CSS3DRenderer";import*as ot from"popmotion";import*as Ht from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ke from"d3-array";import*as $t from"earcut";import*as Yt from"@turf/boolean-clockwise";import*as Jt from"delaunator";import*as Qt from"@turf/boolean-point-in-polygon";import*as We from"d3-geo";import*as qt from"d3-geo-voronoi";import*as er from"d3-scale";var tr={666:function(k){var R=function(M){"use strict";var C=Object.prototype,x=C.hasOwnProperty,T,L=typeof Symbol=="function"?Symbol:{},z=L.iterator||"@@iterator",F=L.asyncIterator||"@@asyncIterator",O=L.toStringTag||"@@toStringTag";function B(p,l,m){return Object.defineProperty(p,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{B({},"")}catch(p){B=function(l,m,E){return l[m]=E}}function X(p,l,m,E){var w=l&&l.prototype instanceof q?l:q,Q=Object.create(w.prototype),U=new fe(E||[]);return Q._invoke=ge(p,m,U),Q}M.wrap=X;function H(p,l,m){try{return{type:"normal",arg:p.call(l,m)}}catch(E){return{type:"throw",arg:E}}}var W="suspendedStart",c="suspendedYield",pe="executing",oe="completed",D={};function q(){}function j(){}function V(){}var ee={};B(ee,z,function(){return this});var se=Object.getPrototypeOf,te=se&&se(se(Ce([])));te&&te!==C&&x.call(te,z)&&(ee=te);var K=V.prototype=q.prototype=Object.create(ee);j.prototype=V,B(K,"constructor",V),B(V,"constructor",j),j.displayName=B(V,O,"GeneratorFunction");function Z(p){["next","throw","return"].forEach(function(l){B(p,l,function(m){return this._invoke(l,m)})})}M.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===j||(l.displayName||l.name)==="GeneratorFunction":!1},M.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,V):(p.__proto__=V,B(p,O,"GeneratorFunction")),p.prototype=Object.create(K),p},M.awrap=function(p){return{__await:p}};function ae(p,l){function m(Q,U,ue,ve){var ce=H(p[Q],p,U);if(ce.type==="throw")ve(ce.arg);else{var Re=ce.arg,Oe=Re.value;return Oe&&typeof Oe=="object"&&x.call(Oe,"__await")?l.resolve(Oe.__await).then(function(ye){m("next",ye,ue,ve)},function(ye){m("throw",ye,ue,ve)}):l.resolve(Oe).then(function(ye){Re.value=ye,ue(Re)},function(ye){return m("throw",ye,ue,ve)})}}var E;function w(Q,U){function ue(){return new l(function(ve,ce){m(Q,U,ve,ce)})}return E=E?E.then(ue,ue):ue()}this._invoke=w}Z(ae.prototype),B(ae.prototype,F,function(){return this}),M.AsyncIterator=ae,M.async=function(p,l,m,E,w){w===void 0&&(w=Promise);var Q=new ae(X(p,l,m,E),w);return M.isGeneratorFunction(l)?Q:Q.next().then(function(U){return U.done?U.value:Q.next()})};function ge(p,l,m){var E=W;return function(Q,U){if(E===pe)throw new Error("Generator is already running");if(E===oe){if(Q==="throw")throw U;return ke()}for(m.method=Q,m.arg=U;;){var ue=m.delegate;if(ue){var ve=xe(ue,m);if(ve){if(ve===D)continue;return ve}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(E===W)throw E=oe,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);E=pe;var ce=H(p,l,m);if(ce.type==="normal"){if(E=m.done?oe:c,ce.arg===D)continue;return{value:ce.arg,done:m.done}}else ce.type==="throw"&&(E=oe,m.method="throw",m.arg=ce.arg)}}}function xe(p,l){var m=p.iterator[l.method];if(m===T){if(l.delegate=null,l.method==="throw"){if(p.iterator.return&&(l.method="return",l.arg=T,xe(p,l),l.method==="throw"))return D;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var E=H(m,p.iterator,l.arg);if(E.type==="throw")return l.method="throw",l.arg=E.arg,l.delegate=null,D;var w=E.arg;if(!w)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,D;if(w.done)l[p.resultName]=w.value,l.next=p.nextLoc,l.method!=="return"&&(l.method="next",l.arg=T);else return w;return l.delegate=null,D}Z(K),B(K,O,"Generator"),B(K,z,function(){return this}),B(K,"toString",function(){return"[object Generator]"});function J(p){var l={tryLoc:p[0]};1 in p&&(l.catchLoc=p[1]),2 in p&&(l.finallyLoc=p[2],l.afterLoc=p[3]),this.tryEntries.push(l)}function Y(p){var l=p.completion||{};l.type="normal",delete l.arg,p.completion=l}function fe(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(J,this),this.reset(!0)}M.keys=function(p){var l=[];for(var m in p)l.push(m);return l.reverse(),function E(){for(;l.length;){var w=l.pop();if(w in p)return E.value=w,E.done=!1,E}return E.done=!0,E}};function Ce(p){if(p){var l=p[z];if(l)return l.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var m=-1,E=function w(){for(;++m<p.length;)if(x.call(p,m))return w.value=p[m],w.done=!1,w;return w.value=T,w.done=!0,w};return E.next=E}}return{next:ke}}M.values=Ce;function ke(){return{value:T,done:!0}}return fe.prototype={constructor:fe,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(Y),!p)for(var l in this)l.charAt(0)==="t"&&x.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=T)},stop:function(){this.done=!0;var p=this.tryEntries[0],l=p.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var l=this;function m(ve,ce){return Q.type="throw",Q.arg=p,l.next=ve,ce&&(l.method="next",l.arg=T),!!ce}for(var E=this.tryEntries.length-1;E>=0;--E){var w=this.tryEntries[E],Q=w.completion;if(w.tryLoc==="root")return m("end");if(w.tryLoc<=this.prev){var U=x.call(w,"catchLoc"),ue=x.call(w,"finallyLoc");if(U&&ue){if(this.prev<w.catchLoc)return m(w.catchLoc,!0);if(this.prev<w.finallyLoc)return m(w.finallyLoc)}else if(U){if(this.prev<w.catchLoc)return m(w.catchLoc,!0)}else if(ue){if(this.prev<w.finallyLoc)return m(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var m=this.tryEntries.length-1;m>=0;--m){var E=this.tryEntries[m];if(E.tryLoc<=this.prev&&x.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var w=E;break}}w&&(p==="break"||p==="continue")&&w.tryLoc<=l&&l<=w.finallyLoc&&(w=null);var Q=w?w.completion:{};return Q.type=p,Q.arg=l,w?(this.method="next",this.next=w.finallyLoc,D):this.complete(Q)},complete:function(p,l){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&l&&(this.next=l),D},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===p)return this.complete(m.completion,m.afterLoc),Y(m),D}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===p){var E=m.completion;if(E.type==="throw"){var w=E.arg;Y(m)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,m){return this.delegate={iterator:Ce(p),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=T),D}},M}(k.exports);try{regeneratorRuntime=R}catch(M){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(k,R,M){M.d(R,{Z:function(){return C}});function C(x){if(x.geometry&&x.geometry.dispose(),x.material){var T=Array.isArray(x.material)?x.material:[x.material];T.forEach(function(L){var z,F,O,B,X,H,W,c,pe,oe,D,q,j;(z=L.map)===null||z===void 0||z.dispose(),(F=L.lightMap)===null||F===void 0||F.dispose(),(O=L.bumpMap)===null||O===void 0||O.dispose(),(B=L.normalMap)===null||B===void 0||B.dispose(),(X=L.specularMap)===null||X===void 0||X.dispose(),(H=L.envMap)===null||H===void 0||H.dispose(),(W=L.alphaMap)===null||W===void 0||W.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(pe=L.displacementMap)===null||pe===void 0||pe.dispose(),(oe=L.emissiveMap)===null||oe===void 0||oe.dispose(),(D=L.gradientMap)===null||D===void 0||D.dispose(),(q=L.metalnessMap)===null||q===void 0||q.dispose(),(j=L.roughnessMap)===null||j===void 0||j.dispose(),L.dispose()})}}},584:function(k,R,M){M.d(R,{wf:function(){return L.Z}});var C=M(666),x=M.n(C),T=null,L=M(695),z=M(949);function F(D){if(D.material){var q=Array.isArray(D.material)?D.material:[D.material];q.forEach(function(j){var V,ee;(V=j.color)===null||V===void 0||V.convertSRGBToLinear(),(ee=j.emissive)===null||ee===void 0||ee.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=M(568),B=M(924),X=M(77),H=M(484),W=null,c=null,pe=function(){var D=(0,O.Z)(x().mark(function q(j,V){var ee,se,te,K,Z,ae,ge,xe,J;return x().wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return ee=V.type,se=ee===void 0?"blob":ee,te=V.version,K=te===void 0?"1":te,fe.next=4,(0,X.get)(j);case 4:if(ae=fe.sent,!(ae&&ae[K])){fe.next=9;break}Z=ae[K],fe.next=15;break;case 9:return fe.next=11,(0,H.Z)(fetch(j).then(function(Ce){if(Ce.ok)return Ce[se]();throw new Error}));case 11:ge=fe.sent,xe=ge.res,J=ge.err,J||(Z=xe,(0,X.set)(j,(0,B.Z)({},K,xe)));case 15:return fe.abrupt("return",Z?{url:se==="json"?j:URL.createObjectURL(Z),store:Z}:{url:j});case 16:case"end":return fe.stop()}},q)}));return function(j,V){return D.apply(this,arguments)}}(),oe=M(705)},484:function(k,R,M){M.d(R,{Z:function(){return x}});var C=M(42);function x(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(z){return(0,C.Z)({err:null,res:z},L)}).catch(function(z){return(0,C.Z)({err:z,res:void 0},L)})}},705:function(k,R,M){M.d(R,{C:function(){return L},y:function(){return T}});var C=M(949),x=new Map,T=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,O,B,X,H){var W=O[B*3],c=O[B*3+1],pe=O[X*3],oe=O[X*3+1],D=O[H*3],q=O[H*3+1],j;if(x.has(F))j=x.get(F);else{var V=z.box3||new C.Box3;if(!z.box3){var ee=F.parameters.shapes.getPoints();V.setFromArray(ee.map(function(ae){return[ae.x,ae.y,0]}).flat())}var se=V.getSize(new C.Vector3);z.split&&(se.y/=z.split),j={box:V,size:se},x.set(F,j)}var te=j.box,K=j.size,Z=z.split?1-z.split:0;return[new C.Vector2((W-te.min.x)/K.x,(c-te.min.y)/K.y+Z),new C.Vector2((pe-te.min.x)/K.x,(oe-te.min.y)/K.y+Z),new C.Vector2((D-te.min.x)/K.x,(q-te.min.y)/K.y+Z)]},generateSideWallUV:function(F,O,B,X,H,W){var c=O[B*3],pe=O[B*3+1],oe=O[B*3+2],D=O[X*3],q=O[X*3+1],j=O[X*3+2],V=O[H*3],ee=O[H*3+1],se=O[H*3+2],te=O[W*3],K=O[W*3+1],Z=O[W*3+2],ae;if(x.has(O))ae=x.get(O);else{var ge=new C.Box3;ge.setFromArray(O);var xe=ge.getSize(new C.Vector3);z.split&&(xe.z/=1-z.split),ae={box:ge,size:xe},x.set(O,ae)}var J=ae.box,Y=ae.size;return Math.abs(pe-q)<Math.abs(c-D)?[new C.Vector2((c-J.min.x)/Y.x,(oe-J.min.z)/Y.z),new C.Vector2((D-J.min.x)/Y.x,(j-J.min.z)/Y.z),new C.Vector2((V-J.min.x)/Y.x,(se-J.min.z)/Y.z),new C.Vector2((te-J.min.x)/Y.x,(Z-J.min.z)/Y.z)]:[new C.Vector2((pe-J.min.y)/Y.y,(oe-J.min.z)/Y.z),new C.Vector2((q-J.min.y)/Y.y,(j-J.min.z)/Y.z),new C.Vector2((ee-J.min.y)/Y.y,(se-J.min.z)/Y.z),new C.Vector2((K-J.min.y)/Y.y,(Z-J.min.z)/Y.z)]}}},L=function(){x.clear()}},77:function(k,R,M){var C=T=>{var L={};return M.d(L,T),L},x=T=>()=>T;k.exports=C({get:()=>it.get,set:()=>it.set})},949:function(k){var R=C=>{var x={};return I.d(x,C),x},M=C=>()=>C;k.exports=Kt},568:function(k,R,M){M.d(R,{Z:function(){return x}});function C(T,L,z,F,O,B,X){try{var H=T[B](X),W=H.value}catch(c){z(c);return}H.done?L(W):Promise.resolve(W).then(F,O)}function x(T){return function(){var L=this,z=arguments;return new Promise(function(F,O){var B=T.apply(L,z);function X(W){C(B,F,O,X,H,"next",W)}function H(W){C(B,F,O,X,H,"throw",W)}X(void 0)})}}},924:function(k,R,M){M.d(R,{Z:function(){return C}});function C(x,T,L){return T in x?Object.defineProperty(x,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):x[T]=L,x}},42:function(k,R,M){M.d(R,{Z:function(){return x}});var C=M(924);function x(T){for(var L=1;L<arguments.length;L++){var z=arguments[L]!=null?arguments[L]:{},F=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(z).filter(function(O){return Object.getOwnPropertyDescriptor(z,O).enumerable}))),F.forEach(function(O){(0,C.Z)(T,O,z[O])})}return T}}},st={};function I(k){var R=st[k];if(R!==void 0)return R.exports;var M=st[k]={exports:{}};return tr[k](M,M.exports,I),M.exports}(function(){I.n=function(k){var R=k&&k.__esModule?function(){return k.default}:function(){return k};return I.d(R,{a:R}),R}})(),function(){I.d=function(k,R){for(var M in R)I.o(R,M)&&!I.o(k,M)&&Object.defineProperty(k,M,{enumerable:!0,get:R[M]})}}(),function(){I.o=function(k,R){return Object.prototype.hasOwnProperty.call(k,R)}}();var de={};(function(){I.d(de,{Ei:function(){return Nt},Yo:function(){return It},ZA:function(){return ft},Ee:function(){return Re},x1:function(){return wt},VJ:function(){return Ae},r7:function(){return Ue},XA:function(){return Xe},NB:function(){return lt},xv:function(){return E},nk:function(){return ut},JX:function(){return Zt},TQ:function(){return xt}});function k(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function R(e,n){return R=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},R(e,n)}function M(e,n){return R(e,n)}function C(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&&M(e,n)}var x=I(42);function T(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 L(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function z(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function O(e){return F(e)}function B(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X(e){return e&&e.constructor===Symbol?"symbol":typeof e}function H(e,n){return n&&(X(n)==="object"||typeof n=="function")?n:B(e)}function W(e){var n=z();return function(){var i=O(e),a;if(n){var t=O(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return H(this,a)}}var c=I(949);function pe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function oe(e,n,r){return pe()?oe=Reflect.construct:oe=function(a,t,o){var s=[null];s.push.apply(s,t);var f=Function.bind.apply(a,s),h=new f;return o&&M(h,o.prototype),h},oe.apply(null,arguments)}function D(e,n,r){return oe.apply(null,arguments)}function q(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 j(e,n,r){return n&&q(e.prototype,n),r&&q(e,r),e}function V(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 ee(e){if(Array.isArray(e))return V(e)}function se(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function te(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(e,n){if(!!e){if(typeof e=="string")return V(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 V(e,n)}}function Z(e){return ee(e)||se(e)||K(e)||te()}var ae=I(484);function ge(){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,ae.Z)(r.promise,n)),r}var xe=e=>{var n={};return I.d(n,e),n},J=e=>()=>e,Y=xe({CSS2DObject:()=>Xt.CSS2DObject}),fe=e=>{var n={};return I.d(n,e),n},Ce=e=>()=>e,ke=fe({CSS3DObject:()=>at.CSS3DObject,CSS3DSprite:()=>at.CSS3DSprite}),p=I(584),l=function(e){e&&((0,p.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||l(n)}))},m=function(){"use strict";function e(){k(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ge(),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=D(c.Mesh,Z(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=D(c.Points,Z(a)),this},n.createCSS2DObject=function(i){return this.object3d=new Y.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new ke.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new ke.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,Z(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,Z(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(){l(this.object3d)},j(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}(),E=function(e){"use strict";C(r,e);var n=W(r);function r(a){k(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.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,h=t.text,v=t.sizeAttenuation;if(f){var d=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:v}));this.object3d=d}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),y=new c.PlaneGeometry(1,1,1,1);this.createMesh(y,g)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(h)},i.setText=function(t,o){var s=(0,x.Z)(L((0,x.Z)({},this.options),{text:t}),o||{}),f=s.text,h=s.fontSize,v=s.fontFamily,d=s.fontWeight,g=s.flipX,y=s.scale,b=this.canvas;b.width=h*f.length*2,b.height=h;var _=b.getContext("2d");_.font="".concat(d," ").concat(h,"px/1 ").concat(v);var u=_.measureText(f).width;b.width=u,this.width=u,_=b.getContext("2d"),_.clearRect(0,0,b.width,b.height),g&&_.scale(-1,1),_.font="".concat(d," ").concat(h,"px/1 ").concat(v),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(f,g?u*-1:0,b.height/2),_.restore();var A=new c.Texture(b);A.anisotropy=16,A.needsUpdate=!0;var P=this.object3d;P.material.map&&P.material.map.dispose(),P.material.map=A,P.material.needsUpdate=!0,P.scale.set(A.image.width*y,A.image.height*y,1)},r}(m),w=I(568),Q=I(666),U=I.n(Q),ue=+c.REVISION<144,ve=ue?"ExtrudeBufferGeometry":"ExtrudeGeometry",ce=ue?"PlaneBufferGeometry":"PlaneGeometry",Re=function(e){"use strict";C(r,e);var n=W(r);function r(a){k(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,w.Z)(U().mark(function o(){var s,f,h,v,d,g,y,b,_,u;return U().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return s=t.options,f=s.transparent,h=s.blending,v=s.src,d=s.depthWrite,g=s.alphaTest,y=s.sprite,b=s.sizeAttenuation,P.next=3,new c.TextureLoader().loadAsync(v);case 3:return _=P.sent,u=y?new c.SpriteMaterial({map:_,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0,sizeAttenuation:b!=null?b:!0}):new c.MeshBasicMaterial({map:_,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0}),P.abrupt("return",u);case 6:case"end":return P.stop()}},o)}))()},i.create=function(){var t=this;return(0,w.Z)(U().mark(function o(){var s,f,h,v,d,g,y,b;return U().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,t.getMaterial();case 5:y=u.sent,d.set(v,y);case 7:if(!d){u.next=13;break}return u.next=10,d.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:b=u.t0,t.texture=b.map,g?t.createSprite(b):t.createMesh(new c[ce](1,1),b),f&&t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return u.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(m);function Oe(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=O(e),e!==null););return e}function ye(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ye=Reflect.get:ye=function(a,t,o){var s=Oe(a,t);if(!!s){var f=Object.getOwnPropertyDescriptor(s,t);return f.get?f.get.call(o||a):f.value}},ye(e,n,r)}function De(e,n,r){return ye(e,n,r)}var ut=function(e){"use strict";C(r,e);var n=W(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.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,h=t.depthWrite,v=t.format,d=t.autoPlay,g=t.loop,y=t.alphaTest,b=t.sprite,_=ge(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var A=new c.VideoTexture(u);A.format=v!=null?v:c.RGBAFormat,A.needsUpdate=!0;var P=b?new c.SpriteMaterial({map:A,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0}):new c.MeshBasicMaterial({map:A,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0});_.resolve(P)},!1),u.src=o,u.muted=!0,u.autoplay=d,u.loop=g,u.preload="auto",_.promise},i.create=function(){var t=this;return(0,w.Z)(U().mark(function o(){var s,f,h,v,d,g,y,b;return U().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,t.getMaterial();case 5:y=u.sent,d.set(v,y);case 7:if(!d){u.next=13;break}return u.next=10,d.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:b=u.t0,t.video=b.map.image,g?t.createSprite(b):t.createMesh(new c[ce](1,1),b),f&&t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return u.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(),De(O(r.prototype),"dispose",this).call(this)},r}(m),ct=function(e){"use strict";C(r,e);var n=W(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{event:"click"},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,f=t.handler,h=t.event,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),f&&h&&this.clickTarge.forEach(function(g){g.addEventListener(h,f)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,w.Z)(U().mark(function o(){var s,f,h,v;return U().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),h=new c.CanvasTexture(s),v=new c.SpriteMaterial({map:h,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",v);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,h=f===void 0?new c.Vector3(1,1,1):f,v=t.position,d=v===void 0?new c.Vector3(0,0,0):v,g=t.cache,y=this;return(0,w.Z)(U().mark(function b(){var _,u,A,P;return U().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(_="node-create-pick-object",!(g&&!g.get(_))){S.next=7;break}return g.init(_),S.next=5,y.getMaterial(s);case 5:u=S.sent,g.set(_,u);case 7:if(!g){S.next=13;break}return S.next=10,g.get(_);case 10:S.t0=S.sent,S.next=16;break;case 13:return S.next=15,y.getMaterial(s);case 15:S.t0=S.sent;case 16:A=S.t0,P=new c.Sprite(A),P.scale.set(A.map.image.width*h.x,A.map.image.height*h.y,1),P.position.copy(d),y.add(P),y.pickObject=P;case 22:case"end":return S.stop()}},b)}))()},i.dispose=function(){var t=this.options,o=t.handler,s=t.event;o&&s&&this.clickTarge.forEach(function(f){f.removeEventListener(s,o)}),De(O(r.prototype),"dispose",this).call(this)},j(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return Z(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(m),lt=ct,ft=function(e){"use strict";C(r,e);var n=W(r);function r(){return k(this,r),n.apply(this,arguments)}var i=r.prototype;return i.create=function(){this.createGroup()},r}(m),ht=`
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
- `),we=function(e){"use strict";P(r,e);var n=z(r);function r(){k(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(B(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(c.BufferGeometry);we.prototype.setMatrixWorld=function(e){this.matrixWorld=e},we.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},we.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 Xe(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,h=new c.Vector3,v=this instanceof c.LineSegments?2:1,d=o.index,g=o.attributes;if(d!==null)for(var b=d.array,y=g.position.array,_=g.width.array,u=0,O=b.length-1;u<O;u+=v){var C=b[u],Z=b[u+1];s.fromArray(y,C*3),f.fromArray(y,Z*3);var M=_[Math.floor(u/3)]!==void 0?_[Math.floor(u/3)]:1,F=e.params.Line.threshold+this.material.lineWidth*M/2,J=F*F,de=i.distanceSqToSegment(s,f,t,h);if(!(de>J)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:h.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=O)}}}}we.prototype.raycast=Xe,we.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]},we.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},we.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 Ve(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}we.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ve(n,0,r,0,a),Ve(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,Ve(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=ht,c.ShaderChunk.meshline_frag=pt;var Ue=function(e){"use strict";P(r,e);var n=z(r);function r(i){k(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(B(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(c.ShaderMaterial);Ue.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 vt(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 dt(e,n){if(e==null)return{};var r=vt(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}function mt(e){if(Array.isArray(e))return e}function gt(){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 mt(e)||ae(e,n)||X(e,n)||gt()}var _t=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,He=_t({animate:()=>ot.animate,linear:()=>ot.linear}),yt=e=>{var n={};return N.d(n,e),n},mr=e=>()=>e,Ee=yt({mergeBufferGeometries:()=>Ht.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new c.BufferGeometry,a=new we;return i.setFromPoints(r),a.setGeometry(i,n),a}var bt={color:new c.Color("#ffffff"),lineWidth:1},wt=function(e){"use strict";P(r,e);var n=z(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},bt,a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.duration,s=t.delay,f=t.onComplete,h=t.setPointWidth,v=t.key,d=t.nodes,g=t.nodesArr,b=t.geometry,y=t.geometryArr,_=t.useGroups,u=dt(t,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups"]),O=this.pencil.getSize(),C=O.width,Z=O.height,M=new Ue(L((0,x.Z)({},u),{resolution:new c.Vector2(C,Z)}));this.material=M;var F=b;if(!F&&d)F=$e({nodes:d,setPointWidth:h});else if(!F&&g)F=Ee.mergeBufferGeometries(g.map(function(de){return $e({nodes:de,setPointWidth:h})}),_!=null?_:!1);else if(!F&&y&&y.length>1)F=Ee.mergeBufferGeometries(y,_!=null?_:!1);else if(!F&&y&&y.length===1){var J;J=ve(y,1),F=J[0]}this.createMesh(F,M)},i.addGeometries=function(t){var o=this.object3d,s=Ee.mergeBufferGeometries([o.geometry].concat(I(t)),!1);o.geometry=s},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,h=this.material.uniforms.offset,v=s!=null?s:0,d=(0,He.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:f,ease:He.linear,onUpdate:function(g){h.value.x=g.x}});this.tween=d},i.dispose=function(){var t;De(S(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(m);function xt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.lineWidth,t=e.projection,o=e.cacheVersion;return new Promise(function(s,f){n.postMessage({coordinatesArr:i,lineWidth:a,projection:t,workerKey:r},{cb:function(h){try{var v=new c.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new c.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new c.BufferAttribute(h[d].array,h[d].itemSize))}),s(v)}catch(d){n.postMessage({delCache:!0,workerKey:r},{cb:f,cacheVersion:o})}},cacheVersion:o})})}var At=e=>{var n={};return N.d(n,e),n},gr=e=>()=>e,Le=At({extent:()=>Ke.extent,mean:()=>Ke.mean,merge:()=>Ke.merge}),Mt=e=>{var n={};return N.d(n,e),n},_r=e=>()=>e,Ne=Mt({default:()=>$t.default}),Pt=e=>{var n={};return N.d(n,e),n},yr=e=>()=>e,St=Pt({default:()=>Yt.default});function Ct(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 Ot=e=>{var n={};return N.d(n,e),n},br=e=>()=>e,Et=Ot({default:()=>Jt.default}),Lt=e=>{var n={};return N.d(n,e),n},wr=e=>()=>e,jt=Lt({default:()=>Qt.default}),kt=e=>{var n={};return N.d(n,e),n},xr=e=>()=>e,Re=kt({geoBounds:()=>We.geoBounds,geoContains:()=>We.geoContains,geoDistance:()=>We.geoDistance,geoInterpolate:()=>We.geoInterpolate}),Rt=e=>{var n={};return N.d(n,e),n},Ar=e=>()=>e,Tt=Rt({geoVoronoi:()=>qt.geoVoronoi}),Bt=e=>{var n={};return N.d(n,e),n},Mr=e=>()=>e,Ye=Bt({scaleLinear:()=>er.scaleLinear});function Gt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Re.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,Re.geoInterpolate)(a,t),f=1/Math.ceil(o/n),h=f;h<1;)i.push(s(h)),h+=f}i.push(a=t)}),i})}function zt(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(u){return u/s*360%360-180},h=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},v=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(v(t)):0,a!==void 0?Math.floor(v(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(u){return u<=i}:i===void 0?function(u){return u>=r}:i>=r?function(u){return u>=r&&u<=i}:function(u){return u>=r||u<=i},b=[],y=d[0];y<=d[1];y++){var _=f(y);g(_)&&b.push([_,h(y)])}return b}function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Re.geoContains)(n,e):(0,jt.default)(e,n)}function Wt(e,n){var r={type:"Polygon",coordinates:e},i=ve((0,Re.geoBounds)(r),2),a=ve(i[0],2),t=a[0],o=a[1],s=ve(i[1],2),f=s[0],h=s[1];if(Math.min(Math.abs(f-t),Math.abs(h-o))<n)return[];var v=t>f||h>=89||o<=-89;return zt(n,{minLng:t,maxLng:f,minLat:o,maxLat:h}).filter(function(d){return Ie(d,r,v)})}function Dt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Gt(e,i),t=(0,Le.merge)(a),o=Wt(e,i),s=I(t).concat(I(o)),f={type:"Polygon",coordinates:e},h=ve((0,Re.geoBounds)(f),2),v=ve(h[0],2),d=v[0],g=v[1],b=ve(h[1],2),y=b[0],_=b[1],u=d>y||_>=89||g<=-89,O=[];if(u){var C=(0,Tt.geoVoronoi)(s).triangles(),Z=new Map(s.map(function(U,Ae){var ge=ve(U,2),_e=ge[0],Ge=ge[1];return["".concat(_e,"-").concat(Ge),Ae]}));C.features.forEach(function(U){var Ae,ge=U.geometry.coordinates[0].slice(0,3).reverse(),_e=[];if(ge.forEach(function(ze){var Me=ve(ze,2),Fe=Me[0],Ft=Me[1],nt="".concat(Fe,"-").concat(Ft);Z.has(nt)&&_e.push(Z.get(nt))}),_e.length===3){if(_e.some(function(ze){return ze<t.length})){var Ge=U.properties.circumcenter;if(!Ie(Ge,f,u))return}(Ae=O).push.apply(Ae,I(_e))}})}else if(o.length)for(var be=function(U,Ae){var ge,_e=[2,1,0].map(function(Me){return xe.triangles[U+Me]}),Ge=_e.map(function(Me){return s[Me]});if(_e.some(function(Me){return Me<t.length})){var ze=[0,1].map(function(Me){return(0,Le.mean)(Ge,function(Fe){return Fe[Me]})});if(!Ie(ze,f,u))return"continue"}(ge=O).push.apply(ge,I(_e))},xe=Et.default.from(s),me=0,Pe=xe.triangles.length;me<Pe;me+=3)be(me,Pe);else{var M=Ne.default.flatten(a),F=M.vertices,J=M.holes,de=J===void 0?[]:J;O=(0,Ne.default)(F,de,2)}var Oe=(0,Ye.scaleLinear)((0,Le.extent)(s,function(U){return U[0]}),[0,1]),Te=(0,Ye.scaleLinear)((0,Le.extent)(s,function(U){return U[1]}),[0,1]),Be=s.map(function(U){var Ae=ve(U,2),ge=Ae[0],_e=Ae[1];return[Oe(ge),Te(_e)]}),rt={points:s,indices:O,uvs:Be};return{contour:a,triangles:rt}}var Vt=Dt,Je=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ze(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=ve(t,2),s=o[0],f=o[1];return r?Ct(s,f,n):[s,f,n]})});return Ne.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ze(e,n,i),t=a.vertices,o=a.holes,s=Ze(e,r,i),f=s.vertices,h=(0,Le.merge)([f,t]),v=Math.round(f.length/3),d=new Set(o),g=0,b=[],y=0;y<v;y++){var _=y+1;if(_===v)_=g;else if(d.has(_)){var u=_;_=g,g=u}b.push(y,y+v,_+v),b.push(_+v,_,y)}for(var O=[],C=1;C>=0;C--)for(var Z=0;Z<v;Z+=1)O.push(Z/(v-1),C);return{indices:b,vertices:h,uvs:O,topVerts:f}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ze([e.points],n,a).vertices,uvs:r}}var Ut=function(e){"use strict";P(r,e);var n=z(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.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,h=o.closedBottom,v=o.closedTop,d=o.includeSides,g=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;(0,St.default)(i[0])||i[0].reverse();var _=Vt(i,{resolution:g}),u=_.contour,O=_.triangles,C=(0,Le.merge)(O.uvs),Z=[],M=[],F=[],J=0,de=function(xe){var me=Math.round(Z.length/3),Pe=F.length;Z=Z.concat(xe.vertices),M=M.concat(xe.uvs),F=F.concat(me?xe.indices.map(function(Oe){return Oe+me}):xe.indices),t.addGroup(Pe,F.length-Pe,J++)};if(d){var be=Qe(u,s,f,b);de(be),t.userData.rso=y?Qe(u,s,f+y,b):be}return h&&de(qe(O,s,C,!1,b)),v&&de(qe(O,f,C,!0,b)),t.setIndex(F),t[Je]("position",new c.Float32BufferAttribute(Z,3)),t[Je]("uv",new c.Float32BufferAttribute(M,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Nt=function(e){"use strict";P(r,e);var n=z(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.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,h=t.closedTop,v=t.curvatureResolution,d=t.userDataRsoOffset,g=t.cartesian,b=new Ut(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:v,cartesian:g,userDataRsoOffset:d});this.createMesh(b,this.options.material)},r}(m),et=N(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=e.box3,t=new c[le](new c.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n,box3:a})});return(0,et.C)(),t}var It=function(e){"use strict";P(r,e);var n=z(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=L((0,x.Z)({depth:1},a),{materialOptions:(0,x.Z)({},{split:.1},a.materialOptions||{})}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,h,v,d,g,b,y,_,u,O,C,Z,M,F,J,de,be,xe,me,Pe,Oe,Te,Be;return V().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(s=t.options,f=s.points,h=s.pointsArr,v=s.useGroups,d=s.depth,g=s.geometry,b=s.geometryArr,y=s.material,_=s.materialOptions,u=s.cache,O=s.box3,C=0,Z=Array.isArray(d)?d:[d],M=Array.isArray(O)?O:[O],F=y,J=g,!(!F&&_)){U.next=26;break}if(C=_.split,de=_.topColor,be=_.sideColor,xe=_.sideMap,me="ExtrudePolygonMaterial:".concat(be||xe).concat(de||""),!(u&&!u.get(me))){U.next=16;break}return u.init(me),U.next=14,t.getMaterial(_);case 14:Pe=U.sent,u.set(me,Pe);case 16:if(!u){U.next=22;break}return U.next=19,u.get(me);case 19:U.t0=U.sent,U.next=25;break;case 22:return U.next=24,t.getMaterial(_);case 24:U.t0=U.sent;case 25:F=U.t0;case 26:!J&&f?J=tt({points:f,depth:Z[0],split:C,box3:M[0]}):!J&&h?J=Ee.mergeBufferGeometries(h.map(function(Ae,ge){return tt({points:Ae,depth:(Oe=Z[ge])!==null&&Oe!==void 0?Oe:Z[0],split:C,box3:(Te=M[ge])!==null&&Te!==void 0?Te:M[0]})}),v!=null?v:!1):!J&&b&&b.length>1?J=Ee.mergeBufferGeometries(b,v!=null?v:!1):!J&&b&&b.length===1&&(Be=ve(b,1),J=Be[0]),t.createMesh(J,F);case 28:case"end":return U.stop()}},o)}))()},i.addGeometries=function(t){var o=this.object3d,s=Ee.mergeBufferGeometries([o.geometry].concat(I(t)),!1);o.geometry=s},i.getMaterial=function(t){var o=this,s=t.topColor,f=t.sideColor,h=t.sideMap,v=t.type,d=t.parameters,g=t.createCanvasObjectURL,b=t.split,y=t.maxAnisotropy;return new Promise(function(_){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var O=b,C=document.createElement("canvas"),Z=C.getContext("2d");C.height=u.height/(1-O),C.width=u.width,O&&s&&(Z.fillStyle=s,Z.fillRect(0,0,u.width,C.height*O)),h&&u instanceof HTMLImageElement?Z.drawImage(u,0,C.height*O,u.width,u.height):f&&(Z.fillStyle=f,Z.fillRect(0,C.height*O,u.width,u.height)),g&&C.toBlob(function(J){console.log(URL.createObjectURL(J))});var M=new c.CanvasTexture(C);M.anisotropy=y||o.pencil.renderer.capabilities.getMaxAnisotropy();var F=new c[v||"MeshBasicMaterial"]((0,x.Z)({map:M},d||{}));_(F)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,w.Z)(V().mark(function s(){var f,h,v,d,g,b,y,_,u,O,C;return V().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(f=o.options,h=f.materialOptions,v=f.cache,d=h.sideColor,g=h.sideMap,b=h.topColor,y=t.sideColor,_=t.topColor,!(_||y)){M.next=22;break}if(u="ExtrudePolygonMaterial:".concat(y||d||g||"").concat(_||b||""),!(v&&!v.get(u))){M.next=11;break}return v.init(u),M.next=9,o.getMaterial((0,x.Z)({},h,t));case 9:O=M.sent,v.set(u,O);case 11:if(!v){M.next=17;break}return M.next=14,v.get(u);case 14:M.t0=M.sent,M.next=20;break;case 17:return M.next=19,o.getMaterial((0,x.Z)({},h,t));case 19:M.t0=M.sent;case 20:C=M.t0,o.object3d.material=C;case 22:case"end":return M.stop()}},s)}))()},r}(m);function Zt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.depth,t=e.split,o=e.projection,s=e.cacheVersion;return new Promise(function(f,h){n.postMessage({coordinatesArr:i,depth:a,split:t!=null?t:.1,projection:o,workerKey:r},{cb:function(v){try{var d=new c.BufferGeometry;Object.keys(v).forEach(function(g){d.setAttribute(g,new c.BufferAttribute(v[g].array,v[g].itemSize))}),f(d)}catch(g){n.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})();var rr=fe.Ei,nr=fe.Yo,ir=fe.ZA,ar=fe.Ee,or=fe.x1,sr=fe.VJ,ur=fe.r7,cr=fe.XA,lr=fe.NB,fr=fe.xv,hr=fe.nk,pr=fe.JX,vr=fe.TQ;export{rr as ConicPolygon,nr as ExtrudePolygon,ir as Group,ar as Image,or as Line,sr as MeshLine,ur as MeshLineMaterial,cr as MeshLineRaycast,lr as Node,fr as Text,hr as Video,pr as getExtrudePolygonGeometry,vr as getLineGeometry};
132
+ `),Ae=function(e){"use strict";C(r,e);var n=W(r);function r(){k(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(B(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(c.BufferGeometry);Ae.prototype.setMatrixWorld=function(e){this.matrixWorld=e},Ae.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},Ae.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 Xe(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,h=new c.Vector3,v=this instanceof c.LineSegments?2:1,d=o.index,g=o.attributes;if(d!==null)for(var y=d.array,b=g.position.array,_=g.width.array,u=0,A=y.length-1;u<A;u+=v){var P=y[u],G=y[u+1];s.fromArray(b,P*3),f.fromArray(b,G*3);var S=_[Math.floor(u/3)]!==void 0?_[Math.floor(u/3)]:1,re=e.params.Line.threshold+this.material.lineWidth*S/2,$=re*re,ne=i.distanceSqToSegment(s,f,t,h);if(!(ne>$)){t.applyMatrix4(this.matrixWorld);var le=e.ray.origin.distanceTo(t);le<e.near||le>e.far||(n.push({distance:le,point:h.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=A)}}}}Ae.prototype.raycast=Xe,Ae.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]},Ae.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},Ae.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 Ve(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}Ae.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ve(n,0,r,0,a),Ve(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,Ve(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=ht,c.ShaderChunk.meshline_frag=pt;var Ue=function(e){"use strict";C(r,e);var n=W(r);function r(i){k(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(B(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(c.ShaderMaterial);Ue.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 vt(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 dt(e,n){if(e==null)return{};var r=vt(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}function mt(e){if(Array.isArray(e))return e}function gt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _e(e,n){return mt(e)||se(e,n)||K(e,n)||gt()}var yt=e=>{var n={};return I.d(n,e),n},dr=e=>()=>e,He=yt({animate:()=>ot.animate,linear:()=>ot.linear}),_t=e=>{var n={};return I.d(n,e),n},mr=e=>()=>e,Le=_t({mergeBufferGeometries:()=>Ht.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new c.BufferGeometry,a=new Ae;return i.setFromPoints(r),a.setGeometry(i,n),a}var bt={color:new c.Color("#ffffff"),lineWidth:1},wt=function(e){"use strict";C(r,e);var n=W(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},bt,a),t}var i=r.prototype;return i.create=function(){var t=this;return(0,w.Z)(U().mark(function o(){var s,f,h,v,d,g,y,b,_,u,A,P,G,S,re,$,ne,le,me,he;return U().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:if(s=t.options,f=s.duration,h=s.delay,v=s.onComplete,d=s.setPointWidth,g=s.key,y=s.nodes,b=s.nodesArr,_=s.geometry,u=s.geometryArr,A=s.useGroups,P=s.material,G=s.cache,S=s.cacheKey,re=dt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),$=P,ne=_,$){ie.next=16;break}if(le="LineMaterial:".concat(S),G&&!G.get(le)&&(G.init(le),me=t.getMaterial((0,x.Z)({},re)),G.set(le,me)),!G){ie.next=12;break}return ie.next=9,G.get(le);case 9:ie.t0=ie.sent,ie.next=15;break;case 12:return ie.next=14,t.getMaterial(re);case 14:ie.t0=ie.sent;case 15:$=ie.t0;case 16:t.material=$,!ne&&y?ne=$e({nodes:y,setPointWidth:d}):!ne&&b?ne=Le.mergeBufferGeometries(b.map(function(Ee){return $e({nodes:Ee,setPointWidth:d})}),A!=null?A:!1):!ne&&u&&u.length>1?ne=Le.mergeBufferGeometries(u,A!=null?A:!1):!ne&&u&&u.length===1&&(he=_e(u,1),ne=he[0]),t.createMesh(ne,P);case 19:case"end":return ie.stop()}},o)}))()},i.getMaterial=function(t){var o=this.pencil.getSize(),s=o.width,f=o.height,h=new Ue(L((0,x.Z)({},t),{resolution:new c.Vector2(s,f)}));return h},i.addGeometries=function(t){var o=this.object3d,s=Le.mergeBufferGeometries([o.geometry].concat(Z(t)),!1);o.geometry=s},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,h=this.material.uniforms.offset,v=s!=null?s:0,d=(0,He.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:f,ease:He.linear,onUpdate:function(g){h.value.x=g.x}});this.tween=d},i.dispose=function(){var t;De(O(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(m);function xt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.lineWidth,t=e.projection,o=e.cacheVersion;return new Promise(function(s,f){n.postMessage({coordinatesArr:i,lineWidth:a,projection:t,workerKey:r},{cb:function(h){try{var v=new c.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new c.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new c.BufferAttribute(h[d].array,h[d].itemSize))}),s(v)}catch(d){n.postMessage({delCache:!0,workerKey:r},{cb:f,cacheVersion:o})}},cacheVersion:o})})}var At=e=>{var n={};return I.d(n,e),n},gr=e=>()=>e,je=At({extent:()=>Ke.extent,mean:()=>Ke.mean,merge:()=>Ke.merge}),Mt=e=>{var n={};return I.d(n,e),n},yr=e=>()=>e,Ne=Mt({default:()=>$t.default}),Pt=e=>{var n={};return I.d(n,e),n},_r=e=>()=>e,St=Pt({default:()=>Yt.default});function Ct(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 Ot=e=>{var n={};return I.d(n,e),n},br=e=>()=>e,Et=Ot({default:()=>Jt.default}),Lt=e=>{var n={};return I.d(n,e),n},wr=e=>()=>e,jt=Lt({default:()=>Qt.default}),kt=e=>{var n={};return I.d(n,e),n},xr=e=>()=>e,Te=kt({geoBounds:()=>We.geoBounds,geoContains:()=>We.geoContains,geoDistance:()=>We.geoDistance,geoInterpolate:()=>We.geoInterpolate}),Rt=e=>{var n={};return I.d(n,e),n},Ar=e=>()=>e,Tt=Rt({geoVoronoi:()=>qt.geoVoronoi}),Bt=e=>{var n={};return I.d(n,e),n},Mr=e=>()=>e,Ye=Bt({scaleLinear:()=>er.scaleLinear});function Gt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Te.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,Te.geoInterpolate)(a,t),f=1/Math.ceil(o/n),h=f;h<1;)i.push(s(h)),h+=f}i.push(a=t)}),i})}function zt(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(u){return u/s*360%360-180},h=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},v=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(v(t)):0,a!==void 0?Math.floor(v(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(u){return u<=i}:i===void 0?function(u){return u>=r}:i>=r?function(u){return u>=r&&u<=i}:function(u){return u>=r||u<=i},y=[],b=d[0];b<=d[1];b++){var _=f(b);g(_)&&y.push([_,h(b)])}return y}function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Te.geoContains)(n,e):(0,jt.default)(e,n)}function Wt(e,n){var r={type:"Polygon",coordinates:e},i=_e((0,Te.geoBounds)(r),2),a=_e(i[0],2),t=a[0],o=a[1],s=_e(i[1],2),f=s[0],h=s[1];if(Math.min(Math.abs(f-t),Math.abs(h-o))<n)return[];var v=t>f||h>=89||o<=-89;return zt(n,{minLng:t,maxLng:f,minLat:o,maxLat:h}).filter(function(d){return Ie(d,r,v)})}function Dt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Gt(e,i),t=(0,je.merge)(a),o=Wt(e,i),s=Z(t).concat(Z(o)),f={type:"Polygon",coordinates:e},h=_e((0,Te.geoBounds)(f),2),v=_e(h[0],2),d=v[0],g=v[1],y=_e(h[1],2),b=y[0],_=y[1],u=d>b||_>=89||g<=-89,A=[];if(u){var P=(0,Tt.geoVoronoi)(s).triangles(),G=new Map(s.map(function(N,Me){var be=_e(N,2),we=be[0],Ge=be[1];return["".concat(we,"-").concat(Ge),Me]}));P.features.forEach(function(N){var Me,be=N.geometry.coordinates[0].slice(0,3).reverse(),we=[];if(be.forEach(function(ze){var Pe=_e(ze,2),Fe=Pe[0],Ft=Pe[1],nt="".concat(Fe,"-").concat(Ft);G.has(nt)&&we.push(G.get(nt))}),we.length===3){if(we.some(function(ze){return ze<t.length})){var Ge=N.properties.circumcenter;if(!Ie(Ge,f,u))return}(Me=A).push.apply(Me,Z(we))}})}else if(o.length)for(var le=function(N,Me){var be,we=[2,1,0].map(function(Pe){return me.triangles[N+Pe]}),Ge=we.map(function(Pe){return s[Pe]});if(we.some(function(Pe){return Pe<t.length})){var ze=[0,1].map(function(Pe){return(0,je.mean)(Ge,function(Fe){return Fe[Pe]})});if(!Ie(ze,f,u))return"continue"}(be=A).push.apply(be,Z(we))},me=Et.default.from(s),he=0,Se=me.triangles.length;he<Se;he+=3)le(he,Se);else{var S=Ne.default.flatten(a),re=S.vertices,$=S.holes,ne=$===void 0?[]:$;A=(0,Ne.default)(re,ne,2)}var ie=(0,Ye.scaleLinear)((0,je.extent)(s,function(N){return N[0]}),[0,1]),Ee=(0,Ye.scaleLinear)((0,je.extent)(s,function(N){return N[1]}),[0,1]),Be=s.map(function(N){var Me=_e(N,2),be=Me[0],we=Me[1];return[ie(be),Ee(we)]}),rt={points:s,indices:A,uvs:Be};return{contour:a,triangles:rt}}var Vt=Dt,Je=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ze(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=_e(t,2),s=o[0],f=o[1];return r?Ct(s,f,n):[s,f,n]})});return Ne.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ze(e,n,i),t=a.vertices,o=a.holes,s=Ze(e,r,i),f=s.vertices,h=(0,je.merge)([f,t]),v=Math.round(f.length/3),d=new Set(o),g=0,y=[],b=0;b<v;b++){var _=b+1;if(_===v)_=g;else if(d.has(_)){var u=_;_=g,g=u}y.push(b,b+v,_+v),y.push(_+v,_,b)}for(var A=[],P=1;P>=0;P--)for(var G=0;G<v;G+=1)A.push(G/(v-1),P);return{indices:y,vertices:h,uvs:A,topVerts:f}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ze([e.points],n,a).vertices,uvs:r}}var Ut=function(e){"use strict";C(r,e);var n=W(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.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,h=o.closedBottom,v=o.closedTop,d=o.includeSides,g=o.curvatureResolution,y=o.cartesian,b=o.userDataRsoOffset;(0,St.default)(i[0])||i[0].reverse();var _=Vt(i,{resolution:g}),u=_.contour,A=_.triangles,P=(0,je.merge)(A.uvs),G=[],S=[],re=[],$=0,ne=function(me){var he=Math.round(G.length/3),Se=re.length;G=G.concat(me.vertices),S=S.concat(me.uvs),re=re.concat(he?me.indices.map(function(ie){return ie+he}):me.indices),t.addGroup(Se,re.length-Se,$++)};if(d){var le=Qe(u,s,f,y);ne(le),t.userData.rso=b?Qe(u,s,f+b,y):le}return h&&ne(qe(A,s,P,!1,y)),v&&ne(qe(A,f,P,!0,y)),t.setIndex(re),t[Je]("position",new c.Float32BufferAttribute(G,3)),t[Je]("uv",new c.Float32BufferAttribute(S,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Nt=function(e){"use strict";C(r,e);var n=W(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.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,h=t.closedTop,v=t.curvatureResolution,d=t.userDataRsoOffset,g=t.cartesian,y=new Ut(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:v,cartesian:g,userDataRsoOffset:d});this.createMesh(y,this.options.material)},r}(m),et=I(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=e.box3,t=new c[ve](new c.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n,box3:a})});return(0,et.C)(),t}var It=function(e){"use strict";C(r,e);var n=W(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=L((0,x.Z)({depth:1},a),{materialOptions:(0,x.Z)({},{split:.1},a.materialOptions||{})}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,w.Z)(U().mark(function o(){var s,f,h,v,d,g,y,b,_,u,A,P,G,S,re,$,ne,le,me,he,Se,ie,Ee,Be;return U().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(s=t.options,f=s.points,h=s.pointsArr,v=s.useGroups,d=s.depth,g=s.geometry,y=s.geometryArr,b=s.material,_=s.materialOptions,u=s.cache,A=s.box3,P=0,G=Array.isArray(d)?d:[d],S=Array.isArray(A)?A:[A],re=b,$=g,!(!re&&_)){N.next=26;break}if(P=_.split,ne=_.topColor,le=_.sideColor,me=_.sideMap,he="ExtrudePolygonMaterial:".concat(le||me).concat(ne||""),!(u&&!u.get(he))){N.next=16;break}return u.init(he),N.next=14,t.getMaterial(_);case 14:Se=N.sent,u.set(he,Se);case 16:if(!u){N.next=22;break}return N.next=19,u.get(he);case 19:N.t0=N.sent,N.next=25;break;case 22:return N.next=24,t.getMaterial(_);case 24:N.t0=N.sent;case 25:re=N.t0;case 26:!$&&f?$=tt({points:f,depth:G[0],split:P,box3:S[0]}):!$&&h?$=Le.mergeBufferGeometries(h.map(function(Me,be){return tt({points:Me,depth:(ie=G[be])!==null&&ie!==void 0?ie:G[0],split:P,box3:(Ee=S[be])!==null&&Ee!==void 0?Ee:S[0]})}),v!=null?v:!1):!$&&y&&y.length>1?$=Le.mergeBufferGeometries(y,v!=null?v:!1):!$&&y&&y.length===1&&(Be=_e(y,1),$=Be[0]),t.createMesh($,re);case 28:case"end":return N.stop()}},o)}))()},i.addGeometries=function(t){var o=this.object3d,s=Le.mergeBufferGeometries([o.geometry].concat(Z(t)),!1);o.geometry=s},i.getMaterial=function(t){var o=this,s=t.topColor,f=t.sideColor,h=t.sideMap,v=t.type,d=t.parameters,g=t.createCanvasObjectURL,y=t.split,b=t.maxAnisotropy;return new Promise(function(_){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var A=y,P=document.createElement("canvas"),G=P.getContext("2d");P.height=u.height/(1-A),P.width=u.width,A&&s&&(G.fillStyle=s,G.fillRect(0,0,u.width,P.height*A)),h&&u instanceof HTMLImageElement?G.drawImage(u,0,P.height*A,u.width,u.height):f&&(G.fillStyle=f,G.fillRect(0,P.height*A,u.width,u.height)),g&&P.toBlob(function($){console.log(URL.createObjectURL($))});var S=new c.CanvasTexture(P);S.anisotropy=b||o.pencil.renderer.capabilities.getMaxAnisotropy();var re=new c[v||"MeshBasicMaterial"]((0,x.Z)({map:S},d||{}));_(re)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,w.Z)(U().mark(function s(){var f,h,v,d,g,y,b,_,u,A,P;return U().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(f=o.options,h=f.materialOptions,v=f.cache,d=h.sideColor,g=h.sideMap,y=h.topColor,b=t.sideColor,_=t.topColor,!(_||b)){S.next=22;break}if(u="ExtrudePolygonMaterial:".concat(b||d||g||"").concat(_||y||""),!(v&&!v.get(u))){S.next=11;break}return v.init(u),S.next=9,o.getMaterial((0,x.Z)({},h,t));case 9:A=S.sent,v.set(u,A);case 11:if(!v){S.next=17;break}return S.next=14,v.get(u);case 14:S.t0=S.sent,S.next=20;break;case 17:return S.next=19,o.getMaterial((0,x.Z)({},h,t));case 19:S.t0=S.sent;case 20:P=S.t0,o.object3d.material=P;case 22:case"end":return S.stop()}},s)}))()},r}(m);function Zt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.depth,t=e.split,o=e.projection,s=e.cacheVersion;return new Promise(function(f,h){n.postMessage({coordinatesArr:i,depth:a,split:t!=null?t:.1,projection:o,workerKey:r},{cb:function(v){try{var d=new c.BufferGeometry;Object.keys(v).forEach(function(g){d.setAttribute(g,new c.BufferAttribute(v[g].array,v[g].itemSize))}),f(d)}catch(g){n.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})();var rr=de.Ei,nr=de.Yo,ir=de.ZA,ar=de.Ee,or=de.x1,sr=de.VJ,ur=de.r7,cr=de.XA,lr=de.NB,fr=de.xv,hr=de.nk,pr=de.JX,vr=de.TQ;export{rr as ConicPolygon,nr as ExtrudePolygon,ir as Group,ar as Image,or as Line,sr as MeshLine,ur as MeshLineMaterial,cr as MeshLineRaycast,lr as Node,fr as Text,hr as Video,pr as getExtrudePolygonGeometry,vr as getLineGeometry};
@@ -1,17 +1,9 @@
1
1
  import * as THREE from 'three';
2
2
  import { PlaybackControls } from 'popmotion';
3
3
  import BaseObject from '../../core/BaseObject';
4
+ import Cache from '../../plugins/Cache';
4
5
  import { MeshLineMaterial } from './meshLine';
5
- interface Options {
6
- nodes?: THREE.Vector3[];
7
- nodesArr?: THREE.Vector3[][];
8
- geometry?: THREE.BufferGeometry;
9
- geometryArr?: THREE.BufferGeometry[];
10
- key?: string;
11
- useGroups?: boolean;
12
- duration?: number;
13
- delay?: number;
14
- onComplete?: (...args: any[]) => void;
6
+ interface MaterialOptions {
15
7
  color?: string | THREE.Color | number;
16
8
  lineWidth?: number;
17
9
  sizeAttenuation?: number;
@@ -32,12 +24,27 @@ interface Options {
32
24
  lightColor?: THREE.Color;
33
25
  setPointWidth?: (p: number) => number;
34
26
  }
27
+ interface Options extends MaterialOptions {
28
+ nodes?: THREE.Vector3[];
29
+ nodesArr?: THREE.Vector3[][];
30
+ geometry?: THREE.BufferGeometry;
31
+ geometryArr?: THREE.BufferGeometry[];
32
+ material?: MeshLineMaterial;
33
+ cache?: Cache;
34
+ cacheKey?: string;
35
+ key?: string;
36
+ useGroups?: boolean;
37
+ duration?: number;
38
+ delay?: number;
39
+ onComplete?: (...args: any[]) => void;
40
+ }
35
41
  export default class Line extends BaseObject {
36
42
  options: Options;
37
43
  tween: PlaybackControls;
38
44
  constructor(options?: Partial<Options>);
39
45
  material: MeshLineMaterial;
40
- create(): void;
46
+ create(): Promise<void>;
47
+ getMaterial(materialOptions: MaterialOptions): MeshLineMaterial;
41
48
  addGeometries(geometries: THREE.BufferGeometry[]): void;
42
49
  resize(w: number, h: number): void;
43
50
  animate(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3003 bundler-dev",