gl-draw 0.2.2 → 0.2.5

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