gl-draw 0.4.2 → 0.4.4

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