Files
gemini-viewer-examples/public/demo/libs/gemini-viewer.esm.min.js
2022-11-20 00:02:55 +08:00

1 line
3.8 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var e={21593:function(e,t,n){var r=n(98235),i=n(83671),s=n(3019);function a(e,t){return e[0]===t[0]&&e[1]===t[1]}e.exports=function(e,t){for(var n={},r=e.length,p=[],d=0;d<r;d++){var m=e[d],f=e[(d+1)%r];h(m,c),h(f,u);for(var g=0;g<r;g++)if(d!==g){var _=e[g],v=e[(g+1)%r];if(h(_,o),h(v,l),!(a(o,c)||a(o,u)||a(l,c)||a(l,u))){var y=i(c,u,o,l),b=y[2];if(1!==b.length||b[0]){var x=s(y[2]);if(y[0]=s(y[0])/x,y[1]=s(y[1])/x,y.pop(),!(a(y,c)||a(y,u)||a(y,o)||a(y,l))){var T=y+"",w=!n[T];w&&(n[T]=!0);var E=w;t&&(E=t(y,d,m,f,g,_,v,w)),E&&p.push(y)}}}}}return p};var o=[0,0],l=[0,0],c=[0,0],u=[0,0];function h(e,t){r(e)?(t[0]=e[0],t[1]=e[1]):(t[0]=e.x,t[1]=e.y)}},40769:function(e,t,n){var r=n(35704),i=n(76555),s=n(8571),a=n(39058),o=n(41359),l=n(79624),c=n(35482).orient2d;function u(e,t,n){t=Math.max(0,void 0===t?2:t),n=n||0;var o=function(e){for(var t=e[0],n=e[0],a=e[0],o=e[0],c=0;c<e.length;c++){var u=e[c];u[0]<t[0]&&(t=u),u[0]>a[0]&&(a=u),u[1]<n[1]&&(n=u),u[1]>o[1]&&(o=u)}var h=[t,n,a,o],p=r(h).call(h);for(c=0;c<e.length;c++)l(e[c],h)||p.push(e[c]);return function(e){i(e).call(e,T);for(var t=[],n=0;n<e.length;n++){for(;t.length>=2&&g(t[t.length-2],t[t.length-1],e[n])<=0;)t.pop();t.push(e[n])}for(var r=[],a=e.length-1;a>=0;a--){for(;r.length>=2&&g(r[r.length-2],r[r.length-1],e[a])<=0;)r.pop();r.push(e[a])}return r.pop(),t.pop(),s(t).call(t,r)}(p)}(e),c=new a(16);c.toBBox=function(e){return{minX:e[0],minY:e[1],maxX:e[0],maxY:e[1]}},c.compareMinX=function(e,t){return e[0]-t[0]},c.compareMinY=function(e,t){return e[1]-t[1]},c.load(e);for(var u,p=[],d=0;d<o.length;d++){var m=o[d];c.remove(m),u=v(m,u),p.push(u)}var f=new a(16);for(d=0;d<p.length;d++)f.insert(_(p[d]));for(var b=t*t,x=n*n;p.length;){var w=p.shift(),E=w.p,S=w.next.p,I=y(E,S);if(!(I<x)){var M=I/b;(m=h(c,w.prev.p,E,S,w.next.next.p,M,f))&&Math.min(y(m,E),y(m,S))<=M&&(p.push(w),p.push(v(m,w)),c.remove(m),f.remove(w),f.insert(_(w)),f.insert(_(w.next)))}}w=u;var A=[];do{A.push(w.p),w=w.next}while(w!==u);return A.push(w.p),A}function h(e,t,n,r,i,s,a){for(var l=new o([],p),c=e.data;c;){for(var u=0;u<c.children.length;u++){var h=c.children[u],m=c.leaf?b(h,n,r):d(n,r,h);m>s||l.push({node:h,dist:m})}for(;l.length&&!l.peek().node.children;){var g=l.pop(),_=g.node,v=b(_,t,n),y=b(_,r,i);if(g.dist<v&&g.dist<y&&f(n,_,a)&&f(r,_,a))return _}(c=l.pop())&&(c=c.node)}return null}function p(e,t){return e.dist-t.dist}function d(e,t,n){if(m(e,n)||m(t,n))return 0;var r=x(e[0],e[1],t[0],t[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=x(e[0],e[1],t[0],t[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var s=x(e[0],e[1],t[0],t[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===s)return 0;var a=x(e[0],e[1],t[0],t[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===a?0:Math.min(r,i,s,a)}function m(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function f(e,t,n){for(var r,i,s,a,o=Math.min(e[0],t[0]),l=Math.min(e[1],t[1]),c=Math.max(e[0],t[0]),u=Math.max(e[1],t[1]),h=n.search({minX:o,minY:l,maxX:c,maxY:u}),p=0;p<h.length;p++)if(r=h[p].p,i=h[p].next.p,s=e,r!==(a=t)&&i!==s&&g(r,i,s)>0!=g(r,i,a)>0&&g(s,a,r)>0!=g(s,a,i)>0)return!1;return!0}function g(e,t,n){return c(e[0],e[1],t[0],t[1],n[0],n[1])}function _(e){var t=e.p,n=e.next.p;return e.minX=Math.min(t[0],n[0]),e.minY=Math.min(t[1],n[1]),e.maxX=Math.max(t[0],n[0]),e.maxY=Math.max(t[1],n[1]),e}function v(e,t){var n={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(n.next=t.next,n.prev=t,t.next.prev=n,t.next=n):(n.prev=n,n.next=n),n}function y(e,t){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function b(e,t,n){var r=t[0],i=t[1],s=n[0]-r,a=n[1]-i;if(0!==s||0!==a){var o=((e[0]-r)*s+(e[1]-i)*a)/(s*s+a*a);o>1?(r=n[0],i=n[1]):o>0&&(r+=s*o,i+=a*o)}return(s=e[0]-r)*s+(a=e[1]-i)*a}function x(e,t,n,r,i,s,a,o){var l,c,u,h,p=n-e,d=r-t,m=a-i,f=o-s,g=e-i,_=t-s,v=p*p+d*d,y=p*m+d*f,b=m*m+f*f,x=p*g+d*_,T=m*g+f*_,w=v*b-y*y,E=w,S=w;0===w?(c=0,E=1,h=T,S=b):(h=v*T-y*x,(c=y*T-b*x)<0?(c=0,h=T,S=b):c>E&&(c=E,h=T+y,S=b)),h<0?(h=0,-x<0?c=0:-x>v?c=E:(c=-x,E=v)):h>S&&(h=S,-x+y<0?c=0:-x+y>v?c=E:(c=-x+y,E=v));var I=(1-(u=0===h?0:h/S))*i+u*a-((1-(l=0===c?0:c/E))*e+l*n),M=(1-u)*s+u*o-((1-l)*t+l*r);return I*I+M*M}function T(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}o.default&&(o=o.default),e.exports=u,e.exports.default=u},33286:function(e,t,n){var r=n(88946),i=n(8571);e.exports=function(e){var t=[];return t.toString=function(){return r(this).call(this,(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var l=0;l<this.length;l++){var c=this[l][0];null!=c&&(o[c]=!0)}for(var u=0;u<e.length;u++){var h,p=i(h=[]).call(h,e[u]);if(!r||!o[p[0]]){var d,m,f;if(void 0!==a)if(void 0===p[5])p[5]=a;else p[1]=i(d="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {")).call(d,p[1],"}"),p[5]=a;if(n)if(p[2])p[1]=i(m="@media ".concat(p[2]," {")).call(m,p[1],"}"),p[2]=n;else p[2]=n;if(s)if(p[4])p[1]=i(f="@supports (".concat(p[4],") {")).call(f,p[1],"}"),p[4]=s;else p[4]="".concat(s);t.push(p)}}},t}},89372:function(e){e.exports=function(e){return e[1]}},83671:function(e,t,n){e.exports=function(e,t,n,l){if(!o(e,t,n,l))return[[0],[0],[0]];var c=i([n[1]],[-l[1]]),u=i([-n[0]],[l[0]]),h=i(i(s(u,e[1]),s(u,-t[1])),i(s(c,e[0]),s(c,-t[0]))),p=i(r(-e[0],t[1]),r(e[1],t[0])),d=i(r(-n[0],l[1]),r(n[1],l[0])),m=i(i(s(d,e[0]),s(d,-t[0])),i(s(p,-n[0]),s(p,l[0]))),f=i(i(s(d,e[1]),s(d,-t[1])),i(s(p,-n[1]),s(p,l[1])));return[a(m),a(f),a(h)]};var r=n(49059),i=n(43632),s=n(34659),a=n(27327),o=n(42988)},15514:function(e,t,n){var r=n(77726),i=n(94185),s=n(52472),a=n(48994),o=n(57445),l=n(3841),c=n(92984),u=n(39272),h=n(24835),p=n(48216),d=n(51791),m=n(54847),f=n(98235),g=n(19389),_=n(35704),v=n(10349),y=n(50429),b=n(40024);e.exports=function(){var e=r,t=i;function n(e){return n="function"==typeof s&&"symbol"==typeof a?function(e){return typeof e}:function(e){return e&&"function"==typeof s&&e.constructor===s&&e!==s.prototype?"symbol":typeof e},n(e)}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),o(e,n.key,n)}function w(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),o(e,"prototype",{writable:!1}),e}function E(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=l(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),o(e,"prototype",{writable:!1}),t&&I(e,t)}function S(e){return S=c?u:function(e){return e.__proto__||u(e)},S(e)}function I(e,t){return I=c||function(e,t){return e.__proto__=t,e},I(e,t)}function M(){if("undefined"==typeof Reflect||!h)return!1;if(h.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(h(Boolean,[],(function(){}))),!0}catch(e){return!1}}function A(){return A=M()?h:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(p(Function).apply(e,r));return n&&I(i,n.prototype),i},A.apply(null,arguments)}function R(e){var t;return-1!==d(t=Function.toString.call(e)).call(t,"[native code]")}function D(e){var t="function"==typeof m?new m:void 0;return D=function(e){function n(){return A(e,arguments,S(this).constructor)}if(null===e||!R(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}return n.prototype=l(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),I(n,e)},D(e)}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}function P(e){var t=M();return function(){var n,r=S(e);if(t){var i=S(this).constructor;n=h(r,arguments,i)}else n=r.apply(this,arguments);return O(this,n)}}function N(e,t){return L(e)||k(e,t)||F(e,t)||B()}function L(e){if(f(e))return e}function k(e,t){var n=null==e?null:void 0!==s&&g(e)||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}function F(e,t){if(e){var n;if("string"==typeof e)return U(e,t);var r=_(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?v(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(e,t):void 0}}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function B(){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 j(e,t){var n=void 0!==s&&g(e)||e["@@iterator"];if(!n){if(f(e)||(n=F(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw a}}}}var G=function(e){var t=Math.abs,r=Math.max,i=Math.floor;function a(e,t){var n;if(x(this,a),(n=o.call(this,e)).sign=t,c(C(n),a.prototype),e>a.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return n}E(a,e);var o=P(a);return w(a,[{key:"toDebugString",value:function(){var e,t=["BigInt["],n=j(this);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push((r?(r>>>0).toString(16):r)+", ")}}catch(e){n.e(e)}finally{n.f()}return t.push("]"),t.join("")}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10;if(2>e||36<e)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":0==(e&e-1)?a.__toStringBasePowerOfTwo(this,e):a.__toStringGeneric(this,e,!1)}},{key:"valueOf",value:function(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function(){for(var e=new a(this.length,this.sign),t=0;t<this.length;t++)e[t]=this[t];return e}},{key:"__trim",value:function(){for(var e=this.length,t=this[e-1];0===t;)t=this[--e-1],this.pop();return 0===e&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var e=0;e<this.length;e++)this[e]=0}},{key:"__clzmsd",value:function(){return a.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(e,t,n){n>this.length&&(n=this.length);for(var r=32767&e,i=e>>>15,s=0,o=t,l=0;l<n;l++){var c=this.__digit(l),u=32767&c,h=c>>>15,p=a.__imul(u,r),d=a.__imul(u,i),m=a.__imul(h,r),f=o+p+s;s=f>>>30,f&=1073741823,s+=(f+=((32767&d)<<15)+((32767&m)<<15))>>>30,o=a.__imul(h,i)+(d>>>15)+(m>>>15),this.__setDigit(l,1073741823&f)}if(0!==s||0!==o)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(e,t,n){for(var r,i=0,s=0;s<n;s++)i=(r=this.__halfDigit(t+s)+e.__halfDigit(s)+i)>>>15,this.__setHalfDigit(t+s,32767&r);return i}},{key:"__inplaceSub",value:function(e,t,n){var r=0;if(1&t){t>>=1;for(var i=this.__digit(t),s=32767&i,a=0;a<n-1>>>1;a++){var o=e.__digit(a),l=(i>>>15)-(32767&o)-r;r=1&l>>>15,this.__setDigit(t+a,(32767&l)<<15|32767&s),r=1&(s=(32767&(i=this.__digit(t+a+1)))-(o>>>15)-r)>>>15}var c=e.__digit(a),u=(i>>>15)-(32767&c)-r;if(r=1&u>>>15,this.__setDigit(t+a,(32767&u)<<15|32767&s),t+a+1>=this.length)throw new RangeError("out of bounds");0==(1&n)&&(r=1&(s=(32767&(i=this.__digit(t+a+1)))-(c>>>15)-r)>>>15,this.__setDigit(t+e.length,1073709056&i|32767&s))}else{t>>=1;for(var h=0;h<e.length-1;h++){var p=this.__digit(t+h),d=e.__digit(h),m=(32767&p)-(32767&d)-r,f=(p>>>15)-(d>>>15)-(r=1&m>>>15);r=1&f>>>15,this.__setDigit(t+h,(32767&f)<<15|32767&m)}var g=this.__digit(t+h),_=e.__digit(h),v=(32767&g)-(32767&_)-r;r=1&v>>>15;var y=0;0==(1&n)&&(r=1&(y=(g>>>15)-(_>>>15)-r)>>>15),this.__setDigit(t+h,(32767&y)<<15|32767&v)}return r}},{key:"__inplaceRightShift",value:function(e){if(0!==e){for(var t,n=this.__digit(0)>>>e,r=this.length-1,i=0;i<r;i++)t=this.__digit(i+1),this.__setDigit(i,1073741823&t<<30-e|n),n=t>>>e;this.__setDigit(r,n)}}},{key:"__digit",value:function(e){return this[e]}},{key:"__unsignedDigit",value:function(e){return this[e]>>>0}},{key:"__setDigit",value:function(e,t){this[e]=0|t}},{key:"__setDigitGrow",value:function(e,t){this[e]=0|t}},{key:"__halfDigitLength",value:function(){var e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}},{key:"__halfDigit",value:function(e){return 32767&this[e>>>1]>>>15*(1&e)}},{key:"__setHalfDigit",value:function(e,t){var n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}}],[{key:"BigInt",value:function(e){var t=y;if("number"==typeof e){if(0===e)return a.__zero();if(a.__isOneDigitInt(e))return 0>e?a.__oneDigit(-e,!0):a.__oneDigit(e,!1);if(!t(e)||i(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return a.__fromDouble(e)}if("string"==typeof e){var r=a.__fromString(e);if(null===r)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return r}if("boolean"==typeof e)return!0===e?a.__oneDigit(1,!1):a.__zero();if("object"===n(e)){if(e.constructor===a)return e;var s=a.__toPrimitive(e);return a.BigInt(s)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(e){var t=e.length;if(0===t)return 0;if(1===t){var n=e.__unsignedDigit(0);return e.sign?-n:n}var r=e.__digit(t-1),i=a.__clz30(r),s=30*t-i;if(1024<s)return e.sign?-1/0:1/0;var o=s-1,l=r,c=t-1,u=i+3,h=32===u?0:l<<u;h>>>=12;var p=u-12,d=12<=u?0:l<<20+u,m=20+u;for(0<p&&0<c&&(c--,h|=(l=e.__digit(c))>>>30-p,d=l<<p+2,m=p+2);0<m&&0<c;)c--,l=e.__digit(c),d|=30<=m?l<<m-30:l>>>30-m,m-=30;var f=a.__decideRounding(e,m,c,l);if((1===f||0===f&&1==(1&d))&&0==(d=d+1>>>0)&&0!=++h>>>20&&(h=0,1023<++o))return e.sign?-1/0:1/0;var g=e.sign?-2147483648:0;return o=o+1023<<20,a.__kBitConversionInts[1]=g|o|h,a.__kBitConversionInts[0]=d,a.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(e){if(0===e.length)return e;var t=e.__copy();return t.sign=!e.sign,t}},{key:"bitwiseNot",value:function(e){return e.sign?a.__absoluteSubOne(e).__trim():a.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return a.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return e.sign&&0==(1&t.__digit(0))?a.unaryMinus(e):e;if(1<t.length)throw new RangeError("BigInt too big");var n=t.__unsignedDigit(0);if(1===n)return e;if(n>=a.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var r=1+(0|n/30),i=new a(r,e.sign&&0!=(1&n));i.__initializeDigits();var s=1<<n%30;return i.__setDigit(r-1,s),i}var o=null,l=e;for(0!=(1&n)&&(o=e),n>>=1;0!==n;n>>=1)l=a.multiply(l,l),0!=(1&n)&&(o=null===o?l:a.multiply(o,l));return o}},{key:"multiply",value:function(e,t){if(0===e.length)return e;if(0===t.length)return t;var n=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&n--;var r=new a(n,e.sign!==t.sign);r.__initializeDigits();for(var i=0;i<e.length;i++)a.__multiplyAccumulate(t,e.__digit(i),r,i);return r.__trim()}},{key:"divide",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>a.__absoluteCompare(e,t))return a.__zero();var n,r=e.sign!==t.sign,i=t.__unsignedDigit(0);if(1===t.length&&32767>=i){if(1===i)return r===e.sign?e:a.unaryMinus(e);n=a.__absoluteDivSmall(e,i,null)}else n=a.__absoluteDivLarge(e,t,!0,!1);return n.sign=r,n.__trim()}},{key:"remainder",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>a.__absoluteCompare(e,t))return e;var n=t.__unsignedDigit(0);if(1===t.length&&32767>=n){if(1===n)return a.__zero();var r=a.__absoluteModSmall(e,n);return 0===r?a.__zero():a.__oneDigit(r,e.sign)}var i=a.__absoluteDivLarge(e,t,!1,!0);return i.sign=e.sign,i.__trim()}},{key:"add",value:function(e,t){var n=e.sign;return n===t.sign?a.__absoluteAdd(e,t,n):0<=a.__absoluteCompare(e,t)?a.__absoluteSub(e,t,n):a.__absoluteSub(t,e,!n)}},{key:"subtract",value:function(e,t){var n=e.sign;return n===t.sign?0<=a.__absoluteCompare(e,t)?a.__absoluteSub(e,t,n):a.__absoluteSub(t,e,!n):a.__absoluteAdd(e,t,n)}},{key:"leftShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?a.__rightShiftByAbsolute(e,t):a.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?a.__leftShiftByAbsolute(e,t):a.__rightShiftByAbsolute(e,t)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(e,t){return 0>a.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function(e,t){return 0>=a.__compareToBigInt(e,t)}},{key:"greaterThan",value:function(e,t){return 0<a.__compareToBigInt(e,t)}},{key:"greaterThanOrEqual",value:function(e,t){return 0<=a.__compareToBigInt(e,t)}},{key:"equal",value:function(e,t){if(e.sign!==t.sign)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e.__digit(n)!==t.__digit(n))return!1;return!0}},{key:"notEqual",value:function(e,t){return!a.equal(e,t)}},{key:"bitwiseAnd",value:function(e,t){if(!e.sign&&!t.sign)return a.__absoluteAnd(e,t).__trim();if(e.sign&&t.sign){var n=r(e.length,t.length)+1,i=a.__absoluteSubOne(e,n),s=a.__absoluteSubOne(t);return i=a.__absoluteOr(i,s,i),a.__absoluteAddOne(i,!0,i).__trim()}if(e.sign){var o=[t,e];e=o[0],t=o[1]}return a.__absoluteAndNot(e,a.__absoluteSubOne(t)).__trim()}},{key:"bitwiseXor",value:function(e,t){if(!e.sign&&!t.sign)return a.__absoluteXor(e,t).__trim();if(e.sign&&t.sign){var n=r(e.length,t.length),i=a.__absoluteSubOne(e,n),s=a.__absoluteSubOne(t);return a.__absoluteXor(i,s,i).__trim()}var o=r(e.length,t.length)+1;if(e.sign){var l=[t,e];e=l[0],t=l[1]}var c=a.__absoluteSubOne(t,o);return c=a.__absoluteXor(c,e,c),a.__absoluteAddOne(c,!0,c).__trim()}},{key:"bitwiseOr",value:function(e,t){var n=r(e.length,t.length);if(!e.sign&&!t.sign)return a.__absoluteOr(e,t).__trim();if(e.sign&&t.sign){var i=a.__absoluteSubOne(e,n),s=a.__absoluteSubOne(t);return i=a.__absoluteAnd(i,s,i),a.__absoluteAddOne(i,!0,i).__trim()}if(e.sign){var o=[t,e];e=o[0],t=o[1]}var l=a.__absoluteSubOne(t,n);return l=a.__absoluteAndNot(l,e,l),a.__absoluteAddOne(l,!0,l).__trim()}},{key:"asIntN",value:function(e,t){if(0===t.length)return t;if(0>(e=i(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return a.__zero();if(e>=a.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length<n)return t;var r=t.__unsignedDigit(n-1),s=1<<(e-1)%30;if(t.length===n&&r<s)return t;if((r&s)!==s)return a.__truncateToNBits(e,t);if(!t.sign)return a.__truncateAndSubFromPowerOfTwo(e,t,!0);if(0==(r&s-1)){for(var o=n-2;0<=o;o--)if(0!==t.__digit(o))return a.__truncateAndSubFromPowerOfTwo(e,t,!1);return t.length===n&&r===s?t:a.__truncateToNBits(e,t)}return a.__truncateAndSubFromPowerOfTwo(e,t,!1)}},{key:"asUintN",value:function(e,t){if(0===t.length)return t;if(0>(e=i(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return a.__zero();if(t.sign){if(e>a.__kMaxLengthBits)throw new RangeError("BigInt too big");return a.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=a.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length<n)return t;var r=e%30;if(t.length==n){if(0===r)return t;if(0==t.__digit(n-1)>>>r)return t}return a.__truncateToNBits(e,t)}},{key:"ADD",value:function(e,t){if(e=a.__toPrimitive(e),t=a.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=a.__toNumeric(e),t=a.__toNumeric(t),a.__isBigInt(e)&&a.__isBigInt(t))return a.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(e,t){return a.__compare(e,t,0)}},{key:"LE",value:function(e,t){return a.__compare(e,t,1)}},{key:"GT",value:function(e,t){return a.__compare(e,t,2)}},{key:"GE",value:function(e,t){return a.__compare(e,t,3)}},{key:"EQ",value:function(e,t){for(;;){if(a.__isBigInt(e))return a.__isBigInt(t)?a.equal(e,t):a.EQ(t,e);if("number"==typeof e){if(a.__isBigInt(t))return a.__equalToNumber(t,e);if("object"!==n(t))return e==t;t=a.__toPrimitive(t)}else if("string"==typeof e){if(a.__isBigInt(t))return null!==(e=a.__fromString(e))&&a.equal(e,t);if("object"!==n(t))return e==t;t=a.__toPrimitive(t)}else if("boolean"==typeof e){if(a.__isBigInt(t))return a.__equalToNumber(t,+e);if("object"!==n(t))return e==t;t=a.__toPrimitive(t)}else if("symbol"===n(e)){if(a.__isBigInt(t))return!1;if("object"!==n(t))return e==t;t=a.__toPrimitive(t)}else{if("object"!==n(e))return e==t;if("object"===n(t)&&t.constructor!==a)return e==t;e=a.__toPrimitive(e)}}}},{key:"NE",value:function(e,t){return!a.EQ(e,t)}},{key:"DataViewGetBigInt64",value:function(e,t){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];return a.asIntN(64,a.DataViewGetBigUint64(e,t,n))}},{key:"DataViewGetBigUint64",value:function(e,t){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],r=N(n?[4,0]:[0,4],2),i=r[0],s=r[1],o=e.getUint32(t+i,n),l=e.getUint32(t+s,n),c=new a(3,!1);return c.__setDigit(0,1073741823&l),c.__setDigit(1,(268435455&o)<<2|l>>>30),c.__setDigit(2,o>>>28),c.__trim()}},{key:"DataViewSetBigInt64",value:function(e,t,n){var r=!!(3<arguments.length&&void 0!==arguments[3])&&arguments[3];a.DataViewSetBigUint64(e,t,n,r)}},{key:"DataViewSetBigUint64",value:function(e,t,n){var r=!!(3<arguments.length&&void 0!==arguments[3])&&arguments[3],i=0,s=0;if(0<(n=a.asUintN(64,n)).length&&(s=n.__digit(0),1<n.length)){var o=n.__digit(1);s|=o<<30,i=o>>>2,2<n.length&&(i|=n.__digit(2)<<28)}var l=N(r?[4,0]:[0,4],2),c=l[0],u=l[1];e.setUint32(t+c,i,r),e.setUint32(t+u,s,r)}},{key:"__zero",value:function(){return new a(0,!1)}},{key:"__oneDigit",value:function(e,t){var n=new a(1,t);return n.__setDigit(0,e),n}},{key:"__decideRounding",value:function(e,t,n,r){if(0<t)return-1;var i;if(0>t)i=-t-1;else{if(0===n)return-1;n--,r=e.__digit(n),i=29}var s=1<<i;if(0==(r&s))return-1;if(0!=(r&(s-=1)))return 1;for(;0<n;)if(n--,0!==e.__digit(n))return 1;return 0}},{key:"__fromDouble",value:function(e){a.__kBitConversionDouble[0]=e;var t,n=(2047&a.__kBitConversionInts[1]>>>20)-1023,r=1+(0|n/30),i=new a(r,0>e),s=1048575&a.__kBitConversionInts[1]|1048576,o=a.__kBitConversionInts[0],l=20,c=n%30,u=0;if(c<l){var h=l-c;u=h+32,t=s>>>h,s=s<<32-h|o>>>h,o<<=32-h}else if(c===l)u=32,t=s,s=o,o=0;else{var p=c-l;u=32-p,t=s<<p|o>>>32-p,s=o<<p,o=0}i.__setDigit(r-1,t);for(var d=r-2;0<=d;d--)0<u?(u-=30,t=s>>>2,s=s<<30|o>>>2,o<<=30):t=0,i.__setDigit(d,t);return i.__trim()}},{key:"__isWhitespace",value:function(e){return!!(13>=e&&9<=e)||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?10>=(e&=131071)||40==e||41==e||47==e||95==e||4096==e:65279==e)}},{key:"__fromString",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=0,r=e.length,i=0;if(i===r)return a.__zero();for(var s=e.charCodeAt(i);a.__isWhitespace(s);){if(++i===r)return a.__zero();s=e.charCodeAt(i)}if(43===s){if(++i===r)return null;s=e.charCodeAt(i),n=1}else if(45===s){if(++i===r)return null;s=e.charCodeAt(i),n=-1}if(0===t){if(t=10,48===s){if(++i===r)return a.__zero();if(88===(s=e.charCodeAt(i))||120===s){if(t=16,++i===r)return null;s=e.charCodeAt(i)}else if(79===s||111===s){if(t=8,++i===r)return null;s=e.charCodeAt(i)}else if(66===s||98===s){if(t=2,++i===r)return null;s=e.charCodeAt(i)}}}else if(16===t&&48===s){if(++i===r)return a.__zero();if(88===(s=e.charCodeAt(i))||120===s){if(++i===r)return null;s=e.charCodeAt(i)}}if(0!==n&&10!==t)return null;for(;48===s;){if(++i===r)return a.__zero();s=e.charCodeAt(i)}var o=r-i,l=a.__kMaxBitsPerChar[t],c=a.__kBitsPerCharTableMultiplier-1;if(o>1073741824/l)return null;var u=new a(0|(29+(l*o+c>>>a.__kBitsPerCharTableShift))/30,!1),h=10>t?t:10,p=10<t?t-10:0;if(0==(t&t-1)){l>>=a.__kBitsPerCharTableShift;var d=[],m=[],f=!1;do{for(var g,_=0,v=0;;){if(g=void 0,s-48>>>0<h)g=s-48;else{if(!((32|s)-97>>>0<p)){f=!0;break}g=(32|s)-87}if(v+=l,_=_<<l|g,++i===r){f=!0;break}if(s=e.charCodeAt(i),30<v+l)break}d.push(_),m.push(v)}while(!f);a.__fillFromParts(u,d,m)}else{u.__initializeDigits();var y=!1,b=0;do{for(var x,T=0,w=1;;){if(x=void 0,s-48>>>0<h)x=s-48;else{if(!((32|s)-97>>>0<p)){y=!0;break}x=(32|s)-87}var E=w*t;if(1073741823<E)break;if(w=E,T=T*t+x,b++,++i===r){y=!0;break}s=e.charCodeAt(i)}var S=0|(l*b+(c=30*a.__kBitsPerCharTableMultiplier-1)>>>a.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(w,T,S)}while(!y)}if(i!==r){if(!a.__isWhitespace(s))return null;for(i++;i<r;i++)if(s=e.charCodeAt(i),!a.__isWhitespace(s))return null}return u.sign=-1===n,u.__trim()}},{key:"__fillFromParts",value:function(e,t,n){for(var r=0,i=0,s=0,a=t.length-1;0<=a;a--){var o=t[a],l=n[a];i|=o<<s,30===(s+=l)?(e.__setDigit(r++,i),s=0,i=0):30<s&&(e.__setDigit(r++,1073741823&i),i=o>>>l-(s-=30))}if(0!==i){if(r>=e.length)throw new Error("implementation bug");e.__setDigit(r++,i)}for(;r<e.length;r++)e.__setDigit(r,0)}},{key:"__toStringBasePowerOfTwo",value:function(e,t){var n=e.length,r=t-1,i=r=(15&(r=(51&(r=(85&r>>>1)+(85&r))>>>2)+(51&r))>>>4)+(15&r),s=t-1,o=e.__digit(n-1),l=0|(30*n-a.__clz30(o)+i-1)/i;if(e.sign&&l++,268435456<l)throw new Error("string too long");for(var c=Array(l),u=l-1,h=0,p=0,d=0;d<n-1;d++){var m=e.__digit(d),f=(h|m<<p)&s;c[u--]=a.__kConversionChars[f];var g=i-p;for(h=m>>>g,p=30-g;p>=i;)c[u--]=a.__kConversionChars[h&s],h>>>=i,p-=i}var _=(h|o<<p)&s;for(c[u--]=a.__kConversionChars[_],h=o>>>i-p;0!==h;)c[u--]=a.__kConversionChars[h&s],h>>>=i;if(e.sign&&(c[u--]="-"),-1!==u)throw new Error("implementation bug");return c.join("")}},{key:"__toStringGeneric",value:function(e,t,n){var r=e.length;if(0===r)return"";if(1===r){var i=e.__unsignedDigit(0).toString(t);return!1===n&&e.sign&&(i="-"+i),i}var s,o,l=30*r-a.__clz30(e.__digit(r-1)),c=a.__kMaxBitsPerChar[t]-1,u=l*a.__kBitsPerCharTableMultiplier,h=1+(u=0|(u+=c-1)/c)>>1,p=a.exponentiate(a.__oneDigit(t,!1),a.__oneDigit(h,!1)),d=p.__unsignedDigit(0);if(1===p.length&&32767>=d){(s=new a(e.length,!1)).__initializeDigits();for(var m,f=0,g=2*e.length-1;0<=g;g--)m=f<<15|e.__halfDigit(g),s.__setHalfDigit(g,0|m/d),f=0|m%d;o=f.toString(t)}else{var _=a.__absoluteDivLarge(e,p,!0,!0);s=_.quotient;var v=_.remainder.__trim();o=a.__toStringGeneric(v,t,!0)}s.__trim();for(var y=a.__toStringGeneric(s,t,!0);o.length<h;)o="0"+o;return!1===n&&e.sign&&(y="-"+y),y+o}},{key:"__unequalSign",value:function(e){return e?-1:1}},{key:"__absoluteGreater",value:function(e){return e?-1:1}},{key:"__absoluteLess",value:function(e){return e?1:-1}},{key:"__compareToBigInt",value:function(e,t){var n=e.sign;if(n!==t.sign)return a.__unequalSign(n);var r=a.__absoluteCompare(e,t);return 0<r?a.__absoluteGreater(n):0>r?a.__absoluteLess(n):0}},{key:"__compareToNumber",value:function(e,n){if(a.__isOneDigitInt(n)){var r=e.sign,i=0>n;if(r!==i)return a.__unequalSign(r);if(0===e.length){if(i)throw new Error("implementation bug");return 0===n?0:-1}if(1<e.length)return a.__absoluteGreater(r);var s=t(n),o=e.__unsignedDigit(0);return o>s?a.__absoluteGreater(r):o<s?a.__absoluteLess(r):0}return a.__compareToDouble(e,n)}},{key:"__compareToDouble",value:function(e,t){if(t!=t)return t;if(t===1/0)return-1;if(t===-1/0)return 1;var n=e.sign;if(n!==0>t)return a.__unequalSign(n);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;a.__kBitConversionDouble[0]=t;var r=2047&a.__kBitConversionInts[1]>>>20;if(2047==r)throw new Error("implementation bug: handled elsewhere");var i=r-1023;if(0>i)return a.__absoluteGreater(n);var s=e.length,o=e.__digit(s-1),l=a.__clz30(o),c=30*s-l,u=i+1;if(c<u)return a.__absoluteLess(n);if(c>u)return a.__absoluteGreater(n);var h=1048576|1048575&a.__kBitConversionInts[1],p=a.__kBitConversionInts[0],d=20,m=29-l;if(m!==(0|(c-1)%30))throw new Error("implementation bug");var f,g=0;if(m<d){var _=d-m;g=_+32,f=h>>>_,h=h<<32-_|p>>>_,p<<=32-_}else if(m===d)g=32,f=h,h=p,p=0;else{var v=m-d;g=32-v,f=h<<v|p>>>32-v,h=p<<v,p=0}if((o>>>=0)>(f>>>=0))return a.__absoluteGreater(n);if(o<f)return a.__absoluteLess(n);for(var y=s-2;0<=y;y--){0<g?(g-=30,f=h>>>2,h=h<<30|p>>>2,p<<=30):f=0;var b=e.__unsignedDigit(y);if(b>f)return a.__absoluteGreater(n);if(b<f)return a.__absoluteLess(n)}if(0!==h||0!==p){if(0===g)throw new Error("implementation bug");return a.__absoluteLess(n)}return 0}},{key:"__equalToNumber",value:function(e,n){return a.__isOneDigitInt(n)?0===n?0===e.length:1===e.length&&e.sign===0>n&&e.__unsignedDigit(0)===t(n):0===a.__compareToDouble(e,n)}},{key:"__comparisonResultToBool",value:function(e,t){return 0===t?0>e:1===t?0>=e:2===t?0<e:3===t?0<=e:void 0}},{key:"__compare",value:function(e,t,n){if(e=a.__toPrimitive(e),t=a.__toPrimitive(t),"string"==typeof e&&"string"==typeof t)switch(n){case 0:return e<t;case 1:return e<=t;case 2:return e>t;case 3:return e>=t}if(a.__isBigInt(e)&&"string"==typeof t)return null!==(t=a.__fromString(t))&&a.__comparisonResultToBool(a.__compareToBigInt(e,t),n);if("string"==typeof e&&a.__isBigInt(t))return null!==(e=a.__fromString(e))&&a.__comparisonResultToBool(a.__compareToBigInt(e,t),n);if(e=a.__toNumeric(e),t=a.__toNumeric(t),a.__isBigInt(e)){if(a.__isBigInt(t))return a.__comparisonResultToBool(a.__compareToBigInt(e,t),n);if("number"!=typeof t)throw new Error("implementation bug");return a.__comparisonResultToBool(a.__compareToNumber(e,t),n)}if("number"!=typeof e)throw new Error("implementation bug");if(a.__isBigInt(t))return a.__comparisonResultToBool(a.__compareToNumber(t,e),2^n);if("number"!=typeof t)throw new Error("implementation bug");return 0===n?e<t:1===n?e<=t:2===n?e>t:3===n?e>=t:void 0}},{key:"__absoluteAdd",value:function(e,t,n){if(e.length<t.length)return a.__absoluteAdd(t,e,n);if(0===e.length)return e;if(0===t.length)return e.sign===n?e:a.unaryMinus(e);var r=e.length;(0===e.__clzmsd()||t.length===e.length&&0===t.__clzmsd())&&r++;for(var i,s=new a(r,n),o=0,l=0;l<t.length;l++)o=(i=e.__digit(l)+t.__digit(l)+o)>>>30,s.__setDigit(l,1073741823&i);for(;l<e.length;l++){var c=e.__digit(l)+o;o=c>>>30,s.__setDigit(l,1073741823&c)}return l<s.length&&s.__setDigit(l,o),s.__trim()}},{key:"__absoluteSub",value:function(e,t,n){if(0===e.length)return e;if(0===t.length)return e.sign===n?e:a.unaryMinus(e);for(var r,i=new a(e.length,n),s=0,o=0;o<t.length;o++)s=1&(r=e.__digit(o)-t.__digit(o)-s)>>>30,i.__setDigit(o,1073741823&r);for(;o<e.length;o++){var l=e.__digit(o)-s;s=1&l>>>30,i.__setDigit(o,1073741823&l)}return i.__trim()}},{key:"__absoluteAddOne",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length;null===n?n=new a(r,t):n.sign=t;for(var i,s=1,o=0;o<r;o++)s=(i=e.__digit(o)+s)>>>30,n.__setDigit(o,1073741823&i);return 0!==s&&n.__setDigitGrow(r,1),n}},{key:"__absoluteSubOne",value:function(e,t){for(var n,r=e.length,i=new a(t=t||r,!1),s=1,o=0;o<r;o++)s=1&(n=e.__digit(o)-s)>>>30,i.__setDigit(o,1073741823&n);if(0!==s)throw new Error("implementation bug");for(var l=r;l<t;l++)i.__setDigit(l,0);return i}},{key:"__absoluteAnd",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,s=i;if(r<i){s=r;var o=e,l=r;e=t,r=i,t=o,i=l}var c=s;null===n?n=new a(c,!1):c=n.length;for(var u=0;u<s;u++)n.__setDigit(u,e.__digit(u)&t.__digit(u));for(;u<c;u++)n.__setDigit(u,0);return n}},{key:"__absoluteAndNot",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,s=i;r<i&&(s=r);var o=r;null===n?n=new a(o,!1):o=n.length;for(var l=0;l<s;l++)n.__setDigit(l,e.__digit(l)&~t.__digit(l));for(;l<r;l++)n.__setDigit(l,e.__digit(l));for(;l<o;l++)n.__setDigit(l,0);return n}},{key:"__absoluteOr",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,s=i;if(r<i){s=r;var o=e,l=r;e=t,r=i,t=o,i=l}var c=r;null===n?n=new a(c,!1):c=n.length;for(var u=0;u<s;u++)n.__setDigit(u,e.__digit(u)|t.__digit(u));for(;u<r;u++)n.__setDigit(u,e.__digit(u));for(;u<c;u++)n.__setDigit(u,0);return n}},{key:"__absoluteXor",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,s=i;if(r<i){s=r;var o=e,l=r;e=t,r=i,t=o,i=l}var c=r;null===n?n=new a(c,!1):c=n.length;for(var u=0;u<s;u++)n.__setDigit(u,e.__digit(u)^t.__digit(u));for(;u<r;u++)n.__setDigit(u,e.__digit(u));for(;u<c;u++)n.__setDigit(u,0);return n}},{key:"__absoluteCompare",value:function(e,t){var n=e.length-t.length;if(0!=n)return n;for(var r=e.length-1;0<=r&&e.__digit(r)===t.__digit(r);)r--;return 0>r?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}},{key:"__multiplyAccumulate",value:function(e,t,n,r){if(0!==t){for(var i=32767&t,s=t>>>15,o=0,l=0,c=0;c<e.length;c++,r++){var u=n.__digit(r),h=e.__digit(c),p=32767&h,d=h>>>15,m=a.__imul(p,i),f=a.__imul(p,s),g=a.__imul(d,i);o=(u+=l+m+o)>>>30,u&=1073741823,o+=(u+=((32767&f)<<15)+((32767&g)<<15))>>>30,l=a.__imul(d,s)+(f>>>15)+(g>>>15),n.__setDigit(r,1073741823&u)}for(;0!==o||0!==l;r++){var _=n.__digit(r);_+=o+l,l=0,o=_>>>30,n.__setDigit(r,1073741823&_)}}}},{key:"__internalMultiplyAdd",value:function(e,t,n,r,i){for(var s=n,o=0,l=0;l<r;l++){var c=e.__digit(l),u=a.__imul(32767&c,t),h=a.__imul(c>>>15,t),p=u+((32767&h)<<15)+o+s;s=p>>>30,o=h>>>15,i.__setDigit(l,1073741823&p)}if(i.length>r)for(i.__setDigit(r++,s+o);r<i.length;)i.__setDigit(r++,0);else if(0!==s+o)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=new a(e.length,!1));for(var r=0,i=2*e.length-1;0<=i;i-=2){var s=(r<<15|e.__halfDigit(i))>>>0,o=0|s/t,l=0|(s=((r=0|s%t)<<15|e.__halfDigit(i-1))>>>0)/t;r=0|s%t,n.__setDigit(i>>>1,o<<15|l)}return n}},{key:"__absoluteModSmall",value:function(e,t){for(var n=0,r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}},{key:"__absoluteDivLarge",value:function(e,t,n,r){var i=t.__halfDigitLength(),s=t.length,o=e.__halfDigitLength()-i,l=null;n&&(l=new a(o+2>>>1,!1)).__initializeDigits();var c=new a(i+2>>>1,!1);c.__initializeDigits();var u=a.__clz15(t.__halfDigit(i-1));0<u&&(t=a.__specialLeftShift(t,u,0));for(var h=a.__specialLeftShift(e,u,1),p=t.__halfDigit(i-1),d=0,m=o;0<=m;m--){var f=32767,g=h.__halfDigit(m+i);if(g!==p){var _=(g<<15|h.__halfDigit(m+i-1))>>>0;f=0|_/p;for(var v=0|_%p,y=t.__halfDigit(i-2),b=h.__halfDigit(m+i-2);a.__imul(f,y)>>>0>(v<<16|b)>>>0&&(f--,!(32767<(v+=p))););}a.__internalMultiplyAdd(t,f,0,s,c);var x=h.__inplaceSub(c,m,i+1);0!==x&&(x=h.__inplaceAdd(t,m,i),h.__setHalfDigit(m+i,32767&h.__halfDigit(m+i)+x),f--),n&&(1&m?d=f<<15:l.__setDigit(m>>>1,d|f))}if(r)return h.__inplaceRightShift(u),n?{quotient:l,remainder:h}:h;if(n)return l;throw new Error("unreachable")}},{key:"__clz15",value:function(e){return a.__clz30(e)-15}},{key:"__specialLeftShift",value:function(e,t,n){var r=e.length,i=new a(r+n,!1);if(0===t){for(var s=0;s<r;s++)i.__setDigit(s,e.__digit(s));return 0<n&&i.__setDigit(r,0),i}for(var o,l=0,c=0;c<r;c++)o=e.__digit(c),i.__setDigit(c,1073741823&o<<t|l),l=o>>>30-t;return 0<n&&i.__setDigit(r,l),i}},{key:"__leftShiftByAbsolute",value:function(e,t){var n=a.__toShiftAmount(t);if(0>n)throw new RangeError("BigInt too big");var r=0|n/30,i=n%30,s=e.length,o=0!==i&&0!=e.__digit(s-1)>>>30-i,l=s+r+(o?1:0),c=new a(l,e.sign);if(0===i){for(var u=0;u<r;u++)c.__setDigit(u,0);for(;u<l;u++)c.__setDigit(u,e.__digit(u-r))}else{for(var h=0,p=0;p<r;p++)c.__setDigit(p,0);for(var d,m=0;m<s;m++)d=e.__digit(m),c.__setDigit(m+r,1073741823&d<<i|h),h=d>>>30-i;if(o)c.__setDigit(s+r,h);else if(0!==h)throw new Error("implementation bug")}return c.__trim()}},{key:"__rightShiftByAbsolute",value:function(e,t){var n=e.length,r=e.sign,i=a.__toShiftAmount(t);if(0>i)return a.__rightShiftByMaximum(r);var s=0|i/30,o=i%30,l=n-s;if(0>=l)return a.__rightShiftByMaximum(r);var c=!1;if(r)if(0!=(e.__digit(s)&(1<<o)-1))c=!0;else for(var u=0;u<s;u++)if(0!==e.__digit(u)){c=!0;break}c&&0===o&&0==~e.__digit(n-1)&&l++;var h=new a(l,r);if(0===o){h.__setDigit(l-1,0);for(var p=s;p<n;p++)h.__setDigit(p-s,e.__digit(p))}else{for(var d,m=e.__digit(s)>>>o,f=n-s-1,g=0;g<f;g++)d=e.__digit(g+s+1),h.__setDigit(g,1073741823&d<<30-o|m),m=d>>>o;h.__setDigit(f,m)}return c&&(h=a.__absoluteAddOne(h,!0,h)),h.__trim()}},{key:"__rightShiftByMaximum",value:function(e){return e?a.__oneDigit(1,!0):a.__zero()}},{key:"__toShiftAmount",value:function(e){if(1<e.length)return-1;var t=e.__unsignedDigit(0);return t>a.__kMaxLengthBits?-1:t}},{key:"__toPrimitive",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"default";if("object"!==n(e))return e;if(e.constructor===a)return e;if(void 0!==s&&"symbol"===n(b)){var r=e[b];if(r){var i=r(t);if("object"!==n(i))return i;throw new TypeError("Cannot convert object to primitive value")}}var o=e.valueOf;if(o){var l=o.call(e);if("object"!==n(l))return l}var c=e.toString;if(c){var u=c.call(e);if("object"!==n(u))return u}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(e){return a.__isBigInt(e)?e:+e}},{key:"__isBigInt",value:function(e){return"object"===n(e)&&null!==e&&e.constructor===a}},{key:"__truncateToNBits",value:function(e,t){for(var n=0|(e+29)/30,r=new a(n,t.sign),i=n-1,s=0;s<i;s++)r.__setDigit(s,t.__digit(s));var o=t.__digit(i);if(0!=e%30){var l=32-e%30;o=o<<l>>>l}return r.__setDigit(i,o),r.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(e,t,n){for(var r,i=Math.min,s=0|(e+29)/30,o=new a(s,n),l=0,c=s-1,u=0,h=i(c,t.length);l<h;l++)u=1&(r=0-t.__digit(l)-u)>>>30,o.__setDigit(l,1073741823&r);for(;l<c;l++)o.__setDigit(l,0|1073741823&-u);var p,d=c<t.length?t.__digit(c):0,m=e%30;if(0===m)p=0-d-u,p&=1073741823;else{var f=32-m,g=1<<32-f;p=g-(d=d<<f>>>f)-u,p&=g-1}return o.__setDigit(c,p),o.__trim()}},{key:"__digitPow",value:function(e,t){for(var n=1;0<t;)1&t&&(n*=e),t>>>=1,e*=e;return n}},{key:"__isOneDigitInt",value:function(e){return(1073741823&e)===e}}]),a}(D(Array));return G.__kMaxLength=33554432,G.__kMaxLengthBits=G.__kMaxLength<<5,G.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],G.__kBitsPerCharTableShift=5,G.__kBitsPerCharTableMultiplier=1<<G.__kBitsPerCharTableShift,G.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],G.__kBitConversionBuffer=new ArrayBuffer(8),G.__kBitConversionDouble=new Float64Array(G.__kBitConversionBuffer),G.__kBitConversionInts=new Int32Array(G.__kBitConversionBuffer),G.__clz30=t?function(e){return t(e)-2}:function(e){var t=Math.LN2,n=Math.log;return 0===e?30:0|29-(0|n(e>>>0)/t)},G.__imul=e||function(e,t){return 0|e*t},G}()},9873:function(e,t,n){var r;e=n.nmd(e);var i=n(10899),s=n(34300),a=n(76555),o=n(35704),l=n(99595),c=n(29898),u=n(90143),h=n(86526),p=n(88946),d=n(51791),m=n(19178),f=n(73324),g=n(86981);(function(){var _,v="Expected a function",y="__lodash_hash_undefined__",b="__lodash_placeholder__",x=16,T=32,w=64,E=128,S=256,I=1/0,M=9007199254740991,A=NaN,R=4294967295,D=[["ary",E],["bind",1],["bindKey",2],["curry",8],["curryRight",x],["flip",512],["partial",T],["partialRight",w],["rearg",S]],C="[object Arguments]",O="[object Array]",P="[object Boolean]",N="[object Date]",L="[object Error]",k="[object Function]",F="[object GeneratorFunction]",U="[object Map]",B="[object Number]",j="[object Object]",G="[object Promise]",z="[object RegExp]",V="[object Set]",H="[object String]",q="[object Symbol]",W="[object WeakMap]",Y="[object ArrayBuffer]",X="[object DataView]",$="[object Float32Array]",K="[object Float64Array]",Z="[object Int8Array]",J="[object Int16Array]",Q="[object Int32Array]",ee="[object Uint8Array]",te="[object Uint8ClampedArray]",ne="[object Uint16Array]",re="[object Uint32Array]",ie=/\b__p \+= '';/g,se=/\b(__p \+=) '' \+/g,ae=/(__e\(.*?\)|\b__t\)) \+\n'';/g,oe=/&(?:amp|lt|gt|quot|#39);/g,le=/[&<>"']/g,ce=RegExp(oe.source),ue=RegExp(le.source),he=/<%-([\s\S]+?)%>/g,pe=/<%([\s\S]+?)%>/g,de=/<%=([\s\S]+?)%>/g,me=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/,ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_e=/[\\^$.*+?()[\]{}|]/g,ve=RegExp(_e.source),ye=/^\s+/,be=/\s/,xe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Te=/\{\n\/\* \[wrapped with (.+)\] \*/,we=/,? & /,Ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Se=/[()=,{}\[\]\/\s]/,Ie=/\\(\\)?/g,Me=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ae=/\w*$/,Re=/^[-+]0x[0-9a-f]+$/i,De=/^0b[01]+$/i,Ce=/^\[object .+?Constructor\]$/,Oe=/^0o[0-7]+$/i,Pe=/^(?:0|[1-9]\d*)$/,Ne=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Le=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ue="\\u2700-\\u27bf",Be="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ge="\\ufe0e\\ufe0f",ze="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ve="[']",He="[\\ud800-\\udfff]",qe="["+ze+"]",We="["+Fe+"]",Ye="\\d+",Xe="[\\u2700-\\u27bf]",$e="["+Be+"]",Ke="[^\\ud800-\\udfff"+ze+Ye+Ue+Be+je+"]",Ze="\\ud83c[\\udffb-\\udfff]",Je="[^\\ud800-\\udfff]",Qe="(?:\\ud83c[\\udde6-\\uddff]){2}",et="[\\ud800-\\udbff][\\udc00-\\udfff]",tt="["+je+"]",nt="(?:"+$e+"|"+Ke+")",rt="(?:"+tt+"|"+Ke+")",it="(?:['](?:d|ll|m|re|s|t|ve))?",st="(?:['](?:D|LL|M|RE|S|T|VE))?",at="(?:"+We+"|"+Ze+")"+"?",ot="[\\ufe0e\\ufe0f]?",lt=ot+at+("(?:\\u200d(?:"+[Je,Qe,et].join("|")+")"+ot+at+")*"),ct="(?:"+[Xe,Qe,et].join("|")+")"+lt,ut="(?:"+[Je+We+"?",We,Qe,et,He].join("|")+")",ht=RegExp(Ve,"g"),pt=RegExp(We,"g"),dt=RegExp(Ze+"(?="+Ze+")|"+ut+lt,"g"),mt=RegExp([tt+"?"+$e+"+"+it+"(?="+[qe,tt,"$"].join("|")+")",rt+"+"+st+"(?="+[qe,tt+nt,"$"].join("|")+")",tt+"?"+nt+"+"+it,tt+"+"+st,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ye,ct].join("|"),"g"),ft=RegExp("[\\u200d\\ud800-\\udfff"+Fe+Ge+"]"),gt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vt=-1,yt={};yt[$]=yt[K]=yt[Z]=yt[J]=yt[Q]=yt[ee]=yt[te]=yt[ne]=yt[re]=!0,yt[C]=yt[O]=yt[Y]=yt[P]=yt[X]=yt[N]=yt[L]=yt[k]=yt[U]=yt[B]=yt[j]=yt[z]=yt[V]=yt[H]=yt[W]=!1;var bt={};bt[C]=bt[O]=bt[Y]=bt[X]=bt[P]=bt[N]=bt[$]=bt[K]=bt[Z]=bt[J]=bt[Q]=bt[U]=bt[B]=bt[j]=bt[z]=bt[V]=bt[H]=bt[q]=bt[ee]=bt[te]=bt[ne]=bt[re]=!0,bt[L]=bt[k]=bt[W]=!1;var xt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tt=i,wt=s,Et="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,St="object"==typeof self&&self&&self.Object===Object&&self,It=Et||St||Function("return this")(),Mt=t&&!t.nodeType&&t,At=Mt&&e&&!e.nodeType&&e,Rt=At&&At.exports===Mt,Dt=Rt&&Et.process,Ct=function(){try{var e=At&&At.require&&At.require("util").types;return e||Dt&&Dt.binding&&Dt.binding("util")}catch(e){}}(),Ot=Ct&&Ct.isArrayBuffer,Pt=Ct&&Ct.isDate,Nt=Ct&&Ct.isMap,Lt=Ct&&Ct.isRegExp,kt=Ct&&Ct.isSet,Ft=Ct&&Ct.isTypedArray;function Ut(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Bt(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Gt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function zt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Vt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Ht(e,t){return!!(null==e?0:e.length)&&en(e,t,0)>-1}function qt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Wt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Yt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Xt(e,t,n,r){var i=-1,s=null==e?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function $t(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Zt=sn("length");function Jt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Qt(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function en(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Qt(e,nn,n)}function tn(e,t,n,r){for(var i=n-1,s=e.length;++i<s;)if(r(e[i],t))return i;return-1}function nn(e){return e!=e}function rn(e,t){var n=null==e?0:e.length;return n?ln(e,t)/n:A}function sn(e){return function(t){return null==t?_:t[e]}}function an(e){return function(t){return null==e?_:e[t]}}function on(e,t,n,r,i){return i(e,(function(e,i,s){n=r?(r=!1,e):t(n,e,i,s)})),n}function ln(e,t){for(var n,r=-1,i=e.length;++r<i;){var s=t(e[r]);s!==_&&(n=n===_?s:n+s)}return n}function cn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function un(e){return e?o(e).call(e,0,An(e)+1).replace(ye,""):e}function hn(e){return function(t){return e(t)}}function pn(e,t){return Wt(t,(function(t){return e[t]}))}function dn(e,t){return e.has(t)}function mn(e,t){for(var n=-1,r=e.length;++n<r&&en(t,e[n],0)>-1;);return n}function fn(e,t){for(var n=e.length;n--&&en(t,e[n],0)>-1;);return n}function gn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var _n=an({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),vn=an({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function yn(e){return"\\"+xt[e]}function bn(e){return ft.test(e)}function xn(e){var t=-1,n=Array(e.size);return l(e).call(e,(function(e,r){n[++t]=[r,e]})),n}function Tn(e,t){return function(n){return e(t(n))}}function wn(e,t){for(var n=-1,r=e.length,i=0,s=[];++n<r;){var a=e[n];a!==t&&a!==b||(e[n]=b,s[i++]=n)}return s}function En(e){var t=-1,n=Array(e.size);return l(e).call(e,(function(e){n[++t]=e})),n}function Sn(e){var t=-1,n=Array(e.size);return l(e).call(e,(function(e){n[++t]=[e,e]})),n}function In(e){return bn(e)?function(e){var t=dt.lastIndex=0;for(;dt.test(e);)++t;return t}(e):Zt(e)}function Mn(e){return bn(e)?function(e){return e.match(dt)||[]}(e):function(e){return e.split("")}(e)}function An(e){for(var t=e.length;t--&&be.test(e.charAt(t)););return t}var Rn=an({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Dn=function e(t){var n,r=(t=null==t?It:Dn.defaults(It.Object(),t,Dn.pick(It,_t))).Array,i=t.Date,s=t.Error,be=t.Function,Fe=t.Math,Ue=t.Object,Be=t.RegExp,je=t.String,Ge=t.TypeError,ze=r.prototype,Ve=be.prototype,He=Ue.prototype,qe=t["__core-js_shared__"],We=Ve.toString,Ye=He.hasOwnProperty,Xe=0,$e=(n=/[^.]+$/.exec(qe&&c(qe)&&c(qe).IE_PROTO||""))?"Symbol(src)_1."+n:"",Ke=He.toString,Ze=We.call(Ue),Je=It._,Qe=Be("^"+We.call(Ye).replace(_e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=Rt?t.Buffer:_,tt=t.Symbol,nt=t.Uint8Array,rt=et?et.allocUnsafe:_,it=Tn(Ue.getPrototypeOf,Ue),st=Ue.create,at=He.propertyIsEnumerable,ot=u(ze),lt=tt?tt.isConcatSpreadable:_,ct=tt?tt.iterator:_,ut=tt?tt.toStringTag:_,dt=function(){try{var e=Es(Ue,"defineProperty");return e({},"",{}),e}catch(e){}}(),ft=t.clearTimeout!==It.clearTimeout&&t.clearTimeout,xt=i&&i.now!==It.Date.now&&i.now,Et=t.setTimeout!==It.setTimeout&&t.setTimeout,St=Fe.ceil,Mt=Fe.floor,At=Ue.getOwnPropertySymbols,Dt=et?et.isBuffer:_,Ct=t.isFinite,Zt=ze.join,an=Tn(c(Ue),Ue),Cn=Fe.max,On=Fe.min,Pn=i.now,Nn=t.parseInt,Ln=Fe.random,kn=h(ze),Fn=Es(t,"DataView"),Un=Es(t,"Map"),Bn=Es(t,"Promise"),jn=Es(t,"Set"),Gn=Es(t,"WeakMap"),zn=Es(Ue,"create"),Vn=Gn&&new Gn,Hn={},qn=Zs(Fn),Wn=Zs(Un),Yn=Zs(Bn),Xn=Zs(jn),$n=Zs(Gn),Kn=tt?tt.prototype:_,Zn=Kn?Kn.valueOf:_,Jn=Kn?Kn.toString:_;function Qn(e){if(fo(e)&&!ro(e)&&!(e instanceof rr)){if(e instanceof nr)return e;if(Ye.call(e,"__wrapped__"))return Js(e)}return new nr(e)}var er=function(){function e(){}return function(t){if(!mo(t))return{};if(st)return st(t);e.prototype=t;var n=new e;return e.prototype=_,n}}();function tr(){}function nr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=_}function rr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function ir(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function sr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ar(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function or(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ar;++t<n;)this.add(e[t])}function lr(e){var t=this.__data__=new sr(e);this.size=t.size}function cr(e,t){var n=ro(e),r=!n&&no(e),i=!n&&!r&&oo(e),s=!n&&!r&&!i&&wo(e),a=n||r||i||s,o=a?cn(e.length,je):[],l=o.length;for(var c in e)!t&&!Ye.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Cs(c,l))||o.push(c);return o}function ur(e){var t=e.length;return t?e[oi(0,t-1)]:_}function hr(e,t){return Xs(zi(e),br(t,0,e.length))}function pr(e){return Xs(zi(e))}function dr(e,t,n){(n!==_&&!Qa(e[t],n)||n===_&&!(t in e))&&vr(e,t,n)}function mr(e,t,n){var r=e[t];Ye.call(e,t)&&Qa(r,n)&&(n!==_||t in e)||vr(e,t,n)}function fr(e,t){for(var n=e.length;n--;)if(Qa(e[n][0],t))return n;return-1}function gr(e,t,n,r){return Sr(e,(function(e,i,s){t(r,e,n(e),s)})),r}function _r(e,t){return e&&Vi(t,qo(t),e)}function vr(e,t,n){"__proto__"==t&&dt?dt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function yr(e,t){for(var n=-1,i=t.length,s=r(i),a=null==e;++n<i;)s[n]=a?_:jo(e,t[n]);return s}function br(e,t,n){return e==e&&(n!==_&&(e=e<=n?e:n),t!==_&&(e=e>=t?e:t)),e}function xr(e,t,n,r,i,s){var a,o=1&t,c=2&t,u=4&t;if(n&&(a=i?n(e,r,i,s):n(e)),a!==_)return a;if(!mo(e))return e;var h=ro(e);if(h){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ye.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!o)return zi(e,a)}else{var p=Ms(e),d=p==k||p==F;if(oo(e))return ki(e,o);if(p==j||p==C||d&&!i){if(a=c||d?{}:Rs(e),!o)return c?function(e,t){return Vi(e,Is(e),t)}(e,function(e,t){return e&&Vi(t,Wo(t),e)}(a,e)):function(e,t){return Vi(e,Ss(e),t)}(e,_r(a,e))}else{if(!bt[p])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case Y:return Fi(e);case P:case N:return new r(+e);case X:return function(e,t){var n=t?Fi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case $:case K:case Z:case J:case Q:case ee:case te:case ne:case re:return Ui(e,n);case U:return new r;case B:case H:return new r(e);case z:return function(e){var t=new e.constructor(e.source,Ae.exec(e));return t.lastIndex=e.lastIndex,t}(e);case V:return new r;case q:return i=e,Zn?Ue(Zn.call(i)):{}}var i}(e,p,o)}}s||(s=new lr);var m=s.get(e);if(m)return m;s.set(e,a),bo(e)?l(e).call(e,(function(r){a.add(xr(r,t,n,r,e,s))})):go(e)&&l(e).call(e,(function(r,i){a.set(i,xr(r,t,n,i,e,s))}));var f=h?_:(u?c?_s:gs:c?Wo:qo)(e);return jt(f||e,(function(r,i){f&&(r=e[i=r]),mr(a,i,xr(r,t,n,i,e,s))})),a}function Tr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ue(e);r--;){var i=n[r],s=t[i],a=e[i];if(a===_&&!(i in e)||!s(a))return!1}return!0}function wr(e,t,n){if("function"!=typeof e)throw new Ge(v);return Hs((function(){e.apply(_,n)}),t)}function Er(e,t,n,r){var i=-1,s=Ht,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;n&&(t=Wt(t,hn(n))),r?(s=qt,a=!1):t.length>=200&&(s=dn,a=!1,t=new or(t));e:for(;++i<o;){var u=e[i],h=null==n?u:n(u);if(u=r||0!==u?u:0,a&&h==h){for(var p=c;p--;)if(t[p]===h)continue e;l.push(u)}else s(t,h,r)||l.push(u)}return l}Qn.templateSettings={escape:he,evaluate:pe,interpolate:de,variable:"",imports:{_:Qn}},Qn.prototype=tr.prototype,Qn.prototype.constructor=Qn,nr.prototype=er(tr.prototype),nr.prototype.constructor=nr,rr.prototype=er(tr.prototype),rr.prototype.constructor=rr,ir.prototype.clear=function(){this.__data__=zn?zn(null):{},this.size=0},ir.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ir.prototype.get=function(e){var t=this.__data__;if(zn){var n=t[e];return n===y?_:n}return Ye.call(t,e)?t[e]:_},ir.prototype.has=function(e){var t=this.__data__;return zn?t[e]!==_:Ye.call(t,e)},ir.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zn&&t===_?y:t,this},sr.prototype.clear=function(){this.__data__=[],this.size=0},sr.prototype.delete=function(e){var t=this.__data__,n=fr(t,e);return!(n<0)&&(n==t.length-1?t.pop():ot.call(t,n,1),--this.size,!0)},sr.prototype.get=function(e){var t=this.__data__,n=fr(t,e);return n<0?_:t[n][1]},sr.prototype.has=function(e){return fr(this.__data__,e)>-1},sr.prototype.set=function(e,t){var n=this.__data__,r=fr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ar.prototype.clear=function(){this.size=0,this.__data__={hash:new ir,map:new(Un||sr),string:new ir}},ar.prototype.delete=function(e){var t=Ts(this,e).delete(e);return this.size-=t?1:0,t},ar.prototype.get=function(e){return Ts(this,e).get(e)},ar.prototype.has=function(e){return Ts(this,e).has(e)},ar.prototype.set=function(e,t){var n=Ts(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},or.prototype.add=or.prototype.push=function(e){return this.__data__.set(e,y),this},or.prototype.has=function(e){return this.__data__.has(e)},lr.prototype.clear=function(){this.__data__=new sr,this.size=0},lr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},lr.prototype.get=function(e){return this.__data__.get(e)},lr.prototype.has=function(e){return this.__data__.has(e)},lr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof sr){var r=n.__data__;if(!Un||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ar(r)}return n.set(e,t),this.size=n.size,this};var Sr=Wi(Pr),Ir=Wi(Nr,!0);function Mr(e,t){var n=!0;return Sr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function Ar(e,t,n){for(var r=-1,i=e.length;++r<i;){var s=e[r],a=t(s);if(null!=a&&(o===_?a==a&&!To(a):n(a,o)))var o=a,l=s}return l}function Rr(e,t){var n=[];return Sr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Dr(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Ds),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Dr(o,t-1,n,r,i):Yt(i,o):r||(i[i.length]=o)}return i}var Cr=Yi(),Or=Yi(!0);function Pr(e,t){return e&&Cr(e,t,qo)}function Nr(e,t){return e&&Or(e,t,qo)}function Lr(e,t){return Vt(t,(function(t){return uo(e[t])}))}function kr(e,t){for(var n=0,r=(t=Oi(t,e)).length;null!=e&&n<r;)e=e[Ks(t[n++])];return n&&n==r?e:_}function Fr(e,t,n){var r=t(e);return ro(e)?r:Yt(r,n(e))}function Ur(e){return null==e?e===_?"[object Undefined]":"[object Null]":ut&&ut in Ue(e)?function(e){var t=Ye.call(e,ut),n=e[ut];try{e[ut]=_;var r=!0}catch(e){}var i=Ke.call(e);r&&(t?e[ut]=n:delete e[ut]);return i}(e):function(e){return Ke.call(e)}(e)}function Br(e,t){return e>t}function jr(e,t){return null!=e&&Ye.call(e,t)}function Gr(e,t){return null!=e&&t in Ue(e)}function zr(e,t,n){for(var i=n?qt:Ht,s=e[0].length,a=e.length,o=a,l=r(a),c=1/0,u=[];o--;){var h=e[o];o&&t&&(h=Wt(h,hn(t))),c=On(h.length,c),l[o]=!n&&(t||s>=120&&h.length>=120)?new or(o&&h):_}h=e[0];var p=-1,d=l[0];e:for(;++p<s&&u.length<c;){var m=h[p],f=t?t(m):m;if(m=n||0!==m?m:0,!(d?dn(d,f):i(u,f,n))){for(o=a;--o;){var g=l[o];if(!(g?dn(g,f):i(e[o],f,n)))continue e}d&&d.push(f),u.push(m)}}return u}function Vr(e,t,n){var r=null==(e=js(e,t=Oi(t,e)))?e:e[Ks(ca(t))];return null==r?_:Ut(r,e,n)}function Hr(e){return fo(e)&&Ur(e)==C}function qr(e,t,n,r,i){return e===t||(null==e||null==t||!fo(e)&&!fo(t)?e!=e&&t!=t:function(e,t,n,r,i,s){var a=ro(e),o=ro(t),l=a?O:Ms(e),c=o?O:Ms(t),u=(l=l==C?j:l)==j,h=(c=c==C?j:c)==j,p=l==c;if(p&&oo(e)){if(!oo(t))return!1;a=!0,u=!1}if(p&&!u)return s||(s=new lr),a||wo(e)?ms(e,t,n,r,i,s):function(e,t,n,r,i,s,a){switch(n){case X:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Y:return!(e.byteLength!=t.byteLength||!s(new nt(e),new nt(t)));case P:case N:case B:return Qa(+e,+t);case L:return e.name==t.name&&e.message==t.message;case z:case H:return e==t+"";case U:var o=xn;case V:var l=1&r;if(o||(o=En),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=ms(o(e),o(t),r,i,s,a);return a.delete(e),u;case q:if(Zn)return Zn.call(e)==Zn.call(t)}return!1}(e,t,l,n,r,i,s);if(!(1&n)){var d=u&&Ye.call(e,"__wrapped__"),m=h&&Ye.call(t,"__wrapped__");if(d||m){var f=d?e.value():e,g=m?t.value():t;return s||(s=new lr),i(f,g,n,r,s)}}if(!p)return!1;return s||(s=new lr),function(e,t,n,r,i,s){var a=1&n,o=gs(e),l=o.length,c=gs(t).length;if(l!=c&&!a)return!1;var u=l;for(;u--;){var h=o[u];if(!(a?h in t:Ye.call(t,h)))return!1}var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var m=!0;s.set(e,t),s.set(t,e);var f=a;for(;++u<l;){var g=e[h=o[u]],v=t[h];if(r)var y=a?r(v,g,h,t,e,s):r(g,v,h,e,t,s);if(!(y===_?g===v||i(g,v,n,r,s):y)){m=!1;break}f||(f="constructor"==h)}if(m&&!f){var b=e.constructor,x=t.constructor;b==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(m=!1)}return s.delete(e),s.delete(t),m}(e,t,n,r,i,s)}(e,t,n,r,qr,i))}function Wr(e,t,n,r){var i=n.length,s=i,a=!r;if(null==e)return!s;for(e=Ue(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){var l=(o=n[i])[0],c=e[l],u=o[1];if(a&&o[2]){if(c===_&&!(l in e))return!1}else{var h=new lr;if(r)var p=r(c,u,l,e,t,h);if(!(p===_?qr(u,c,3,r,h):p))return!1}}return!0}function Yr(e){return!(!mo(e)||(t=e,$e&&$e in t))&&(uo(e)?Qe:Ce).test(Zs(e));var t}function Xr(e){return"function"==typeof e?e:null==e?_l:"object"==typeof e?ro(e)?ei(e[0],e[1]):Qr(e):Il(e)}function $r(e){if(!ks(e))return an(e);var t=[];for(var n in Ue(e))Ye.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Kr(e){if(!mo(e))return function(e){var t=[];if(null!=e)for(var n in Ue(e))t.push(n);return t}(e);var t=ks(e),n=[];for(var r in e)("constructor"!=r||!t&&Ye.call(e,r))&&n.push(r);return n}function Zr(e,t){return e<t}function Jr(e,t){var n=-1,i=so(e)?r(e.length):[];return Sr(e,(function(e,r,s){i[++n]=t(e,r,s)})),i}function Qr(e){var t=ws(e);return 1==t.length&&t[0][2]?Us(t[0][0],t[0][1]):function(n){return n===e||Wr(n,e,t)}}function ei(e,t){return Ps(e)&&Fs(t)?Us(Ks(e),t):function(n){var r=jo(n,e);return r===_&&r===t?Go(n,e):qr(t,r,3)}}function ti(e,t,n,r,i){e!==t&&Cr(t,(function(s,a){if(i||(i=new lr),mo(s))!function(e,t,n,r,i,s,a){var o=zs(e,n),l=zs(t,n),c=a.get(l);if(c)return void dr(e,n,c);var u=s?s(o,l,n+"",e,t,a):_,h=u===_;if(h){var p=ro(l),d=!p&&oo(l),m=!p&&!d&&wo(l);u=l,p||d||m?ro(o)?u=o:ao(o)?u=zi(o):d?(h=!1,u=ki(l,!0)):m?(h=!1,u=Ui(l,!0)):u=[]:vo(l)||no(l)?(u=o,no(o)?u=Co(o):mo(o)&&!uo(o)||(u=Rs(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l));dr(e,n,u)}(e,t,a,n,ti,r,i);else{var o=r?r(zs(e,a),s,a+"",e,t,i):_;o===_&&(o=s),dr(e,a,o)}}),Wo)}function ni(e,t){var n=e.length;if(n)return Cs(t+=t<0?n:0,n)?e[t]:_}function ri(e,t,n){t=t.length?Wt(t,(function(e){return ro(e)?function(t){return kr(t,1===e.length?e[0]:e)}:e})):[_l];var r=-1;t=Wt(t,hn(xs()));var i=Jr(e,(function(e,n,i){var s=Wt(t,(function(t){return t(e)}));return{criteria:s,index:++r,value:e}}));return function(e,t){var n=e.length;for(a(e).call(e,t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;for(;++r<a;){var l=Bi(i[r],s[r]);if(l)return r>=o?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function ii(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=kr(e,a);n(o,a)&&pi(s,Oi(a,e),o)}return s}function si(e,t,n,r){var i=r?tn:en,s=-1,a=t.length,o=e;for(e===t&&(t=zi(t)),n&&(o=Wt(e,hn(n)));++s<a;)for(var l=0,c=t[s],u=n?n(c):c;(l=i(o,u,l,r))>-1;)o!==e&&ot.call(o,l,1),ot.call(e,l,1);return e}function ai(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==s){var s=i;Cs(i)?ot.call(e,i,1):Ei(e,i)}}return e}function oi(e,t){return e+Mt(Ln()*(t-e+1))}function li(e,t){var n="";if(!e||t<1||t>M)return n;do{t%2&&(n+=e),(t=Mt(t/2))&&(e+=e)}while(t);return n}function ci(e,t){return qs(Bs(e,t,_l),e+"")}function ui(e){return ur(el(e))}function hi(e,t){var n=el(e);return Xs(n,br(t,0,n.length))}function pi(e,t,n,r){if(!mo(e))return e;for(var i=-1,s=(t=Oi(t,e)).length,a=s-1,o=e;null!=o&&++i<s;){var l=Ks(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=a){var u=o[l];(c=r?r(u,l,o):_)===_&&(c=mo(u)?u:Cs(t[i+1])?[]:{})}mr(o,l,c),o=o[l]}return e}var di=Vn?function(e,t){return Vn.set(e,t),e}:_l,mi=dt?function(e,t){return dt(e,"toString",{configurable:!0,enumerable:!1,value:ml(t),writable:!0})}:_l;function fi(e){return Xs(el(e))}function gi(e,t,n){var i=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=r(s);++i<s;)a[i]=e[i+t];return a}function _i(e,t){var n;return Sr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function vi(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var s=r+i>>>1,a=e[s];null!==a&&!To(a)&&(n?a<=t:a<t)?r=s+1:i=s}return i}return yi(e,t,_l,n)}function yi(e,t,n,r){var i=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,o=null===t,l=To(t),c=t===_;i<s;){var u=Mt((i+s)/2),h=n(e[u]),p=h!==_,d=null===h,m=h==h,f=To(h);if(a)var g=r||m;else g=c?m&&(r||p):o?m&&p&&(r||!d):l?m&&p&&!d&&(r||!f):!d&&!f&&(r?h<=t:h<t);g?i=u+1:s=u}return On(s,4294967294)}function bi(e,t){for(var n=-1,r=e.length,i=0,s=[];++n<r;){var a=e[n],o=t?t(a):a;if(!n||!Qa(o,l)){var l=o;s[i++]=0===a?0:a}}return s}function xi(e){return"number"==typeof e?e:To(e)?A:+e}function Ti(e){if("string"==typeof e)return e;if(ro(e))return Wt(e,Ti)+"";if(To(e))return Jn?Jn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function wi(e,t,n){var r=-1,i=Ht,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=qt;else if(s>=200){var c=t?null:ls(e);if(c)return En(c);a=!1,i=dn,l=new or}else l=t?[]:o;e:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=n||0!==u?u:0,a&&h==h){for(var p=l.length;p--;)if(l[p]===h)continue e;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}function Ei(e,t){return null==(e=js(e,t=Oi(t,e)))||delete e[Ks(ca(t))]}function Si(e,t,n,r){return pi(e,t,n(kr(e,t)),r)}function Ii(e,t,n,r){for(var i=e.length,s=r?i:-1;(r?s--:++s<i)&&t(e[s],s,e););return n?gi(e,r?0:s,r?s+1:i):gi(e,r?s+1:0,r?i:s)}function Mi(e,t){var n=e;return n instanceof rr&&(n=n.value()),Xt(t,(function(e,t){return t.func.apply(t.thisArg,Yt([e],t.args))}),n)}function Ai(e,t,n){var i=e.length;if(i<2)return i?wi(e[0]):[];for(var s=-1,a=r(i);++s<i;)for(var o=e[s],l=-1;++l<i;)l!=s&&(a[s]=Er(a[s]||o,e[l],t,n));return wi(Dr(a,1),t,n)}function Ri(e,t,n){for(var r=-1,i=e.length,s=t.length,a={};++r<i;){var o=r<s?t[r]:_;n(a,e[r],o)}return a}function Di(e){return ao(e)?e:[]}function Ci(e){return"function"==typeof e?e:_l}function Oi(e,t){return ro(e)?e:Ps(e,t)?[e]:$s(Oo(e))}var Pi=ci;function Ni(e,t,n){var r=e.length;return n=n===_?r:n,!t&&n>=r?e:gi(e,t,n)}var Li=ft||function(e){return It.clearTimeout(e)};function ki(e,t){if(t)return o(e).call(e);var n=e.length,r=rt?rt(n):new e.constructor(n);return e.copy(r),r}function Fi(e){var t=new e.constructor(e.byteLength);return new nt(t).set(new nt(e)),t}function Ui(e,t){var n=t?Fi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Bi(e,t){if(e!==t){var n=e!==_,r=null===e,i=e==e,s=To(e),a=t!==_,o=null===t,l=t==t,c=To(t);if(!o&&!c&&!s&&e>t||s&&a&&l&&!o&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&e<t||c&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!l)return-1}return 0}function ji(e,t,n,i){for(var s=-1,a=e.length,o=n.length,l=-1,c=t.length,u=Cn(a-o,0),h=r(c+u),p=!i;++l<c;)h[l]=t[l];for(;++s<o;)(p||s<a)&&(h[n[s]]=e[s]);for(;u--;)h[l++]=e[s++];return h}function Gi(e,t,n,i){for(var s=-1,a=e.length,o=-1,l=n.length,c=-1,u=t.length,h=Cn(a-l,0),p=r(h+u),d=!i;++s<h;)p[s]=e[s];for(var m=s;++c<u;)p[m+c]=t[c];for(;++o<l;)(d||s<a)&&(p[m+n[o]]=e[s++]);return p}function zi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Vi(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):_;l===_&&(l=e[o]),i?vr(n,o,l):mr(n,o,l)}return n}function Hi(e,t){return function(n,r){var i=ro(n)?Bt:gr,s=t?t():{};return i(n,e,xs(r,2),s)}}function qi(e){return ci((function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:_,a=i>2?n[2]:_;for(s=e.length>3&&"function"==typeof s?(i--,s):_,a&&Os(n[0],n[1],a)&&(s=i<3?_:s,i=1),t=Ue(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t}))}function Wi(e,t){return function(n,r){if(null==n)return n;if(!so(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Ue(n);(t?s--:++s<i)&&!1!==r(a[s],s,a););return n}}function Yi(e){return function(t,n,r){for(var i=-1,s=Ue(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(!1===n(s[l],l,s))break}return t}}function Xi(e){return function(t){var n=bn(t=Oo(t))?Mn(t):_,r=n?n[0]:t.charAt(0),i=n?Ni(n,1).join(""):o(t).call(t,1);return r[e]()+i}}function $i(e){return function(t){return Xt(hl(rl(t).replace(ht,"")),e,"")}}function Ki(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=er(e.prototype),r=e.apply(n,t);return mo(r)?r:n}}function Zi(e){return function(t,n,r){var i=Ue(t);if(!so(t)){var s=xs(n,3);t=qo(t),n=function(e){return s(i[e],e,i)}}var a=e(t,n,r);return a>-1?i[s?t[a]:a]:_}}function Ji(e){return fs((function(t){var n=t.length,r=n,i=nr.prototype.thru;for(e&&h(t).call(t);r--;){var s=t[r];if("function"!=typeof s)throw new Ge(v);if(i&&!a&&"wrapper"==ys(s))var a=new nr([],!0)}for(r=a?r:n;++r<n;){var o=ys(s=t[r]),l="wrapper"==o?vs(s):_;a=l&&Ns(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ys(l[0])].apply(a,l[3]):1==s.length&&Ns(s)?a[o]():a.thru(s)}return function(){var e=arguments,r=e[0];if(a&&1==e.length&&ro(r))return a.plant(r).value();for(var i=0,s=n?t[i].apply(this,e):r;++i<n;)s=t[i].call(this,s);return s}}))}function Qi(e,t,n,i,s,a,o,l,c,u){var p=t&E,d=1&t,m=2&t,f=24&t,g=512&t,v=m?_:Ki(e);return function _(){for(var y=arguments.length,b=r(y),x=y;x--;)b[x]=arguments[x];if(f)var T=bs(_),w=gn(b,T);if(i&&(b=ji(b,i,s,f)),a&&(b=Gi(b,a,o,f)),y-=w,f&&y<u){var E=wn(b,T);return as(e,t,Qi,_.placeholder,n,b,E,l,c,u-y)}var S=d?n:this,I=m?S[e]:e;return y=b.length,l?b=Gs(b,l):g&&y>1&&h(b).call(b),p&&c<y&&(b.length=c),this&&this!==It&&this instanceof _&&(I=v||Ki(I)),I.apply(S,b)}}function es(e,t){return function(n,r){return function(e,t,n,r){return Pr(e,(function(e,i,s){t(r,n(e),i,s)})),r}(n,e,t(r),{})}}function ts(e,t){return function(n,r){var i;if(n===_&&r===_)return t;if(n!==_&&(i=n),r!==_){if(i===_)return r;"string"==typeof n||"string"==typeof r?(n=Ti(n),r=Ti(r)):(n=xi(n),r=xi(r)),i=e(n,r)}return i}}function ns(e){return fs((function(t){return t=Wt(t,hn(xs())),ci((function(n){var r=this;return e(t,(function(e){return Ut(e,r,n)}))}))}))}function rs(e,t){var n=(t=t===_?" ":Ti(t)).length;if(n<2)return n?li(t,e):t;var r=li(t,St(e/In(t)));return bn(t)?Ni(Mn(r),0,e).join(""):o(r).call(r,0,e)}function is(e){return function(t,n,i){return i&&"number"!=typeof i&&Os(t,n,i)&&(n=i=_),t=Mo(t),n===_?(n=t,t=0):n=Mo(n),function(e,t,n,i){for(var s=-1,a=Cn(St((t-e)/(n||1)),0),o=r(a);a--;)o[i?a:++s]=e,e+=n;return o}(t,n,i=i===_?t<n?1:-1:Mo(i),e)}}function ss(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Do(t),n=Do(n)),e(t,n)}}function as(e,t,n,r,i,s,a,o,l,c){var u=8&t;t|=u?T:w,4&(t&=~(u?w:T))||(t&=-4);var h=[e,t,i,u?s:_,u?a:_,u?_:s,u?_:a,o,l,c],p=n.apply(_,h);return Ns(e)&&Vs(p,h),p.placeholder=r,Ws(p,e,t)}function os(e){var t=Fe[e];return function(e,n){if(e=Do(e),(n=null==n?0:On(Ao(n),292))&&Ct(e)){var r=(Oo(e)+"e").split("e");return+((r=(Oo(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var ls=jn&&1/En(new jn([,-0]))[1]==I?function(e){return new jn(e)}:Tl;function cs(e){return function(t){var n=Ms(t);return n==U?xn(t):n==V?Sn(t):function(e,t){return Wt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function us(e,t,n,i,s,a,o,l){var c=2&t;if(!c&&"function"!=typeof e)throw new Ge(v);var u=i?i.length:0;if(u||(t&=-97,i=s=_),o=o===_?o:Cn(Ao(o),0),l=l===_?l:Ao(l),u-=s?s.length:0,t&w){var h=i,p=s;i=s=_}var d=c?_:vs(e),m=[e,t,n,i,s,h,p,a,o,l];if(d&&function(e,t){var n=e[1],r=t[1],i=n|r,s=i<131,a=r==E&&8==n||r==E&&n==S&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!s&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var o=t[3];if(o){var l=e[3];e[3]=l?ji(l,o,t[4]):o,e[4]=l?wn(e[3],b):t[4]}(o=t[5])&&(l=e[5],e[5]=l?Gi(l,o,t[6]):o,e[6]=l?wn(e[5],b):t[6]);(o=t[7])&&(e[7]=o);r&E&&(e[8]=null==e[8]?t[8]:On(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(m,d),e=m[0],t=m[1],n=m[2],i=m[3],s=m[4],!(l=m[9]=m[9]===_?c?0:e.length:Cn(m[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||t==x?function(e,t,n){var i=Ki(e);return function s(){for(var a=arguments.length,o=r(a),l=a,c=bs(s);l--;)o[l]=arguments[l];var u=a<3&&o[0]!==c&&o[a-1]!==c?[]:wn(o,c);return(a-=u.length)<n?as(e,t,Qi,s.placeholder,_,o,u,_,_,n-a):Ut(this&&this!==It&&this instanceof s?i:e,this,o)}}(e,t,l):t!=T&&33!=t||s.length?Qi.apply(_,m):function(e,t,n,i){var s=1&t,a=Ki(e);return function t(){for(var o=-1,l=arguments.length,c=-1,u=i.length,h=r(u+l),p=this&&this!==It&&this instanceof t?a:e;++c<u;)h[c]=i[c];for(;l--;)h[c++]=arguments[++o];return Ut(p,s?n:this,h)}}(e,t,n,i);else var f=function(e,t,n){var r=1&t,i=Ki(e);return function t(){return(this&&this!==It&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Ws((d?di:Vs)(f,m),e,t)}function hs(e,t,n,r){return e===_||Qa(e,He[n])&&!Ye.call(r,n)?t:e}function ps(e,t,n,r,i,s){return mo(e)&&mo(t)&&(s.set(t,e),ti(e,t,_,ps,s),s.delete(t)),e}function ds(e){return vo(e)?_:e}function ms(e,t,n,r,i,s){var a=1&n,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,p=!0,d=2&n?new or:_;for(s.set(e,t),s.set(t,e);++h<o;){var m=e[h],f=t[h];if(r)var g=a?r(f,m,h,t,e,s):r(m,f,h,e,t,s);if(g!==_){if(g)continue;p=!1;break}if(d){if(!Kt(t,(function(e,t){if(!dn(d,t)&&(m===e||i(m,e,n,r,s)))return d.push(t)}))){p=!1;break}}else if(m!==f&&!i(m,f,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function fs(e){return qs(Bs(e,_,ia),e+"")}function gs(e){return Fr(e,qo,Ss)}function _s(e){return Fr(e,Wo,Is)}var vs=Vn?function(e){return Vn.get(e)}:Tl;function ys(e){for(var t=e.name+"",n=Hn[t],r=Ye.call(Hn,t)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==e)return i.name}return t}function bs(e){return(Ye.call(Qn,"placeholder")?Qn:e).placeholder}function xs(){var e=Qn.iteratee||vl;return e=e===vl?Xr:e,arguments.length?e(arguments[0],arguments[1]):e}function Ts(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:p(i)}function ws(e){for(var t=qo(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Fs(i)]}return t}function Es(e,t){var n=function(e,t){return null==e?_:e[t]}(e,t);return Yr(n)?n:_}var Ss=At?function(e){return null==e?[]:(e=Ue(e),Vt(At(e),(function(t){return at.call(e,t)})))}:Rl,Is=At?function(e){for(var t=[];e;)Yt(t,Ss(e)),e=it(e);return t}:Rl,Ms=Ur;function As(e,t,n){for(var r=-1,i=(t=Oi(t,e)).length,s=!1;++r<i;){var a=Ks(t[r]);if(!(s=null!=e&&n(e,a)))break;e=e[a]}return s||++r!=i?s:!!(i=null==e?0:e.length)&&po(i)&&Cs(a,i)&&(ro(e)||no(e))}function Rs(e){return"function"!=typeof e.constructor||ks(e)?{}:er(it(e))}function Ds(e){return ro(e)||no(e)||!!(lt&&e&&e[lt])}function Cs(e,t){var n=typeof e;return!!(t=null==t?M:t)&&("number"==n||"symbol"!=n&&Pe.test(e))&&e>-1&&e%1==0&&e<t}function Os(e,t,n){if(!mo(n))return!1;var r=typeof t;return!!("number"==r?so(n)&&Cs(t,n.length):"string"==r&&t in n)&&Qa(n[t],e)}function Ps(e,t){if(ro(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!To(e))||(fe.test(e)||!me.test(e)||null!=t&&e in Ue(t))}function Ns(e){var t=ys(e),n=Qn[t];if("function"!=typeof n||!(t in rr.prototype))return!1;if(e===n)return!0;var r=vs(n);return!!r&&e===r[0]}(Fn&&Ms(new Fn(new ArrayBuffer(1)))!=X||Un&&Ms(new Un)!=U||Bn&&Ms(Bn.resolve())!=G||jn&&Ms(new jn)!=V||Gn&&Ms(new Gn)!=W)&&(Ms=function(e){var t=Ur(e),n=t==j?e.constructor:_,r=n?Zs(n):"";if(r)switch(r){case qn:return X;case Wn:return U;case Yn:return G;case Xn:return V;case $n:return W}return t});var Ls=qe?uo:Dl;function ks(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||He)}function Fs(e){return e==e&&!mo(e)}function Us(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==_||e in Ue(n)))}}function Bs(e,t,n){return t=Cn(t===_?e.length-1:t,0),function(){for(var i=arguments,s=-1,a=Cn(i.length-t,0),o=r(a);++s<a;)o[s]=i[t+s];s=-1;for(var l=r(t+1);++s<t;)l[s]=i[s];return l[t]=n(o),Ut(e,this,l)}}function js(e,t){return t.length<2?e:kr(e,gi(t,0,-1))}function Gs(e,t){for(var n=e.length,r=On(t.length,n),i=zi(e);r--;){var s=t[r];e[r]=Cs(s,n)?i[s]:_}return e}function zs(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Vs=Ys(di),Hs=Et||function(e,t){return It.setTimeout(e,t)},qs=Ys(mi);function Ws(e,t,n){var r=t+"";return qs(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(xe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(D,(function(n){var r="_."+n[0];t&n[1]&&!Ht(e,r)&&e.push(r)})),a(e).call(e)}(function(e){var t=e.match(Te);return t?t[1].split(we):[]}(r),n)))}function Ys(e){var t=0,n=0;return function(){var r=Pn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(_,arguments)}}function Xs(e,t){var n=-1,r=e.length,i=r-1;for(t=t===_?r:t;++n<t;){var s=oi(n,i),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var $s=function(e){var t=Ya(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ge,(function(e,n,r,i){t.push(r?i.replace(Ie,"$1"):n||e)})),t}));function Ks(e){if("string"==typeof e||To(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zs(e){if(null!=e){try{return We.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Js(e){if(e instanceof rr)return e.clone();var t=new nr(e.__wrapped__,e.__chain__);return t.__actions__=zi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Qs=ci((function(e,t){return ao(e)?Er(e,Dr(t,1,ao,!0)):[]})),ea=ci((function(e,t){var n=ca(t);return ao(n)&&(n=_),ao(e)?Er(e,Dr(t,1,ao,!0),xs(n,2)):[]})),ta=ci((function(e,t){var n=ca(t);return ao(n)&&(n=_),ao(e)?Er(e,Dr(t,1,ao,!0),_,n):[]}));function na(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Ao(n);return i<0&&(i=Cn(r+i,0)),Qt(e,xs(t,3),i)}function ra(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==_&&(i=Ao(n),i=n<0?Cn(r+i,0):On(i,r-1)),Qt(e,xs(t,3),i,!0)}function ia(e){return(null==e?0:e.length)?Dr(e,1):[]}function sa(e){return e&&e.length?e[0]:_}var aa=ci((function(e){var t=Wt(e,Di);return t.length&&t[0]===e[0]?zr(t):[]})),oa=ci((function(e){var t=ca(e),n=Wt(e,Di);return t===ca(n)?t=_:n.pop(),n.length&&n[0]===e[0]?zr(n,xs(t,2)):[]})),la=ci((function(e){var t=ca(e),n=Wt(e,Di);return(t="function"==typeof t?t:_)&&n.pop(),n.length&&n[0]===e[0]?zr(n,_,t):[]}));function ca(e){var t=null==e?0:e.length;return t?e[t-1]:_}var ua=ci(ha);function ha(e,t){return e&&e.length&&t&&t.length?si(e,t):e}var pa=fs((function(e,t){var n,r=null==e?0:e.length,i=yr(e,t);return ai(e,a(n=Wt(t,(function(e){return Cs(e,r)?+e:e}))).call(n,Bi)),i}));function da(e){return null==e?e:kn.call(e)}var ma=ci((function(e){return wi(Dr(e,1,ao,!0))})),fa=ci((function(e){var t=ca(e);return ao(t)&&(t=_),wi(Dr(e,1,ao,!0),xs(t,2))})),ga=ci((function(e){var t=ca(e);return t="function"==typeof t?t:_,wi(Dr(e,1,ao,!0),_,t)}));function _a(e){if(!e||!e.length)return[];var t=0;return e=Vt(e,(function(e){if(ao(e))return t=Cn(e.length,t),!0})),cn(t,(function(t){return Wt(e,sn(t))}))}function va(e,t){if(!e||!e.length)return[];var n=_a(e);return null==t?n:Wt(n,(function(e){return Ut(t,_,e)}))}var ya=ci((function(e,t){return ao(e)?Er(e,t):[]})),ba=ci((function(e){return Ai(Vt(e,ao))})),xa=ci((function(e){var t=ca(e);return ao(t)&&(t=_),Ai(Vt(e,ao),xs(t,2))})),Ta=ci((function(e){var t=ca(e);return t="function"==typeof t?t:_,Ai(Vt(e,ao),_,t)})),wa=ci(_a);var Ea=ci((function(e){var t=e.length,n=t>1?e[t-1]:_;return n="function"==typeof n?(e.pop(),n):_,va(e,n)}));function Sa(e){var t=Qn(e);return t.__chain__=!0,t}function Ia(e,t){return t(e)}var Ma=fs((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return yr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof rr&&Cs(n)?((r=o(r).call(r,n,+n+(t?1:0))).__actions__.push({func:Ia,args:[i],thisArg:_}),new nr(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(_),e}))):this.thru(i)}));var Aa=Hi((function(e,t,n){Ye.call(e,n)?++e[n]:vr(e,n,1)}));var Ra=Zi(na),Da=Zi(ra);function Ca(e,t){return(ro(e)?jt:Sr)(e,xs(t,3))}function Oa(e,t){return(ro(e)?Gt:Ir)(e,xs(t,3))}var Pa=Hi((function(e,t,n){Ye.call(e,n)?e[n].push(t):vr(e,n,[t])}));var Na=ci((function(e,t,n){var i=-1,s="function"==typeof t,a=so(e)?r(e.length):[];return Sr(e,(function(e){a[++i]=s?Ut(t,e,n):Vr(e,t,n)})),a})),La=Hi((function(e,t,n){vr(e,n,t)}));function ka(e,t){return(ro(e)?Wt:Jr)(e,xs(t,3))}var Fa=Hi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ua=ci((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Os(e,t[0],t[1])?t=[]:n>2&&Os(t[0],t[1],t[2])&&(t=[t[0]]),ri(e,Dr(t,1),[])})),Ba=xt||function(){return It.Date.now()};function ja(e,t,n){return t=n?_:t,t=e&&null==t?e.length:t,us(e,E,_,_,_,_,t)}function Ga(e,t){var n;if("function"!=typeof t)throw new Ge(v);return e=Ao(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=_),n}}var za=ci((function(e,t,n){var r=1;if(n.length){var i=wn(n,bs(za));r|=T}return us(e,r,t,n,i)})),Va=ci((function(e,t,n){var r=3;if(n.length){var i=wn(n,bs(Va));r|=T}return us(t,r,e,n,i)}));function Ha(e,t,n){var r,i,s,a,o,l,c=0,u=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ge(v);function d(t){var n=r,s=i;return r=i=_,c=t,a=e.apply(s,n)}function m(e){return c=e,o=Hs(g,t),u?d(e):a}function f(e){var n=e-l;return l===_||n>=t||n<0||h&&e-c>=s}function g(){var e=Ba();if(f(e))return y(e);o=Hs(g,function(e){var n=t-(e-l);return h?On(n,s-(e-c)):n}(e))}function y(e){return o=_,p&&r?d(e):(r=i=_,a)}function b(){var e=Ba(),n=f(e);if(r=arguments,i=this,l=e,n){if(o===_)return m(l);if(h)return Li(o),o=Hs(g,t),d(l)}return o===_&&(o=Hs(g,t)),a}return t=Do(t)||0,mo(n)&&(u=!!n.leading,s=(h="maxWait"in n)?Cn(Do(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){o!==_&&Li(o),c=0,r=l=i=o=_},b.flush=function(){return o===_?a:y(Ba())},b}var qa=ci((function(e,t){return wr(e,1,t)})),Wa=ci((function(e,t,n){return wr(e,Do(t)||0,n)}));function Ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ge(v);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ya.Cache||ar),n}function Xa(e){if("function"!=typeof e)throw new Ge(v);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ya.Cache=ar;var $a=Pi((function(e,t){var n=(t=1==t.length&&ro(t[0])?Wt(t[0],hn(xs())):Wt(Dr(t,1),hn(xs()))).length;return ci((function(r){for(var i=-1,s=On(r.length,n);++i<s;)r[i]=t[i].call(this,r[i]);return Ut(e,this,r)}))})),Ka=ci((function(e,t){var n=wn(t,bs(Ka));return us(e,T,_,t,n)})),Za=ci((function(e,t){var n=wn(t,bs(Za));return us(e,w,_,t,n)})),Ja=fs((function(e,t){return us(e,S,_,_,_,t)}));function Qa(e,t){return e===t||e!=e&&t!=t}var eo=ss(Br),to=ss((function(e,t){return e>=t})),no=Hr(function(){return arguments}())?Hr:function(e){return fo(e)&&Ye.call(e,"callee")&&!at.call(e,"callee")},ro=r.isArray,io=Ot?hn(Ot):function(e){return fo(e)&&Ur(e)==Y};function so(e){return null!=e&&po(e.length)&&!uo(e)}function ao(e){return fo(e)&&so(e)}var oo=Dt||Dl,lo=Pt?hn(Pt):function(e){return fo(e)&&Ur(e)==N};function co(e){if(!fo(e))return!1;var t=Ur(e);return t==L||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!vo(e)}function uo(e){if(!mo(e))return!1;var t=Ur(e);return t==k||t==F||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ho(e){return"number"==typeof e&&e==Ao(e)}function po(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=M}function mo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function fo(e){return null!=e&&"object"==typeof e}var go=Nt?hn(Nt):function(e){return fo(e)&&Ms(e)==U};function _o(e){return"number"==typeof e||fo(e)&&Ur(e)==B}function vo(e){if(!fo(e)||Ur(e)!=j)return!1;var t=it(e);if(null===t)return!0;var n=Ye.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&We.call(n)==Ze}var yo=Lt?hn(Lt):function(e){return fo(e)&&Ur(e)==z};var bo=kt?hn(kt):function(e){return fo(e)&&Ms(e)==V};function xo(e){return"string"==typeof e||!ro(e)&&fo(e)&&Ur(e)==H}function To(e){return"symbol"==typeof e||fo(e)&&Ur(e)==q}var wo=Ft?hn(Ft):function(e){return fo(e)&&po(e.length)&&!!yt[Ur(e)]};var Eo=ss(Zr),So=ss((function(e,t){return e<=t}));function Io(e){if(!e)return[];if(so(e))return xo(e)?Mn(e):zi(e);if(ct&&e[ct])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ct]());var t=Ms(e);return(t==U?xn:t==V?En:el)(e)}function Mo(e){return e?(e=Do(e))===I||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ao(e){var t=Mo(e),n=t%1;return t==t?n?t-n:t:0}function Ro(e){return e?br(Ao(e),0,R):0}function Do(e){if("number"==typeof e)return e;if(To(e))return A;if(mo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=mo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=un(e);var n=De.test(e);return n||Oe.test(e)?wt(o(e).call(e,2),n?2:8):Re.test(e)?A:+e}function Co(e){return Vi(e,Wo(e))}function Oo(e){return null==e?"":Ti(e)}var Po=qi((function(e,t){if(ks(t)||so(t))Vi(t,qo(t),e);else for(var n in t)Ye.call(t,n)&&mr(e,n,t[n])})),No=qi((function(e,t){Vi(t,Wo(t),e)})),Lo=qi((function(e,t,n,r){Vi(t,Wo(t),e,r)})),ko=qi((function(e,t,n,r){Vi(t,qo(t),e,r)})),Fo=fs(yr);var Uo=ci((function(e,t){e=Ue(e);var n=-1,r=t.length,i=r>2?t[2]:_;for(i&&Os(t[0],t[1],i)&&(r=1);++n<r;)for(var s=t[n],a=Wo(s),o=-1,l=a.length;++o<l;){var c=a[o],u=e[c];(u===_||Qa(u,He[c])&&!Ye.call(e,c))&&(e[c]=s[c])}return e})),Bo=ci((function(e){return e.push(_,ps),Ut(Xo,_,e)}));function jo(e,t,n){var r=null==e?_:kr(e,t);return r===_?n:r}function Go(e,t){return null!=e&&As(e,t,Gr)}var zo=es((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ke.call(t)),e[t]=n}),ml(_l)),Vo=es((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ke.call(t)),Ye.call(e,t)?e[t].push(n):e[t]=[n]}),xs),Ho=ci(Vr);function qo(e){return so(e)?cr(e):$r(e)}function Wo(e){return so(e)?cr(e,!0):Kr(e)}var Yo=qi((function(e,t,n){ti(e,t,n)})),Xo=qi((function(e,t,n,r){ti(e,t,n,r)})),$o=fs((function(e,t){var n={};if(null==e)return n;var r=!1;t=Wt(t,(function(t){return t=Oi(t,e),r||(r=t.length>1),t})),Vi(e,_s(e),n),r&&(n=xr(n,7,ds));for(var i=t.length;i--;)Ei(n,t[i]);return n}));var Ko=fs((function(e,t){return null==e?{}:function(e,t){return ii(e,t,(function(t,n){return Go(e,n)}))}(e,t)}));function Zo(e,t){if(null==e)return{};var n=Wt(_s(e),(function(e){return[e]}));return t=xs(t),ii(e,n,(function(e,n){return t(e,n[0])}))}var Jo=cs(qo),Qo=cs(Wo);function el(e){return null==e?[]:pn(e,qo(e))}var tl=$i((function(e,t,n){return t=t.toLowerCase(),e+(n?nl(t):t)}));function nl(e){return ul(Oo(e).toLowerCase())}function rl(e){return(e=Oo(e))&&e.replace(Ne,_n).replace(pt,"")}var il=$i((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),sl=$i((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),al=Xi("toLowerCase");var ol=$i((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var ll=$i((function(e,t,n){return e+(n?" ":"")+ul(t)}));var cl=$i((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),ul=Xi("toUpperCase");function hl(e,t,n){return e=Oo(e),(t=n?_:t)===_?function(e){return gt.test(e)}(e)?function(e){return e.match(mt)||[]}(e):function(e){return e.match(Ee)||[]}(e):e.match(t)||[]}var pl=ci((function(e,t){try{return Ut(e,_,t)}catch(e){return co(e)?e:new s(e)}})),dl=fs((function(e,t){return jt(t,(function(t){t=Ks(t),vr(e,t,za(e[t],e))})),e}));function ml(e){return function(){return e}}var fl=Ji(),gl=Ji(!0);function _l(e){return e}function vl(e){return Xr("function"==typeof e?e:xr(e,1))}var yl=ci((function(e,t){return function(n){return Vr(n,e,t)}})),bl=ci((function(e,t){return function(n){return Vr(e,n,t)}}));function xl(e,t,n){var r=qo(t),i=Lr(t,r);null!=n||mo(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Lr(t,qo(t)));var s=!(mo(n)&&"chain"in n&&!n.chain),a=uo(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(s||t){var n=e(this.__wrapped__),i=n.__actions__=zi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Yt([this.value()],arguments))})})),e}function Tl(){}var wl=ns(Wt),El=ns(zt),Sl=ns(Kt);function Il(e){return Ps(e)?sn(Ks(e)):function(e){return function(t){return kr(t,e)}}(e)}var Ml=is(),Al=is(!0);function Rl(){return[]}function Dl(){return!1}var Cl=ts((function(e,t){return e+t}),0),Ol=os("ceil"),Pl=ts((function(e,t){return e/t}),1),Nl=os("floor");var Ll,kl=ts((function(e,t){return e*t}),1),Fl=os("round"),Ul=ts((function(e,t){return e-t}),0);return Qn.after=function(e,t){if("function"!=typeof t)throw new Ge(v);return e=Ao(e),function(){if(--e<1)return t.apply(this,arguments)}},Qn.ary=ja,Qn.assign=Po,Qn.assignIn=No,Qn.assignInWith=Lo,Qn.assignWith=ko,Qn.at=Fo,Qn.before=Ga,Qn.bind=za,Qn.bindAll=dl,Qn.bindKey=Va,Qn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ro(e)?e:[e]},Qn.chain=Sa,Qn.chunk=function(e,t,n){t=(n?Os(e,t,n):t===_)?1:Cn(Ao(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,a=0,o=r(St(i/t));s<i;)o[a++]=gi(e,s,s+=t);return o},Qn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var s=e[t];s&&(i[r++]=s)}return i},Qn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Yt(ro(n)?zi(n):[n],Dr(t,1))},Qn.cond=function(e){var t=null==e?0:e.length,n=xs();return e=t?Wt(e,(function(e){if("function"!=typeof e[1])throw new Ge(v);return[n(e[0]),e[1]]})):[],ci((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ut(i[0],this,n))return Ut(i[1],this,n)}}))},Qn.conforms=function(e){return function(e){var t=qo(e);return function(n){return Tr(n,e,t)}}(xr(e,1))},Qn.constant=ml,Qn.countBy=Aa,Qn.create=function(e,t){var n=er(e);return null==t?n:_r(n,t)},Qn.curry=function e(t,n,r){var i=us(t,8,_,_,_,_,_,n=r?_:n);return i.placeholder=e.placeholder,i},Qn.curryRight=function e(t,n,r){var i=us(t,x,_,_,_,_,_,n=r?_:n);return i.placeholder=e.placeholder,i},Qn.debounce=Ha,Qn.defaults=Uo,Qn.defaultsDeep=Bo,Qn.defer=qa,Qn.delay=Wa,Qn.difference=Qs,Qn.differenceBy=ea,Qn.differenceWith=ta,Qn.drop=function(e,t,n){var r=null==e?0:e.length;return r?gi(e,(t=n||t===_?1:Ao(t))<0?0:t,r):[]},Qn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?gi(e,0,(t=r-(t=n||t===_?1:Ao(t)))<0?0:t):[]},Qn.dropRightWhile=function(e,t){return e&&e.length?Ii(e,xs(t,3),!0,!0):[]},Qn.dropWhile=function(e,t){return e&&e.length?Ii(e,xs(t,3),!0):[]},Qn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&Os(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=Ao(n))<0&&(n=-n>i?0:i+n),(r=r===_||r>i?i:Ao(r))<0&&(r+=i),r=n>r?0:Ro(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Qn.filter=function(e,t){return(ro(e)?Vt:Rr)(e,xs(t,3))},Qn.flatMap=function(e,t){return Dr(ka(e,t),1)},Qn.flatMapDeep=function(e,t){return Dr(ka(e,t),I)},Qn.flatMapDepth=function(e,t,n){return n=n===_?1:Ao(n),Dr(ka(e,t),n)},Qn.flatten=ia,Qn.flattenDeep=function(e){return(null==e?0:e.length)?Dr(e,I):[]},Qn.flattenDepth=function(e,t){return(null==e?0:e.length)?Dr(e,t=t===_?1:Ao(t)):[]},Qn.flip=function(e){return us(e,512)},Qn.flow=fl,Qn.flowRight=gl,Qn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Qn.functions=function(e){return null==e?[]:Lr(e,qo(e))},Qn.functionsIn=function(e){return null==e?[]:Lr(e,Wo(e))},Qn.groupBy=Pa,Qn.initial=function(e){return(null==e?0:e.length)?gi(e,0,-1):[]},Qn.intersection=aa,Qn.intersectionBy=oa,Qn.intersectionWith=la,Qn.invert=zo,Qn.invertBy=Vo,Qn.invokeMap=Na,Qn.iteratee=vl,Qn.keyBy=La,Qn.keys=qo,Qn.keysIn=Wo,Qn.map=ka,Qn.mapKeys=function(e,t){var n={};return t=xs(t,3),Pr(e,(function(e,r,i){vr(n,t(e,r,i),e)})),n},Qn.mapValues=function(e,t){var n={};return t=xs(t,3),Pr(e,(function(e,r,i){vr(n,r,t(e,r,i))})),n},Qn.matches=function(e){return Qr(xr(e,1))},Qn.matchesProperty=function(e,t){return ei(e,xr(t,1))},Qn.memoize=Ya,Qn.merge=Yo,Qn.mergeWith=Xo,Qn.method=yl,Qn.methodOf=bl,Qn.mixin=xl,Qn.negate=Xa,Qn.nthArg=function(e){return e=Ao(e),ci((function(t){return ni(t,e)}))},Qn.omit=$o,Qn.omitBy=function(e,t){return Zo(e,Xa(xs(t)))},Qn.once=function(e){return Ga(2,e)},Qn.orderBy=function(e,t,n,r){return null==e?[]:(ro(t)||(t=null==t?[]:[t]),ro(n=r?_:n)||(n=null==n?[]:[n]),ri(e,t,n))},Qn.over=wl,Qn.overArgs=$a,Qn.overEvery=El,Qn.overSome=Sl,Qn.partial=Ka,Qn.partialRight=Za,Qn.partition=Fa,Qn.pick=Ko,Qn.pickBy=Zo,Qn.property=Il,Qn.propertyOf=function(e){return function(t){return null==e?_:kr(e,t)}},Qn.pull=ua,Qn.pullAll=ha,Qn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?si(e,t,xs(n,2)):e},Qn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?si(e,t,_,n):e},Qn.pullAt=pa,Qn.range=Ml,Qn.rangeRight=Al,Qn.rearg=Ja,Qn.reject=function(e,t){return(ro(e)?Vt:Rr)(e,Xa(xs(t,3)))},Qn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],s=e.length;for(t=xs(t,3);++r<s;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return ai(e,i),n},Qn.rest=function(e,t){if("function"!=typeof e)throw new Ge(v);return ci(e,t=t===_?t:Ao(t))},Qn.reverse=da,Qn.sampleSize=function(e,t,n){return t=(n?Os(e,t,n):t===_)?1:Ao(t),(ro(e)?hr:hi)(e,t)},Qn.set=function(e,t,n){return null==e?e:pi(e,t,n)},Qn.setWith=function(e,t,n,r){return r="function"==typeof r?r:_,null==e?e:pi(e,t,n,r)},Qn.shuffle=function(e){return(ro(e)?pr:fi)(e)},Qn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&Os(e,t,n)?(t=0,n=r):(t=null==t?0:Ao(t),n=n===_?r:Ao(n)),gi(e,t,n)):[]},Qn.sortBy=Ua,Qn.sortedUniq=function(e){return e&&e.length?bi(e):[]},Qn.sortedUniqBy=function(e,t){return e&&e.length?bi(e,xs(t,2)):[]},Qn.split=function(e,t,n){return n&&"number"!=typeof n&&Os(e,t,n)&&(t=n=_),(n=n===_?R:n>>>0)?(e=Oo(e))&&("string"==typeof t||null!=t&&!yo(t))&&!(t=Ti(t))&&bn(e)?Ni(Mn(e),0,n):e.split(t,n):[]},Qn.spread=function(e,t){if("function"!=typeof e)throw new Ge(v);return t=null==t?0:Cn(Ao(t),0),ci((function(n){var r=n[t],i=Ni(n,0,t);return r&&Yt(i,r),Ut(e,this,i)}))},Qn.tail=function(e){var t=null==e?0:e.length;return t?gi(e,1,t):[]},Qn.take=function(e,t,n){return e&&e.length?gi(e,0,(t=n||t===_?1:Ao(t))<0?0:t):[]},Qn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?gi(e,(t=r-(t=n||t===_?1:Ao(t)))<0?0:t,r):[]},Qn.takeRightWhile=function(e,t){return e&&e.length?Ii(e,xs(t,3),!1,!0):[]},Qn.takeWhile=function(e,t){return e&&e.length?Ii(e,xs(t,3)):[]},Qn.tap=function(e,t){return t(e),e},Qn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ge(v);return mo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ha(e,t,{leading:r,maxWait:t,trailing:i})},Qn.thru=Ia,Qn.toArray=Io,Qn.toPairs=Jo,Qn.toPairsIn=Qo,Qn.toPath=function(e){return ro(e)?Wt(e,Ks):To(e)?[e]:zi($s(Oo(e)))},Qn.toPlainObject=Co,Qn.transform=function(e,t,n){var r=ro(e),i=r||oo(e)||wo(e);if(t=xs(t,4),null==n){var s=e&&e.constructor;n=i?r?new s:[]:mo(e)&&uo(s)?er(it(e)):{}}return(i?jt:Pr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Qn.unary=function(e){return ja(e,1)},Qn.union=ma,Qn.unionBy=fa,Qn.unionWith=ga,Qn.uniq=function(e){return e&&e.length?wi(e):[]},Qn.uniqBy=function(e,t){return e&&e.length?wi(e,xs(t,2)):[]},Qn.uniqWith=function(e,t){return t="function"==typeof t?t:_,e&&e.length?wi(e,_,t):[]},Qn.unset=function(e,t){return null==e||Ei(e,t)},Qn.unzip=_a,Qn.unzipWith=va,Qn.update=function(e,t,n){return null==e?e:Si(e,t,Ci(n))},Qn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:_,null==e?e:Si(e,t,Ci(n),r)},Qn.values=el,Qn.valuesIn=function(e){return null==e?[]:pn(e,Wo(e))},Qn.without=ya,Qn.words=hl,Qn.wrap=function(e,t){return Ka(Ci(t),e)},Qn.xor=ba,Qn.xorBy=xa,Qn.xorWith=Ta,Qn.zip=wa,Qn.zipObject=function(e,t){return Ri(e||[],t||[],mr)},Qn.zipObjectDeep=function(e,t){return Ri(e||[],t||[],pi)},Qn.zipWith=Ea,Qn.entries=Jo,Qn.entriesIn=Qo,Qn.extend=No,Qn.extendWith=Lo,xl(Qn,Qn),Qn.add=Cl,Qn.attempt=pl,Qn.camelCase=tl,Qn.capitalize=nl,Qn.ceil=Ol,Qn.clamp=function(e,t,n){return n===_&&(n=t,t=_),n!==_&&(n=(n=Do(n))==n?n:0),t!==_&&(t=(t=Do(t))==t?t:0),br(Do(e),t,n)},Qn.clone=function(e){return xr(e,4)},Qn.cloneDeep=function(e){return xr(e,5)},Qn.cloneDeepWith=function(e,t){return xr(e,5,t="function"==typeof t?t:_)},Qn.cloneWith=function(e,t){return xr(e,4,t="function"==typeof t?t:_)},Qn.conformsTo=function(e,t){return null==t||Tr(e,t,qo(t))},Qn.deburr=rl,Qn.defaultTo=function(e,t){return null==e||e!=e?t:e},Qn.divide=Pl,Qn.endsWith=function(e,t,n){e=Oo(e),t=Ti(t);var r=e.length,i=n=n===_?r:br(Ao(n),0,r);return(n-=t.length)>=0&&o(e).call(e,n,i)==t},Qn.eq=Qa,Qn.escape=function(e){return(e=Oo(e))&&ue.test(e)?e.replace(le,vn):e},Qn.escapeRegExp=function(e){return(e=Oo(e))&&ve.test(e)?e.replace(_e,"\\$&"):e},Qn.every=function(e,t,n){var r=ro(e)?zt:Mr;return n&&Os(e,t,n)&&(t=_),r(e,xs(t,3))},Qn.find=Ra,Qn.findIndex=na,Qn.findKey=function(e,t){return Jt(e,xs(t,3),Pr)},Qn.findLast=Da,Qn.findLastIndex=ra,Qn.findLastKey=function(e,t){return Jt(e,xs(t,3),Nr)},Qn.floor=Nl,Qn.forEach=Ca,Qn.forEachRight=Oa,Qn.forIn=function(e,t){return null==e?e:Cr(e,xs(t,3),Wo)},Qn.forInRight=function(e,t){return null==e?e:Or(e,xs(t,3),Wo)},Qn.forOwn=function(e,t){return e&&Pr(e,xs(t,3))},Qn.forOwnRight=function(e,t){return e&&Nr(e,xs(t,3))},Qn.get=jo,Qn.gt=eo,Qn.gte=to,Qn.has=function(e,t){return null!=e&&As(e,t,jr)},Qn.hasIn=Go,Qn.head=sa,Qn.identity=_l,Qn.includes=function(e,t,n,r){e=so(e)?e:el(e),n=n&&!r?Ao(n):0;var i=e.length;return n<0&&(n=Cn(i+n,0)),xo(e)?n<=i&&d(e).call(e,t,n)>-1:!!i&&en(e,t,n)>-1},Qn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Ao(n);return i<0&&(i=Cn(r+i,0)),en(e,t,i)},Qn.inRange=function(e,t,n){return t=Mo(t),n===_?(n=t,t=0):n=Mo(n),function(e,t,n){return e>=On(t,n)&&e<Cn(t,n)}(e=Do(e),t,n)},Qn.invoke=Ho,Qn.isArguments=no,Qn.isArray=ro,Qn.isArrayBuffer=io,Qn.isArrayLike=so,Qn.isArrayLikeObject=ao,Qn.isBoolean=function(e){return!0===e||!1===e||fo(e)&&Ur(e)==P},Qn.isBuffer=oo,Qn.isDate=lo,Qn.isElement=function(e){return fo(e)&&1===e.nodeType&&!vo(e)},Qn.isEmpty=function(e){if(null==e)return!0;if(so(e)&&(ro(e)||"string"==typeof e||"function"==typeof u(e)||oo(e)||wo(e)||no(e)))return!e.length;var t=Ms(e);if(t==U||t==V)return!e.size;if(ks(e))return!$r(e).length;for(var n in e)if(Ye.call(e,n))return!1;return!0},Qn.isEqual=function(e,t){return qr(e,t)},Qn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:_)?n(e,t):_;return r===_?qr(e,t,_,n):!!r},Qn.isError=co,Qn.isFinite=function(e){return"number"==typeof e&&Ct(e)},Qn.isFunction=uo,Qn.isInteger=ho,Qn.isLength=po,Qn.isMap=go,Qn.isMatch=function(e,t){return e===t||Wr(e,t,ws(t))},Qn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:_,Wr(e,t,ws(t),n)},Qn.isNaN=function(e){return _o(e)&&e!=+e},Qn.isNative=function(e){if(Ls(e))throw new s("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Yr(e)},Qn.isNil=function(e){return null==e},Qn.isNull=function(e){return null===e},Qn.isNumber=_o,Qn.isObject=mo,Qn.isObjectLike=fo,Qn.isPlainObject=vo,Qn.isRegExp=yo,Qn.isSafeInteger=function(e){return ho(e)&&e>=-9007199254740991&&e<=M},Qn.isSet=bo,Qn.isString=xo,Qn.isSymbol=To,Qn.isTypedArray=wo,Qn.isUndefined=function(e){return e===_},Qn.isWeakMap=function(e){return fo(e)&&Ms(e)==W},Qn.isWeakSet=function(e){return fo(e)&&"[object WeakSet]"==Ur(e)},Qn.join=function(e,t){return null==e?"":Zt.call(e,t)},Qn.kebabCase=il,Qn.last=ca,Qn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==_&&(i=(i=Ao(n))<0?Cn(r+i,0):On(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Qt(e,nn,i,!0)},Qn.lowerCase=sl,Qn.lowerFirst=al,Qn.lt=Eo,Qn.lte=So,Qn.max=function(e){return e&&e.length?Ar(e,_l,Br):_},Qn.maxBy=function(e,t){return e&&e.length?Ar(e,xs(t,2),Br):_},Qn.mean=function(e){return rn(e,_l)},Qn.meanBy=function(e,t){return rn(e,xs(t,2))},Qn.min=function(e){return e&&e.length?Ar(e,_l,Zr):_},Qn.minBy=function(e,t){return e&&e.length?Ar(e,xs(t,2),Zr):_},Qn.stubArray=Rl,Qn.stubFalse=Dl,Qn.stubObject=function(){return{}},Qn.stubString=function(){return""},Qn.stubTrue=function(){return!0},Qn.multiply=kl,Qn.nth=function(e,t){return e&&e.length?ni(e,Ao(t)):_},Qn.noConflict=function(){return It._===this&&(It._=Je),this},Qn.noop=Tl,Qn.now=Ba,Qn.pad=function(e,t,n){e=Oo(e);var r=(t=Ao(t))?In(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return rs(Mt(i),n)+e+rs(St(i),n)},Qn.padEnd=function(e,t,n){e=Oo(e);var r=(t=Ao(t))?In(e):0;return t&&r<t?e+rs(t-r,n):e},Qn.padStart=function(e,t,n){e=Oo(e);var r=(t=Ao(t))?In(e):0;return t&&r<t?rs(t-r,n)+e:e},Qn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Nn(Oo(e).replace(ye,""),t||0)},Qn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&Os(e,t,n)&&(t=n=_),n===_&&("boolean"==typeof t?(n=t,t=_):"boolean"==typeof e&&(n=e,e=_)),e===_&&t===_?(e=0,t=1):(e=Mo(e),t===_?(t=e,e=0):t=Mo(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Ln();return On(e+i*(t-e+Tt("1e-"+((i+"").length-1))),t)}return oi(e,t)},Qn.reduce=function(e,t,n){var r=ro(e)?Xt:on,i=arguments.length<3;return r(e,xs(t,4),n,i,Sr)},Qn.reduceRight=function(e,t,n){var r=ro(e)?$t:on,i=arguments.length<3;return r(e,xs(t,4),n,i,Ir)},Qn.repeat=function(e,t,n){return t=(n?Os(e,t,n):t===_)?1:Ao(t),li(Oo(e),t)},Qn.replace=function(){var e=arguments,t=Oo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Qn.result=function(e,t,n){var r=-1,i=(t=Oi(t,e)).length;for(i||(i=1,e=_);++r<i;){var s=null==e?_:e[Ks(t[r])];s===_&&(r=i,s=n),e=uo(s)?s.call(e):s}return e},Qn.round=Fl,Qn.runInContext=e,Qn.sample=function(e){return(ro(e)?ur:ui)(e)},Qn.size=function(e){if(null==e)return 0;if(so(e))return xo(e)?In(e):e.length;var t=Ms(e);return t==U||t==V?e.size:$r(e).length},Qn.snakeCase=ol,Qn.some=function(e,t,n){var r=ro(e)?Kt:_i;return n&&Os(e,t,n)&&(t=_),r(e,xs(t,3))},Qn.sortedIndex=function(e,t){return vi(e,t)},Qn.sortedIndexBy=function(e,t,n){return yi(e,t,xs(n,2))},Qn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=vi(e,t);if(r<n&&Qa(e[r],t))return r}return-1},Qn.sortedLastIndex=function(e,t){return vi(e,t,!0)},Qn.sortedLastIndexBy=function(e,t,n){return yi(e,t,xs(n,2),!0)},Qn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=vi(e,t,!0)-1;if(Qa(e[n],t))return n}return-1},Qn.startCase=ll,Qn.startsWith=function(e,t,n){return e=Oo(e),n=null==n?0:br(Ao(n),0,e.length),t=Ti(t),o(e).call(e,n,n+t.length)==t},Qn.subtract=Ul,Qn.sum=function(e){return e&&e.length?ln(e,_l):0},Qn.sumBy=function(e,t){return e&&e.length?ln(e,xs(t,2)):0},Qn.template=function(e,t,n){var r=Qn.templateSettings;n&&Os(e,t,n)&&(t=_),e=Oo(e),t=Lo({},t,r,hs);var i,a,l=Lo({},t.imports,r.imports,hs),c=qo(l),u=pn(l,c),h=0,p=t.interpolate||Le,d="__p += '",m=Be((t.escape||Le).source+"|"+p.source+"|"+(p===de?Me:Le).source+"|"+(t.evaluate||Le).source+"|$","g"),f="//# sourceURL="+(Ye.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++vt+"]")+"\n";e.replace(m,(function(t,n,r,s,l,c){return r||(r=s),d+=o(e).call(e,h,c).replace(ke,yn),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),l&&(a=!0,d+="';\n"+l+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=c+t.length,t})),d+="';\n";var g=Ye.call(t,"variable")&&t.variable;if(g){if(Se.test(g))throw new s("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(ie,""):d).replace(se,"$1").replace(ae,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=pl((function(){return be(c,f+"return "+d).apply(_,u)}));if(v.source=d,co(v))throw v;return v},Qn.times=function(e,t){if((e=Ao(e))<1||e>M)return[];var n=R,r=On(e,R);t=xs(t),e-=R;for(var i=cn(r,t);++n<e;)t(n);return i},Qn.toFinite=Mo,Qn.toInteger=Ao,Qn.toLength=Ro,Qn.toLower=function(e){return Oo(e).toLowerCase()},Qn.toNumber=Do,Qn.toSafeInteger=function(e){return e?br(Ao(e),-9007199254740991,M):0===e?e:0},Qn.toString=Oo,Qn.toUpper=function(e){return Oo(e).toUpperCase()},Qn.trim=function(e,t,n){if((e=Oo(e))&&(n||t===_))return un(e);if(!e||!(t=Ti(t)))return e;var r=Mn(e),i=Mn(t);return Ni(r,mn(r,i),fn(r,i)+1).join("")},Qn.trimEnd=function(e,t,n){if((e=Oo(e))&&(n||t===_))return o(e).call(e,0,An(e)+1);if(!e||!(t=Ti(t)))return e;var r=Mn(e);return Ni(r,0,fn(r,Mn(t))+1).join("")},Qn.trimStart=function(e,t,n){if((e=Oo(e))&&(n||t===_))return e.replace(ye,"");if(!e||!(t=Ti(t)))return e;var r=Mn(e);return Ni(r,mn(r,Mn(t))).join("")},Qn.truncate=function(e,t){var n=30,r="...";if(mo(t)){var i="separator"in t?t.separator:i;n="length"in t?Ao(t.length):n,r="omission"in t?Ti(t.omission):r}var s=(e=Oo(e)).length;if(bn(e)){var a=Mn(e);s=a.length}if(n>=s)return e;var l=n-In(r);if(l<1)return r;var c=a?Ni(a,0,l).join(""):o(e).call(e,0,l);if(i===_)return c+r;if(a&&(l+=c.length-l),yo(i)){if(o(e).call(e,l).search(i)){var u,h=c;for(i.global||(i=Be(i.source,Oo(Ae.exec(i))+"g")),i.lastIndex=0;u=i.exec(h);)var p=u.index;c=o(c).call(c,0,p===_?l:p)}}else if(d(e).call(e,Ti(i),l)!=l){var f=m(c).call(c,i);f>-1&&(c=o(c).call(c,0,f))}return c+r},Qn.unescape=function(e){return(e=Oo(e))&&ce.test(e)?e.replace(oe,Rn):e},Qn.uniqueId=function(e){var t=++Xe;return Oo(e)+t},Qn.upperCase=cl,Qn.upperFirst=ul,Qn.each=Ca,Qn.eachRight=Oa,Qn.first=sa,xl(Qn,(Ll={},Pr(Qn,(function(e,t){Ye.call(Qn.prototype,t)||(Ll[t]=e)})),Ll),{chain:!1}),Qn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Qn[e].placeholder=Qn})),jt(["drop","take"],(function(e,t){rr.prototype[e]=function(n){n=n===_?1:Cn(Ao(n),0);var r=this.__filtered__&&!t?new rr(this):this.clone();return r.__filtered__?r.__takeCount__=On(n,r.__takeCount__):r.__views__.push({size:On(n,R),type:e+(r.__dir__<0?"Right":"")}),r},rr.prototype[e+"Right"]=function(t){var n;return h(n=h(this).call(this)[e](t)).call(n)}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;rr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:xs(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");rr.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");rr.prototype[e]=function(){return this.__filtered__?new rr(this):this[n](1)}})),rr.prototype.compact=function(){return f(this).call(this,_l)},rr.prototype.find=function(e){return f(this).call(this,e).head()},rr.prototype.findLast=function(e){var t;return g(t=h(this).call(this)).call(t,e)},rr.prototype.invokeMap=ci((function(e,t){return"function"==typeof e?new rr(this):p(this).call(this,(function(n){return Vr(n,e,t)}))})),rr.prototype.reject=function(e){return f(this).call(this,Xa(xs(e)))},rr.prototype.slice=function(e,t){e=Ao(e);var n=this;return n.__filtered__&&(e>0||t<0)?new rr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==_&&(n=(t=Ao(t))<0?n.dropRight(-t):n.take(t-e)),n)},rr.prototype.takeRightWhile=function(e){var t;return h(t=h(this).call(this).takeWhile(e)).call(t)},rr.prototype.toArray=function(){return this.take(R)},Pr(rr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Qn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);i&&(Qn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,o=t instanceof rr,l=a[0],c=o||ro(t),u=function(e){var t=i.apply(Qn,Yt([e],a));return r&&h?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(o=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=s&&!h,m=o&&!p;if(!s&&c){t=m?t:new rr(this);var f=e.apply(t,a);return f.__actions__.push({func:Ia,args:[u],thisArg:_}),new nr(f,h)}return d&&m?e.apply(this,a):(f=this.thru(u),d?r?f.value()[0]:f.value():f)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ze[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Qn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ro(i)?i:[],e)}return this[n]((function(n){return t.apply(ro(n)?n:[],e)}))}})),Pr(rr.prototype,(function(e,t){var n=Qn[t];if(n){var r=n.name+"";Ye.call(Hn,r)||(Hn[r]=[]),Hn[r].push({name:t,func:n})}})),Hn[Qi(_,2).name]=[{name:"wrapper",func:_}],rr.prototype.clone=function(){var e=new rr(this.__wrapped__);return e.__actions__=zi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=zi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=zi(this.__views__),e},rr.prototype.reverse=function(){if(this.__filtered__){var e=new rr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},rr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ro(e),r=t<0,i=n?e.length:0,s=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var s=n[r],a=s.size;switch(s.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=On(t,e+a);break;case"takeRight":e=Cn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=s.start,o=s.end,l=o-a,c=r?o:a-1,u=this.__iteratees__,h=u.length,p=0,d=On(l,this.__takeCount__);if(!n||!r&&i==l&&d==l)return Mi(e,this.__actions__);var m=[];e:for(;l--&&p<d;){for(var f=-1,g=e[c+=t];++f<h;){var _=u[f],v=_.iteratee,y=_.type,b=v(g);if(2==y)g=b;else if(!b){if(1==y)continue e;break e}}m[p++]=g}return m},Qn.prototype.at=Ma,Qn.prototype.chain=function(){return Sa(this)},Qn.prototype.commit=function(){return new nr(this.value(),this.__chain__)},Qn.prototype.next=function(){this.__values__===_&&(this.__values__=Io(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?_:this.__values__[this.__index__++]}},Qn.prototype.plant=function(e){for(var t,n=this;n instanceof tr;){var r=Js(n);r.__index__=0,r.__values__=_,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Qn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof rr){var t=e;return this.__actions__.length&&(t=new rr(this)),(t=h(t).call(t)).__actions__.push({func:Ia,args:[da],thisArg:_}),new nr(t,this.__chain__)}return this.thru(da)},Qn.prototype.toJSON=Qn.prototype.valueOf=Qn.prototype.value=function(){return Mi(this.__wrapped__,this.__actions__)},Qn.prototype.first=Qn.prototype.head,ct&&(Qn.prototype[ct]=function(){return this}),Qn}();It._=Dn,(r=function(){return Dn}.call(t,n,t,e))===_||(e.exports=r)}).call(this)},14179:function(e,t,n){var r,i,s=n(48216),a=n(51791),o=n(35704);r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function i(e,t){var n=e[t];if("function"==typeof s(n))return s(n).call(n,e);try{return s(Function.prototype).call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?l:void 0!==console[r]?i(console,r):void 0!==console.log?i(console,"log"):e)}function u(t,n){for(var i=0;i<r.length;i++){var s=r[i];this[s]=i<t?e:this.methodFactory(s,t,n)}this.log=this.debug}function h(e,n,r){return function(){typeof console!==t&&(u.call(this,n,r),this[e].apply(this,arguments))}}function p(e,t,n){return c(e)||h.apply(this,arguments)}function d(e,n,i){var s,l=this;n=null==n?"WARN":n;var c="loglevel";function h(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&c){try{return void(window.localStorage[c]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(e){}}}function d(){var e;if(typeof window!==t&&c){try{e=window.localStorage[c]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=a(n).call(n,encodeURIComponent(c)+"=");-1!==r&&(e=/^([^;]+)/.exec(o(n).call(n,r))[1])}catch(e){}return void 0===l.levels[e]&&(e=void 0),e}}function m(){if(typeof window!==t&&c){try{return void window.localStorage.removeItem(c)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}"string"==typeof e?c+=":"+e:"symbol"==typeof e&&(c=void 0),l.name=e,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=i||p,l.getLevel=function(){return s},l.setLevel=function(n,r){if("string"==typeof n&&void 0!==l.levels[n.toUpperCase()]&&(n=l.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(s=n,!1!==r&&h(n),u.call(l,n,e),typeof console===t&&n<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(e){n=e,d()||l.setLevel(e,!1)},l.resetLevel=function(){l.setLevel(n,!1),m()},l.enableAll=function(e){l.setLevel(l.levels.TRACE,e)},l.disableAll=function(e){l.setLevel(l.levels.SILENT,e)};var f=d();null==f&&(f=n),l.setLevel(f,!1)}var m=new d,f={};m.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=f[e];return t||(t=f[e]=new d(e,m.getLevel(),m.methodFactory)),t};var g=typeof window!==t?window.log:void 0;return m.noConflict=function(){return typeof window!==t&&window.log===m&&(window.log=g),m},m.getLoggers=function(){return f},m.default=m,m},void 0===(i="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=i)},40529:function(e){e.exports=function(e,t,n,r){var i=e[0],s=e[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=t.length);for(var o=(r-n)/2,l=0,c=o-1;l<o;c=l++){var u=t[n+2*l+0],h=t[n+2*l+1],p=t[n+2*c+0],d=t[n+2*c+1];h>s!=d>s&&i<(p-u)*(s-h)/(d-h)+u&&(a=!a)}return a}},79624:function(e,t,n){var r=n(98235),i=n(40529),s=n(2553);e.exports=function(e,t,n,a){return t.length>0&&r(t[0])?s(e,t,n,a):i(e,t,n,a)},e.exports.nested=s,e.exports.flat=i},2553:function(e){e.exports=function(e,t,n,r){var i=e[0],s=e[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=t.length);for(var o=r-n,l=0,c=o-1;l<o;c=l++){var u=t[l+n][0],h=t[l+n][1],p=t[c+n][0],d=t[c+n][1];h>s!=d>s&&i<(p-u)*(s-h)/(d-h)+u&&(a=!a)}return a}},76501:function(e,t,n){var r,i=n(99595),s=n(84323),a=n(97688),o=n(62263),l=n(76481),c=n(60146),u=n(31784),h=!1,p=a();function d(e,t,n){var i=r.segments(e),s=r.segments(t),a=n(r.combine(i,s));return r.polygon(a)}r={buildLog:function(e){return!0===e?h=s():!1===e&&(h=!1),!1!==h&&h.list},epsilon:function(e){return p.epsilon(e)},segments:function(e){var t,n=o(!0,p,h);return i(t=e.regions).call(t,n.addRegion),{segments:n.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,p,h).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:c.union(e.combined,h),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:c.intersect(e.combined,h),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:c.difference(e.combined,h),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:c.differenceRev(e.combined,h),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:c.xor(e.combined,h),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,p,h),inverted:e.inverted}},polygonFromGeoJSON:function(e){return u.toPolygon(r,e)},polygonToGeoJSON:function(e){return u.fromPolygon(r,p,e)},union:function(e,t){return d(e,t,r.selectUnion)},intersect:function(e,t){return d(e,t,r.selectIntersect)},difference:function(e,t){return d(e,t,r.selectDifference)},differenceRev:function(e,t){return d(e,t,r.selectDifferenceRev)},xor:function(e,t){return d(e,t,r.selectXor)}},"object"==typeof window&&(window.PolyBool=r),e.exports=r},84323:function(e,t,n){var r=n(58218);e.exports=function(){var e,t=0,n=!1;function i(t,n){return e.list.push({type:t,data:n?JSON.parse(r(n)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return i("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return i("div_seg",{seg:e,pt:t}),i("chop",{seg:e,pt:t})},statusRemove:function(e){return i("pop_seg",{seg:e})},segmentUpdate:function(e){return i("seg_update",{seg:e})},segmentNew:function(e,t){return i("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return i("rem_seg",{seg:e})},tempStatus:function(e,t,n){return i("temp_status",{seg:e,above:t,below:n})},rewind:function(e){return i("rewind",{seg:e})},status:function(e,t,n){return i("status",{seg:e,above:t,below:n})},vert:function(t){return t===n?e:(n=t,i("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=r(e,!1," ")),i("log",{txt:e})},reset:function(){return i("reset")},selected:function(e){return i("selected",{segs:e})},chainStart:function(e){return i("chain_start",{seg:e})},chainRemoveHead:function(e,t){return i("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return i("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return i("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return i("chain_match",{index:e})},chainClose:function(e){return i("chain_close",{index:e})},chainAddHead:function(e,t){return i("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return i("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return i("chain_con",{index1:e,index2:t})},chainReverse:function(e){return i("chain_rev",{index:e})},chainJoin:function(e,t){return i("chain_join",{index1:e,index2:t})},done:function(){return i("done")}}}},97688:function(e){e.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,n,r){var i=n[0],s=n[1],a=r[0],o=r[1],l=t[0];return(a-i)*(t[1]-s)-(o-s)*(l-i)>=-e},pointBetween:function(t,n,r){var i=t[1]-n[1],s=r[0]-n[0],a=t[0]-n[0],o=r[1]-n[1],l=a*s+i*o;return!(l<e)&&!(l-(s*s+o*o)>-e)},pointsSameX:function(t,n){return Math.abs(t[0]-n[0])<e},pointsSameY:function(t,n){return Math.abs(t[1]-n[1])<e},pointsSame:function(e,n){return t.pointsSameX(e,n)&&t.pointsSameY(e,n)},pointsCompare:function(e,n){return t.pointsSameX(e,n)?t.pointsSameY(e,n)?0:e[1]<n[1]?-1:1:e[0]<n[0]?-1:1},pointsCollinear:function(t,n,r){var i=t[0]-n[0],s=t[1]-n[1],a=n[0]-r[0],o=n[1]-r[1];return Math.abs(i*o-a*s)<e},linesIntersect:function(t,n,r,i){var s=n[0]-t[0],a=n[1]-t[1],o=i[0]-r[0],l=i[1]-r[1],c=s*l-a*o;if(Math.abs(c)<e)return!1;var u=t[0]-r[0],h=t[1]-r[1],p=(o*h-l*u)/c,d=(s*h-a*u)/c,m={alongA:0,alongB:0,pt:[t[0]+p*s,t[1]+p*a]};return m.alongA=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,m.alongB=d<=-e?-2:d<e?-1:d-1<=-e?0:d-1<e?1:2,m},pointInsideRegion:function(t,n){for(var r=t[0],i=t[1],s=n[n.length-1][0],a=n[n.length-1][1],o=!1,l=0;l<n.length;l++){var c=n[l][0],u=n[l][1];u-i>e!=a-i>e&&(s-c)*(i-u)/(a-u)+c-r>e&&(o=!o),s=c,a=u}return o}};return t}},31784:function(e,t,n){var r=n(35704),i=n(90143),s=n(86526),a={toPolygon:function(e,t){function n(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function n(t){var n=r(t).call(t,0,t.length-1);return e.segments({inverted:!1,regions:[n]})}for(var i=n(t[0]),s=1;s<t.length;s++)i=e.selectDifference(e.combine(i,n(t[s])));return i}if("Polygon"===t.type)return e.polygon(n(t.coordinates));if("MultiPolygon"===t.type){for(var i=e.segments({inverted:!1,regions:[]}),s=0;s<t.coordinates.length;s++)i=e.selectUnion(e.combine(i,n(t.coordinates[s])));return e.polygon(i)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,n){function r(e,n){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],n)}function a(e){return{region:e,children:[]}}n=e.polygon(e.segments(n));var o=a(null);function l(e,t){for(var n=0;n<e.children.length;n++){if(r(t,(o=e.children[n]).region))return void l(o,t)}var s=a(t);for(n=0;n<e.children.length;n++){var o,c;if(r((o=e.children[n]).region,t))s.children.push(o),i(c=e.children).call(c,n,1),n--}e.children.push(s)}for(var c=0;c<n.regions.length;c++){var u=n.regions[c];u.length<3||l(o,u)}function h(e,t){for(var n=0,r=e[e.length-1][0],i=e[e.length-1][1],a=[],o=0;o<e.length;o++){var l=e[o][0],c=e[o][1];a.push([l,c]),n+=c*r-l*i,r=l,i=c}return n<0!==t&&s(a).call(a),a.push([a[0][0],a[0][1]]),a}var p=[];function d(e){var t=[h(e.region,!1)];p.push(t);for(var n=0;n<e.children.length;n++)t.push(m(e.children[n]))}function m(e){for(var t=0;t<e.children.length;t++)d(e.children[t]);return h(e.region,!0)}for(c=0;c<o.children.length;c++)d(o.children[c]);return p.length<=0?{type:"Polygon",coordinates:[]}:1==p.length?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}};e.exports=a},62263:function(e,t,n){var r=n(99595),i=n(87333);e.exports=function(e,t,n){function s(e,t,r){return{id:n?n.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=i.create();function o(e,n){a.insertBefore(e,(function(r){return function(e,n,r,i,s,a){var o=t.pointsCompare(n,s);return 0!==o?o:t.pointsSame(r,a)?0:e!==i?e?1:-1:t.pointAboveOrOnLine(r,i?s:a,i?a:s)?1:-1}(e.isStart,e.pt,n,r.isStart,r.pt,r.other.pt)<0}))}function l(e,t){var n=function(e,t){var n=i.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(n,e.end),n}(e,t);return function(e,t,n){var r=i.node({isStart:!1,pt:t.end,seg:t,primary:n,other:e,status:null});e.other=r,o(r,e.pt)}(n,e,t),n}function c(e,t){var r=s(t,e.seg.end,e.seg);return function(e,t){n&&n.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),l(r,e.primary)}function u(r,s){var o=i.create();function l(e){return o.findTransition((function(n){var r,i,s,a,o,l;return(r=e,i=n.ev,s=r.seg.start,a=r.seg.end,o=i.seg.start,l=i.seg.end,t.pointsCollinear(s,o,l)?t.pointsCollinear(a,o,l)||t.pointAboveOrOnLine(a,o,l)?1:-1:t.pointAboveOrOnLine(s,o,l)?1:-1)>0}))}function u(e,r){var i=e.seg,s=r.seg,a=i.start,o=i.end,l=s.start,u=s.end;n&&n.checkIntersection(i,s);var h=t.linesIntersect(a,o,l,u);if(!1===h){if(!t.pointsCollinear(a,o,l))return!1;if(t.pointsSame(a,u)||t.pointsSame(o,l))return!1;var p=t.pointsSame(a,l),d=t.pointsSame(o,u);if(p&&d)return r;var m=!p&&t.pointBetween(a,l,u),f=!d&&t.pointBetween(o,l,u);if(p)return f?c(r,o):c(e,u),r;m&&(d||(f?c(r,o):c(e,u)),c(r,a))}else 0===h.alongA&&(-1===h.alongB?c(e,l):0===h.alongB?c(e,h.pt):1===h.alongB&&c(e,u)),0===h.alongB&&(-1===h.alongA?c(r,a):0===h.alongA?c(r,h.pt):1===h.alongA&&c(r,o));return!1}for(var h=[];!a.isEmpty();){var p=a.getHead();if(n&&n.vert(p.pt[0]),p.isStart){n&&n.segmentNew(p.seg,p.primary);var d=l(p),m=d.before?d.before.ev:null,f=d.after?d.after.ev:null;function g(){if(m){var e=u(p,m);if(e)return e}return!!f&&u(p,f)}n&&n.tempStatus(p.seg,!!m&&m.seg,!!f&&f.seg);var _,v=g();if(v){var y;if(e)(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=p.seg.myFill;n&&n.segmentUpdate(v.seg),p.other.remove(),p.remove()}if(a.getHead()!==p){n&&n.rewind(p.seg);continue}if(e)y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=f?f.seg.myFill.above:r,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below;else if(null===p.seg.otherFill)_=f?p.primary===f.primary?f.seg.otherFill.above:f.seg.myFill.above:p.primary?s:r,p.seg.otherFill={above:_,below:_};n&&n.status(p.seg,!!m&&m.seg,!!f&&f.seg),p.other.status=d.insert(i.node({ev:p}))}else{var b=p.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(o.exists(b.prev)&&o.exists(b.next)&&u(b.prev.ev,b.next.ev),n&&n.statusRemove(b.ev.seg),b.remove(),!p.primary){var x=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=x}h.push(p.seg)}a.getHead().remove()}return n&&n.done(),h}return e?{addRegion:function(e){for(var r,i,s,a=e[e.length-1],o=0;o<e.length;o++){r=a,a=e[o];var c=t.pointsCompare(r,a);0!==c&&l((i=c<0?r:a,s=c<0?a:r,{id:n?n.segmentId():-1,start:i,end:s,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(e){return u(e,!1)}}:{calculate:function(e,t,n,i){return r(e).call(e,(function(e){l(s(e.start,e.end,e),!0)})),r(n).call(n,(function(e){l(s(e.start,e.end,e),!1)})),u(t,i)}}}},87333:function(e){e.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,n){for(var r=e.root,i=e.root.next;null!==i;){if(n(i))return t.prev=i.prev,t.next=i,i.prev.next=t,void(i.prev=t);r=i,i=i.next}r.next=t,t.prev=r,t.next=null},findTransition:function(t){for(var n=e.root,r=e.root.next;null!==r&&!t(r);)n=r,r=r.next;return{before:n===e.root?null:n,after:r,insert:function(e){return e.prev=n,e.next=r,n.next=e,null!==r&&(r.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}},76481:function(e,t,n){var r=n(99595),i=n(90143),s=n(86526),a=n(8571);e.exports=function(e,t,n){var o=[],l=[];return r(e).call(e,(function(e){var r=e.start,c=e.end;if(t.pointsSame(r,c))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{n&&n.chainStart(e);for(var u={index:0,matches_head:!1,matches_pt1:!1},h={index:0,matches_head:!1,matches_pt1:!1},p=u,d=0;d<o.length;d++){var m=(y=o[d])[0],f=(y[1],y[y.length-1]);y[y.length-2];if(t.pointsSame(m,r)){if(M(d,!0,!0))break}else if(t.pointsSame(m,c)){if(M(d,!0,!1))break}else if(t.pointsSame(f,r)){if(M(d,!1,!0))break}else if(t.pointsSame(f,c)&&M(d,!1,!1))break}if(p===u)return o.push([r,c]),void(n&&n.chainNew(r,c));if(p===h){n&&n.chainMatch(u.index);var g=u.index,_=u.matches_pt1?c:r,v=u.matches_head,y=o[g],b=v?y[0]:y[y.length-1],x=v?y[1]:y[y.length-2],T=v?y[y.length-1]:y[0],w=v?y[y.length-2]:y[1];return t.pointsCollinear(x,b,_)&&(v?(n&&n.chainRemoveHead(u.index,_),y.shift()):(n&&n.chainRemoveTail(u.index,_),y.pop()),b=x),t.pointsSame(T,_)?(i(o).call(o,g,1),t.pointsCollinear(w,T,b)&&(v?(n&&n.chainRemoveTail(u.index,b),y.pop()):(n&&n.chainRemoveHead(u.index,b),y.shift())),n&&n.chainClose(u.index),void l.push(y)):void(v?(n&&n.chainAddHead(u.index,_),y.unshift(_)):(n&&n.chainAddTail(u.index,_),y.push(_)))}var E=u.index,S=h.index;n&&n.chainConnect(E,S);var I=o[E].length<o[S].length;u.matches_head?h.matches_head?I?(A(E),R(E,S)):(A(S),R(S,E)):R(S,E):h.matches_head?R(E,S):I?(A(E),R(S,E)):(A(S),R(E,S))}function M(e,t,n){return p.index=e,p.matches_head=t,p.matches_pt1=n,p===u?(p=h,!1):(p=null,!0)}function A(e){var t;n&&n.chainReverse(e),s(t=o[e]).call(t)}function R(e,r){var s=o[e],l=o[r],c=s[s.length-1],u=s[s.length-2],h=l[0],p=l[1];t.pointsCollinear(u,c,h)&&(n&&n.chainRemoveTail(e,c),s.pop(),c=u),t.pointsCollinear(c,h,p)&&(n&&n.chainRemoveHead(r,h),l.shift()),n&&n.chainJoin(e,r),o[e]=a(s).call(s,l),i(o).call(o,r,1)}})),l}},60146:function(e,t,n){var r=n(99595);function i(e,t,n){var i=[];return r(e).call(e,(function(e){var r=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[r]&&i.push({id:n?n.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[r],below:2===t[r]},otherFill:null})})),n&&n.selected(i),i}var s={union:function(e,t){return i(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return i(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return i(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return i(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return i(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};e.exports=s},19456:function(e,t,n){n(92381);var r=n(57445),i=n(99595),s=n(55243),a=n(54847),o=n(35704),l=n(51791),c=n(90143),u=n(8571),h=n(98235),p=n(86526),d=n(76555),m=n(86981);e.exports=function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r(e,i.key,i)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}var f=function(){function e(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return e}();function g(e,t){return e>t?1:e<t?-1:0}function _(e,t,n){for(var r=new f(null,null),i=r,s=r;;){var a=n(e,t.key);if(a<0){if(null===t.left)break;if(n(e,t.left.key)<0){var o=t.left;if(t.left=o.right,o.right=t,null===(t=o).left)break}s.left=t,s=t,t=t.left}else{if(!(a>0))break;if(null===t.right)break;if(n(e,t.right.key)>0&&(o=t.right,t.right=o.left,o.left=t,null===(t=o).right))break;i.right=t,i=t,t=t.right}}return i.right=t.left,s.left=t.right,t.left=r.right,t.right=r.left,t}function v(e,t,n,r){var i=new f(e,t);if(null===n)return i.left=i.right=null,i;var s=r(e,(n=_(e,n,r)).key);return s<0?(i.left=n.left,i.right=n,n.left=null):s>=0&&(i.right=n.right,i.left=n,n.right=null),i}function y(e,t,n){var r=null,i=null;if(t){var s=n((t=_(e,t,n)).key,e);0===s?(r=t.left,i=t.right):s<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function b(e,t,n){return null===t?e:(null===e||((t=_(e.key,t,n)).left=e),t)}function x(e,t,n,r,i){if(e){r(t+(n?"└── ":"├── ")+i(e)+"\n");var s=t+(n?" ":"│ ");e.left&&x(e.left,s,!1,r,i),e.right&&x(e.right,s,!0,r,i)}}var T=function(){function e(e){void 0===e&&(e=g),this._root=null,this._size=0,this._comparator=e}return e.prototype.insert=function(e,t){return this._size++,this._root=v(e,t,this._root,this._comparator)},e.prototype.add=function(e,t){var n=new f(e,t);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,i=_(e,this._root,r),s=r(e,i.key);return 0===s?this._root=i:(s<0?(n.left=i.left,n.right=i,i.left=null):s>0&&(n.right=i.right,n.left=i,i.right=null),this._size++,this._root=n),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,n){var r;return null===t?null:0===n(e,(t=_(e,t,n)).key)?(null===t.left?r=t.right:(r=_(e,t.left,n)).right=t.right,this._size--,r):t},e.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=_(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},e.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},e.prototype.find=function(e){return this._root&&(this._root=_(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},e.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),e.call(t,n),n=n.right):i=!0;return this},e.prototype.range=function(e,t,n,r){for(var i=[],s=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(s((a=i.pop()).key,t)>0)break;if(s(a.key,e)>=0&&n.call(r,a))return this;a=a.right}return this},e.prototype.keys=function(){var e,t=[];return i(e=this).call(e,(function(e){var n=e.key;return t.push(n)})),t},e.prototype.values=function(){var e,t=[];return i(e=this).call(e,(function(e){var n=e.data;return t.push(n)})),t},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},e.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},e.prototype.at=function(e){for(var t=this._root,n=!1,r=0,i=[];!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},e.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?(n=t,t=t.left):t=t.right}return n},e.prototype.prev=function(e){var t=this._root,n=null;if(null!==e.left){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?t=t.left:(n=t,t=t.right)}return n},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return S(this._root)},e.prototype.load=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1);var r=e.length,i=this._comparator;if(n&&A(e,t,0,r-1,i),null===this._root)this._root=w(e,t,0,r),this._size=r;else{var s=M(this.toList(),E(e,t),i);r=this._size+r,this._root=I({head:s},0,r)}return this},e.prototype.isEmpty=function(){return null===this._root},r(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),r(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return x(this._root,"",!0,(function(e){return t.push(e)}),e),t.join("")},e.prototype.update=function(e,t,n){var r=this._comparator,i=y(e,this._root,r),s=i.left,a=i.right;r(e,t)<0?a=v(t,n,a,r):s=v(t,n,s,r),this._root=b(s,a,r)},e.prototype.split=function(e){return y(e,this._root,this._comparator)},e}();function w(e,t,n,r){var i=r-n;if(i>0){var s=n+Math.floor(i/2),a=e[s],o=t[s],l=new f(a,o);return l.left=w(e,t,n,s),l.right=w(e,t,s+1,r),l}return null}function E(e,t){for(var n=new f(null,null),r=n,i=0;i<e.length;i++)r=r.next=new f(e[i],t[i]);return r.next=null,n.next}function S(e){for(var t=e,n=[],r=!1,i=new f(null,null),s=i;!r;)t?(n.push(t),t=t.left):n.length>0?t=(t=s=s.next=n.pop()).right:r=!0;return s.next=null,i.next}function I(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2),s=I(e,t,i),a=e.head;return a.left=s,e.head=e.head.next,a.right=I(e,i+1,n),a}return null}function M(e,t,n){for(var r=new f(null,null),i=r,s=e,a=t;null!==s&&null!==a;)n(s.key,a.key)<0?(i.next=s,s=s.next):(i.next=a,a=a.next),i=i.next;return null!==s?i.next=s:null!==a&&(i.next=a),r.next}function A(e,t,n,r,i){if(!(n>=r)){for(var s=e[n+r>>1],a=n-1,o=r+1;;){do{a++}while(i(e[a],s)<0);do{o--}while(i(e[o],s)>0);if(a>=o)break;var l=e[a];e[a]=e[o],e[o]=l,l=t[a],t[a]=t[o],t[o]=l}A(e,t,n,o,i),A(e,t,o+1,r,i)}}var R=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},D=function(e,t){if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;var n=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:n,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:r,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}},C=s;void 0===C&&(C=Math.pow(2,-52));var O=C*C,P=function(e,t){if(-C<e&&e<C&&-C<t&&t<C)return 0;var n=e-t;return n*n<O*e*t?0:e<t?-1:1},N=function(){function t(){e(this,t),this.reset()}return n(t,[{key:"reset",value:function(){this.xRounder=new L,this.yRounder=new L}},{key:"round",value:function(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}]),t}(),L=function(){function t(){e(this,t),this.tree=new T,this.round(0)}return n(t,[{key:"round",value:function(e){var t=this.tree.add(e),n=this.tree.prev(t);if(null!==n&&0===P(t.key,n.key))return this.tree.remove(e),n.key;var r=this.tree.next(t);return null!==r&&0===P(t.key,r.key)?(this.tree.remove(e),r.key):e}}]),t}(),k=new N,F=function(e,t){return e.x*t.y-e.y*t.x},U=function(e,t){return e.x*t.x+e.y*t.y},B=function(e,t,n){var r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y},s=F(r,i);return P(s,0)},j=function(e){return Math.sqrt(U(e,e))},G=function(e,t,n){var r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return F(i,r)/j(i)/j(r)},z=function(e,t,n){var r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return U(i,r)/j(i)/j(r)},V=function(e,t,n){return 0===t.y?null:{x:e.x+t.x/t.y*(n-e.y),y:n}},H=function(e,t,n){return 0===t.x?null:{x:n,y:e.y+t.y/t.x*(n-e.x)}},q=function(e,t,n,r){if(0===t.x)return H(n,r,e.x);if(0===r.x)return H(e,t,n.x);if(0===t.y)return V(n,r,e.y);if(0===r.y)return V(e,t,n.y);var i=F(t,r);if(0==i)return null;var s={x:n.x-e.x,y:n.y-e.y},a=F(s,t)/i,o=F(s,r)/i;return{x:(e.x+o*t.x+(n.x+a*r.x))/2,y:(e.y+o*t.y+(n.y+a*r.y))/2}},W=function(){function t(n,r){e(this,t),void 0===n.events?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=r}return n(t,null,[{key:"compare",value:function(e,n){var r=t.comparePoints(e.point,n.point);return 0!==r?r:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:X.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}}]),n(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var t=e.point.events,n=0,r=t.length;n<r;n++){var i=t[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,t=0;t<e;t++){var n=this.point.events[t];if(void 0===n.segment.consumedBy)for(var r=t+1;r<e;r++){var i=this.point.events[r];void 0===i.consumedBy&&n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],t=0,n=this.point.events.length;t<n;t++){var r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}},{key:"getLeftmostComparator",value:function(e){var t=this,n=new a,r=function(r){var i=r.otherSE;n.set(r,{sine:G(t.point,e.point,i.point),cosine:z(t.point,e.point,i.point)})};return function(e,t){n.has(e)||r(e),n.has(t)||r(t);var i=n.get(e),s=i.sine,a=i.cosine,o=n.get(t),l=o.sine,c=o.cosine;return s>=0&&l>=0?a<c?1:a>c?-1:0:s<0&&l<0?a<c?-1:a>c?1:0:l<s?-1:l>s?1:0}}}]),t}(),Y=0,X=function(){function t(n,r,i,s){e(this,t),this.id=++Y,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=s}return n(t,null,[{key:"compare",value:function(e,t){var n=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,s=t.rightSE.point.x;if(s<n)return 1;if(i<r)return-1;var a=e.leftSE.point.y,o=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(n<r){if(o<a&&o<l)return 1;if(o>a&&o>l)return-1;var u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return-1;var h=t.comparePoint(e.rightSE.point);return 0!==h?h:-1}if(n>r){if(a<o&&a<c)return-1;if(a>o&&a>c)return 1;var p=t.comparePoint(e.leftSE.point);if(0!==p)return p;var d=e.comparePoint(t.rightSE.point);return d<0?1:d>0?-1:1}if(a<o)return-1;if(a>o)return 1;if(i<s){var m=t.comparePoint(e.rightSE.point);if(0!==m)return m}if(i>s){var f=e.comparePoint(t.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(i!==s){var g=l-a,_=i-n,v=c-o,y=s-r;if(g>_&&v<y)return 1;if(g<_&&v>y)return-1}return i>s?1:i<s||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}}]),n(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;var i=(e.y-t.y)/r.y,s=t.x+i*r.x;if(e.x===s)return 0;var a=(e.x-t.x)/r.x,o=t.y+a*r.y;return e.y===o?0:e.y<o?-1:1}},{key:"getIntersection",value:function(e){var t=this.bbox(),n=e.bbox(),r=D(t,n);if(null===r)return null;var i=this.leftSE.point,s=this.rightSE.point,a=e.leftSE.point,o=e.rightSE.point,l=R(t,a)&&0===this.comparePoint(a),c=R(n,i)&&0===e.comparePoint(i),u=R(t,o)&&0===this.comparePoint(o),h=R(n,s)&&0===e.comparePoint(s);if(c&&l)return h&&!u?s:!h&&u?o:null;if(c)return u&&i.x===o.x&&i.y===o.y?null:i;if(l)return h&&s.x===a.x&&s.y===a.y?null:a;if(h&&u)return null;if(h)return s;if(u)return o;var p=q(i,this.vector(),a,e.vector());return null===p?null:R(r,p)?k.round(p.x,p.y):null}},{key:"split",value:function(e){var n,r,i=[],s=void 0!==e.events,a=new W(e,!0),l=new W(e,!1),c=this.rightSE;this.replaceRightSE(l),i.push(l),i.push(a);var u=new t(a,c,o(n=this.rings).call(n),o(r=this.windings).call(r));return W.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),W.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),s&&(a.checkForConsuming(),l.checkForConsuming()),i}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}},{key:"consume",value:function(e){for(var n=this,r=e;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=t.compare(n,r);if(0!==i){if(i>0){var s=n;n=r,r=s}if(n.prev===r){var a=n;n=r,r=a}for(var o=0,c=r.rings.length;o<c;o++){var u,h=r.rings[o],p=r.windings[o],d=l(u=n.rings).call(u,h);-1===d?(n.rings.push(h),n.windings.push(p)):n.windings[d]+=p}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){var e,t;if(void 0!==this._afterState)return this._afterState;var n=this.beforeState();this._afterState={rings:o(e=n.rings).call(e,0),windings:o(t=n.windings).call(t,0),multiPolys:[]};for(var r=this._afterState.rings,i=this._afterState.windings,s=this._afterState.multiPolys,a=0,u=this.rings.length;a<u;a++){var h=this.rings[a],p=this.windings[a],d=l(r).call(r,h);-1===d?(r.push(h),i.push(p)):i[d]+=p}for(var m=[],f=[],g=0,_=r.length;g<_;g++)if(0!==i[g]){var v=r[g],y=v.poly;if(-1===l(f).call(f,y))if(v.isExterior)m.push(y);else{-1===l(f).call(f,y)&&f.push(y);var b=l(m).call(m,v.poly);-1!==b&&c(m).call(m,b,1)}}for(var x=0,T=m.length;x<T;x++){var w=m[x].multiPoly;-1===l(s).call(s,w)&&s.push(w)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ie.type){case"union":var n=0===e.length,r=0===t.length;this._isInResult=n!==r;break;case"intersection":var i,s;e.length<t.length?(i=e.length,s=t.length):(i=t.length,s=e.length),this._isInResult=s===ie.numMultiPolys&&i<s;break;case"xor":var a=Math.abs(e.length-t.length);this._isInResult=a%2==1;break;case"difference":var o=function(e){return 1===e.length&&e[0].isSubject};this._isInResult=o(e)!==o(t);break;default:throw new Error("Unrecognized operation type found ".concat(ie.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,r){var i,s,a,o,l=W.comparePoints(e,n);if(l<0)s=e,a=n,o=1;else{if(!(l>0))throw new Error(u(i="Tried to create degenerate segment at [".concat(e.x,", ")).call(i,e.y,"]"));s=n,a=e,o=-1}return new t(new W(s,!0),new W(a,!1),[r],[o])}}]),t}(),$=function(){function t(n,r,i){if(e(this,t),!h(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof n[0][0]||"number"!=typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=k.round(n[0][0],n[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};for(var a=s,o=1,l=n.length;o<l;o++){if("number"!=typeof n[o][0]||"number"!=typeof n[o][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var c=k.round(n[o][0],n[o][1]);c.x===a.x&&c.y===a.y||(this.segments.push(X.fromRing(a,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),a=c)}s.x===a.x&&s.y===a.y||this.segments.push(X.fromRing(a,s,this))}return n(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,n=this.segments.length;t<n;t++){var r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}]),t}(),K=function(){function t(n,r){if(e(this,t),!h(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,s=n.length;i<s;i++){var a=new $(n[i],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return n(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,n=this.interiorRings.length;t<n;t++)for(var r=this.interiorRings[t].getSweepEvents(),i=0,s=r.length;i<s;i++)e.push(r[i]);return e}}]),t}(),Z=function(){function t(n,r){if(e(this,t),!h(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof n[0][0][0]&&(n=[n])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,s=n.length;i<s;i++){var a=new K(n[i],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return n(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,n=this.polys.length;t<n;t++)for(var r=this.polys[t].getSweepEvents(),i=0,s=r.length;i<s;i++)e.push(r[i]);return e}}]),t}(),J=function(){function t(n){e(this,t),this.events=n;for(var r=0,i=n.length;r<i;r++)n[r].segment.ringOut=this;this.poly=null}return n(t,null,[{key:"factory",value:function(e){for(var n=[],r=0,i=e.length;r<i;r++){var s=e[r];if(s.isInResult()&&!s.ringOut){for(var a=null,o=s.leftSE,l=s.rightSE,h=[o],m=o.point,f=[];a=o,o=l,h.push(o),o.point!==m;)for(;;){var g=o.getAvailableLinkedEvents();if(0===g.length){var _,v=h[0].point,y=h[h.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(v.x,",")+" ".concat(v.y,"]. Last matching segment found ends at")+u(_=" [".concat(y.x,", ")).call(_,y.y,"]."))}if(1===g.length){l=g[0].otherSE;break}for(var b=null,x=0,T=f.length;x<T;x++)if(f[x].point===o.point){b=x;break}if(null===b){f.push({index:h.length,point:o.point});var w=o.getLeftmostComparator(a);l=d(g).call(g,w)[0].otherSE;break}var E=c(f).call(f,b)[0],S=c(h).call(h,E.index);S.unshift(S[0].otherSE),n.push(new t(p(S).call(S)))}n.push(new t(h))}}return n}}]),n(t,[{key:"getGeom",value:function(){for(var e=this.events[0].point,t=[e],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,s=this.events[n+1].point;0!==B(i,e,s)&&(t.push(i),e=i)}if(1===t.length)return null;var a=t[0],o=t[1];0===B(a,e,o)&&t.shift(),t.push(t[0]);for(var l=this.isExteriorRing()?1:-1,c=this.isExteriorRing()?0:t.length-1,u=this.isExteriorRing()?t.length:-1,h=[],p=c;p!=u;p+=l)h.push([t[p].x,t[p].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],t=1,n=this.events.length;t<n;t++){var r=this.events[t];W.compare(e,r)>0&&(e=r)}for(var i=e.segment.prevInResult(),s=i?i.prevInResult():null;;){if(!i)return null;if(!s)return i.ringOut;if(s.ringOut!==i.ringOut)return s.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=s.prevInResult(),s=i?i.prevInResult():null}}}]),t}(),Q=function(){function t(n){e(this,t),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return n(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(var t=0,n=this.interiorRings.length;t<n;t++){var r=this.interiorRings[t].getGeom();null!==r&&e.push(r)}return e}}]),t}(),ee=function(){function t(n){e(this,t),this.rings=n,this.polys=this._composePolys(n)}return n(t,[{key:"getGeom",value:function(){for(var e=[],t=0,n=this.polys.length;t<n;t++){var r=this.polys[t].getGeom();null!==r&&e.push(r)}return e}},{key:"_composePolys",value:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];if(!i.poly)if(i.isExteriorRing())t.push(new Q(i));else{var s=i.enclosingRing();s.poly||t.push(new Q(s)),s.poly.addInterior(i)}}return t}}]),t}(),te=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:X.compare;e(this,t),this.queue=n,this.tree=new T(r),this.segments=[]}return n(t,[{key:"process",value:function(e){var t,n,r,i=e.segment,s=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(i),s;var a=e.isLeft?this.tree.insert(i):m(t=this.tree).call(t,i);if(!a)throw new Error("Unable to find segment #".concat(i.id," ")+u(n="[".concat(i.leftSE.point.x,", ")).call(n,i.leftSE.point.y,"] -> ")+u(r="[".concat(i.rightSE.point.x,", ")).call(r,i.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var o=a,l=a,c=void 0,h=void 0;void 0===c;)null===(o=this.tree.prev(o))?c=null:void 0===o.key.consumedBy&&(c=o.key);for(;void 0===h;)null===(l=this.tree.next(l))?h=null:void 0===l.key.consumedBy&&(h=l.key);if(e.isLeft){var p=null;if(c){var d=c.getIntersection(i);if(null!==d&&(i.isAnEndpoint(d)||(p=d),!c.isAnEndpoint(d)))for(var f=this._splitSafely(c,d),g=0,_=f.length;g<_;g++)s.push(f[g])}var v=null;if(h){var y=h.getIntersection(i);if(null!==y&&(i.isAnEndpoint(y)||(v=y),!h.isAnEndpoint(y)))for(var b=this._splitSafely(h,y),x=0,T=b.length;x<T;x++)s.push(b[x])}if(null!==p||null!==v){var w=null;w=null===p?v:null===v||W.comparePoints(p,v)<=0?p:v,this.queue.remove(i.rightSE),s.push(i.rightSE);for(var E=i.split(w),S=0,I=E.length;S<I;S++)s.push(E[S])}s.length>0?(this.tree.remove(i),s.push(e)):(this.segments.push(i),i.prev=c)}else{if(c&&h){var M=c.getIntersection(h);if(null!==M){if(!c.isAnEndpoint(M))for(var A=this._splitSafely(c,M),R=0,D=A.length;R<D;R++)s.push(A[R]);if(!h.isAnEndpoint(M))for(var C=this._splitSafely(h,M),O=0,P=C.length;O<P;O++)s.push(C[O])}}this.tree.remove(i)}return s}},{key:"_splitSafely",value:function(e,t){this.tree.remove(e);var n=e.rightSE;this.queue.remove(n);var r=e.split(t);return r.push(n),void 0===e.consumedBy&&this.tree.insert(e),r}}]),t}(),ne="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,re="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,ie=new(function(){function t(){e(this,t)}return n(t,[{key:"run",value:function(e,t,n){ie.type=e,k.reset();for(var r=[new Z(t,!0)],i=0,s=n.length;i<s;i++)r.push(new Z(n[i],!1));if(ie.numMultiPolys=r.length,"difference"===ie.type)for(var a=r[0],o=1;o<r.length;)null!==D(r[o].bbox,a.bbox)?o++:c(r).call(r,o,1);if("intersection"===ie.type)for(var l=0,h=r.length;l<h;l++)for(var p=r[l],d=l+1,m=r.length;d<m;d++)if(null===D(p.bbox,r[d].bbox))return[];for(var f=new T(W.compare),g=0,_=r.length;g<_;g++)for(var v=r[g].getSweepEvents(),y=0,b=v.length;y<b;y++)if(f.insert(v[y]),f.size>ne)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var x=new te(f),w=f.size,E=f.pop();E;){var S=E.key;if(f.size===w){var I,M,A,R,C=S.segment;throw new Error("Unable to pop() ".concat(S.isLeft?"left":"right"," SweepEvent ")+u(I=u(M="[".concat(S.point.x,", ")).call(M,S.point.y,"] from segment #")).call(I,C.id," ")+u(A="[".concat(C.leftSE.point.x,", ")).call(A,C.leftSE.point.y,"] -> ")+u(R="[".concat(C.rightSE.point.x,", ")).call(R,C.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>ne)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(x.segments.length>re)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var O=x.process(S),P=0,N=O.length;P<N;P++){var L=O[P];void 0===L.consumedBy&&f.insert(L)}w=f.size,E=f.pop()}k.reset();var F=J.factory(x.segments);return new ee(F).getGeom()}}]),t}()),se=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ie.run("union",e,n)},ae=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ie.run("intersection",e,n)},oe=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ie.run("xor",e,n)},le=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ie.run("difference",e,n)};return{union:se,intersection:ae,xor:oe,difference:le}}()},39058:function(e,t,n){var r=n(51791),i=n(35704),s=n(90143),a=n(76555);e.exports=function(){function e(e,r,i,s,a){!function e(n,r,i,s,a){for(;s>i;){if(s-i>600){var o=s-i+1,l=r-i+1,c=Math.log(o),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(o-u)/o)*(l-o/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/o+h)),Math.min(s,Math.floor(r+(o-l)*u/o+h)),a)}var p=n[r],d=i,m=s;for(t(n,i,r),a(n[s],p)>0&&t(n,i,s);d<m;){for(t(n,d,m),d++,m--;a(n[d],p)<0;)d++;for(;a(n[m],p)>0;)m--}0===a(n[i],p)?t(n,i,m):t(n,++m,s),m<=r&&(i=m+1),r<=m&&(s=m-1)}}(e,r,i||0,s||e.length-1,a||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return e<t?-1:e>t?1:0}var o=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function l(e,t,n){if(!n)return r(t).call(t,e);for(var i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function c(e,t){u(e,0,e.children.length,t,e)}function u(e,t,n,r,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var s=t;s<n;s++){var a=e.children[s];h(i,e.leaf?r(a):a)}return i}function h(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function p(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,n,r,i,s){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var o=n+Math.ceil((r-n)/i/2)*i;e(t,o,n,r,s),a.push(n,o,o,r)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(e){var t=this.data,n=[];if(!_(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var s=0;s<t.children.length;s++){var a=t.children[s],o=t.leaf?r(a):a;_(e,o)&&(t.leaf?n.push(a):g(e,o)?this._all(a,n):i.push(a))}t=i.pop()}return n},o.prototype.collides=function(e){var t=this.data;if(!_(e,t))return!1;for(var n=[];t;){for(var r=0;r<t.children.length;r++){var i=t.children[r],s=t.leaf?this.toBBox(i):i;if(_(e,s)){if(t.leaf||g(e,s))return!0;n.push(i)}}t=n.pop()}return!1},o.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var n=this._build(i(e).call(e),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},o.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},o.prototype.clear=function(){return this.data=v([]),this},o.prototype.remove=function(e,t){if(!e)return this;for(var n,r,i,a=this.data,o=this.toBBox(e),c=[],u=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=u.pop(),i=!0),a.leaf){var h,p=l(e,a.children,t);if(-1!==p)return s(h=a.children).call(h,p,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),u.push(n),n=0,r=a,a=a.children[0])}return this},o.prototype.toBBox=function(e){return e},o.prototype.compareMinX=function(e,t){return e.minX-t.minX},o.prototype.compareMinY=function(e,t){return e.minY-t.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(e){return this.data=e,this},o.prototype._all=function(e,t){for(var n=[];e;)e.leaf?t.push.apply(t,e.children):n.push.apply(n,e.children),e=n.pop();return t},o.prototype._build=function(e,t,n,r){var s,a=n-t+1,o=this._maxEntries;if(a<=o)return c(s=v(i(e).call(e,t,n+1)),this.toBBox),s;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(s=v([])).leaf=!1,s.height=r;var l=Math.ceil(a/o),u=l*Math.ceil(Math.sqrt(o));y(e,t,n,u,this.compareMinX);for(var h=t;h<=n;h+=u){var p=Math.min(h+u-1,n);y(e,h,p,l,this.compareMinY);for(var d=h;d<=p;d+=l){var m=Math.min(d+l-1,p);s.children.push(this._build(e,d,m,r-1))}}return c(s,this.toBBox),s},o.prototype._chooseSubtree=function(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){for(var i=1/0,s=1/0,a=void 0,o=0;o<t.children.length;o++){var l=t.children[o],c=m(l),u=(h=e,p=l,(Math.max(p.maxX,h.maxX)-Math.min(p.minX,h.minX))*(Math.max(p.maxY,h.maxY)-Math.min(p.minY,h.minY))-c);u<s?(s=u,i=c<i?c:i,a=l):u===s&&c<i&&(i=c,a=l)}t=a||t.children[0]}var h,p;return t},o.prototype._insert=function(e,t,n){var r=n?e:this.toBBox(e),i=[],s=this._chooseSubtree(r,this.data,t,i);for(s.children.push(e),h(s,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},o.prototype._split=function(e,t){var n,r=e[t],i=r.children.length,a=this._minEntries;this._chooseSplitAxis(r,a,i);var o=this._chooseSplitIndex(r,a,i),l=v(s(n=r.children).call(n,o,r.children.length-o));l.height=r.height,l.leaf=r.leaf,c(r,this.toBBox),c(l,this.toBBox),t?e[t-1].children.push(l):this._splitRoot(r,l)},o.prototype._splitRoot=function(e,t){this.data=v([e,t]),this.data.height=e.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,s,a,o,l,c,h=1/0,p=1/0,d=t;d<=n-t;d++){var f=u(e,0,d,this.toBBox),g=u(e,d,n,this.toBBox),_=(i=f,s=g,a=void 0,o=void 0,l=void 0,c=void 0,a=Math.max(i.minX,s.minX),o=Math.max(i.minY,s.minY),l=Math.min(i.maxX,s.maxX),c=Math.min(i.maxY,s.maxY),Math.max(0,l-a)*Math.max(0,c-o)),v=m(f)+m(g);_<h?(h=_,r=d,p=v<p?v:p):_===h&&v<p&&(p=v,r=d)}return r||n-t},o.prototype._chooseSplitAxis=function(e,t,n){var r,i=e.leaf?this.compareMinX:p,s=e.leaf?this.compareMinY:d;this._allDistMargin(e,t,n,i)<this._allDistMargin(e,t,n,s)&&a(r=e.children).call(r,i)},o.prototype._allDistMargin=function(e,t,n,r){var i;a(i=e.children).call(i,r);for(var s=this.toBBox,o=u(e,0,t,s),l=u(e,n-t,n,s),c=f(o)+f(l),p=t;p<n-t;p++){var d=e.children[p];h(o,e.leaf?s(d):d),c+=f(o)}for(var m=n-t-1;m>=t;m--){var g=e.children[m];h(l,e.leaf?s(g):g),c+=f(l)}return c},o.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)h(t[r],e)},o.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--){var i;0===e[t].children.length?t>0?s(i=n=e[t-1].children).call(i,r(n).call(n,e[t]),1):this.clear():c(e[t],this.toBBox)}},o}()},27327:function(e){e.exports=function(e){for(var t=e.length,n=e[e.length-1],r=t,i=t-2;i>=0;--i){var s=n,a=e[i];(l=a-((n=s+a)-s))&&(e[--r]=n,n=l)}var o=0;for(i=r;i<t;++i){var l;s=e[i];(l=(a=n)-((n=s+a)-s))&&(e[o++]=l)}return e[o++]=n,e.length=o,e}},3019:function(e){e.exports=function(e){var t=0,n=e.length;switch(n){case 1:t=e[0];break;case 2:t=e[0]+e[1];break;case 3:t=e[0]+e[1]+e[2];break;case 4:t=e[0]+e[1]+e[2]+e[3];break;default:for(var r=0;r<n;r++)t+=e[r]}return t}},83163:function(e,t,n){var r=n(8571),i=n(49059),s=n(43632),a=n(34659),o=n(87981);function l(e,t,n,r){return function(n,i,s){var a=e(e(t(i[1],s[0]),t(-s[1],i[0])),e(t(n[1],i[0]),t(-i[1],n[0]))),o=e(t(n[1],s[0]),t(-s[1],n[0])),l=r(a,o);return l[l.length-1]}}function c(e,t,n,r){return function(i,s,a,o){var l=e(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]),e(n(e(t(s[1],o[0]),t(-o[1],s[0])),-a[2]),n(e(t(s[1],a[0]),t(-a[1],s[0])),o[2]))),e(n(e(t(s[1],o[0]),t(-o[1],s[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),o[2])))),c=e(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),e(n(e(t(s[1],a[0]),t(-a[1],s[0])),i[2]),e(n(e(t(i[1],a[0]),t(-a[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),a[2])))),u=r(l,c);return u[u.length-1]}}function u(e,t,n,r){return function(i,s,a,o,l){var c=e(e(e(n(e(n(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(n(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),s[3]),e(n(e(n(e(t(o[1],l[0]),t(-l[1],o[0])),s[2]),e(n(e(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),n(e(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),-a[3]),n(e(n(e(t(a[1],l[0]),t(-l[1],a[0])),s[2]),e(n(e(t(s[1],l[0]),t(-l[1],s[0])),-a[2]),n(e(t(s[1],a[0]),t(-a[1],s[0])),l[2]))),o[3]))),e(n(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]),e(n(e(t(s[1],o[0]),t(-o[1],s[0])),-a[2]),n(e(t(s[1],a[0]),t(-a[1],s[0])),o[2]))),-l[3]),e(n(e(n(e(t(o[1],l[0]),t(-l[1],o[0])),s[2]),e(n(e(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),n(e(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),i[3]),n(e(n(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(n(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),-s[3])))),e(e(n(e(n(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(n(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),o[3]),e(n(e(n(e(t(s[1],o[0]),t(-o[1],s[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),o[2]))),-l[3]),n(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]),e(n(e(t(s[1],o[0]),t(-o[1],s[0])),-a[2]),n(e(t(s[1],a[0]),t(-a[1],s[0])),o[2]))),i[3]))),e(n(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-s[3]),e(n(e(n(e(t(s[1],o[0]),t(-o[1],s[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),o[2]))),a[3]),n(e(n(e(t(s[1],a[0]),t(-a[1],s[0])),i[2]),e(n(e(t(i[1],a[0]),t(-a[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),a[2]))),-o[3]))))),u=e(e(e(n(e(n(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(n(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),i[3]),n(e(n(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(n(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),-a[3])),e(n(e(n(e(t(a[1],l[0]),t(-l[1],a[0])),i[2]),e(n(e(t(i[1],l[0]),t(-l[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),l[2]))),o[3]),n(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-l[3]))),e(e(n(e(n(e(t(a[1],l[0]),t(-l[1],a[0])),s[2]),e(n(e(t(s[1],l[0]),t(-l[1],s[0])),-a[2]),n(e(t(s[1],a[0]),t(-a[1],s[0])),l[2]))),i[3]),n(e(n(e(t(a[1],l[0]),t(-l[1],a[0])),i[2]),e(n(e(t(i[1],l[0]),t(-l[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),l[2]))),-s[3])),e(n(e(n(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(n(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),a[3]),n(e(n(e(t(s[1],a[0]),t(-a[1],s[0])),i[2]),e(n(e(t(i[1],a[0]),t(-a[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),a[2]))),-l[3])))),h=r(c,u);return h[h.length-1]}}function h(e){return(3===e?l:4===e?c:u)(s,i,a,o)}var p=h(3),d=h(4),m=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,n){var r,i=(e[1]-n[1])*(t[0]-n[0]),s=(e[0]-n[0])*(t[1]-n[1]),a=i-s;if(i>0){if(s<=0)return a;r=i+s}else{if(!(i<0))return a;if(s>=0)return a;r=-(i+s)}var o=33306690738754716e-32*r;return a>=o||a<=-o?a:p(e,t,n)},function(e,t,n,r){var i=e[0]-r[0],s=t[0]-r[0],a=n[0]-r[0],o=e[1]-r[1],l=t[1]-r[1],c=n[1]-r[1],u=e[2]-r[2],h=t[2]-r[2],p=n[2]-r[2],m=s*c,f=a*l,g=a*o,_=i*c,v=i*l,y=s*o,b=u*(m-f)+h*(g-_)+p*(v-y),x=7771561172376103e-31*((Math.abs(m)+Math.abs(f))*Math.abs(u)+(Math.abs(g)+Math.abs(_))*Math.abs(h)+(Math.abs(v)+Math.abs(y))*Math.abs(p));return b>x||-b>x?b:d(e,t,n,r)}];function f(e){var t=m[e.length];return t||(t=m[e.length]=h(e.length)),t.apply(void 0,e)}function g(e,t,n,r,i,s,a){return function(t,n,o,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return r(t,n);case 3:return i(t,n,o);case 4:return s(t,n,o,l);case 5:return a(t,n,o,l,c)}for(var u=new Array(arguments.length),h=0;h<arguments.length;++h)u[h]=arguments[h];return e(u)}}!function(){for(var t;m.length<=5;)m.push(h(m.length));e.exports=g.apply(void 0,r(t=[f]).call(t,m));for(var n=0;n<=5;++n)e.exports[n]=m[n]}()},35482:function(e,t,n){var r=n(57445);!function(e){const t=134217729,n=33306690738754706e-32;function i(e,t,n,r,i){let s,a,o,l,c=t[0],u=r[0],h=0,p=0;u>c==u>-c?(s=c,c=t[++h]):(s=u,u=r[++p]);let d=0;if(h<e&&p<n)for(u>c==u>-c?(o=s-((a=c+s)-c),c=t[++h]):(o=s-((a=u+s)-u),u=r[++p]),s=a,0!==o&&(i[d++]=o);h<e&&p<n;)u>c==u>-c?(o=s-((a=s+c)-(l=a-s))+(c-l),c=t[++h]):(o=s-((a=s+u)-(l=a-s))+(u-l),u=r[++p]),s=a,0!==o&&(i[d++]=o);for(;h<e;)o=s-((a=s+c)-(l=a-s))+(c-l),c=t[++h],s=a,0!==o&&(i[d++]=o);for(;p<n;)o=s-((a=s+u)-(l=a-s))+(u-l),u=r[++p],s=a,0!==o&&(i[d++]=o);return 0===s&&0!==d||(i[d++]=s),d}function s(e){return new Float64Array(e)}const a=33306690738754716e-32,o=22204460492503146e-32,l=11093356479670487e-47,c=s(4),u=s(8),h=s(12),p=s(16),d=s(4);e.orient2d=function(e,r,s,m,f,g){const _=(r-g)*(s-f),v=(e-f)*(m-g),y=_-v;if(0===_||0===v||_>0!=v>0)return y;const b=Math.abs(_+v);return Math.abs(y)>=a*b?y:-function(e,r,s,a,m,f,g){let _,v,y,b,x,T,w,E,S,I,M,A,R,D,C,O,P,N;const L=e-m,k=s-m,F=r-f,U=a-f;x=(C=(E=L-(w=(T=t*L)-(T-L)))*(I=U-(S=(T=t*U)-(T-U)))-((D=L*U)-w*S-E*S-w*I))-(M=C-(P=(E=F-(w=(T=t*F)-(T-F)))*(I=k-(S=(T=t*k)-(T-k)))-((O=F*k)-w*S-E*S-w*I))),c[0]=C-(M+x)+(x-P),x=(R=D-((A=D+M)-(x=A-D))+(M-x))-(M=R-O),c[1]=R-(M+x)+(x-O),x=(N=A+M)-A,c[2]=A-(N-x)+(M-x),c[3]=N;let B=function(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}(4,c),j=o*g;if(B>=j||-B>=j)return B;if(_=e-(L+(x=e-L))+(x-m),y=s-(k+(x=s-k))+(x-m),v=r-(F+(x=r-F))+(x-f),b=a-(U+(x=a-U))+(x-f),0===_&&0===v&&0===y&&0===b)return B;if(j=l*g+n*Math.abs(B),(B+=L*b+U*_-(F*y+k*v))>=j||-B>=j)return B;x=(C=(E=_-(w=(T=t*_)-(T-_)))*(I=U-(S=(T=t*U)-(T-U)))-((D=_*U)-w*S-E*S-w*I))-(M=C-(P=(E=v-(w=(T=t*v)-(T-v)))*(I=k-(S=(T=t*k)-(T-k)))-((O=v*k)-w*S-E*S-w*I))),d[0]=C-(M+x)+(x-P),x=(R=D-((A=D+M)-(x=A-D))+(M-x))-(M=R-O),d[1]=R-(M+x)+(x-O),x=(N=A+M)-A,d[2]=A-(N-x)+(M-x),d[3]=N;const G=i(4,c,4,d,u);x=(C=(E=L-(w=(T=t*L)-(T-L)))*(I=b-(S=(T=t*b)-(T-b)))-((D=L*b)-w*S-E*S-w*I))-(M=C-(P=(E=F-(w=(T=t*F)-(T-F)))*(I=y-(S=(T=t*y)-(T-y)))-((O=F*y)-w*S-E*S-w*I))),d[0]=C-(M+x)+(x-P),x=(R=D-((A=D+M)-(x=A-D))+(M-x))-(M=R-O),d[1]=R-(M+x)+(x-O),x=(N=A+M)-A,d[2]=A-(N-x)+(M-x),d[3]=N;const z=i(G,u,4,d,h);x=(C=(E=_-(w=(T=t*_)-(T-_)))*(I=b-(S=(T=t*b)-(T-b)))-((D=_*b)-w*S-E*S-w*I))-(M=C-(P=(E=v-(w=(T=t*v)-(T-v)))*(I=y-(S=(T=t*y)-(T-y)))-((O=v*y)-w*S-E*S-w*I))),d[0]=C-(M+x)+(x-P),x=(R=D-((A=D+M)-(x=A-D))+(M-x))-(M=R-O),d[1]=R-(M+x)+(x-O),x=(N=A+M)-A,d[2]=A-(N-x)+(M-x),d[3]=N;const V=i(z,h,4,d,p);return p[V-1]}(e,r,s,m,f,g,b)},e.orient2dfast=function(e,t,n,r,i,s){return(t-s)*(n-i)-(e-i)*(r-s)},r(e,"__esModule",{value:!0})}(t)},34659:function(e,t,n){var r=n(49059),i=n(83623);e.exports=function(e,t){var n=e.length;if(1===n){var s=r(e[0],t);return s[0]?s:[s[1]]}var a=new Array(2*n),o=[.1,.1],l=[.1,.1],c=0;r(e[0],t,o),o[0]&&(a[c++]=o[0]);for(var u=1;u<n;++u){r(e[u],t,l);var h=o[1];i(h,l[0],o),o[0]&&(a[c++]=o[0]);var p=l[1],d=o[1],m=p+d,f=d-(m-p);o[1]=m,f&&(a[c++]=f)}o[1]&&(a[c++]=o[1]);0===c&&(a[c++]=0);return a.length=c,a}},42988:function(e,t,n){e.exports=function(e,t,n,i){var s=r(e,n,i),a=r(t,n,i);if(s>0&&a>0||s<0&&a<0)return!1;var o=r(n,e,t),l=r(i,e,t);if(o>0&&l>0||o<0&&l<0)return!1;if(0===s&&0===a&&0===o&&0===l)return function(e,t,n,r){for(var i=0;i<2;++i){var s=e[i],a=t[i],o=Math.min(s,a),l=Math.max(s,a),c=n[i],u=r[i],h=Math.min(c,u);if(Math.max(c,u)<o||l<h)return!1}return!0}(e,t,n,i);return!0};var r=n(83163)[3]},87981:function(e){e.exports=function(e,t){var n=0|e.length,r=0|t.length;if(1===n&&1===r)return function(e,t){var n=e+t,r=n-e,i=e-(n-r)+(t-r);if(i)return[i,n];return[n]}(e[0],-t[0]);var i,s,a=new Array(n+r),o=0,l=0,c=0,u=Math.abs,h=e[l],p=u(h),d=-t[c],m=u(d);p<m?(s=h,(l+=1)<n&&(h=e[l],p=u(h))):(s=d,(c+=1)<r&&(d=-t[c],m=u(d)));l<n&&p<m||c>=r?(i=h,(l+=1)<n&&(h=e[l],p=u(h))):(i=d,(c+=1)<r&&(d=-t[c],m=u(d)));var f,g,_=i+s,v=_-i,y=s-v,b=y,x=_;for(;l<n&&c<r;)p<m?(i=h,(l+=1)<n&&(h=e[l],p=u(h))):(i=d,(c+=1)<r&&(d=-t[c],m=u(d))),(y=(s=b)-(v=(_=i+s)-i))&&(a[o++]=y),b=x-((f=x+_)-(g=f-x))+(_-g),x=f;for(;l<n;)(y=(s=b)-(v=(_=(i=h)+s)-i))&&(a[o++]=y),b=x-((f=x+_)-(g=f-x))+(_-g),x=f,(l+=1)<n&&(h=e[l]);for(;c<r;)(y=(s=b)-(v=(_=(i=d)+s)-i))&&(a[o++]=y),b=x-((f=x+_)-(g=f-x))+(_-g),x=f,(c+=1)<r&&(d=-t[c]);b&&(a[o++]=b);x&&(a[o++]=x);o||(a[o++]=0);return a.length=o,a}},43632:function(e){e.exports=function(e,t){var n=0|e.length,r=0|t.length;if(1===n&&1===r)return function(e,t){var n=e+t,r=n-e,i=e-(n-r)+(t-r);if(i)return[i,n];return[n]}(e[0],t[0]);var i,s,a=new Array(n+r),o=0,l=0,c=0,u=Math.abs,h=e[l],p=u(h),d=t[c],m=u(d);p<m?(s=h,(l+=1)<n&&(h=e[l],p=u(h))):(s=d,(c+=1)<r&&(d=t[c],m=u(d)));l<n&&p<m||c>=r?(i=h,(l+=1)<n&&(h=e[l],p=u(h))):(i=d,(c+=1)<r&&(d=t[c],m=u(d)));var f,g,_=i+s,v=_-i,y=s-v,b=y,x=_;for(;l<n&&c<r;)p<m?(i=h,(l+=1)<n&&(h=e[l],p=u(h))):(i=d,(c+=1)<r&&(d=t[c],m=u(d))),(y=(s=b)-(v=(_=i+s)-i))&&(a[o++]=y),b=x-((f=x+_)-(g=f-x))+(_-g),x=f;for(;l<n;)(y=(s=b)-(v=(_=(i=h)+s)-i))&&(a[o++]=y),b=x-((f=x+_)-(g=f-x))+(_-g),x=f,(l+=1)<n&&(h=e[l]);for(;c<r;)(y=(s=b)-(v=(_=(i=d)+s)-i))&&(a[o++]=y),b=x-((f=x+_)-(g=f-x))+(_-g),x=f,(c+=1)<r&&(d=t[c]);b&&(a[o++]=b);x&&(a[o++]=x);o||(a[o++]=0);return a.length=o,a}},92007:function(e,t,n){var r;!function(){function i(e,t,n){var r=t.x,i=t.y,s=n.x-r,a=n.y-i;if(0!==s||0!==a){var o=((e.x-r)*s+(e.y-i)*a)/(s*s+a*a);o>1?(r=n.x,i=n.y):o>0&&(r+=s*o,i+=a*o)}return(s=e.x-r)*s+(a=e.y-i)*a}function s(e,t,n,r,a){for(var o,l=r,c=t+1;c<n;c++){var u=i(e[c],e[t],e[n]);u>l&&(o=c,l=u)}l>r&&(o-t>1&&s(e,t,o,r,a),a.push(e[o]),n-o>1&&s(e,o,n,r,a))}function a(e,t){var n=e.length-1,r=[e[0]];return s(e,0,n,t,r),r.push(e[n]),r}function o(e,t,n){if(e.length<=2)return e;var r=void 0!==t?t*t:1;return e=n?e:function(e,t){for(var n,r,i,s,a,o=e[0],l=[o],c=1,u=e.length;c<u;c++)n=e[c],i=o,s=void 0,a=void 0,s=(r=n).x-i.x,a=r.y-i.y,s*s+a*a>t&&(l.push(n),o=n);return o!==n&&l.push(n),l}(e,r),e=a(e,r)}void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},41359:function(e,t,n){n.r(t),n.d(t,{default:function(){return r}});class r{constructor(e=[],t=i){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,r=t[e];for(;e>0;){const i=e-1>>1,s=t[i];if(n(r,s)>=0)break;t[e]=s,e=i}t[e]=r}_down(e){const{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=1+(e<<1),s=t[r];const a=r+1;if(a<this.length&&n(t[a],s)<0&&(r=a,s=t[a]),n(s,i)>=0)break;t[e]=s,e=r}t[e]=i}}function i(e,t){return e<t?-1:e>t?1:0}},49059:function(e){e.exports=function(e,n,r){var i=e*n,s=t*e,a=s-(s-e),o=e-a,l=t*n,c=l-(l-n),u=n-c,h=o*u-(i-a*c-o*c-a*u);if(r)return r[0]=h,r[1]=i,r;return[h,i]};var t=+(Math.pow(2,27)+1)},83623:function(e){e.exports=function(e,t,n){var r=e+t,i=r-e,s=t-i,a=e-(r-i);if(n)return n[0]=a+s,n[1]=r,n;return[a+s,r]}},95299:function(e,t,n){var r=n(27698);e.exports=r},83450:function(e,t,n){var r=n(83363);e.exports=r},83865:function(e,t,n){var r=n(41793);e.exports=r},5316:function(e,t,n){var r=n(57784);e.exports=r},66820:function(e,t,n){var r=n(56243);e.exports=r},5023:function(e,t,n){var r=n(72369);e.exports=r},90093:function(e,t,n){var r=n(28196);e.exports=r},82772:function(e,t,n){var r=n(8065);e.exports=r},24439:function(e,t,n){var r=n(53370);e.exports=r},40327:function(e,t,n){var r=n(95247);e.exports=r},83354:function(e,t,n){var r=n(57448);e.exports=r},9314:function(e,t,n){var r=n(29455);e.exports=r},17601:function(e,t,n){var r=n(69743);e.exports=r},3688:function(e,t,n){var r=n(11955);e.exports=r},78212:function(e,t,n){var r=n(96064);e.exports=r},39641:function(e,t,n){var r=n(61577);e.exports=r},3282:function(e,t,n){var r=n(48842);e.exports=r},57660:function(e,t,n){var r=n(34913);e.exports=r},83838:function(e,t,n){var r=n(46279);e.exports=r},55712:function(e,t,n){var r=n(33778);e.exports=r},15684:function(e,t,n){var r=n(19373);e.exports=r},41147:function(e,t,n){var r=n(73819);e.exports=r},40682:function(e,t,n){var r=n(11022);e.exports=r},12548:function(e,t,n){var r=n(61798);e.exports=r},46655:function(e,t,n){var r=n(17911);e.exports=r},62089:function(e,t,n){var r=n(88906);e.exports=r},37276:function(e,t,n){var r=n(52527);e.exports=r},5501:function(e,t,n){var r=n(36857);e.exports=r},99826:function(e,t,n){var r=n(28427);e.exports=r},84234:function(e,t,n){var r=n(82073);e.exports=r},55576:function(e,t,n){var r=n(45286);e.exports=r},7328:function(e,t,n){var r=n(62856);e.exports=r},90900:function(e,t,n){var r=n(2348);e.exports=r},75598:function(e,t,n){var r=n(35178);e.exports=r},37394:function(e,t,n){var r=n(87169);e.exports=r},96279:function(e,t,n){var r=n(76361);e.exports=r},79401:function(e,t,n){var r=n(62908);e.exports=r},57679:function(e,t,n){var r=n(8933);e.exports=r},92182:function(e,t,n){var r=n(15868);e.exports=r},66792:function(e,t,n){var r=n(80188);e.exports=r},87101:function(e,t,n){var r=n(79002);e.exports=r},28436:function(e,t,n){var r=n(21917);e.exports=r},60043:function(e,t,n){var r=n(65138);e.exports=r},97498:function(e,t,n){var r=n(60155);e.exports=r},72319:function(e,t,n){var r=n(55169);e.exports=r},36629:function(e,t,n){var r=n(14873);e.exports=r},38396:function(e,t,n){var r=n(61799);e.exports=r},9965:function(e,t,n){var r=n(38849);e.exports=r},58168:function(e,t,n){var r=n(76258);e.exports=r},83592:function(e,t,n){var r=n(42119);e.exports=r},65362:function(e,t,n){var r=n(63383);e.exports=r},32271:function(e,t,n){var r=n(14471);e.exports=r},91254:function(e,t,n){var r=n(57396);e.exports=r},43536:function(e,t,n){var r=n(41910);e.exports=r},36024:function(e,t,n){var r=n(86209);e.exports=r},23427:function(e,t,n){var r=n(35021);e.exports=r},37331:function(e,t,n){var r=n(79427);e.exports=r},68522:function(e,t,n){var r=n(62857);e.exports=r},62183:function(e,t,n){var r=n(64477);e.exports=r},73151:function(e,t,n){var r=n(9534);e.exports=r},99565:function(e,t,n){var r=n(96507);e.exports=r},45012:function(e,t,n){var r=n(23059);e.exports=r},78690:function(e,t,n){var r=n(16670);e.exports=r},1610:function(e,t,n){var r=n(47795);e.exports=r},42679:function(e,t,n){var r=n(66877);e.exports=r},34116:function(e,t,n){var r=n(74888);e.exports=r},25626:function(e,t,n){var r=n(27460);e.exports=r},84670:function(e,t,n){var r=n(61895);e.exports=r},54942:function(e,t,n){var r=n(43474);e.exports=r},55057:function(e,t,n){var r=n(27989);e.exports=r},66082:function(e,t,n){var r=n(5519);e.exports=r},31626:function(e,t,n){var r=n(21194);e.exports=r},48439:function(e,t,n){var r=n(88004);e.exports=r},80281:function(e,t,n){var r=n(92547);e.exports=r},40031:function(e,t,n){var r=n(46509);e.exports=r},17487:function(e,t,n){var r=n(35774);e.exports=r},47877:function(e,t,n){var r=n(57641);e.exports=r},91718:function(e,t,n){var r=n(72010);e.exports=r},89002:function(e,t,n){var r=n(93726);e.exports=r},54493:function(e,t,n){n(77971),n(53242);var r=n(54058);e.exports=r.Array.from},24034:function(e,t,n){n(92737);var r=n(54058);e.exports=r.Array.isArray},87716:function(e,t,n){n(94481);var r=n(35703);e.exports=r("Array").at},15367:function(e,t,n){n(85906);var r=n(35703);e.exports=r("Array").concat},81388:function(e,t,n){n(72455);var r=n(35703);e.exports=r("Array").copyWithin},12710:function(e,t,n){n(66274),n(55967);var r=n(35703);e.exports=r("Array").entries},51459:function(e,t,n){n(48851);var r=n(35703);e.exports=r("Array").every},6172:function(e,t,n){n(80290);var r=n(35703);e.exports=r("Array").fill},62383:function(e,t,n){n(21501);var r=n(35703);e.exports=r("Array").filter},60009:function(e,t,n){n(44929);var r=n(35703);e.exports=r("Array").findIndex},17671:function(e,t,n){n(80833);var r=n(35703);e.exports=r("Array").find},44373:function(e,t,n){n(94944),n(1107);var r=n(35703);e.exports=r("Array").flat},99324:function(e,t,n){n(2437);var r=n(35703);e.exports=r("Array").forEach},80991:function(e,t,n){n(97690);var r=n(35703);e.exports=r("Array").includes},8700:function(e,t,n){n(99076);var r=n(35703);e.exports=r("Array").indexOf},95909:function(e,t,n){n(66274),n(55967);var r=n(35703);e.exports=r("Array").keys},6442:function(e,t,n){n(75915);var r=n(35703);e.exports=r("Array").lastIndexOf},23866:function(e,t,n){n(68787);var r=n(35703);e.exports=r("Array").map},52999:function(e,t,n){n(81876);var r=n(35703);e.exports=r("Array").reduce},91876:function(e,t,n){n(11490);var r=n(35703);e.exports=r("Array").reverse},24900:function(e,t,n){n(60186);var r=n(35703);e.exports=r("Array").slice},3824:function(e,t,n){n(36026);var r=n(35703);e.exports=r("Array").some},2948:function(e,t,n){n(4115);var r=n(35703);e.exports=r("Array").sort},78209:function(e,t,n){n(98611);var r=n(35703);e.exports=r("Array").splice},14423:function(e,t,n){n(66274),n(55967);var r=n(35703);e.exports=r("Array").values},81103:function(e,t,n){n(95160);var r=n(54058);e.exports=r.Date.now},27700:function(e,t,n){n(73381);var r=n(35703);e.exports=r("Function").bind},13830:function(e,t,n){n(66274),n(77971);var r=n(22902);e.exports=r},91031:function(e,t,n){n(52595),e.exports=n(21899)},16246:function(e,t,n){var r=n(7046),i=n(27700),s=Function.prototype;e.exports=function(e){var t=e.bind;return e===s||r(s,e)&&t===s.bind?i:t}},56043:function(e,t,n){var r=n(7046),i=n(15367),s=Array.prototype;e.exports=function(e){var t=e.concat;return e===s||r(s,e)&&t===s.concat?i:t}},58422:function(e,t,n){var r=n(7046),i=n(81388),s=Array.prototype;e.exports=function(e){var t=e.copyWithin;return e===s||r(s,e)&&t===s.copyWithin?i:t}},1727:function(e,t,n){var r=n(7046),i=n(17796),s=String.prototype;e.exports=function(e){var t=e.endsWith;return"string"==typeof e||e===s||r(s,e)&&t===s.endsWith?i:t}},13160:function(e,t,n){var r=n(7046),i=n(51459),s=Array.prototype;e.exports=function(e){var t=e.every;return e===s||r(s,e)&&t===s.every?i:t}},80446:function(e,t,n){var r=n(7046),i=n(6172),s=Array.prototype;e.exports=function(e){var t=e.fill;return e===s||r(s,e)&&t===s.fill?i:t}},2480:function(e,t,n){var r=n(7046),i=n(62383),s=Array.prototype;e.exports=function(e){var t=e.filter;return e===s||r(s,e)&&t===s.filter?i:t}},7147:function(e,t,n){var r=n(7046),i=n(60009),s=Array.prototype;e.exports=function(e){var t=e.findIndex;return e===s||r(s,e)&&t===s.findIndex?i:t}},32236:function(e,t,n){var r=n(7046),i=n(17671),s=Array.prototype;e.exports=function(e){var t=e.find;return e===s||r(s,e)&&t===s.find?i:t}},66793:function(e,t,n){var r=n(7046),i=n(11677),s=RegExp.prototype;e.exports=function(e){return e===s||r(s,e)?i(e):e.flags}},68098:function(e,t,n){var r=n(7046),i=n(44373),s=Array.prototype;e.exports=function(e){var t=e.flat;return e===s||r(s,e)&&t===s.flat?i:t}},58557:function(e,t,n){var r=n(7046),i=n(80991),s=n(21631),a=Array.prototype,o=String.prototype;e.exports=function(e){var t=e.includes;return e===a||r(a,e)&&t===a.includes?i:"string"==typeof e||e===o||r(o,e)&&t===o.includes?s:t}},34570:function(e,t,n){var r=n(7046),i=n(8700),s=Array.prototype;e.exports=function(e){var t=e.indexOf;return e===s||r(s,e)&&t===s.indexOf?i:t}},57564:function(e,t,n){var r=n(7046),i=n(6442),s=Array.prototype;e.exports=function(e){var t=e.lastIndexOf;return e===s||r(s,e)&&t===s.lastIndexOf?i:t}},88287:function(e,t,n){var r=n(7046),i=n(23866),s=Array.prototype;e.exports=function(e){var t=e.map;return e===s||r(s,e)&&t===s.map?i:t}},75192:function(e,t,n){var r=n(7046),i=n(889),s=String.prototype;e.exports=function(e){var t=e.matchAll;return"string"==typeof e||e===s||r(s,e)&&t===s.matchAll?i:t}},51337:function(e,t,n){var r=n(7046),i=n(49335),s=String.prototype;e.exports=function(e){var t=e.padStart;return"string"==typeof e||e===s||r(s,e)&&t===s.padStart?i:t}},68025:function(e,t,n){var r=n(7046),i=n(52999),s=Array.prototype;e.exports=function(e){var t=e.reduce;return e===s||r(s,e)&&t===s.reduce?i:t}},59257:function(e,t,n){var r=n(7046),i=n(80454),s=String.prototype;e.exports=function(e){var t=e.repeat;return"string"==typeof e||e===s||r(s,e)&&t===s.repeat?i:t}},91060:function(e,t,n){var r=n(7046),i=n(91876),s=Array.prototype;e.exports=function(e){var t=e.reverse;return e===s||r(s,e)&&t===s.reverse?i:t}},69601:function(e,t,n){var r=n(7046),i=n(24900),s=Array.prototype;e.exports=function(e){var t=e.slice;return e===s||r(s,e)&&t===s.slice?i:t}},28299:function(e,t,n){var r=n(7046),i=n(3824),s=Array.prototype;e.exports=function(e){var t=e.some;return e===s||r(s,e)&&t===s.some?i:t}},69355:function(e,t,n){var r=n(7046),i=n(2948),s=Array.prototype;e.exports=function(e){var t=e.sort;return e===s||r(s,e)&&t===s.sort?i:t}},18339:function(e,t,n){var r=n(7046),i=n(78209),s=Array.prototype;e.exports=function(e){var t=e.splice;return e===s||r(s,e)&&t===s.splice?i:t}},71611:function(e,t,n){var r=n(7046),i=n(3269),s=String.prototype;e.exports=function(e){var t=e.startsWith;return"string"==typeof e||e===s||r(s,e)&&t===s.startsWith?i:t}},47987:function(e,t,n){var r=n(7046),i=n(88874),s=String.prototype;e.exports=function(e){var t=e.trimStart;return"string"==typeof e||e===s||r(s,e)&&t===s.trimStart?i:t}},62774:function(e,t,n){var r=n(7046),i=n(13348),s=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===s||r(s,e)&&t===s.trim?i:t}},84426:function(e,t,n){n(32619);var r=n(54058),i=n(79730);r.JSON||(r.JSON={stringify:JSON.stringify}),e.exports=function(e,t,n){return i(r.JSON.stringify,null,arguments)}},91018:function(e,t,n){n(66274),n(37501),n(55967),n(77971);var r=n(54058);e.exports=r.Map},35272:function(e,t,n){n(86833);var r=n(54058);e.exports=r.Math.clz32},70338:function(e,t,n){n(33434);var r=n(54058);e.exports=r.Math.hypot},95213:function(e,t,n){n(53874);var r=n(54058);e.exports=r.Math.imul},22068:function(e,t,n){n(77649);var r=n(54058);e.exports=r.Math.log10},88908:function(e,t,n){n(88359);var r=n(54058);e.exports=r.Math.log2},76837:function(e,t,n){n(25499);var r=n(54058);e.exports=r.Math.sign},97849:function(e,t,n){n(54973),e.exports=Math.pow(2,-52)},26712:function(e,t,n){n(56883);var r=n(54058);e.exports=r.Number.isFinite},3820:function(e,t,n){n(30800);var r=n(54058);e.exports=r.Number.isInteger},70063:function(e,t,n){n(89622);var r=n(54058);e.exports=r.Number.isNaN},4723:function(e,t,n){n(71967),e.exports=9007199254740991},45999:function(e,t,n){n(49221);var r=n(54058);e.exports=r.Object.assign},35254:function(e,t,n){n(53882);var r=n(54058).Object;e.exports=function(e,t){return r.create(e,t)}},7702:function(e,t,n){n(74979);var r=n(54058).Object,i=e.exports=function(e,t){return r.defineProperties(e,t)};r.defineProperties.sham&&(i.sham=!0)},48171:function(e,t,n){n(86450);var r=n(54058).Object,i=e.exports=function(e,t,n){return r.defineProperty(e,t,n)};r.defineProperty.sham&&(i.sham=!0)},73081:function(e,t,n){n(21078);var r=n(54058);e.exports=r.Object.entries},73770:function(e,t,n){n(15711);var r=n(54058);e.exports=r.Object.freeze},286:function(e,t,n){n(46924);var r=n(54058).Object,i=e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)};r.getOwnPropertyDescriptor.sham&&(i.sham=!0)},92766:function(e,t,n){n(88482);var r=n(54058);e.exports=r.Object.getOwnPropertyDescriptors},83288:function(e,t,n){n(9816);var r=n(54058).Object;e.exports=function(e){return r.getOwnPropertyNames(e)}},30498:function(e,t,n){n(35824);var r=n(54058);e.exports=r.Object.getOwnPropertySymbols},13966:function(e,t,n){n(17405);var r=n(54058);e.exports=r.Object.getPrototypeOf},48494:function(e,t,n){n(21724);var r=n(54058);e.exports=r.Object.keys},3065:function(e,t,n){n(90108);var r=n(54058);e.exports=r.Object.setPrototypeOf},98430:function(e,t,n){n(26614);var r=n(54058);e.exports=r.Object.values},7579:function(e,t,n){n(49718);var r=n(54058);e.exports=r.parseFloat},98524:function(e,t,n){n(14038);var r=n(54058);e.exports=r.parseInt},52956:function(e,t,n){n(47627),n(66274),n(55967),n(98881),n(4560),n(91302),n(44349),n(77971);var r=n(54058);e.exports=r.Promise},14983:function(e,t,n){n(7453);var r=n(54058);e.exports=r.Reflect.construct},11677:function(e,t,n){n(94261);var r=n(43613);e.exports=r},76998:function(e,t,n){n(66274),n(55967),n(69008),n(77971);var r=n(54058);e.exports=r.Set},46614:function(e,t,n){n(23809);var r=n(54058);e.exports=r.String.fromCodePoint},12318:function(e,t,n){n(93588);var r=n(35703);e.exports=r("String").at},17796:function(e,t,n){n(1293);var r=n(35703);e.exports=r("String").endsWith},21631:function(e,t,n){n(11035);var r=n(35703);e.exports=r("String").includes},889:function(e,t,n){n(55967),n(67091),n(32199);var r=n(35703);e.exports=r("String").matchAll},49335:function(e,t,n){n(92075);var r=n(35703);e.exports=r("String").padStart},80454:function(e,t,n){n(60986);var r=n(35703);e.exports=r("String").repeat},3269:function(e,t,n){n(94761);var r=n(35703);e.exports=r("String").startsWith},88874:function(e,t,n){n(60350);var r=n(35703);e.exports=r("String").trimLeft},13348:function(e,t,n){n(57398);var r=n(35703);e.exports=r("String").trim},57473:function(e,t,n){n(85906),n(55967),n(35824),n(8555),n(52615),n(21732),n(35903),n(1825),n(28394),n(45915),n(61766),n(62737),n(89911),n(74315),n(63131),n(64714),n(70659),n(69120),n(79413),n(1502);var r=n(54058);e.exports=r.Symbol},24227:function(e,t,n){n(66274),n(55967),n(77971),n(1825);var r=n(11477);e.exports=r.f("iterator")},62978:function(e,t,n){n(18084),n(63131);var r=n(11477);e.exports=r.f("toPrimitive")},32304:function(e,t,n){n(66274),n(55967),n(54334);var r=n(54058);e.exports=r.WeakMap},29567:function(e,t,n){n(66274),n(55967),n(1773);var r=n(54058);e.exports=r.WeakSet},27385:function(e,t,n){e.exports=n(64225)},81522:function(e,t,n){e.exports=n(30382)},2626:function(e,t,n){e.exports=n(83173)},32209:function(e,t,n){e.exports=n(40478)},30888:function(e,t,n){e.exports=n(51403)},66449:function(e,t,n){e.exports=n(74352)},14122:function(e,t,n){e.exports=n(89097)},21086:function(e,t,n){e.exports=n(90898)},19632:function(e,t,n){e.exports=n(41443)},47895:function(e,t,n){e.exports=n(78675)},27759:function(e,t,n){e.exports=n(98022)},66515:function(e,t,n){e.exports=n(68712)},32726:function(e,t,n){e.exports=n(24851)},44442:function(e,t,n){e.exports=n(51675)},57478:function(e,t,n){e.exports=n(46660)},2636:function(e,t,n){e.exports=n(82535)},61218:function(e,t,n){e.exports=n(5311)},8145:function(e,t,n){e.exports=n(14054)},57152:function(e,t,n){e.exports=n(82507)},11408:function(e,t,n){e.exports=n(88255)},69447:function(e,t,n){e.exports=n(628)},56211:function(e,t,n){e.exports=n(29834)},25376:function(e,t,n){e.exports=n(48460)},86942:function(e,t,n){e.exports=n(88698)},89430:function(e,t,n){e.exports=n(70152)},66594:function(e,t,n){e.exports=n(56236)},38096:function(e,t,n){e.exports=n(2622)},79595:function(e,t,n){e.exports=n(48646)},17579:function(e,t,n){e.exports=n(33294)},81493:function(e,t,n){e.exports=n(97088)},4111:function(e,t,n){e.exports=n(70495)},72858:function(e,t,n){e.exports=n(8391)},71777:function(e,t,n){e.exports=n(62792)},75319:function(e,t,n){e.exports=n(28744)},59788:function(e,t,n){e.exports=n(32639)},75425:function(e,t,n){e.exports=n(36384)},99465:function(e,t,n){e.exports=n(63249)},52740:function(e,t,n){e.exports=n(59821)},86672:function(e,t,n){e.exports=n(44574)},6489:function(e,t,n){e.exports=n(73462)},86183:function(e,t,n){e.exports=n(83570)},2753:function(e,t,n){e.exports=n(14919)},53850:function(e,t,n){e.exports=n(44917)},18260:function(e,t,n){e.exports=n(77700)},93376:function(e,t,n){e.exports=n(63145)},78421:function(e,t,n){e.exports=n(89974)},59122:function(e,t,n){e.exports=n(83240)},82320:function(e,t,n){n(51230)},40691:function(e,t,n){e.exports=n(6706)},75632:function(e,t,n){e.exports=n(12237)},60269:function(e,t,n){e.exports=n(76936)},76094:function(e,t,n){e.exports=n(26467)},70573:function(e,t,n){e.exports=n(18180)},73685:function(e,t,n){e.exports=n(80621)},36785:function(e,t,n){e.exports=n(99259)},23252:function(e,t,n){e.exports=n(62793)},27533:function(e,t,n){e.exports=n(48403)},39057:function(e,t,n){e.exports=n(82108)},30034:function(e,t,n){e.exports=n(27585)},84710:function(e,t,n){e.exports=n(14058)},74303:function(e,t,n){e.exports=n(28688)},93799:function(e,t,n){e.exports=n(92093)},55122:function(e,t,n){e.exports=n(5383)},54437:function(e,t,n){e.exports=n(49360)},91645:function(e,t,n){e.exports=n(35796)},53103:function(e,t,n){e.exports=n(36309)},29531:function(e,t,n){e.exports=n(32050)},10856:function(e,t,n){e.exports=n(46733)},21490:function(e,t,n){e.exports=n(6170)},24803:function(e,t,n){e.exports=n(31051)},65743:function(e,t,n){e.exports=n(65309)},33054:function(e,t,n){e.exports=n(29382)},86600:function(e,t,n){e.exports=n(52201)},9759:function(e,t,n){e.exports=n(27398)},71384:function(e,t,n){e.exports=n(26189)},87740:function(e,t,n){e.exports=n(53085)},58714:function(e,t,n){e.exports=n(93463)},82790:function(e,t,n){e.exports=n(35069)},64225:function(e,t,n){var r=n(95299);e.exports=r},30382:function(e,t,n){var r=n(83450);e.exports=r},26627:function(e,t,n){var r=n(83865);n(54322),e.exports=r},83173:function(e,t,n){var r=n(5316);e.exports=r},40478:function(e,t,n){var r=n(66820);e.exports=r},51403:function(e,t,n){n(9668);var r=n(5023);e.exports=r},74352:function(e,t,n){var r=n(7046),i=n(26627),s=n(9499),a=Array.prototype,o=String.prototype;e.exports=function(e){var t=e.at;return e===a||r(a,e)&&t===a.at?i:"string"==typeof e||e===o||r(o,e)&&t===o.at?s:t}},89097:function(e,t,n){var r=n(90093);e.exports=r},90898:function(e,t,n){var r=n(82772);e.exports=r},41443:function(e,t,n){var r=n(24439);e.exports=r},78675:function(e,t,n){var r=n(40327);e.exports=r},98022:function(e,t,n){var r=n(83354);e.exports=r},68712:function(e,t,n){var r=n(9314);e.exports=r},24851:function(e,t,n){var r=n(17601);e.exports=r},51675:function(e,t,n){var r=n(3688);e.exports=r},46660:function(e,t,n){var r=n(78212);e.exports=r},82535:function(e,t,n){var r=n(39641);e.exports=r},5311:function(e,t,n){var r=n(3282);e.exports=r},14054:function(e,t,n){var r=n(57660);e.exports=r},82507:function(e,t,n){var r=n(83838);e.exports=r},88255:function(e,t,n){var r=n(55712);e.exports=r},628:function(e,t,n){var r=n(15684);e.exports=r},29834:function(e,t,n){var r=n(41147);e.exports=r},48460:function(e,t,n){var r=n(40682);e.exports=r},88698:function(e,t,n){var r=n(12548);e.exports=r},70152:function(e,t,n){n(79470);var r=n(46655);e.exports=r},56236:function(e,t,n){var r=n(62089);e.exports=r},2622:function(e,t,n){var r=n(37276);e.exports=r},48646:function(e,t,n){var r=n(5501);e.exports=r},33294:function(e,t,n){var r=n(99826);e.exports=r},97088:function(e,t,n){var r=n(84234);e.exports=r},70495:function(e,t,n){var r=n(55576);e.exports=r},8391:function(e,t,n){var r=n(7328);e.exports=r},62792:function(e,t,n){var r=n(90900);e.exports=r},28744:function(e,t,n){var r=n(75598);e.exports=r},32639:function(e,t,n){var r=n(37394);e.exports=r},36384:function(e,t,n){var r=n(96279);e.exports=r},63249:function(e,t,n){var r=n(79401);e.exports=r},59821:function(e,t,n){var r=n(57679);e.exports=r},44574:function(e,t,n){var r=n(92182);n(52453),n(32523),n(66591),n(55121),n(14751),n(52407),n(48580),n(27281),n(36507),n(93647),n(47641),n(18552),n(27693),n(8),n(48514),n(8212),n(89642),n(78485),n(42256),n(68826),e.exports=r},73462:function(e,t,n){var r=n(66792);e.exports=r},83570:function(e,t,n){var r=n(87101);e.exports=r},14919:function(e,t,n){var r=n(28436);e.exports=r},44917:function(e,t,n){var r=n(60043);e.exports=r},77700:function(e,t,n){var r=n(97498);e.exports=r},63145:function(e,t,n){var r=n(72319);e.exports=r},89974:function(e,t,n){var r=n(36629);e.exports=r},83240:function(e,t,n){var r=n(38396);e.exports=r},51230:function(e,t,n){var r=n(9965);e.exports=r},6706:function(e,t,n){var r=n(58168);e.exports=r},12237:function(e,t,n){var r=n(83592);e.exports=r},76936:function(e,t,n){var r=n(65362);e.exports=r},26467:function(e,t,n){var r=n(32271);e.exports=r},18180:function(e,t,n){var r=n(91254);e.exports=r},80621:function(e,t,n){var r=n(43536);e.exports=r},99259:function(e,t,n){var r=n(36024);e.exports=r},62793:function(e,t,n){var r=n(23427);e.exports=r},48403:function(e,t,n){var r=n(37331);e.exports=r},82108:function(e,t,n){var r=n(68522);e.exports=r},27585:function(e,t,n){var r=n(62183);e.exports=r},14058:function(e,t,n){var r=n(73151);e.exports=r},28688:function(e,t,n){var r=n(99565);e.exports=r},92093:function(e,t,n){var r=n(45012);e.exports=r},5383:function(e,t,n){var r=n(78690);e.exports=r},49360:function(e,t,n){var r=n(1610);e.exports=r},35796:function(e,t,n){var r=n(42679);e.exports=r},36309:function(e,t,n){var r=n(34116);e.exports=r},32050:function(e,t,n){var r=n(25626);n(89731),n(55708),n(30014),n(88731),e.exports=r},46733:function(e,t,n){var r=n(84670);e.exports=r},6170:function(e,t,n){var r=n(54942);e.exports=r},31051:function(e,t,n){var r=n(55057);e.exports=r},65309:function(e,t,n){var r=n(66082);n(95800),n(73676),n(32645),n(32578),n(4573),n(17421),n(13787),n(40256),n(52032),n(21873),n(26566),n(50987),n(71892),n(3352),n(76988),n(16875),n(3859),n(56690),e.exports=r},29382:function(e,t,n){var r=n(31626);e.exports=r},9499:function(e,t,n){n(48439),n(54975);var r=n(35703);e.exports=r("String").at},52201:function(e,t,n){var r=n(80281);n(28783),n(43975),n(65799),n(31943),n(46774),n(45414),n(80620),n(36172),e.exports=r},27398:function(e,t,n){var r=n(40031);e.exports=r},26189:function(e,t,n){var r=n(17487);e.exports=r},53085:function(e,t,n){var r=n(47877);e.exports=r},93463:function(e,t,n){var r=n(91718);n(77971),n(86442),n(26207),n(13215),n(4629),n(4055),e.exports=r},35069:function(e,t,n){var r=n(89002);n(77971),n(15896),n(35501),n(22511),n(33309),e.exports=r},24883:function(e,t,n){var r=n(57475),i=n(69826),s=TypeError;e.exports=function(e){if(r(e))return e;throw s(i(e)+" is not a function")}},174:function(e,t,n){var r=n(24284),i=n(69826),s=TypeError;e.exports=function(e){if(r(e))return e;throw s(i(e)+" is not a constructor")}},11851:function(e,t,n){var r=n(57475),i=String,s=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw s("Can't set "+i(e)+" as a prototype")}},18479:function(e){e.exports=function(){}},29900:function(e,t,n){var r=n(64620).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},5743:function(e,t,n){var r=n(7046),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw i("Incorrect invocation")}},96059:function(e,t,n){var r=n(10941),i=String,s=TypeError;e.exports=function(e){if(r(e))return e;throw s(i(e)+" is not an object")}},97135:function(e,t,n){var r=n(95981);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},7139:function(e,t,n){var r=n(89678),i=n(59413),s=n(10623),a=n(15863),o=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),l=s(n),c=i(e,l),u=i(t,l),h=arguments.length>2?arguments[2]:void 0,p=o((void 0===h?l:i(h,l))-u,l-c),d=1;for(u<c&&c<u+p&&(d=-1,u+=p-1,c+=p-1);p-- >0;)u in n?n[c]=n[u]:a(n,c),c+=d,u+=d;return n}},91860:function(e,t,n){var r=n(89678),i=n(59413),s=n(10623);e.exports=function(e){for(var t=r(this),n=s(t),a=arguments.length,o=i(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:i(l,n);c>o;)t[o++]=e;return t}},56837:function(e,t,n){var r=n(3610).forEach,i=n(34194)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},11354:function(e,t,n){var r=n(86843),i=n(78834),s=n(89678),a=n(75196),o=n(6782),l=n(24284),c=n(10623),u=n(55449),h=n(53476),p=n(22902),d=Array;e.exports=function(e){var t=s(e),n=l(this),m=arguments.length,f=m>1?arguments[1]:void 0,g=void 0!==f;g&&(f=r(f,m>2?arguments[2]:void 0));var _,v,y,b,x,T,w=p(t),E=0;if(!w||this===d&&o(w))for(_=c(t),v=n?new this(_):d(_);_>E;E++)T=g?f(t[E],E):t[E],u(v,E,T);else for(x=(b=h(t,w)).next,v=n?new this:[];!(y=i(x,b)).done;E++)T=g?a(b,f,[y.value,E],!0):y.value,u(v,E,T);return v.length=E,v}},31692:function(e,t,n){var r=n(74529),i=n(59413),s=n(10623),a=function(e){return function(t,n,a){var o,l=r(t),c=s(l),u=i(a,c);if(e&&n!=n){for(;c>u;)if((o=l[u++])!=o)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},3610:function(e,t,n){var r=n(86843),i=n(95329),s=n(37026),a=n(89678),o=n(10623),l=n(64692),c=i([].push),u=function(e){var t=1==e,n=2==e,i=3==e,u=4==e,h=6==e,p=7==e,d=5==e||h;return function(m,f,g,_){for(var v,y,b=a(m),x=s(b),T=r(f,g),w=o(x),E=0,S=_||l,I=t?S(m,w):n||p?S(m,0):void 0;w>E;E++)if((d||E in x)&&(y=T(v=x[E],E,b),e))if(t)I[E]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return E;case 2:c(I,v)}else switch(e){case 4:return!1;case 7:c(I,v)}return h?-1:i||u?u:I}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},67145:function(e,t,n){var r=n(79730),i=n(74529),s=n(62435),a=n(10623),o=n(34194),l=Math.min,c=[].lastIndexOf,u=!!c&&1/[1].lastIndexOf(1,-0)<0,h=o("lastIndexOf"),p=u||!h;e.exports=p?function(e){if(u)return r(c,this,arguments)||0;var t=i(this),n=a(t),o=n-1;for(arguments.length>1&&(o=l(o,s(arguments[1]))),o<0&&(o=n+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return-1}:c},50568:function(e,t,n){var r=n(95981),i=n(99813),s=n(53385),a=i("species");e.exports=function(e){return s>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34194:function(e,t,n){var r=n(95981);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},46499:function(e,t,n){var r=n(24883),i=n(89678),s=n(37026),a=n(10623),o=TypeError,l=function(e){return function(t,n,l,c){r(n);var u=i(t),h=s(u),p=a(u),d=e?p-1:0,m=e?-1:1;if(l<2)for(;;){if(d in h){c=h[d],d+=m;break}if(d+=m,e?d<0:p<=d)throw o("Reduce of empty array with no initial value")}for(;e?d>=0:p>d;d+=m)d in h&&(c=n(c,h[d],d,u));return c}};e.exports={left:l(!1),right:l(!0)}},89779:function(e,t,n){var r=n(55746),i=n(1052),s=TypeError,a=Object.getOwnPropertyDescriptor,o=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=o?function(e,t){if(i(e)&&!a(e,"length").writable)throw s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},15790:function(e,t,n){var r=n(59413),i=n(10623),s=n(55449),a=Array,o=Math.max;e.exports=function(e,t,n){for(var l=i(e),c=r(t,l),u=r(void 0===n?l:n,l),h=a(o(u-c,0)),p=0;c<u;c++,p++)s(h,p,e[c]);return h.length=p,h}},93765:function(e,t,n){var r=n(95329);e.exports=r([].slice)},61388:function(e,t,n){var r=n(15790),i=Math.floor,s=function(e,t){var n=e.length,l=i(n/2);return n<8?a(e,t):o(e,s(r(e,0,l),t),s(r(e,l),t),t)},a=function(e,t){for(var n,r,i=e.length,s=1;s<i;){for(r=s,n=e[s];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==s++&&(e[r]=n)}return e},o=function(e,t,n,r){for(var i=t.length,s=n.length,a=0,o=0;a<i||o<s;)e[a+o]=a<i&&o<s?r(t[a],n[o])<=0?t[a++]:n[o++]:a<i?t[a++]:n[o++];return e};e.exports=s},5693:function(e,t,n){var r=n(1052),i=n(24284),s=n(10941),a=n(99813)("species"),o=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===o||r(t.prototype))||s(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?o:t}},64692:function(e,t,n){var r=n(5693);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},75196:function(e,t,n){var r=n(96059),i=n(7609);e.exports=function(e,t,n,s){try{return s?t(r(n)[0],n[1]):t(n)}catch(t){i(e,"throw",t)}}},21385:function(e,t,n){var r=n(99813)("iterator"),i=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var s={};s[r]=function(){return{next:function(){return{done:n=!0}}}},e(s)}catch(e){}return n}},82532:function(e,t,n){var r=n(95329),i=r({}.toString),s=r("".slice);e.exports=function(e){return s(i(e),8,-1)}},9697:function(e,t,n){var r=n(22885),i=n(57475),s=n(82532),a=n(99813)("toStringTag"),o=Object,l="Arguments"==s(function(){return arguments}());e.exports=r?s:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=o(e),a))?n:l?s(t):"Object"==(r=s(t))&&i(t.callee)?"Arguments":r}},7622:function(e,t,n){var r=n(78834),i=n(24883),s=n(96059);e.exports=function(){for(var e=s(this),t=i(e.add),n=0,a=arguments.length;n<a;n++)r(t,e,arguments[n]);return e}},28984:function(e,t,n){var r=n(78834),i=n(24883),s=n(96059);e.exports=function(){for(var e,t=s(this),n=i(t.delete),a=!0,o=0,l=arguments.length;o<l;o++)e=r(n,t,arguments[o]),a=a&&e;return!!a}},83590:function(e,t,n){var r=n(86843),i=n(78834),s=n(24883),a=n(174),o=n(82119),l=n(93091),c=[].push;e.exports=function(e){var t,n,u,h,p=arguments.length,d=p>1?arguments[1]:void 0;return a(this),(t=void 0!==d)&&s(d),o(e)?new this:(n=[],t?(u=0,h=r(d,p>2?arguments[2]:void 0),l(e,(function(e){i(c,n,h(e,u++))}))):l(e,c,{that:n}),new this(n))}},45226:function(e,t,n){var r=n(93765);e.exports=function(){return new this(r(arguments))}},85616:function(e,t,n){var r=n(65988).f,i=n(29290),s=n(94380),a=n(86843),o=n(5743),l=n(82119),c=n(93091),u=n(75105),h=n(23538),p=n(94431),d=n(55746),m=n(21647).fastKey,f=n(45402),g=f.set,_=f.getterFor;e.exports={getConstructor:function(e,t,n,u){var h=e((function(e,r){o(e,p),g(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),d||(e.size=0),l(r)||c(r,e[u],{that:e,AS_ENTRIES:n})})),p=h.prototype,f=_(t),v=function(e,t,n){var r,i,s=f(e),a=y(e,t);return a?a.value=n:(s.last=a={index:i=m(t,!0),key:t,value:n,previous:r=s.last,next:void 0,removed:!1},s.first||(s.first=a),r&&(r.next=a),d?s.size++:e.size++,"F"!==i&&(s.index[i]=a)),e},y=function(e,t){var n,r=f(e),i=m(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return s(p,{clear:function(){for(var e=f(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,d?e.size=0:this.size=0},delete:function(e){var t=this,n=f(t),r=y(t,e);if(r){var i=r.next,s=r.previous;delete n.index[r.index],r.removed=!0,s&&(s.next=i),i&&(i.previous=s),n.first==r&&(n.first=i),n.last==r&&(n.last=s),d?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=f(this),r=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),s(p,n?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,0===e?0:e,t)}}:{add:function(e){return v(this,e=0===e?0:e,e)}}),d&&r(p,"size",{get:function(){return f(this).size}}),h},setStrong:function(e,t,n){var r=t+" Iterator",i=_(t),s=_(r);u(e,t,(function(e,t){g(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=s(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?h("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,h(void 0,!0))}),n?"entries":"values",!n,!0),p(t)}}},8850:function(e,t,n){var r=n(95329),i=n(94380),s=n(21647).getWeakData,a=n(5743),o=n(96059),l=n(82119),c=n(10941),u=n(93091),h=n(3610),p=n(90953),d=n(45402),m=d.set,f=d.getterFor,g=h.find,_=h.findIndex,v=r([].splice),y=0,b=function(e){return e.frozen||(e.frozen=new x)},x=function(){this.entries=[]},T=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};x.prototype={get:function(e){var t=T(this,e);if(t)return t[1]},has:function(e){return!!T(this,e)},set:function(e,t){var n=T(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=_(this.entries,(function(t){return t[0]===e}));return~t&&v(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var h=e((function(e,i){a(e,d),m(e,{type:t,id:y++,frozen:void 0}),l(i)||u(i,e[r],{that:e,AS_ENTRIES:n})})),d=h.prototype,g=f(t),_=function(e,t,n){var r=g(e),i=s(o(t),!0);return!0===i?b(r).set(t,n):i[r.id]=n,e};return i(d,{delete:function(e){var t=g(this);if(!c(e))return!1;var n=s(e);return!0===n?b(t).delete(e):n&&p(n,t.id)&&delete n[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var n=s(e);return!0===n?b(t).has(e):n&&p(n,t.id)}}),i(d,n?{get:function(e){var t=g(this);if(c(e)){var n=s(e);return!0===n?b(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return _(this,e,t)}}:{add:function(e){return _(this,e,!0)}}),h}}},24683:function(e,t,n){var r=n(76887),i=n(21899),s=n(21647),a=n(95981),o=n(32029),l=n(93091),c=n(5743),u=n(57475),h=n(10941),p=n(90904),d=n(65988).f,m=n(3610).forEach,f=n(55746),g=n(45402),_=g.set,v=g.getterFor;e.exports=function(e,t,n){var g,y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),x=y?"set":"add",T=i[e],w=T&&T.prototype,E={};if(f&&u(T)&&(b||w.forEach&&!a((function(){(new T).entries().next()})))){var S=(g=t((function(t,n){_(c(t,S),{type:e,collection:new T}),null!=n&&l(n,t[x],{that:t,AS_ENTRIES:y})}))).prototype,I=v(e);m(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in w)||b&&"clear"==e||o(S,e,(function(n,r){var i=I(this).collection;if(!t&&b&&!h(n))return"get"==e&&void 0;var s=i[e](0===n?0:n,r);return t?this:s}))})),b||d(S,"size",{configurable:!0,get:function(){return I(this).collection.size}})}else g=n.getConstructor(t,e,y,x),s.enable();return p(g,e,!1,!0),E[e]=g,r({global:!0,forced:!0},E),b||n.setStrong(g,e,y),g}},23489:function(e,t,n){var r=n(90953),i=n(31136),s=n(49677),a=n(65988);e.exports=function(e,t,n){for(var o=i(t),l=a.f,c=s.f,u=0;u<o.length;u++){var h=o[u];r(e,h)||n&&r(n,h)||l(e,h,c(t,h))}}},67772:function(e,t,n){var r=n(99813)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},64160:function(e,t,n){var r=n(95981);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},23538:function(e){e.exports=function(e,t){return{value:e,done:t}}},32029:function(e,t,n){var r=n(55746),i=n(65988),s=n(31887);e.exports=r?function(e,t,n){return i.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},31887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},55449:function(e,t,n){var r=n(83894),i=n(65988),s=n(31887);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,s(0,n)):e[a]=n}},29202:function(e,t,n){var r=n(65988);e.exports=function(e,t,n){return r.f(e,t,n)}},95929:function(e,t,n){var r=n(32029);e.exports=function(e,t,n,i){return i&&i.enumerable?e[t]=n:r(e,t,n),e}},94380:function(e,t,n){var r=n(95929);e.exports=function(e,t,n){for(var i in t)n&&n.unsafe&&e[i]?e[i]=t[i]:r(e,i,t[i],n);return e}},75609:function(e,t,n){var r=n(21899),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},15863:function(e,t,n){var r=n(69826),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw i("Cannot delete property "+r(t)+" of "+r(e))}},55746:function(e,t,n){var r=n(95981);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},76616:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},61333:function(e,t,n){var r=n(21899),i=n(10941),s=r.document,a=i(s)&&i(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},66796:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},63281:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},34342:function(e,t,n){var r=n(2861).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},23321:function(e,t,n){var r=n(48501),i=n(6049);e.exports=!r&&!i&&"object"==typeof window&&"object"==typeof document},48501:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},81046:function(e,t,n){var r=n(2861);e.exports=/MSIE|Trident/.test(r)},4470:function(e,t,n){var r=n(2861),i=n(21899);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},22749:function(e,t,n){var r=n(2861);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},6049:function(e,t,n){var r=n(82532),i=n(21899);e.exports="process"==r(i.process)},58045:function(e,t,n){var r=n(2861);e.exports=/web0s(?!.*chrome)/i.test(r)},2861:function(e,t,n){var r=n(626);e.exports=r("navigator","userAgent")||""},53385:function(e,t,n){var r,i,s=n(21899),a=n(2861),o=s.process,l=s.Deno,c=o&&o.versions||l&&l.version,u=c&&c.v8;u&&(i=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},18938:function(e,t,n){var r=n(2861).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},35703:function(e,t,n){var r=n(54058);e.exports=function(e){return r[e+"Prototype"]}},56759:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},53995:function(e,t,n){var r=n(95329),i=Error,s=r("".replace),a=String(i("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=s(e,o,"");return e}},18780:function(e,t,n){var r=n(95981),i=n(31887);e.exports=!r((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},76887:function(e,t,n){var r=n(21899),i=n(79730),s=n(95329),a=n(57475),o=n(49677).f,l=n(37252),c=n(54058),u=n(86843),h=n(32029),p=n(90953),d=function(e){var t=function(n,r,s){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,s)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,i,m,f,g,_,v,y,b=e.target,x=e.global,T=e.stat,w=e.proto,E=x?r:T?r[b]:(r[b]||{}).prototype,S=x?c:c[b]||h(c,b,{})[b],I=S.prototype;for(m in t)n=!l(x?m:b+(T?".":"#")+m,e.forced)&&E&&p(E,m),g=S[m],n&&(_=e.dontCallGetSet?(y=o(E,m))&&y.value:E[m]),f=n&&_?_:t[m],n&&typeof g==typeof f||(v=e.bind&&n?u(f,r):e.wrap&&n?d(f):w&&a(f)?s(f):f,(e.sham||f&&f.sham||g&&g.sham)&&h(v,"sham",!0),h(S,m,v),w&&(p(c,i=b+"Prototype")||h(c,i,{}),h(c[i],m,f),e.real&&I&&!I[m]&&h(I,m,f)))}},95981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},13092:function(e,t,n){var r=n(1052),i=n(10623),s=n(66796),a=n(86843),o=function(e,t,n,l,c,u,h,p){for(var d,m,f=c,g=0,_=!!h&&a(h,p);g<l;)g in n&&(d=_?_(n[g],g,t):n[g],u>0&&r(d)?(m=i(d),f=o(e,t,d,m,f,u-1)-1):(s(f+1),e[f]=d),f++),g++;return f};e.exports=o},45602:function(e,t,n){var r=n(95981);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},79730:function(e,t,n){var r=n(18285),i=Function.prototype,s=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},86843:function(e,t,n){var r=n(95329),i=n(24883),s=n(18285),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},18285:function(e,t,n){var r=n(95981);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},98308:function(e,t,n){var r=n(95329),i=n(24883),s=n(10941),a=n(90953),o=n(93765),l=n(18285),c=Function,u=r([].concat),h=r([].join),p={},d=function(e,t,n){if(!a(p,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";p[t]=c("C,a","return new C("+h(r,",")+")")}return p[t](e,n)};e.exports=l?c.bind:function(e){var t=i(this),n=t.prototype,r=o(arguments,1),a=function(){var n=u(r,o(arguments));return this instanceof a?d(t,n.length,n):t.apply(e,n)};return s(n)&&(a.prototype=n),a}},78834:function(e,t,n){var r=n(18285),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},79417:function(e,t,n){var r=n(55746),i=n(90953),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,o=i(s,"name"),l=o&&"something"===function(){}.name,c=o&&(!r||r&&a(s,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},95329:function(e,t,n){var r=n(18285),i=Function.prototype,s=i.bind,a=i.call,o=r&&s.bind(a,a);e.exports=r?function(e){return e&&o(e)}:function(e){return e&&function(){return a.apply(e,arguments)}}},626:function(e,t,n){var r=n(54058),i=n(21899),s=n(57475),a=function(e){return s(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},22902:function(e,t,n){var r=n(9697),i=n(14229),s=n(82119),a=n(12077),o=n(99813)("iterator");e.exports=function(e){if(!s(e))return i(e,o)||i(e,"@@iterator")||a[r(e)]}},53476:function(e,t,n){var r=n(78834),i=n(24883),s=n(96059),a=n(69826),o=n(22902),l=TypeError;e.exports=function(e,t){var n=arguments.length<2?o(e):t;if(i(n))return s(r(n,e));throw l(a(e)+" is not iterable")}},79993:function(e,t,n){var r=n(53476);e.exports=r},14229:function(e,t,n){var r=n(24883),i=n(82119);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},69571:function(e,t,n){var r=n(53476);e.exports=r},21899:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},90953:function(e,t,n){var r=n(95329),i=n(89678),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(i(e),t)}},27748:function(e){e.exports={}},34845:function(e,t,n){var r=n(21899);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},15463:function(e,t,n){var r=n(626);e.exports=r("document","documentElement")},2840:function(e,t,n){var r=n(55746),i=n(95981),s=n(61333);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},37026:function(e,t,n){var r=n(95329),i=n(95981),s=n(82532),a=Object,o=r("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?o(e,""):a(e)}:a},81302:function(e,t,n){var r=n(95329),i=n(57475),s=n(63030),a=r(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},53794:function(e,t,n){var r=n(10941),i=n(32029);e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},21647:function(e,t,n){var r=n(76887),i=n(95329),s=n(27748),a=n(10941),o=n(90953),l=n(65988).f,c=n(10946),u=n(684),h=n(91584),p=n(99418),d=n(45602),m=!1,f=p("meta"),g=0,_=function(e){l(e,f,{value:{objectID:"O"+g++,weakData:{}}})},v=e.exports={enable:function(){v.enable=function(){},m=!0;var e=c.f,t=i([].splice),n={};n[f]=1,e(n).length&&(c.f=function(n){for(var r=e(n),i=0,s=r.length;i<s;i++)if(r[i]===f){t(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,f)){if(!h(e))return"F";if(!t)return"E";_(e)}return e[f].objectID},getWeakData:function(e,t){if(!o(e,f)){if(!h(e))return!0;if(!t)return!1;_(e)}return e[f].weakData},onFreeze:function(e){return d&&m&&h(e)&&!o(e,f)&&_(e),e}};s[f]=!0},45402:function(e,t,n){var r,i,s,a=n(47093),o=n(21899),l=n(95329),c=n(10941),u=n(32029),h=n(90953),p=n(63030),d=n(44262),m=n(27748),f="Object already initialized",g=o.TypeError,_=o.WeakMap;if(a||p.state){var v=p.state||(p.state=new _),y=l(v.get),b=l(v.has),x=l(v.set);r=function(e,t){if(b(v,e))throw g(f);return t.facade=e,x(v,e,t),t},i=function(e){return y(v,e)||{}},s=function(e){return b(v,e)}}else{var T=d("state");m[T]=!0,r=function(e,t){if(h(e,T))throw g(f);return t.facade=e,u(e,T,t),t},i=function(e){return h(e,T)?e[T]:{}},s=function(e){return h(e,T)}}e.exports={set:r,get:i,has:s,enforce:function(e){return s(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=i(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return n}}}},6782:function(e,t,n){var r=n(99813),i=n(12077),s=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[s]===e)}},1052:function(e,t,n){var r=n(82532);e.exports=Array.isArray||function(e){return"Array"==r(e)}},57475:function(e,t,n){var r=n(76616),i=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},24284:function(e,t,n){var r=n(95329),i=n(95981),s=n(57475),a=n(9697),o=n(626),l=n(81302),c=function(){},u=[],h=o("Reflect","construct"),p=/^\s*(?:class|function)\b/,d=r(p.exec),m=!p.exec(c),f=function(e){if(!s(e))return!1;try{return h(c,u,e),!0}catch(e){return!1}},g=function(e){if(!s(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!d(p,l(e))}catch(e){return!0}};g.sham=!0,e.exports=!h||i((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?g:f},37252:function(e,t,n){var r=n(95981),i=n(57475),s=/#|\.prototype\./,a=function(e,t){var n=l[o(e)];return n==u||n!=c&&(i(t)?r(t):!!t)},o=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},54639:function(e,t,n){var r=n(10941),i=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&i(e)===e}},82119:function(e){e.exports=function(e){return null==e}},10941:function(e,t,n){var r=n(57475),i=n(76616),s=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===s}:function(e){return"object"==typeof e?null!==e:r(e)}},82529:function(e){e.exports=!0},60685:function(e,t,n){var r=n(10941),i=n(82532),s=n(99813)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==i(e))}},56664:function(e,t,n){var r=n(626),i=n(57475),s=n(7046),a=n(32302),o=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&s(t.prototype,o(e))}},93091:function(e,t,n){var r=n(86843),i=n(78834),s=n(96059),a=n(69826),o=n(6782),l=n(10623),c=n(7046),u=n(53476),h=n(22902),p=n(7609),d=TypeError,m=function(e,t){this.stopped=e,this.result=t},f=m.prototype;e.exports=function(e,t,n){var g,_,v,y,b,x,T,w=n&&n.that,E=!(!n||!n.AS_ENTRIES),S=!(!n||!n.IS_RECORD),I=!(!n||!n.IS_ITERATOR),M=!(!n||!n.INTERRUPTED),A=r(t,w),R=function(e){return g&&p(g,"normal",e),new m(!0,e)},D=function(e){return E?(s(e),M?A(e[0],e[1],R):A(e[0],e[1])):M?A(e,R):A(e)};if(S)g=e.iterator;else if(I)g=e;else{if(!(_=h(e)))throw d(a(e)+" is not iterable");if(o(_)){for(v=0,y=l(e);y>v;v++)if((b=D(e[v]))&&c(f,b))return b;return new m(!1)}g=u(e,_)}for(x=S?e.next:g.next;!(T=i(x,g)).done;){try{b=D(T.value)}catch(e){p(g,"throw",e)}if("object"==typeof b&&b&&c(f,b))return b}return new m(!1)}},7609:function(e,t,n){var r=n(78834),i=n(96059),s=n(14229);e.exports=function(e,t,n){var a,o;i(e);try{if(!(a=s(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){o=!0,a=e}if("throw"===t)throw n;if(o)throw a;return i(a),n}},53847:function(e,t,n){var r=n(35143).IteratorPrototype,i=n(29290),s=n(31887),a=n(90904),o=n(12077),l=function(){return this};e.exports=function(e,t,n,c){var u=t+" Iterator";return e.prototype=i(r,{next:s(+!c,n)}),a(e,u,!1,!0),o[u]=l,e}},75105:function(e,t,n){var r=n(76887),i=n(78834),s=n(82529),a=n(79417),o=n(57475),l=n(53847),c=n(249),u=n(88929),h=n(90904),p=n(32029),d=n(95929),m=n(99813),f=n(12077),g=n(35143),_=a.PROPER,v=a.CONFIGURABLE,y=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,x=m("iterator"),T="keys",w="values",E="entries",S=function(){return this};e.exports=function(e,t,n,a,m,g,I){l(n,t,a);var M,A,R,D=function(e){if(e===m&&L)return L;if(!b&&e in P)return P[e];switch(e){case T:case w:case E:return function(){return new n(this,e)}}return function(){return new n(this)}},C=t+" Iterator",O=!1,P=e.prototype,N=P[x]||P["@@iterator"]||m&&P[m],L=!b&&N||D(m),k="Array"==t&&P.entries||N;if(k&&(M=c(k.call(new e)))!==Object.prototype&&M.next&&(s||c(M)===y||(u?u(M,y):o(M[x])||d(M,x,S)),h(M,C,!0,!0),s&&(f[C]=S)),_&&m==w&&N&&N.name!==w&&(!s&&v?p(P,"name",w):(O=!0,L=function(){return i(N,this)})),m)if(A={values:D(w),keys:g?L:D(T),entries:D(E)},I)for(R in A)(b||O||!(R in P))&&d(P,R,A[R]);else r({target:t,proto:!0,forced:b||O},A);return s&&!I||P[x]===L||d(P,x,L,{name:m}),f[t]=L,A}},35143:function(e,t,n){var r,i,s,a=n(95981),o=n(57475),l=n(10941),c=n(29290),u=n(249),h=n(95929),p=n(99813),d=n(82529),m=p("iterator"),f=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(r=i):f=!0),!l(r)||a((function(){var e={};return r[m].call(e)!==e}))?r={}:d&&(r=c(r)),o(r[m])||h(r,m,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},12077:function(e){e.exports={}},10623:function(e,t,n){var r=n(43057);e.exports=function(e){return r(e.length)}},48721:function(e,t,n){var r=n(78834),i=n(24883),s=n(96059);e.exports=function(e,t){var n,a,o=s(this),l=i(o.get),c=i(o.has),u=i(o.set);return r(c,o,e)?(n=r(l,o,e),"update"in t&&(n=t.update(n,e,o),r(u,o,e,n)),n):(a=t.insert(e,o),r(u,o,e,a),a)}},20716:function(e,t,n){var r=n(78834),i=n(24883),s=n(57475),a=n(96059),o=TypeError;e.exports=function(e,t){var n,l=a(this),c=i(l.get),u=i(l.has),h=i(l.set),p=arguments.length>2?arguments[2]:void 0;if(!s(t)&&!s(p))throw o("At least one callback required");return r(u,l,e)?(n=r(c,l,e),s(t)&&(n=t(n),r(h,l,e,n))):s(p)&&(n=p(),r(h,l,e,n)),n}},83964:function(e){var t=Math.log,n=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*n}},6383:function(e){e.exports=Math.sign||function(e){var t=+e;return 0==t||t!=t?t:t<0?-1:1}},35331:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},66132:function(e,t,n){var r,i,s,a,o,l,c,u,h=n(21899),p=n(86843),d=n(49677).f,m=n(42941).set,f=n(22749),g=n(4470),_=n(58045),v=n(6049),y=h.MutationObserver||h.WebKitMutationObserver,b=h.document,x=h.process,T=h.Promise,w=d(h,"queueMicrotask"),E=w&&w.value;E||(r=function(){var e,t;for(v&&(e=x.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():s=void 0,e}}s=void 0,e&&e.enter()},f||v||_||!y||!b?!g&&T&&T.resolve?((c=T.resolve(void 0)).constructor=T,u=p(c.then,c),a=function(){u(r)}):v?a=function(){x.nextTick(r)}:(m=p(m,h),a=function(){m(r)}):(o=!0,l=b.createTextNode(""),new y(r).observe(l,{characterData:!0}),a=function(){l.data=o=!o})),e.exports=E||function(e){var t={fn:e,next:void 0};s&&(s.next=t),i||(i=t,a()),s=t}},69520:function(e,t,n){var r=n(24883),i=TypeError,s=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new s(e)}},14649:function(e,t,n){var r=n(85803);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},70344:function(e,t,n){var r=n(60685),i=TypeError;e.exports=function(e){if(r(e))throw i("The method doesn't accept regular expressions");return e}},72534:function(e,t,n){var r=n(21899).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},81942:function(e,t,n){var r=n(21899),i=n(95981),s=n(95329),a=n(85803),o=n(74853).trim,l=n(73483),c=s("".charAt),u=r.parseFloat,h=r.Symbol,p=h&&h.iterator,d=1/u(l+"-0")!=-1/0||p&&!i((function(){u(Object(p))}));e.exports=d?function(e){var t=o(a(e)),n=u(t);return 0===n&&"-"==c(t,0)?-0:n}:u},29806:function(e,t,n){var r=n(21899),i=n(95981),s=n(95329),a=n(85803),o=n(74853).trim,l=n(73483),c=r.parseInt,u=r.Symbol,h=u&&u.iterator,p=/^[+-]?0x/i,d=s(p.exec),m=8!==c(l+"08")||22!==c(l+"0x16")||h&&!i((function(){c(Object(h))}));e.exports=m?function(e,t){var n=o(a(e));return c(n,t>>>0||(d(p,n)?16:10))}:c},24420:function(e,t,n){var r=n(55746),i=n(95329),s=n(78834),a=n(95981),o=n(14771),l=n(87857),c=n(36760),u=n(89678),h=n(37026),p=Object.assign,d=Object.defineProperty,m=i([].concat);e.exports=!p||a((function(){if(r&&1!==p({b:1},p(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=p({},e)[n]||o(p({},t)).join("")!=i}))?function(e,t){for(var n=u(e),i=arguments.length,a=1,p=l.f,d=c.f;i>a;)for(var f,g=h(arguments[a++]),_=p?m(o(g),p(g)):o(g),v=_.length,y=0;v>y;)f=_[y++],r&&!s(d,g,f)||(n[f]=g[f]);return n}:p},29290:function(e,t,n){var r,i=n(96059),s=n(59938),a=n(56759),o=n(27748),l=n(15463),c=n(61333),u=n(44262),h=u("IE_PROTO"),p=function(){},d=function(e){return"<script>"+e+"</"+"script>"},m=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},f=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t;f="undefined"!=typeof document?document.domain&&r?m(r):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):m(r);for(var n=a.length;n--;)delete f.prototype[a[n]];return f()};o[h]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p.prototype=i(e),n=new p,p.prototype=null,n[h]=e):n=f(),void 0===t?n:s.f(n,t)}},59938:function(e,t,n){var r=n(55746),i=n(83937),s=n(65988),a=n(96059),o=n(74529),l=n(14771);t.f=r&&!i?Object.defineProperties:function(e,t){a(e);for(var n,r=o(t),i=l(t),c=i.length,u=0;c>u;)s.f(e,n=i[u++],r[n]);return e}},65988:function(e,t,n){var r=n(55746),i=n(2840),s=n(83937),a=n(96059),o=n(83894),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",p="configurable",d="writable";t.f=r?s?function(e,t,n){if(a(e),t=o(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n.writable){var r=u(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:p in n?n.configurable:r.configurable,enumerable:h in n?n.enumerable:r.enumerable,writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(a(e),t=o(t),a(n),i)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},49677:function(e,t,n){var r=n(55746),i=n(78834),s=n(36760),a=n(31887),o=n(74529),l=n(83894),c=n(90953),u=n(2840),h=Object.getOwnPropertyDescriptor;t.f=r?h:function(e,t){if(e=o(e),t=l(t),u)try{return h(e,t)}catch(e){}if(c(e,t))return a(!i(s.f,e,t),e[t])}},684:function(e,t,n){var r=n(82532),i=n(74529),s=n(10946).f,a=n(15790),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"Window"==r(e)?function(e){try{return s(e)}catch(e){return a(o)}}(e):s(i(e))}},10946:function(e,t,n){var r=n(55629),i=n(56759).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},87857:function(e,t){t.f=Object.getOwnPropertySymbols},249:function(e,t,n){var r=n(90953),i=n(57475),s=n(89678),a=n(44262),o=n(64160),l=a("IE_PROTO"),c=Object,u=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=s(e);if(r(t,l))return t[l];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?u:null}},91584:function(e,t,n){var r=n(95981),i=n(10941),s=n(82532),a=n(97135),o=Object.isExtensible,l=r((function(){o(1)}));e.exports=l||a?function(e){return!!i(e)&&((!a||"ArrayBuffer"!=s(e))&&(!o||o(e)))}:o},7046:function(e,t,n){var r=n(95329);e.exports=r({}.isPrototypeOf)},55629:function(e,t,n){var r=n(95329),i=n(90953),s=n(74529),a=n(31692).indexOf,o=n(27748),l=r([].push);e.exports=function(e,t){var n,r=s(e),c=0,u=[];for(n in r)!i(o,n)&&i(r,n)&&l(u,n);for(;t.length>c;)i(r,n=t[c++])&&(~a(u,n)||l(u,n));return u}},14771:function(e,t,n){var r=n(55629),i=n(56759);e.exports=Object.keys||function(e){return r(e,i)}},36760:function(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},88929:function(e,t,n){var r=n(95329),i=n(96059),s=n(11851);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return i(n),s(r),t?e(n,r):n.__proto__=r,n}}():void 0)},88810:function(e,t,n){var r=n(55746),i=n(95329),s=n(14771),a=n(74529),o=i(n(36760).f),l=i([].push),c=function(e){return function(t){for(var n,i=a(t),c=s(i),u=c.length,h=0,p=[];u>h;)n=c[h++],r&&!o(i,n)||l(p,e?[n,i[n]]:i[n]);return p}};e.exports={entries:c(!0),values:c(!1)}},95623:function(e,t,n){var r=n(22885),i=n(9697);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},39811:function(e,t,n){var r=n(78834),i=n(57475),s=n(10941),a=TypeError;e.exports=function(e,t){var n,o;if("string"===t&&i(n=e.toString)&&!s(o=r(n,e)))return o;if(i(n=e.valueOf)&&!s(o=r(n,e)))return o;if("string"!==t&&i(n=e.toString)&&!s(o=r(n,e)))return o;throw a("Can't convert object to primitive value")}},31136:function(e,t,n){var r=n(626),i=n(95329),s=n(10946),a=n(87857),o=n(96059),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=s.f(o(e)),n=a.f;return n?l(t,n(e)):t}},54058:function(e){e.exports={}},40002:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},67742:function(e,t,n){var r=n(21899),i=n(6991),s=n(57475),a=n(37252),o=n(81302),l=n(99813),c=n(23321),u=n(48501),h=n(82529),p=n(53385),d=i&&i.prototype,m=l("species"),f=!1,g=s(r.PromiseRejectionEvent),_=a("Promise",(function(){var e=o(i),t=e!==String(i);if(!t&&66===p)return!0;if(h&&(!d.catch||!d.finally))return!0;if(!p||p<51||!/native code/.test(e)){var n=new i((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[m]=r,!(f=n.then((function(){}))instanceof r))return!0}return!t&&(c||u)&&!g}));e.exports={CONSTRUCTOR:_,REJECTION_EVENT:g,SUBCLASSING:f}},6991:function(e,t,n){var r=n(21899);e.exports=r.Promise},56584:function(e,t,n){var r=n(96059),i=n(10941),s=n(69520);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=s.f(e);return(0,n.resolve)(t),n.promise}},31542:function(e,t,n){var r=n(6991),i=n(21385),s=n(67742).CONSTRUCTOR;e.exports=s||!i((function(e){r.all(e).then(void 0,(function(){}))}))},18397:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},66293:function(e,t,n){var r=n(78834),i=n(96059),s=n(57475),a=n(82532),o=n(24231),l=TypeError;e.exports=function(e,t){var n=e.exec;if(s(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===a(e))return r(o,e,t);throw l("RegExp#exec called on incompatible receiver")}},24231:function(e){e.exports=/./.exec},66777:function(e,t,n){var r=n(96059);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},43613:function(e,t,n){var r=n(78834),i=n(90953),s=n(7046),a=n(66777),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||i(e,"flags")||!s(o,e)?t:r(a,e)}},48219:function(e,t,n){var r=n(82119),i=TypeError;e.exports=function(e){if(r(e))throw i("Can't call method on "+e);return e}},57309:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},37620:function(e,t,n){var r=n(21899),i=n(79730),s=n(57475),a=n(2861),o=n(93765),l=n(18348),c=/MSIE .\./.test(a),u=r.Function,h=function(e){return c?function(t,n){var r=l(arguments.length,1)>2,a=s(t)?t:u(t),c=r?o(arguments,2):void 0;return e(r?function(){i(a,this,c)}:a,n)}:e};e.exports={setTimeout:h(r.setTimeout),setInterval:h(r.setInterval)}},94431:function(e,t,n){var r=n(626),i=n(65988),s=n(99813),a=n(55746),o=s("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[o]&&n(t,o,{configurable:!0,get:function(){return this}})}},90904:function(e,t,n){var r=n(22885),i=n(65988).f,s=n(32029),a=n(90953),o=n(95623),l=n(99813)("toStringTag");e.exports=function(e,t,n,c){if(e){var u=n?e:e.prototype;a(u,l)||i(u,l,{configurable:!0,value:t}),c&&!r&&s(u,"toString",o)}}},44262:function(e,t,n){var r=n(68726),i=n(99418),s=r("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},63030:function(e,t,n){var r=n(21899),i=n(75609),s="__core-js_shared__",a=r[s]||i(s,{});e.exports=a},68726:function(e,t,n){var r=n(82529),i=n(63030);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.3",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE",source:"https://github.com/zloirock/core-js"})},70487:function(e,t,n){var r=n(96059),i=n(174),s=n(82119),a=n(99813)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||s(n=r(o)[a])?t:i(n)}},64620:function(e,t,n){var r=n(95329),i=n(62435),s=n(85803),a=n(48219),o=r("".charAt),l=r("".charCodeAt),c=r("".slice),u=function(e){return function(t,n){var r,u,h=s(a(t)),p=i(n),d=h.length;return p<0||p>=d?e?"":void 0:(r=l(h,p))<55296||r>56319||p+1===d||(u=l(h,p+1))<56320||u>57343?e?o(h,p):r:e?c(h,p,p+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},4887:function(e,t,n){var r=n(2861);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},6930:function(e,t,n){var r=n(95329),i=n(43057),s=n(85803),a=n(16178),o=n(48219),l=r(a),c=r("".slice),u=Math.ceil,h=function(e){return function(t,n,r){var a,h,p=s(o(t)),d=i(n),m=p.length,f=void 0===r?" ":s(r);return d<=m||""==f?p:((h=l(f,u((a=d-m)/f.length))).length>a&&(h=c(h,0,a)),e?p+h:h+p)}};e.exports={start:h(!1),end:h(!0)}},73291:function(e,t,n){var r=n(95329),i=2147483647,s=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",l=RangeError,c=r(a.exec),u=Math.floor,h=String.fromCharCode,p=r("".charCodeAt),d=r([].join),m=r([].push),f=r("".replace),g=r("".split),_=r("".toLowerCase),v=function(e){return e+22+75*(e<26)},y=function(e,t,n){var r=0;for(e=n?u(e/700):e>>1,e+=u(e/t);e>455;)e=u(e/35),r+=36;return u(r+36*e/(e+38))},b=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=p(e,n++);if(i>=55296&&i<=56319&&n<r){var s=p(e,n++);56320==(64512&s)?m(t,((1023&i)<<10)+(1023&s)+65536):(m(t,i),n--)}else m(t,i)}return t}(e);var n,r,s=e.length,a=128,c=0,f=72;for(n=0;n<e.length;n++)(r=e[n])<128&&m(t,h(r));var g=t.length,_=g;for(g&&m(t,"-");_<s;){var b=i;for(n=0;n<e.length;n++)(r=e[n])>=a&&r<b&&(b=r);var x=_+1;if(b-a>u((i-c)/x))throw l(o);for(c+=(b-a)*x,a=b,n=0;n<e.length;n++){if((r=e[n])<a&&++c>i)throw l(o);if(r==a){for(var T=c,w=36;;){var E=w<=f?1:w>=f+26?26:w-f;if(T<E)break;var S=T-E,I=36-E;m(t,h(v(E+S%I))),T=u(S/I),w+=36}m(t,h(v(T))),f=y(c,x,_==g),c=0,_++}}c++,a++}return d(t,"")};e.exports=function(e){var t,n,r=[],i=g(f(_(e),a,"."),".");for(t=0;t<i.length;t++)n=i[t],m(r,c(s,n)?"xn--"+b(n):n);return d(r,".")}},16178:function(e,t,n){var r=n(62435),i=n(85803),s=n(48219),a=RangeError;e.exports=function(e){var t=i(s(this)),n="",o=r(e);if(o<0||o==1/0)throw a("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},93093:function(e,t,n){var r=n(79417).PROPER,i=n(95981),s=n(73483);e.exports=function(e){return i((function(){return!!s[e]()||"…"!=="…"[e]()||r&&s[e].name!==e}))}},54560:function(e,t,n){var r=n(74853).start,i=n(93093);e.exports=i("trimStart")?function(){return r(this)}:"".trimStart},74853:function(e,t,n){var r=n(95329),i=n(48219),s=n(85803),a=n(73483),o=r("".replace),l="["+a+"]",c=RegExp("^"+l+l+"*"),u=RegExp(l+l+"*$"),h=function(e){return function(t){var n=s(i(t));return 1&e&&(n=o(n,c,"")),2&e&&(n=o(n,u,"")),n}};e.exports={start:h(1),end:h(2),trim:h(3)}},63405:function(e,t,n){var r=n(53385),i=n(95981);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},29630:function(e,t,n){var r=n(78834),i=n(626),s=n(99813),a=n(95929);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,o=s("toPrimitive");t&&!t[o]&&a(t,o,(function(e){return r(n,this)}),{arity:1})}},34680:function(e,t,n){var r=n(63405);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},42941:function(e,t,n){var r,i,s,a,o=n(21899),l=n(79730),c=n(86843),u=n(57475),h=n(90953),p=n(95981),d=n(15463),m=n(93765),f=n(61333),g=n(18348),_=n(22749),v=n(6049),y=o.setImmediate,b=o.clearImmediate,x=o.process,T=o.Dispatch,w=o.Function,E=o.MessageChannel,S=o.String,I=0,M={},A="onreadystatechange";try{r=o.location}catch(e){}var R=function(e){if(h(M,e)){var t=M[e];delete M[e],t()}},D=function(e){return function(){R(e)}},C=function(e){R(e.data)},O=function(e){o.postMessage(S(e),r.protocol+"//"+r.host)};y&&b||(y=function(e){g(arguments.length,1);var t=u(e)?e:w(e),n=m(arguments,1);return M[++I]=function(){l(t,void 0,n)},i(I),I},b=function(e){delete M[e]},v?i=function(e){x.nextTick(D(e))}:T&&T.now?i=function(e){T.now(D(e))}:E&&!_?(a=(s=new E).port2,s.port1.onmessage=C,i=c(a.postMessage,a)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&r&&"file:"!==r.protocol&&!p(O)?(i=O,o.addEventListener("message",C,!1)):i=A in f("script")?function(e){d.appendChild(f("script")).onreadystatechange=function(){d.removeChild(this),R(e)}}:function(e){setTimeout(D(e),0)}),e.exports={set:y,clear:b}},59413:function(e,t,n){var r=n(62435),i=Math.max,s=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):s(n,t)}},74529:function(e,t,n){var r=n(37026),i=n(48219);e.exports=function(e){return r(i(e))}},62435:function(e,t,n){var r=n(35331);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},43057:function(e,t,n){var r=n(62435),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},89678:function(e,t,n){var r=n(48219),i=Object;e.exports=function(e){return i(r(e))}},46935:function(e,t,n){var r=n(78834),i=n(10941),s=n(56664),a=n(14229),o=n(39811),l=n(99813),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var n,l=a(e,u);if(l){if(void 0===t&&(t="default"),n=r(l,e,t),!i(n)||s(n))return n;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},83894:function(e,t,n){var r=n(46935),i=n(56664);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},22885:function(e,t,n){var r={};r[n(99813)("toStringTag")]="z",e.exports="[object z]"===String(r)},85803:function(e,t,n){var r=n(9697),i=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},69826:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},99418:function(e,t,n){var r=n(95329),i=0,s=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+s,36)}},14766:function(e,t,n){var r=n(95981),i=n(99813),s=n(82529),a=i("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),s&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},32302:function(e,t,n){var r=n(63405);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},83937:function(e,t,n){var r=n(55746),i=n(95981);e.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},18348:function(e){var t=TypeError;e.exports=function(e,n){if(e<n)throw t("Not enough arguments");return e}},47093:function(e,t,n){var r=n(21899),i=n(57475),s=r.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},73464:function(e,t,n){var r=n(54058),i=n(90953),s=n(11477),a=n(65988).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||a(t,e,{value:s.f(e)})}},11477:function(e,t,n){var r=n(99813);t.f=r},99813:function(e,t,n){var r=n(21899),i=n(68726),s=n(90953),a=n(99418),o=n(63405),l=n(32302),c=i("wks"),u=r.Symbol,h=u&&u.for,p=l?u:u&&u.withoutSetter||a;e.exports=function(e){if(!s(c,e)||!o&&"string"!=typeof c[e]){var t="Symbol."+e;o&&s(u,e)?c[e]=u[e]:c[e]=l&&h?h(t):p(t)}return c[e]}},73483:function(e){e.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},49812:function(e,t,n){var r=n(76887),i=n(7046),s=n(249),a=n(88929),o=n(23489),l=n(29290),c=n(32029),u=n(31887),h=n(53995),p=n(53794),d=n(93091),m=n(14649),f=n(99813),g=n(18780),_=f("toStringTag"),v=Error,y=[].push,b=function(e,t){var n,r=arguments.length>2?arguments[2]:void 0,o=i(x,this);a?n=a(v(),o?s(this):x):(n=o?this:l(x),c(n,_,"Error")),void 0!==t&&c(n,"message",m(t)),g&&c(n,"stack",h(n.stack,1)),p(n,r);var u=[];return d(e,y,{that:u}),c(n,"errors",u),n};a?a(b,v):o(b,v,{name:!0});var x=b.prototype=l(v.prototype,{constructor:u(1,b),message:u(1,""),name:u(1,"AggregateError")});r({global:!0,constructor:!0,arity:2},{AggregateError:b})},47627:function(e,t,n){n(49812)},94481:function(e,t,n){var r=n(76887),i=n(89678),s=n(10623),a=n(62435),o=n(18479);r({target:"Array",proto:!0},{at:function(e){var t=i(this),n=s(t),r=a(e),o=r>=0?r:n+r;return o<0||o>=n?void 0:t[o]}}),o("at")},85906:function(e,t,n){var r=n(76887),i=n(95981),s=n(1052),a=n(10941),o=n(89678),l=n(10623),c=n(66796),u=n(55449),h=n(64692),p=n(50568),d=n(99813),m=n(53385),f=d("isConcatSpreadable"),g=m>=51||!i((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),_=p("concat"),v=function(e){if(!a(e))return!1;var t=e[f];return void 0!==t?!!t:s(e)};r({target:"Array",proto:!0,arity:1,forced:!g||!_},{concat:function(e){var t,n,r,i,s,a=o(this),p=h(a,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(v(s=-1===t?a:arguments[t]))for(i=l(s),c(d+i),n=0;n<i;n++,d++)n in s&&u(p,d,s[n]);else c(d+1),u(p,d++,s);return p.length=d,p}})},72455:function(e,t,n){var r=n(76887),i=n(7139),s=n(18479);r({target:"Array",proto:!0},{copyWithin:i}),s("copyWithin")},48851:function(e,t,n){var r=n(76887),i=n(3610).every;r({target:"Array",proto:!0,forced:!n(34194)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},80290:function(e,t,n){var r=n(76887),i=n(91860),s=n(18479);r({target:"Array",proto:!0},{fill:i}),s("fill")},21501:function(e,t,n){var r=n(76887),i=n(3610).filter;r({target:"Array",proto:!0,forced:!n(50568)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},44929:function(e,t,n){var r=n(76887),i=n(3610).findIndex,s=n(18479),a="findIndex",o=!0;a in[]&&Array(1).findIndex((function(){o=!1})),r({target:"Array",proto:!0,forced:o},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(a)},80833:function(e,t,n){var r=n(76887),i=n(3610).find,s=n(18479),a="find",o=!0;a in[]&&Array(1).find((function(){o=!1})),r({target:"Array",proto:!0,forced:o},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(a)},94944:function(e,t,n){var r=n(76887),i=n(13092),s=n(89678),a=n(10623),o=n(62435),l=n(64692);r({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=s(this),n=a(t),r=l(t,0);return r.length=i(r,t,t,n,0,void 0===e?1:o(e)),r}})},2437:function(e,t,n){var r=n(76887),i=n(56837);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},53242:function(e,t,n){var r=n(76887),i=n(11354);r({target:"Array",stat:!0,forced:!n(21385)((function(e){Array.from(e)}))},{from:i})},97690:function(e,t,n){var r=n(76887),i=n(31692).includes,s=n(95981),a=n(18479);r({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},99076:function(e,t,n){var r=n(76887),i=n(95329),s=n(31692).indexOf,a=n(34194),o=i([].indexOf),l=!!o&&1/o([1],1,-0)<0,c=a("indexOf");r({target:"Array",proto:!0,forced:l||!c},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return l?o(this,e,t)||0:s(this,e,t)}})},92737:function(e,t,n){n(76887)({target:"Array",stat:!0},{isArray:n(1052)})},66274:function(e,t,n){var r=n(74529),i=n(18479),s=n(12077),a=n(45402),o=n(65988).f,l=n(75105),c=n(23538),u=n(82529),h=n(55746),p="Array Iterator",d=a.set,m=a.getterFor(p);e.exports=l(Array,"Array",(function(e,t){d(this,{type:p,target:r(e),index:0,kind:t})}),(function(){var e=m(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,c(void 0,!0)):c("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var f=s.Arguments=s.Array;if(i("keys"),i("values"),i("entries"),!u&&h&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(e){}},75915:function(e,t,n){var r=n(76887),i=n(67145);r({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},68787:function(e,t,n){var r=n(76887),i=n(3610).map;r({target:"Array",proto:!0,forced:!n(50568)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},81876:function(e,t,n){var r=n(76887),i=n(46499).left,s=n(34194),a=n(53385),o=n(6049);r({target:"Array",proto:!0,forced:!s("reduce")||!o&&a>79&&a<83},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},11490:function(e,t,n){var r=n(76887),i=n(95329),s=n(1052),a=i([].reverse),o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),a(this)}})},60186:function(e,t,n){var r=n(76887),i=n(1052),s=n(24284),a=n(10941),o=n(59413),l=n(10623),c=n(74529),u=n(55449),h=n(99813),p=n(50568),d=n(93765),m=p("slice"),f=h("species"),g=Array,_=Math.max;r({target:"Array",proto:!0,forced:!m},{slice:function(e,t){var n,r,h,p=c(this),m=l(p),v=o(e,m),y=o(void 0===t?m:t,m);if(i(p)&&(n=p.constructor,(s(n)&&(n===g||i(n.prototype))||a(n)&&null===(n=n[f]))&&(n=void 0),n===g||void 0===n))return d(p,v,y);for(r=new(void 0===n?g:n)(_(y-v,0)),h=0;v<y;v++,h++)v in p&&u(r,h,p[v]);return r.length=h,r}})},36026:function(e,t,n){var r=n(76887),i=n(3610).some;r({target:"Array",proto:!0,forced:!n(34194)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},4115:function(e,t,n){var r=n(76887),i=n(95329),s=n(24883),a=n(89678),o=n(10623),l=n(15863),c=n(85803),u=n(95981),h=n(61388),p=n(34194),d=n(34342),m=n(81046),f=n(53385),g=n(18938),_=[],v=i(_.sort),y=i(_.push),b=u((function(){_.sort(void 0)})),x=u((function(){_.sort(null)})),T=p("sort"),w=!u((function(){if(f)return f<70;if(!(d&&d>3)){if(m)return!0;if(g)return g<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)_.push({k:t+r,v:n})}for(_.sort((function(e,t){return t.v-e.v})),r=0;r<_.length;r++)t=_[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:b||!x||!T||!w},{sort:function(e){void 0!==e&&s(e);var t=a(this);if(w)return void 0===e?v(t):v(t,e);var n,r,i=[],u=o(t);for(r=0;r<u;r++)r in t&&y(i,t[r]);for(h(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:c(t)>c(n)?1:-1}}(e)),n=o(i),r=0;r<n;)t[r]=i[r++];for(;r<u;)l(t,r++);return t}})},98611:function(e,t,n){var r=n(76887),i=n(89678),s=n(59413),a=n(62435),o=n(10623),l=n(89779),c=n(66796),u=n(64692),h=n(55449),p=n(15863),d=n(50568)("splice"),m=Math.max,f=Math.min;r({target:"Array",proto:!0,forced:!d},{splice:function(e,t){var n,r,d,g,_,v,y=i(this),b=o(y),x=s(e,b),T=arguments.length;for(0===T?n=r=0:1===T?(n=0,r=b-x):(n=T-2,r=f(m(a(t),0),b-x)),c(b+n-r),d=u(y,r),g=0;g<r;g++)(_=x+g)in y&&h(d,g,y[_]);if(d.length=r,n<r){for(g=x;g<b-r;g++)v=g+n,(_=g+r)in y?y[v]=y[_]:p(y,v);for(g=b;g>b-r+n;g--)p(y,g-1)}else if(n>r)for(g=b-r;g>x;g--)v=g+n-1,(_=g+r-1)in y?y[v]=y[_]:p(y,v);for(g=0;g<n;g++)y[g+x]=arguments[g+2];return l(y,b-r+n),d}})},1107:function(e,t,n){n(18479)("flat")},95160:function(e,t,n){var r=n(76887),i=n(95329),s=Date,a=i(s.prototype.getTime);r({target:"Date",stat:!0},{now:function(){return a(new s)}})},18084:function(){},73381:function(e,t,n){var r=n(76887),i=n(98308);r({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},52595:function(e,t,n){var r=n(76887),i=n(21899);r({global:!0,forced:i.globalThis!==i},{globalThis:i})},32619:function(e,t,n){var r=n(76887),i=n(626),s=n(79730),a=n(78834),o=n(95329),l=n(95981),c=n(1052),u=n(57475),h=n(10941),p=n(56664),d=n(93765),m=n(63405),f=i("JSON","stringify"),g=o(/./.exec),_=o("".charAt),v=o("".charCodeAt),y=o("".replace),b=o(1..toString),x=/[\uD800-\uDFFF]/g,T=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!m||l((function(){var e=i("Symbol")();return"[null]"!=f([e])||"{}"!=f({a:e})||"{}"!=f(Object(e))})),S=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),I=function(e,t){var n=d(arguments),r=t;if((h(t)||void 0!==e)&&!p(e))return c(t)||(t=function(e,t){if(u(r)&&(t=a(r,this,e,t)),!p(t))return t}),n[1]=t,s(f,null,n)},M=function(e,t,n){var r=_(n,t-1),i=_(n,t+1);return g(T,e)&&!g(w,i)||g(w,e)&&!g(T,r)?"\\u"+b(v(e,0),16):e};f&&r({target:"JSON",stat:!0,arity:3,forced:E||S},{stringify:function(e,t,n){var r=d(arguments),i=s(E?I:f,null,r);return S&&"string"==typeof i?y(i,x,M):i}})},69120:function(e,t,n){var r=n(21899);n(90904)(r.JSON,"JSON",!0)},23112:function(e,t,n){n(24683)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(85616))},37501:function(e,t,n){n(23112)},86833:function(e,t,n){var r=n(76887),i=Math.floor,s=Math.log,a=Math.LOG2E;r({target:"Math",stat:!0},{clz32:function(e){var t=e>>>0;return t?31-i(s(t+.5)*a):32}})},33434:function(e,t,n){var r=n(76887),i=Math.hypot,s=Math.abs,a=Math.sqrt;r({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(e,t){for(var n,r,i=0,o=0,l=arguments.length,c=0;o<l;)c<(n=s(arguments[o++]))?(i=i*(r=c/n)*r+1,c=n):i+=n>0?(r=n/c)*r:n;return c===1/0?1/0:c*a(i)}})},53874:function(e,t,n){var r=n(76887),i=n(95981),s=Math.imul;r({target:"Math",stat:!0,forced:i((function(){return-5!=s(4294967295,5)||2!=s.length}))},{imul:function(e,t){var n=65535,r=+e,i=+t,s=n&r,a=n&i;return 0|s*a+((n&r>>>16)*a+s*(n&i>>>16)<<16>>>0)}})},77649:function(e,t,n){n(76887)({target:"Math",stat:!0},{log10:n(83964)})},88359:function(e,t,n){var r=n(76887),i=Math.log,s=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return i(e)/s}})},25499:function(e,t,n){n(76887)({target:"Math",stat:!0},{sign:n(6383)})},79413:function(){},54973:function(e,t,n){n(76887)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},56883:function(e,t,n){n(76887)({target:"Number",stat:!0},{isFinite:n(72534)})},30800:function(e,t,n){n(76887)({target:"Number",stat:!0},{isInteger:n(54639)})},89622:function(e,t,n){n(76887)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},71967:function(e,t,n){n(76887)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},49221:function(e,t,n){var r=n(76887),i=n(24420);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},53882:function(e,t,n){n(76887)({target:"Object",stat:!0,sham:!n(55746)},{create:n(29290)})},74979:function(e,t,n){var r=n(76887),i=n(55746),s=n(59938).f;r({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!i},{defineProperties:s})},86450:function(e,t,n){var r=n(76887),i=n(55746),s=n(65988).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!i},{defineProperty:s})},21078:function(e,t,n){var r=n(76887),i=n(88810).entries;r({target:"Object",stat:!0},{entries:function(e){return i(e)}})},15711:function(e,t,n){var r=n(76887),i=n(45602),s=n(95981),a=n(10941),o=n(21647).onFreeze,l=Object.freeze;r({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!i},{freeze:function(e){return l&&a(e)?l(o(e)):e}})},46924:function(e,t,n){var r=n(76887),i=n(95981),s=n(74529),a=n(49677).f,o=n(55746),l=i((function(){a(1)}));r({target:"Object",stat:!0,forced:!o||l,sham:!o},{getOwnPropertyDescriptor:function(e,t){return a(s(e),t)}})},88482:function(e,t,n){var r=n(76887),i=n(55746),s=n(31136),a=n(74529),o=n(49677),l=n(55449);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),i=o.f,c=s(r),u={},h=0;c.length>h;)void 0!==(n=i(r,t=c[h++]))&&l(u,t,n);return u}})},9816:function(e,t,n){var r=n(76887),i=n(95981),s=n(684).f;r({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},37144:function(e,t,n){var r=n(76887),i=n(63405),s=n(95981),a=n(87857),o=n(89678);r({target:"Object",stat:!0,forced:!i||s((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(o(e)):[]}})},17405:function(e,t,n){var r=n(76887),i=n(95981),s=n(89678),a=n(249),o=n(64160);r({target:"Object",stat:!0,forced:i((function(){a(1)})),sham:!o},{getPrototypeOf:function(e){return a(s(e))}})},21724:function(e,t,n){var r=n(76887),i=n(89678),s=n(14771);r({target:"Object",stat:!0,forced:n(95981)((function(){s(1)}))},{keys:function(e){return s(i(e))}})},90108:function(e,t,n){n(76887)({target:"Object",stat:!0},{setPrototypeOf:n(88929)})},55967:function(){},26614:function(e,t,n){var r=n(76887),i=n(88810).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},49718:function(e,t,n){var r=n(76887),i=n(81942);r({global:!0,forced:parseFloat!=i},{parseFloat:i})},14038:function(e,t,n){var r=n(76887),i=n(29806);r({global:!0,forced:parseInt!=i},{parseInt:i})},4560:function(e,t,n){var r=n(76887),i=n(78834),s=n(24883),a=n(69520),o=n(40002),l=n(93091);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=a.f(t),r=n.resolve,c=n.reject,u=o((function(){var n=s(t.resolve),a=[],o=0,c=1;l(e,(function(e){var s=o++,l=!1;c++,i(n,t,e).then((function(e){l||(l=!0,a[s]={status:"fulfilled",value:e},--c||r(a))}),(function(e){l||(l=!0,a[s]={status:"rejected",reason:e},--c||r(a))}))})),--c||r(a)}));return u.error&&c(u.value),n.promise}})},16890:function(e,t,n){var r=n(76887),i=n(78834),s=n(24883),a=n(69520),o=n(40002),l=n(93091);r({target:"Promise",stat:!0,forced:n(31542)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,c=n.reject,u=o((function(){var n=s(t.resolve),a=[],o=0,u=1;l(e,(function(e){var s=o++,l=!1;u++,i(n,t,e).then((function(e){l||(l=!0,a[s]=e,--u||r(a))}),c)})),--u||r(a)}));return u.error&&c(u.value),n.promise}})},91302:function(e,t,n){var r=n(76887),i=n(78834),s=n(24883),a=n(626),o=n(69520),l=n(40002),c=n(93091),u="No one promise resolved";r({target:"Promise",stat:!0},{any:function(e){var t=this,n=a("AggregateError"),r=o.f(t),h=r.resolve,p=r.reject,d=l((function(){var r=s(t.resolve),a=[],o=0,l=1,d=!1;c(e,(function(e){var s=o++,c=!1;l++,i(r,t,e).then((function(e){c||d||(d=!0,h(e))}),(function(e){c||d||(c=!0,a[s]=e,--l||p(new n(a,u)))}))})),--l||p(new n(a,u))}));return d.error&&p(d.value),r.promise}})},83376:function(e,t,n){var r=n(76887),i=n(82529),s=n(67742).CONSTRUCTOR,a=n(6991),o=n(626),l=n(57475),c=n(95929),u=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&l(a)){var h=o("Promise").prototype.catch;u.catch!==h&&c(u,"catch",h,{unsafe:!0})}},26934:function(e,t,n){var r,i,s,a=n(76887),o=n(82529),l=n(6049),c=n(21899),u=n(78834),h=n(95929),p=n(88929),d=n(90904),m=n(94431),f=n(24883),g=n(57475),_=n(10941),v=n(5743),y=n(70487),b=n(42941).set,x=n(66132),T=n(34845),w=n(40002),E=n(18397),S=n(45402),I=n(6991),M=n(67742),A=n(69520),R="Promise",D=M.CONSTRUCTOR,C=M.REJECTION_EVENT,O=M.SUBCLASSING,P=S.getterFor(R),N=S.set,L=I&&I.prototype,k=I,F=L,U=c.TypeError,B=c.document,j=c.process,G=A.f,z=G,V=!!(B&&B.createEvent&&c.dispatchEvent),H="unhandledrejection",q=function(e){var t;return!(!_(e)||!g(t=e.then))&&t},W=function(e,t){var n,r,i,s=t.value,a=1==t.state,o=a?e.ok:e.fail,l=e.resolve,c=e.reject,h=e.domain;try{o?(a||(2===t.rejection&&Z(t),t.rejection=1),!0===o?n=s:(h&&h.enter(),n=o(s),h&&(h.exit(),i=!0)),n===e.promise?c(U("Promise-chain cycle")):(r=q(n))?u(r,n,l,c):l(n)):c(s)}catch(e){h&&!i&&h.exit(),c(e)}},Y=function(e,t){e.notified||(e.notified=!0,x((function(){for(var n,r=e.reactions;n=r.get();)W(n,e);e.notified=!1,t&&!e.rejection&&$(e)})))},X=function(e,t,n){var r,i;V?((r=B.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!C&&(i=c["on"+e])?i(r):e===H&&T("Unhandled promise rejection",n)},$=function(e){u(b,c,(function(){var t,n=e.facade,r=e.value;if(K(e)&&(t=w((function(){l?j.emit("unhandledRejection",r,n):X(H,n,r)})),e.rejection=l||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},Z=function(e){u(b,c,(function(){var t=e.facade;l?j.emit("rejectionHandled",t):X("rejectionhandled",t,e.value)}))},J=function(e,t,n){return function(r){e(t,r,n)}},Q=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Y(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw U("Promise can't be resolved itself");var r=q(t);r?x((function(){var n={done:!1};try{u(r,t,J(ee,n,e),J(Q,n,e))}catch(t){Q(n,t,e)}})):(e.value=t,e.state=1,Y(e,!1))}catch(t){Q({done:!1},t,e)}}};if(D&&(F=(k=function(e){v(this,F),f(e),u(r,this);var t=P(this);try{e(J(ee,t),J(Q,t))}catch(e){Q(t,e)}}).prototype,(r=function(e){N(this,{type:R,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=h(F,"then",(function(e,t){var n=P(this),r=G(y(this,k));return n.parent=!0,r.ok=!g(e)||e,r.fail=g(t)&&t,r.domain=l?j.domain:void 0,0==n.state?n.reactions.add(r):x((function(){W(r,n)})),r.promise})),i=function(){var e=new r,t=P(e);this.promise=e,this.resolve=J(ee,t),this.reject=J(Q,t)},A.f=G=function(e){return e===k||undefined===e?new i(e):z(e)},!o&&g(I)&&L!==Object.prototype)){s=L.then,O||h(L,"then",(function(e,t){var n=this;return new k((function(e,t){u(s,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete L.constructor}catch(e){}p&&p(L,F)}a({global:!0,constructor:!0,wrap:!0,forced:D},{Promise:k}),d(k,R,!1,!0),m(R)},44349:function(e,t,n){var r=n(76887),i=n(82529),s=n(6991),a=n(95981),o=n(626),l=n(57475),c=n(70487),u=n(56584),h=n(95929),p=s&&s.prototype;if(r({target:"Promise",proto:!0,real:!0,forced:!!s&&a((function(){p.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,o("Promise")),n=l(e);return this.then(n?function(n){return u(t,e()).then((function(){return n}))}:e,n?function(n){return u(t,e()).then((function(){throw n}))}:e)}}),!i&&l(s)){var d=o("Promise").prototype.finally;p.finally!==d&&h(p,"finally",d,{unsafe:!0})}},98881:function(e,t,n){n(26934),n(16890),n(83376),n(55921),n(64069),n(14482)},55921:function(e,t,n){var r=n(76887),i=n(78834),s=n(24883),a=n(69520),o=n(40002),l=n(93091);r({target:"Promise",stat:!0,forced:n(31542)},{race:function(e){var t=this,n=a.f(t),r=n.reject,c=o((function(){var a=s(t.resolve);l(e,(function(e){i(a,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},64069:function(e,t,n){var r=n(76887),i=n(78834),s=n(69520);r({target:"Promise",stat:!0,forced:n(67742).CONSTRUCTOR},{reject:function(e){var t=s.f(this);return i(t.reject,void 0,e),t.promise}})},14482:function(e,t,n){var r=n(76887),i=n(626),s=n(82529),a=n(6991),o=n(67742).CONSTRUCTOR,l=n(56584),c=i("Promise"),u=s&&!o;r({target:"Promise",stat:!0,forced:s||o},{resolve:function(e){return l(u&&this===c?a:this,e)}})},7453:function(e,t,n){var r=n(76887),i=n(626),s=n(79730),a=n(98308),o=n(174),l=n(96059),c=n(10941),u=n(29290),h=n(95981),p=i("Reflect","construct"),d=Object.prototype,m=[].push,f=h((function(){function e(){}return!(p((function(){}),[],e)instanceof e)})),g=!h((function(){p((function(){}))})),_=f||g;r({target:"Reflect",stat:!0,forced:_,sham:_},{construct:function(e,t){o(e),l(t);var n=arguments.length<3?e:o(arguments[2]);if(g&&!f)return p(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return s(m,r,t),new(s(a,e,r))}var i=n.prototype,h=u(c(i)?i:d),_=s(e,h,t);return c(_)?_:h}})},1502:function(){},67091:function(){},94261:function(){},82266:function(e,t,n){n(24683)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(85616))},69008:function(e,t,n){n(82266)},93588:function(e,t,n){var r=n(76887),i=n(95329),s=n(48219),a=n(62435),o=n(85803),l=n(95981),c=i("".charAt);r({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(e){var t=o(s(this)),n=t.length,r=a(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:c(t,i)}})},1293:function(e,t,n){var r,i=n(76887),s=n(95329),a=n(49677).f,o=n(43057),l=n(85803),c=n(70344),u=n(48219),h=n(67772),p=n(82529),d=s("".endsWith),m=s("".slice),f=Math.min,g=h("endsWith");i({target:"String",proto:!0,forced:!!(p||g||(r=a(String.prototype,"endsWith"),!r||r.writable))&&!g},{endsWith:function(e){var t=l(u(this));c(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,i=void 0===n?r:f(o(n),r),s=l(e);return d?d(t,s,i):m(t,i-s.length,i)===s}})},23809:function(e,t,n){var r=n(76887),i=n(95329),s=n(59413),a=RangeError,o=String.fromCharCode,l=String.fromCodePoint,c=i([].join);r({target:"String",stat:!0,arity:1,forced:!!l&&1!=l.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,i=0;r>i;){if(t=+arguments[i++],s(t,1114111)!==t)throw a(t+" is not a valid code point");n[i]=t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320)}return c(n,"")}})},11035:function(e,t,n){var r=n(76887),i=n(95329),s=n(70344),a=n(48219),o=n(85803),l=n(67772),c=i("".indexOf);r({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~c(o(a(this)),o(s(e)),arguments.length>1?arguments[1]:void 0)}})},77971:function(e,t,n){var r=n(64620).charAt,i=n(85803),s=n(45402),a=n(75105),o=n(23538),l="String Iterator",c=s.set,u=s.getterFor(l);a(String,"String",(function(e){c(this,{type:l,string:i(e),index:0})}),(function(){var e,t=u(this),n=t.string,i=t.index;return i>=n.length?o(void 0,!0):(e=r(n,i),t.index+=e.length,o(e,!1))}))},32199:function(e,t,n){var r=n(76887),i=n(78834),s=n(95329),a=n(53847),o=n(23538),l=n(48219),c=n(43057),u=n(85803),h=n(96059),p=n(82119),d=n(82532),m=n(60685),f=n(43613),g=n(14229),_=n(95929),v=n(95981),y=n(99813),b=n(70487),x=n(29900),T=n(66293),w=n(45402),E=n(82529),S=y("matchAll"),I="RegExp String",M="RegExp String Iterator",A=w.set,R=w.getterFor(M),D=RegExp.prototype,C=TypeError,O=s("".indexOf),P=s("".matchAll),N=!!P&&!v((function(){P("a",/./)})),L=a((function(e,t,n,r){A(this,{type:M,regexp:e,string:t,global:n,unicode:r,done:!1})}),I,(function(){var e=R(this);if(e.done)return o(void 0,!0);var t=e.regexp,n=e.string,r=T(t,n);return null===r?(e.done=!0,o(void 0,!0)):e.global?(""===u(r[0])&&(t.lastIndex=x(n,c(t.lastIndex),e.unicode)),o(r,!1)):(e.done=!0,o(r,!1))})),k=function(e){var t,n,r,i=h(this),s=u(e),a=b(i,RegExp),o=u(f(i));return t=new a(a===RegExp?i.source:i,o),n=!!~O(o,"g"),r=!!~O(o,"u"),t.lastIndex=c(i.lastIndex),new L(t,s,n,r)};r({target:"String",proto:!0,forced:N},{matchAll:function(e){var t,n,r,s,a=l(this);if(p(e)){if(N)return P(a,e)}else{if(m(e)&&(t=u(l(f(e))),!~O(t,"g")))throw C("`.matchAll` does not allow non-global regexes");if(N)return P(a,e);if(void 0===(r=g(e,S))&&E&&"RegExp"==d(e)&&(r=k),r)return i(r,e,a)}return n=u(a),s=new RegExp(e,"g"),E?i(k,s,n):s[S](n)}}),E||S in D||_(D,S,k)},92075:function(e,t,n){var r=n(76887),i=n(6930).start;r({target:"String",proto:!0,forced:n(4887)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},60986:function(e,t,n){n(76887)({target:"String",proto:!0},{repeat:n(16178)})},94761:function(e,t,n){var r,i=n(76887),s=n(95329),a=n(49677).f,o=n(43057),l=n(85803),c=n(70344),u=n(48219),h=n(67772),p=n(82529),d=s("".startsWith),m=s("".slice),f=Math.min,g=h("startsWith");i({target:"String",proto:!0,forced:!!(p||g||(r=a(String.prototype,"startsWith"),!r||r.writable))&&!g},{startsWith:function(e){var t=l(u(this));c(e);var n=o(f(arguments.length>1?arguments[1]:void 0,t.length)),r=l(e);return d?d(t,r,n):m(t,n,n+r.length)===r}})},56998:function(e,t,n){var r=n(76887),i=n(54560);r({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==i},{trimLeft:i})},60350:function(e,t,n){n(56998);var r=n(76887),i=n(54560);r({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==i},{trimStart:i})},57398:function(e,t,n){var r=n(76887),i=n(74853).trim;r({target:"String",proto:!0,forced:n(93093)("trim")},{trim:function(){return i(this)}})},8555:function(e,t,n){n(73464)("asyncIterator")},48616:function(e,t,n){var r=n(76887),i=n(21899),s=n(78834),a=n(95329),o=n(82529),l=n(55746),c=n(63405),u=n(95981),h=n(90953),p=n(7046),d=n(96059),m=n(74529),f=n(83894),g=n(85803),_=n(31887),v=n(29290),y=n(14771),b=n(10946),x=n(684),T=n(87857),w=n(49677),E=n(65988),S=n(59938),I=n(36760),M=n(95929),A=n(68726),R=n(44262),D=n(27748),C=n(99418),O=n(99813),P=n(11477),N=n(73464),L=n(29630),k=n(90904),F=n(45402),U=n(3610).forEach,B=R("hidden"),j="Symbol",G=F.set,z=F.getterFor(j),V=Object.prototype,H=i.Symbol,q=H&&H.prototype,W=i.TypeError,Y=i.QObject,X=w.f,$=E.f,K=x.f,Z=I.f,J=a([].push),Q=A("symbols"),ee=A("op-symbols"),te=A("wks"),ne=!Y||!Y.prototype||!Y.prototype.findChild,re=l&&u((function(){return 7!=v($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=X(V,t);r&&delete V[t],$(e,t,n),r&&e!==V&&$(V,t,r)}:$,ie=function(e,t){var n=Q[e]=v(q);return G(n,{type:j,tag:e,description:t}),l||(n.description=t),n},se=function(e,t,n){e===V&&se(ee,t,n),d(e);var r=f(t);return d(n),h(Q,r)?(n.enumerable?(h(e,B)&&e[B][r]&&(e[B][r]=!1),n=v(n,{enumerable:_(0,!1)})):(h(e,B)||$(e,B,_(1,{})),e[B][r]=!0),re(e,r,n)):$(e,r,n)},ae=function(e,t){d(e);var n=m(t),r=y(n).concat(ue(n));return U(r,(function(t){l&&!s(oe,n,t)||se(e,t,n[t])})),e},oe=function(e){var t=f(e),n=s(Z,this,t);return!(this===V&&h(Q,t)&&!h(ee,t))&&(!(n||!h(this,t)||!h(Q,t)||h(this,B)&&this[B][t])||n)},le=function(e,t){var n=m(e),r=f(t);if(n!==V||!h(Q,r)||h(ee,r)){var i=X(n,r);return!i||!h(Q,r)||h(n,B)&&n[B][r]||(i.enumerable=!0),i}},ce=function(e){var t=K(m(e)),n=[];return U(t,(function(e){h(Q,e)||h(D,e)||J(n,e)})),n},ue=function(e){var t=e===V,n=K(t?ee:m(e)),r=[];return U(n,(function(e){!h(Q,e)||t&&!h(V,e)||J(r,Q[e])})),r};c||(H=function(){if(p(q,this))throw W("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,t=C(e),n=function(e){this===V&&s(n,ee,e),h(this,B)&&h(this[B],t)&&(this[B][t]=!1),re(this,t,_(1,e))};return l&&ne&&re(V,t,{configurable:!0,set:n}),ie(t,e)},M(q=H.prototype,"toString",(function(){return z(this).tag})),M(H,"withoutSetter",(function(e){return ie(C(e),e)})),I.f=oe,E.f=se,S.f=ae,w.f=le,b.f=x.f=ce,T.f=ue,P.f=function(e){return ie(O(e),e)},l&&($(q,"description",{configurable:!0,get:function(){return z(this).description}}),o||M(V,"propertyIsEnumerable",oe,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:H}),U(y(te),(function(e){N(e)})),r({target:j,stat:!0,forced:!c},{useSetter:function(){ne=!0},useSimple:function(){ne=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?v(e):ae(v(e),t)},defineProperty:se,defineProperties:ae,getOwnPropertyDescriptor:le}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:ce}),L(),k(H,j),D[B]=!0},52615:function(){},64523:function(e,t,n){var r=n(76887),i=n(626),s=n(90953),a=n(85803),o=n(68726),l=n(34680),c=o("string-to-symbol-registry"),u=o("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(s(c,t))return c[t];var n=i("Symbol")(t);return c[t]=n,u[n]=t,n}})},21732:function(e,t,n){n(73464)("hasInstance")},35903:function(e,t,n){n(73464)("isConcatSpreadable")},1825:function(e,t,n){n(73464)("iterator")},35824:function(e,t,n){n(48616),n(64523),n(38608),n(32619),n(37144)},38608:function(e,t,n){var r=n(76887),i=n(90953),s=n(56664),a=n(69826),o=n(68726),l=n(34680),c=o("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!s(e))throw TypeError(a(e)+" is not a symbol");if(i(c,e))return c[e]}})},45915:function(e,t,n){n(73464)("matchAll")},28394:function(e,t,n){n(73464)("match")},61766:function(e,t,n){n(73464)("replace")},62737:function(e,t,n){n(73464)("search")},89911:function(e,t,n){n(73464)("species")},74315:function(e,t,n){n(73464)("split")},63131:function(e,t,n){var r=n(73464),i=n(29630);r("toPrimitive"),i()},64714:function(e,t,n){var r=n(626),i=n(73464),s=n(90904);i("toStringTag"),s(r("Symbol"),"Symbol")},70659:function(e,t,n){n(73464)("unscopables")},94776:function(e,t,n){var r,i=n(21899),s=n(95329),a=n(94380),o=n(21647),l=n(24683),c=n(8850),u=n(10941),h=n(91584),p=n(45402).enforce,d=n(47093),m=!i.ActiveXObject&&"ActiveXObject"in i,f=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},g=l("WeakMap",f,c);if(d&&m){r=c.getConstructor(f,"WeakMap",!0),o.enable();var _=g.prototype,v=s(_.delete),y=s(_.has),b=s(_.get),x=s(_.set);a(_,{delete:function(e){if(u(e)&&!h(e)){var t=p(this);return t.frozen||(t.frozen=new r),v(this,e)||t.frozen.delete(e)}return v(this,e)},has:function(e){if(u(e)&&!h(e)){var t=p(this);return t.frozen||(t.frozen=new r),y(this,e)||t.frozen.has(e)}return y(this,e)},get:function(e){if(u(e)&&!h(e)){var t=p(this);return t.frozen||(t.frozen=new r),y(this,e)?b(this,e):t.frozen.get(e)}return b(this,e)},set:function(e,t){if(u(e)&&!h(e)){var n=p(this);n.frozen||(n.frozen=new r),y(this,e)?x(this,e,t):n.frozen.set(e,t)}else x(this,e,t);return this}})}},54334:function(e,t,n){n(94776)},31115:function(e,t,n){n(24683)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(8850))},1773:function(e,t,n){n(31115)},89731:function(e,t,n){n(47627)},54322:function(e,t,n){n(94481)},9668:function(e,t,n){n(52595)},66591:function(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:n(28984)})},55121:function(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,forced:!0},{emplace:n(48721)})},14751:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(79993),o=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return!o(n,(function(e,n,i){if(!r(n,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},52407:function(e,t,n){var r=n(76887),i=n(626),s=n(86843),a=n(78834),o=n(24883),l=n(96059),c=n(70487),u=n(79993),h=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=l(this),n=u(t),r=s(e,arguments.length>1?arguments[1]:void 0),p=new(c(t,i("Map"))),d=o(p.set);return h(n,(function(e,n){r(n,e,t)&&a(d,p,e,n)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),p}})},27281:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(79993),o=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return o(n,(function(e,n,i){if(r(n,e,t))return i(e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},48580:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(79993),o=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return o(n,(function(e,n,i){if(r(n,e,t))return i(n)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},52453:function(e,t,n){n(76887)({target:"Map",stat:!0,forced:!0},{from:n(83590)})},36507:function(e,t,n){var r=n(76887),i=n(78834),s=n(95329),a=n(24883),o=n(53476),l=n(93091),c=s([].push);r({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){a(t);var n=o(e),r=new this,s=a(r.has),u=a(r.get),h=a(r.set);return l(n,(function(e){var n=t(e);i(s,r,n)?c(i(u,r,n),e):i(h,r,n,[e])}),{IS_ITERATOR:!0}),r}})},93647:function(e,t,n){var r=n(76887),i=n(96059),s=n(79993),a=n(57309),o=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return o(s(i(this)),(function(t,n,r){if(a(n,e))return r()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},47641:function(e,t,n){var r=n(76887),i=n(78834),s=n(93091),a=n(24883);r({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var n=new this;a(t);var r=a(n.set);return s(e,(function(e){i(r,n,t(e),e)})),n}})},18552:function(e,t,n){var r=n(76887),i=n(96059),s=n(79993),a=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){return a(s(i(this)),(function(t,n,r){if(n===e)return r(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},27693:function(e,t,n){var r=n(76887),i=n(626),s=n(86843),a=n(78834),o=n(24883),l=n(96059),c=n(70487),u=n(79993),h=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=l(this),n=u(t),r=s(e,arguments.length>1?arguments[1]:void 0),p=new(c(t,i("Map"))),d=o(p.set);return h(n,(function(e,n){a(d,p,r(n,e,t),n)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),p}})},8:function(e,t,n){var r=n(76887),i=n(626),s=n(86843),a=n(78834),o=n(24883),l=n(96059),c=n(70487),u=n(79993),h=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=l(this),n=u(t),r=s(e,arguments.length>1?arguments[1]:void 0),p=new(c(t,i("Map"))),d=o(p.set);return h(n,(function(e,n){a(d,p,e,r(n,e,t))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),p}})},48514:function(e,t,n){var r=n(76887),i=n(24883),s=n(96059),a=n(93091);r({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=s(this),n=i(t.set),r=arguments.length,o=0;o<r;)a(arguments[o++],n,{that:t,AS_ENTRIES:!0});return t}})},32523:function(e,t,n){n(76887)({target:"Map",stat:!0,forced:!0},{of:n(45226)})},8212:function(e,t,n){var r=n(76887),i=n(96059),s=n(24883),a=n(79993),o=n(93091),l=TypeError;r({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=i(this),n=a(t),r=arguments.length<2,c=r?void 0:arguments[1];if(s(e),o(n,(function(n,i){r?(r=!1,c=i):c=e(c,i,n,t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),r)throw l("Reduce of empty map with no initial value");return c}})},89642:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(79993),o=n(93091);r({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return o(n,(function(e,n,i){if(r(n,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},68826:function(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:n(20716)})},78485:function(e,t,n){var r=n(76887),i=n(78834),s=n(96059),a=n(24883),o=TypeError;r({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var n=s(this),r=a(n.get),l=a(n.has),c=a(n.set),u=arguments.length;a(t);var h=i(l,n,e);if(!h&&u<3)throw o("Updating absent value");var p=h?i(r,n,e):a(u>2?arguments[2]:void 0)(e,n);return i(c,n,e,t(p,e,n)),n}})},42256:function(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:n(20716)})},55708:function(e,t,n){n(4560)},88731:function(e,t,n){n(91302)},30014:function(e,t,n){var r=n(76887),i=n(69520),s=n(40002);r({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=i.f(this),n=s(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},32645:function(e,t,n){n(76887)({target:"Set",proto:!0,real:!0,forced:!0},{addAll:n(7622)})},32578:function(e,t,n){n(76887)({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:n(28984)})},17421:function(e,t,n){var r=n(76887),i=n(626),s=n(78834),a=n(24883),o=n(96059),l=n(70487),c=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){var t=o(this),n=new(l(t,i("Set")))(t),r=a(n.delete);return c(e,(function(e){s(r,n,e)})),n}})},4573:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(69571),o=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return!o(n,(function(e,n){if(!r(e,e,t))return n()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},13787:function(e,t,n){var r=n(76887),i=n(626),s=n(78834),a=n(24883),o=n(96059),l=n(86843),c=n(70487),u=n(69571),h=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=o(this),n=u(t),r=l(e,arguments.length>1?arguments[1]:void 0),p=new(c(t,i("Set"))),d=a(p.add);return h(n,(function(e){r(e,e,t)&&s(d,p,e)}),{IS_ITERATOR:!0}),p}})},40256:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(69571),o=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return o(n,(function(e,n){if(r(e,e,t))return n(e)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},95800:function(e,t,n){n(76887)({target:"Set",stat:!0,forced:!0},{from:n(83590)})},52032:function(e,t,n){var r=n(76887),i=n(626),s=n(78834),a=n(24883),o=n(96059),l=n(70487),c=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){var t=o(this),n=new(l(t,i("Set"))),r=a(t.has),u=a(n.add);return c(e,(function(e){s(r,t,e)&&s(u,n,e)})),n}})},21873:function(e,t,n){var r=n(76887),i=n(78834),s=n(24883),a=n(96059),o=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){var t=a(this),n=s(t.has);return!o(e,(function(e,r){if(!0===i(n,t,e))return r()}),{INTERRUPTED:!0}).stopped}})},26566:function(e,t,n){var r=n(76887),i=n(626),s=n(78834),a=n(24883),o=n(57475),l=n(96059),c=n(53476),u=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){var t=c(this),n=l(e),r=n.has;return o(r)||(n=new(i("Set"))(e),r=a(n.has)),!u(t,(function(e,t){if(!1===s(r,n,e))return t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},50987:function(e,t,n){var r=n(76887),i=n(78834),s=n(24883),a=n(96059),o=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){var t=a(this),n=s(t.has);return!o(e,(function(e,r){if(!1===i(n,t,e))return r()}),{INTERRUPTED:!0}).stopped}})},71892:function(e,t,n){var r=n(76887),i=n(95329),s=n(96059),a=n(85803),o=n(69571),l=n(93091),c=i([].join),u=[].push;r({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=s(this),n=o(t),r=void 0===e?",":a(e),i=[];return l(n,u,{that:i,IS_ITERATOR:!0}),c(i,r)}})},3352:function(e,t,n){var r=n(76887),i=n(626),s=n(86843),a=n(78834),o=n(24883),l=n(96059),c=n(70487),u=n(69571),h=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=l(this),n=u(t),r=s(e,arguments.length>1?arguments[1]:void 0),p=new(c(t,i("Set"))),d=o(p.add);return h(n,(function(e){a(d,p,r(e,e,t))}),{IS_ITERATOR:!0}),p}})},73676:function(e,t,n){n(76887)({target:"Set",stat:!0,forced:!0},{of:n(45226)})},76988:function(e,t,n){var r=n(76887),i=n(24883),s=n(96059),a=n(69571),o=n(93091),l=TypeError;r({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=s(this),n=a(t),r=arguments.length<2,c=r?void 0:arguments[1];if(i(e),o(n,(function(n){r?(r=!1,c=n):c=e(c,n,n,t)}),{IS_ITERATOR:!0}),r)throw l("Reduce of empty set with no initial value");return c}})},16875:function(e,t,n){var r=n(76887),i=n(96059),s=n(86843),a=n(69571),o=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=i(this),n=a(t),r=s(e,arguments.length>1?arguments[1]:void 0);return o(n,(function(e,n){if(r(e,e,t))return n()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},3859:function(e,t,n){var r=n(76887),i=n(626),s=n(78834),a=n(24883),o=n(96059),l=n(70487),c=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){var t=o(this),n=new(l(t,i("Set")))(t),r=a(n.delete),u=a(n.add);return c(e,(function(e){s(r,n,e)||s(u,n,e)})),n}})},56690:function(e,t,n){var r=n(76887),i=n(626),s=n(24883),a=n(96059),o=n(70487),l=n(93091);r({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){var t=a(this),n=new(o(t,i("Set")))(t);return l(e,s(n.add),{that:n}),n}})},54975:function(e,t,n){var r=n(76887),i=n(64620).charAt,s=n(48219),a=n(62435),o=n(85803);r({target:"String",proto:!0,forced:!0},{at:function(e){var t=o(s(this)),n=t.length,r=a(e),l=r>=0?r:n+r;return l<0||l>=n?void 0:i(t,l)}})},79470:function(e,t,n){n(32199)},28783:function(e,t,n){n(73464)("asyncDispose")},43975:function(e,t,n){n(73464)("dispose")},65799:function(e,t,n){n(73464)("matcher")},31943:function(e,t,n){n(73464)("metadataKey")},45414:function(e,t,n){n(73464)("metadata")},46774:function(e,t,n){n(73464)("observable")},80620:function(e,t,n){n(73464)("patternMatch")},36172:function(e,t,n){n(73464)("replaceAll")},4629:function(e,t,n){n(76887)({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:n(28984)})},86442:function(e,t,n){n(76887)({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:n(48721)})},26207:function(e,t,n){n(76887)({target:"WeakMap",stat:!0,forced:!0},{from:n(83590)})},13215:function(e,t,n){n(76887)({target:"WeakMap",stat:!0,forced:!0},{of:n(45226)})},4055:function(e,t,n){n(76887)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:n(20716)})},15896:function(e,t,n){n(76887)({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:n(7622)})},35501:function(e,t,n){n(76887)({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:n(28984)})},22511:function(e,t,n){n(76887)({target:"WeakSet",stat:!0,forced:!0},{from:n(83590)})},33309:function(e,t,n){n(76887)({target:"WeakSet",stat:!0,forced:!0},{of:n(45226)})},7634:function(e,t,n){n(66274);var r=n(63281),i=n(21899),s=n(9697),a=n(32029),o=n(12077),l=n(99813)("toStringTag");for(var c in r){var u=i[c],h=u&&u.prototype;h&&s(h)!==l&&a(h,l,c),o[c]=o.Array}},79229:function(e,t,n){var r=n(76887),i=n(21899),s=n(37620).setInterval;r({global:!0,bind:!0,forced:i.setInterval!==s},{setInterval:s})},17749:function(e,t,n){var r=n(76887),i=n(21899),s=n(37620).setTimeout;r({global:!0,bind:!0,forced:i.setTimeout!==s},{setTimeout:s})},71249:function(e,t,n){n(79229),n(17749)},62524:function(e,t,n){n(66274);var r=n(76887),i=n(21899),s=n(78834),a=n(95329),o=n(55746),l=n(14766),c=n(95929),u=n(94380),h=n(90904),p=n(53847),d=n(45402),m=n(5743),f=n(57475),g=n(90953),_=n(86843),v=n(9697),y=n(96059),b=n(10941),x=n(85803),T=n(29290),w=n(31887),E=n(53476),S=n(22902),I=n(18348),M=n(99813),A=n(61388),R=M("iterator"),D="URLSearchParams",C="URLSearchParamsIterator",O=d.set,P=d.getterFor(D),N=d.getterFor(C),L=Object.getOwnPropertyDescriptor,k=function(e){if(!o)return i[e];var t=L(i,e);return t&&t.value},F=k("fetch"),U=k("Request"),B=k("Headers"),j=U&&U.prototype,G=B&&B.prototype,z=i.RegExp,V=i.TypeError,H=i.decodeURIComponent,q=i.encodeURIComponent,W=a("".charAt),Y=a([].join),X=a([].push),$=a("".replace),K=a([].shift),Z=a([].splice),J=a("".split),Q=a("".slice),ee=/\+/g,te=Array(4),ne=function(e){return te[e-1]||(te[e-1]=z("((?:%[\\da-f]{2}){"+e+"})","gi"))},re=function(e){try{return H(e)}catch(t){return e}},ie=function(e){var t=$(e,ee," "),n=4;try{return H(t)}catch(e){for(;n;)t=$(t,ne(n--),re);return t}},se=/[!'()~]|%20/g,ae={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},oe=function(e){return ae[e]},le=function(e){return $(q(e),se,oe)},ce=p((function(e,t){O(this,{type:C,iterator:E(P(e).entries),kind:t})}),"Iterator",(function(){var e=N(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n}),!0),ue=function(e){this.entries=[],this.url=null,void 0!==e&&(b(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===W(e,0)?Q(e,1):e:x(e)))};ue.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,a,o,l,c=S(e);if(c)for(n=(t=E(e,c)).next;!(r=s(n,t)).done;){if(a=(i=E(y(r.value))).next,(o=s(a,i)).done||(l=s(a,i)).done||!s(a,i).done)throw V("Expected sequence with length 2");X(this.entries,{key:x(o.value),value:x(l.value)})}else for(var u in e)g(e,u)&&X(this.entries,{key:u,value:x(e[u])})},parseQuery:function(e){if(e)for(var t,n,r=J(e,"&"),i=0;i<r.length;)(t=r[i++]).length&&(n=J(t,"="),X(this.entries,{key:ie(K(n)),value:ie(Y(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],X(n,le(e.key)+"="+le(e.value));return Y(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var he=function(){m(this,pe);var e=arguments.length>0?arguments[0]:void 0;O(this,new ue(e))},pe=he.prototype;if(u(pe,{append:function(e,t){I(arguments.length,2);var n=P(this);X(n.entries,{key:x(e),value:x(t)}),n.updateURL()},delete:function(e){I(arguments.length,1);for(var t=P(this),n=t.entries,r=x(e),i=0;i<n.length;)n[i].key===r?Z(n,i,1):i++;t.updateURL()},get:function(e){I(arguments.length,1);for(var t=P(this).entries,n=x(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){I(arguments.length,1);for(var t=P(this).entries,n=x(e),r=[],i=0;i<t.length;i++)t[i].key===n&&X(r,t[i].value);return r},has:function(e){I(arguments.length,1);for(var t=P(this).entries,n=x(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){I(arguments.length,1);for(var n,r=P(this),i=r.entries,s=!1,a=x(e),o=x(t),l=0;l<i.length;l++)(n=i[l]).key===a&&(s?Z(i,l--,1):(s=!0,n.value=o));s||X(i,{key:a,value:o}),r.updateURL()},sort:function(){var e=P(this);A(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=P(this).entries,r=_(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new ce(this,"keys")},values:function(){return new ce(this,"values")},entries:function(){return new ce(this,"entries")}},{enumerable:!0}),c(pe,R,pe.entries,{name:"entries"}),c(pe,"toString",(function(){return P(this).serialize()}),{enumerable:!0}),h(he,D),r({global:!0,constructor:!0,forced:!l},{URLSearchParams:he}),!l&&f(B)){var de=a(G.has),me=a(G.set),fe=function(e){if(b(e)){var t,n=e.body;if(v(n)===D)return t=e.headers?new B(e.headers):new B,de(t,"content-type")||me(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),T(e,{body:w(0,x(n)),headers:w(0,t)})}return e};if(f(F)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return F(e,arguments.length>1?fe(arguments[1]):{})}}),f(U)){var ge=function(e){return m(this,j),new U(e,arguments.length>1?fe(arguments[1]):{})};j.constructor=ge,ge.prototype=j,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ge})}}e.exports={URLSearchParams:he,getState:P}},95304:function(e,t,n){n(62524)},47250:function(e,t,n){n(77971);var r,i=n(76887),s=n(55746),a=n(14766),o=n(21899),l=n(86843),c=n(95329),u=n(95929),h=n(29202),p=n(5743),d=n(90953),m=n(24420),f=n(11354),g=n(15790),_=n(64620).codeAt,v=n(73291),y=n(85803),b=n(90904),x=n(18348),T=n(62524),w=n(45402),E=w.set,S=w.getterFor("URL"),I=T.URLSearchParams,M=T.getState,A=o.URL,R=o.TypeError,D=o.parseInt,C=Math.floor,O=Math.pow,P=c("".charAt),N=c(/./.exec),L=c([].join),k=c(1..toString),F=c([].pop),U=c([].push),B=c("".replace),j=c([].shift),G=c("".split),z=c("".slice),V=c("".toLowerCase),H=c([].unshift),q="Invalid scheme",W="Invalid host",Y="Invalid port",X=/[a-z]/i,$=/[\d+-.a-z]/i,K=/\d/,Z=/^0x/i,J=/^[0-7]+$/,Q=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ne=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ie=/[\t\n\r]/g,se=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)H(t,e%256),e=C(e/256);return L(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,s=0;s<8;s++)0!==e[s]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=s),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=k(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},ae={},oe=m({},ae,{" ":1,'"':1,"<":1,">":1,"`":1}),le=m({},oe,{"#":1,"?":1,"{":1,"}":1}),ce=m({},le,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ue=function(e,t){var n=_(e,0);return n>32&&n<127&&!d(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pe=function(e,t){var n;return 2==e.length&&N(X,P(e,0))&&(":"==(n=P(e,1))||!t&&"|"==n)},de=function(e){var t;return e.length>1&&pe(z(e,0,2))&&(2==e.length||"/"===(t=P(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===V(e)},fe={},ge={},_e={},ve={},ye={},be={},xe={},Te={},we={},Ee={},Se={},Ie={},Me={},Ae={},Re={},De={},Ce={},Oe={},Pe={},Ne={},Le={},ke=function(e,t,n){var r,i,s,a=y(e);if(t){if(i=this.parse(a))throw R(i);this.searchParams=null}else{if(void 0!==n&&(r=new ke(n,!0)),i=this.parse(a,null,r))throw R(i);(s=M(new I)).bindURL(this),this.searchParams=s}};ke.prototype={type:"URL",parse:function(e,t,n){var i,s,a,o,l,c=this,u=t||fe,h=0,p="",m=!1,_=!1,v=!1;for(e=y(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=B(e,re,"")),e=B(e,ie,""),i=f(e);h<=i.length;){switch(s=i[h],u){case fe:if(!s||!N(X,s)){if(t)return q;u=_e;continue}p+=V(s),u=ge;break;case ge:if(s&&(N($,s)||"+"==s||"-"==s||"."==s))p+=V(s);else{if(":"!=s){if(t)return q;p="",u=_e,h=0;continue}if(t&&(c.isSpecial()!=d(he,p)||"file"==p&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=p,t)return void(c.isSpecial()&&he[c.scheme]==c.port&&(c.port=null));p="","file"==c.scheme?u=Ae:c.isSpecial()&&n&&n.scheme==c.scheme?u=ve:c.isSpecial()?u=Te:"/"==i[h+1]?(u=ye,h++):(c.cannotBeABaseURL=!0,U(c.path,""),u=Pe)}break;case _e:if(!n||n.cannotBeABaseURL&&"#"!=s)return q;if(n.cannotBeABaseURL&&"#"==s){c.scheme=n.scheme,c.path=g(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=Le;break}u="file"==n.scheme?Ae:be;continue;case ve:if("/"!=s||"/"!=i[h+1]){u=be;continue}u=we,h++;break;case ye:if("/"==s){u=Ee;break}u=Oe;continue;case be:if(c.scheme=n.scheme,s==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=g(n.path),c.query=n.query;else if("/"==s||"\\"==s&&c.isSpecial())u=xe;else if("?"==s)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=g(n.path),c.query="",u=Ne;else{if("#"!=s){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=g(n.path),c.path.length--,u=Oe;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=g(n.path),c.query=n.query,c.fragment="",u=Le}break;case xe:if(!c.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=Oe;continue}u=Ee}else u=we;break;case Te:if(u=we,"/"!=s||"/"!=P(p,h+1))continue;h++;break;case we:if("/"!=s&&"\\"!=s){u=Ee;continue}break;case Ee:if("@"==s){m&&(p="%40"+p),m=!0,a=f(p);for(var b=0;b<a.length;b++){var x=a[b];if(":"!=x||v){var T=ue(x,ce);v?c.password+=T:c.username+=T}else v=!0}p=""}else if(s==r||"/"==s||"?"==s||"#"==s||"\\"==s&&c.isSpecial()){if(m&&""==p)return"Invalid authority";h-=f(p).length+1,p="",u=Se}else p+=s;break;case Se:case Ie:if(t&&"file"==c.scheme){u=De;continue}if(":"!=s||_){if(s==r||"/"==s||"?"==s||"#"==s||"\\"==s&&c.isSpecial()){if(c.isSpecial()&&""==p)return W;if(t&&""==p&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(p))return o;if(p="",u=Ce,t)return;continue}"["==s?_=!0:"]"==s&&(_=!1),p+=s}else{if(""==p)return W;if(o=c.parseHost(p))return o;if(p="",u=Me,t==Ie)return}break;case Me:if(!N(K,s)){if(s==r||"/"==s||"?"==s||"#"==s||"\\"==s&&c.isSpecial()||t){if(""!=p){var w=D(p,10);if(w>65535)return Y;c.port=c.isSpecial()&&w===he[c.scheme]?null:w,p=""}if(t)return;u=Ce;continue}return Y}p+=s;break;case Ae:if(c.scheme="file","/"==s||"\\"==s)u=Re;else{if(!n||"file"!=n.scheme){u=Oe;continue}if(s==r)c.host=n.host,c.path=g(n.path),c.query=n.query;else if("?"==s)c.host=n.host,c.path=g(n.path),c.query="",u=Ne;else{if("#"!=s){de(L(g(i,h),""))||(c.host=n.host,c.path=g(n.path),c.shortenPath()),u=Oe;continue}c.host=n.host,c.path=g(n.path),c.query=n.query,c.fragment="",u=Le}}break;case Re:if("/"==s||"\\"==s){u=De;break}n&&"file"==n.scheme&&!de(L(g(i,h),""))&&(pe(n.path[0],!0)?U(c.path,n.path[0]):c.host=n.host),u=Oe;continue;case De:if(s==r||"/"==s||"\\"==s||"?"==s||"#"==s){if(!t&&pe(p))u=Oe;else if(""==p){if(c.host="",t)return;u=Ce}else{if(o=c.parseHost(p))return o;if("localhost"==c.host&&(c.host=""),t)return;p="",u=Ce}continue}p+=s;break;case Ce:if(c.isSpecial()){if(u=Oe,"/"!=s&&"\\"!=s)continue}else if(t||"?"!=s)if(t||"#"!=s){if(s!=r&&(u=Oe,"/"!=s))continue}else c.fragment="",u=Le;else c.query="",u=Ne;break;case Oe:if(s==r||"/"==s||"\\"==s&&c.isSpecial()||!t&&("?"==s||"#"==s)){if(".."===(l=V(l=p))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"==s||"\\"==s&&c.isSpecial()||U(c.path,"")):me(p)?"/"==s||"\\"==s&&c.isSpecial()||U(c.path,""):("file"==c.scheme&&!c.path.length&&pe(p)&&(c.host&&(c.host=""),p=P(p,0)+":"),U(c.path,p)),p="","file"==c.scheme&&(s==r||"?"==s||"#"==s))for(;c.path.length>1&&""===c.path[0];)j(c.path);"?"==s?(c.query="",u=Ne):"#"==s&&(c.fragment="",u=Le)}else p+=ue(s,le);break;case Pe:"?"==s?(c.query="",u=Ne):"#"==s?(c.fragment="",u=Le):s!=r&&(c.path[0]+=ue(s,ae));break;case Ne:t||"#"!=s?s!=r&&("'"==s&&c.isSpecial()?c.query+="%27":c.query+="#"==s?"%23":ue(s,ae)):(c.fragment="",u=Le);break;case Le:s!=r&&(c.fragment+=ue(s,oe))}h++}},parseHost:function(e){var t,n,r;if("["==P(e,0)){if("]"!=P(e,e.length-1))return W;if(t=function(e){var t,n,r,i,s,a,o,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,p=function(){return P(e,h)};if(":"==p()){if(":"!=P(e,1))return;h+=2,u=++c}for(;p();){if(8==c)return;if(":"!=p()){for(t=n=0;n<4&&N(ee,p());)t=16*t+D(p(),16),h++,n++;if("."==p()){if(0==n)return;if(h-=n,c>6)return;for(r=0;p();){if(i=null,r>0){if(!("."==p()&&r<4))return;h++}if(!N(K,p()))return;for(;N(K,p());){if(s=D(p(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;h++}l[c]=256*l[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==p()){if(h++,!p())return}else if(p())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)o=l[c],l[c--]=l[u+a-1],l[u+--a]=o;else if(8!=c)return;return l}(z(e,1,-1)),!t)return W;this.host=t}else if(this.isSpecial()){if(e=v(e),N(te,e))return W;if(t=function(e){var t,n,r,i,s,a,o,l=G(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=l[r]))return e;if(s=10,i.length>1&&"0"==P(i,0)&&(s=N(Z,i)?16:8,i=z(i,8==s?1:2)),""===i)a=0;else{if(!N(10==s?Q:8==s?J:ee,i))return e;a=D(i,s)}U(n,a)}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=O(256,5-t))return null}else if(a>255)return null;for(o=F(n),r=0;r<n.length;r++)o+=n[r]*O(256,3-r);return o}(e),null===t)return W;this.host=t}else{if(N(ne,e))return W;for(t="",n=f(e),r=0;r<n.length;r++)t+=ue(n[r],ae);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return d(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&pe(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,s=e.port,a=e.path,o=e.query,l=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=n+(r?":"+r:"")+"@"),c+=se(i),null!==s&&(c+=":"+s)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+L(a,"/"):"",null!==o&&(c+="?"+o),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw R(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new Fe(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+se(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(y(e)+":",fe)},getUsername:function(){return this.username},setUsername:function(e){var t=f(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=ue(t[n],ce)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=ue(t[n],ce)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?se(e):se(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Se)},getHostname:function(){var e=this.host;return null===e?"":se(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ie)},getPort:function(){var e=this.port;return null===e?"":y(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=y(e))?this.port=null:this.parse(e,Me))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+L(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ce))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=y(e))?this.query=null:("?"==P(e,0)&&(e=z(e,1)),this.query="",this.parse(e,Ne)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=y(e))?("#"==P(e,0)&&(e=z(e,1)),this.fragment="",this.parse(e,Le)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Fe=function(e){var t=p(this,Ue),n=x(arguments.length,1)>1?arguments[1]:void 0,r=E(t,new ke(e,!1,n));s||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},Ue=Fe.prototype,Be=function(e,t){return{get:function(){return S(this)[e]()},set:t&&function(e){return S(this)[t](e)},configurable:!0,enumerable:!0}};if(s&&(h(Ue,"href",Be("serialize","setHref")),h(Ue,"origin",Be("getOrigin")),h(Ue,"protocol",Be("getProtocol","setProtocol")),h(Ue,"username",Be("getUsername","setUsername")),h(Ue,"password",Be("getPassword","setPassword")),h(Ue,"host",Be("getHost","setHost")),h(Ue,"hostname",Be("getHostname","setHostname")),h(Ue,"port",Be("getPort","setPort")),h(Ue,"pathname",Be("getPathname","setPathname")),h(Ue,"search",Be("getSearch","setSearch")),h(Ue,"searchParams",Be("getSearchParams")),h(Ue,"hash",Be("getHash","setHash"))),u(Ue,"toJSON",(function(){return S(this).serialize()}),{enumerable:!0}),u(Ue,"toString",(function(){return S(this).serialize()}),{enumerable:!0}),A){var je=A.createObjectURL,Ge=A.revokeObjectURL;je&&u(Fe,"createObjectURL",l(je,A)),Ge&&u(Fe,"revokeObjectURL",l(Ge,A))}b(Fe,"URL"),i({global:!0,constructor:!0,forced:!a,sham:!s},{URL:Fe})},33601:function(e,t,n){n(47250)},98947:function(){},27698:function(e,t,n){var r=n(54493);e.exports=r},83363:function(e,t,n){var r=n(24034);e.exports=r},41793:function(e,t,n){var r=n(87716);e.exports=r},38079:function(e,t,n){var r=n(12710);e.exports=r},49216:function(e,t,n){var r=n(99324);e.exports=r},56668:function(e,t,n){var r=n(95909);e.exports=r},74719:function(e,t,n){var r=n(14423);e.exports=r},57784:function(e,t,n){var r=n(81103);e.exports=r},56243:function(e,t,n){var r=n(13830);n(7634),e.exports=r},72369:function(e,t,n){var r=n(91031);e.exports=r},28196:function(e,t,n){var r=n(16246);e.exports=r},8065:function(e,t,n){var r=n(56043);e.exports=r},53370:function(e,t,n){var r=n(58422);e.exports=r},95247:function(e,t,n){var r=n(1727);e.exports=r},57448:function(e,t,n){n(7634);var r=n(9697),i=n(90953),s=n(7046),a=n(38079),o=Array.prototype,l={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.entries;return e===o||s(o,e)&&t===o.entries||i(l,r(e))?a:t}},29455:function(e,t,n){var r=n(13160);e.exports=r},69743:function(e,t,n){var r=n(80446);e.exports=r},11955:function(e,t,n){var r=n(2480);e.exports=r},96064:function(e,t,n){var r=n(7147);e.exports=r},61577:function(e,t,n){var r=n(32236);e.exports=r},48842:function(e,t,n){var r=n(66793);e.exports=r},34913:function(e,t,n){var r=n(68098);e.exports=r},46279:function(e,t,n){n(7634);var r=n(9697),i=n(90953),s=n(7046),a=n(49216),o=Array.prototype,l={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.forEach;return e===o||s(o,e)&&t===o.forEach||i(l,r(e))?a:t}},33778:function(e,t,n){var r=n(58557);e.exports=r},19373:function(e,t,n){var r=n(34570);e.exports=r},73819:function(e,t,n){n(7634);var r=n(9697),i=n(90953),s=n(7046),a=n(56668),o=Array.prototype,l={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.keys;return e===o||s(o,e)&&t===o.keys||i(l,r(e))?a:t}},11022:function(e,t,n){var r=n(57564);e.exports=r},61798:function(e,t,n){var r=n(88287);e.exports=r},17911:function(e,t,n){var r=n(75192);e.exports=r},88906:function(e,t,n){var r=n(51337);e.exports=r},52527:function(e,t,n){var r=n(68025);e.exports=r},36857:function(e,t,n){var r=n(59257);e.exports=r},28427:function(e,t,n){var r=n(91060);e.exports=r},82073:function(e,t,n){var r=n(69601);e.exports=r},45286:function(e,t,n){var r=n(28299);e.exports=r},62856:function(e,t,n){var r=n(69355);e.exports=r},2348:function(e,t,n){var r=n(18339);e.exports=r},35178:function(e,t,n){var r=n(71611);e.exports=r},87169:function(e,t,n){var r=n(47987);e.exports=r},76361:function(e,t,n){var r=n(62774);e.exports=r},62908:function(e,t,n){n(7634);var r=n(9697),i=n(90953),s=n(7046),a=n(74719),o=Array.prototype,l={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.values;return e===o||s(o,e)&&t===o.values||i(l,r(e))?a:t}},8933:function(e,t,n){var r=n(84426);e.exports=r},15868:function(e,t,n){var r=n(91018);n(7634),e.exports=r},80188:function(e,t,n){var r=n(35272);e.exports=r},79002:function(e,t,n){var r=n(70338);e.exports=r},21917:function(e,t,n){var r=n(95213);e.exports=r},65138:function(e,t,n){var r=n(22068);e.exports=r},60155:function(e,t,n){var r=n(88908);e.exports=r},55169:function(e,t,n){var r=n(76837);e.exports=r},14873:function(e,t,n){var r=n(97849);e.exports=r},61799:function(e,t,n){var r=n(26712);e.exports=r},38849:function(e,t,n){var r=n(3820);e.exports=r},76258:function(e,t,n){var r=n(70063);e.exports=r},42119:function(e,t,n){var r=n(4723);e.exports=r},63383:function(e,t,n){var r=n(45999);e.exports=r},14471:function(e,t,n){var r=n(35254);e.exports=r},57396:function(e,t,n){var r=n(7702);e.exports=r},41910:function(e,t,n){var r=n(48171);e.exports=r},86209:function(e,t,n){var r=n(73081);e.exports=r},35021:function(e,t,n){var r=n(73770);e.exports=r},79427:function(e,t,n){var r=n(286);e.exports=r},62857:function(e,t,n){var r=n(92766);e.exports=r},64477:function(e,t,n){var r=n(83288);e.exports=r},9534:function(e,t,n){var r=n(30498);e.exports=r},96507:function(e,t,n){var r=n(13966);e.exports=r},23059:function(e,t,n){var r=n(48494);e.exports=r},16670:function(e,t,n){var r=n(3065);e.exports=r},47795:function(e,t,n){var r=n(98430);e.exports=r},66877:function(e,t,n){var r=n(7579);e.exports=r},74888:function(e,t,n){var r=n(98524);e.exports=r},27460:function(e,t,n){var r=n(52956);n(7634),e.exports=r},61895:function(e,t,n){var r=n(14983);e.exports=r},43474:function(e,t,n){n(71249);var r=n(54058);e.exports=r.setInterval},27989:function(e,t,n){n(71249);var r=n(54058);e.exports=r.setTimeout},5519:function(e,t,n){var r=n(76998);n(7634),e.exports=r},21194:function(e,t,n){var r=n(46614);e.exports=r},88004:function(e,t,n){var r=n(12318);e.exports=r},92547:function(e,t,n){var r=n(57473);n(7634),e.exports=r},46509:function(e,t,n){var r=n(24227);n(7634),e.exports=r},35774:function(e,t,n){var r=n(62978);e.exports=r},57641:function(e,t,n){var r=n(71459);e.exports=r},72010:function(e,t,n){var r=n(32304);n(7634),e.exports=r},93726:function(e,t,n){var r=n(29567);n(7634),e.exports=r},71459:function(e,t,n){n(33601),n(98947),n(95304);var r=n(54058);e.exports=r.URL},14958:function(e,t,n){var r=n(89372),i=n.n(r),s=n(33286),a=n.n(s)()(i());a.push([e.id,"@import url(//at.alicdn.com/t/font_2809422_tyv73h24h8.css);"]),a.push([e.id,"@import url(//at.alicdn.com/t/c/font_2802048_pr0orli1rac.css);"]),a.push([e.id,".axesRenderer{width:100px;height:100px;position:absolute;display:block;bottom:1px;left:10px;background:#ffffff00}.overview-map{width:200px;height:200px;top:10px;left:10px;position:absolute;z-index:1;border:1px #50505090 solid;background-color:#80808030}.statsOutput{position:absolute;opacity:0.6;top:1px;left:1px}#navCube{position:absolute;bottom:10px;right:10px;z-index:1;pointer-events:none;cursor:pointer}#navCube:hover{opacity:1}.css3d-navcube .navcube-plane{backface-visibility:hidden;z-index:1;transition:all 0.2s}.css3d-navcube .navcube-plane.outer{opacity:.7;background:linear-gradient(-45deg, transparent 15px, #efefef 0) bottom right,linear-gradient(-135deg, transparent 15px, #efefef 0) top right,linear-gradient(135deg, transparent 15px, #efefef 0) top left,linear-gradient(45deg, transparent 15px, #efefef 0) bottom left;background-size:70% 70%;background-repeat:no-repeat}.css3d-navcube .navcube-plane.inner{margin:2px;font-size:30px;text-align:center;line-height:100px;background:linear-gradient(-45deg, transparent 14px, #2c7be5 0) bottom right,linear-gradient(-135deg, transparent 14px, #2c7be5 0) top right,linear-gradient(135deg, transparent 14px, #2c7be5 0) top left,linear-gradient(45deg, transparent 14px, #2c7be5 0) bottom left;background-size:70% 70%;background-repeat:no-repeat}.css3d-navcube .navcube-plane:hover{opacity:1 !important}.css3d-navcube .navcube-edge{opacity:0;z-index:2;transition:all 0.2s}.css3d-navcube .navcube-edge:hover{opacity:1 !important}.css3d-navcube .navcube-corner{opacity:.7;backface-visibility:hidden;box-sizing:content-box;transform-origin:50% 33%;top:4px;z-index:3;transition:all 0.2s}.css3d-navcube .navcube-corner-plane{opacity:0;backface-visibility:hidden;transform-origin:bottom;top:-6.5px;z-index:3;transition:all 0.2s}.css3d-navcube .highlight{opacity:1}.progress-bar{z-index:3;bottom:calc(15%);left:calc(25%);position:absolute;color:#ffffffa0;width:50%;user-select:none}.progress-bar.hidden{display:none}.progress-bar .progress-bar-item{width:100%;text-align:center;padding:2px}.pop-panel{z-index:99999999;top:calc(70% - 100px);left:calc(90% - 160px);position:absolute;background:#ffffff;color:#333333;border-radius:4px;width:160px;box-shadow:0px 12px 48px 16px rgba(0,0,0,0.03),0px 9px 28px 0px rgba(0,0,0,0.05),0px 6px 16px -8px rgba(0,0,0,0.08)}.pop-panel .pop-panel-header{font-size:16px;font-weight:bolder;padding:16px 24px 8px 24px;color:#333333;border-bottom:1px solid #EFEFEF;cursor:move;user-select:none}.pop-panel .pop-panel-body{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 24px 16px 24px}.pop-panel .pop-panel-body .pop-panel-item{display:inline-block;cursor:pointer;margin-right:16px;font-size:16px}.pop-panel .pop-panel-body .pop-panel-item .gemini-viewer-icon{font-size:24px}.pop-panel .pop-panel-body .pop-panel-item:last-child{margin-right:0}.pop-panel .pop-panel-body .pop-panel-item:hover{color:#2c7be5}.pop-panel .pop-panel-body .pop-panel-item.active{color:#2c7be5}.pop-panel .pop-panel-body .pop-panel-item.disable{color:#999;cursor:not-allowed}.model-layout-switch-bar{position:absolute;bottom:0;width:100%;height:24px;background:#ffffff;opacity:0.7;display:flex;font-size:12px;line-height:1;overflow-x:scroll;z-index:1}.model-layout-switch-bar .model-layout-switch-bar-content{white-space:nowrap}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item{position:relative;display:inline-block;padding:4px 16px 0;color:#000000;height:22px;margin-left:8px;cursor:pointer;transform:translateX(0)}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item::before{content:'';position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:#fff;border:1px solid #000;border-radius:0 0 5px 5px;border-top:0px;transform:perspective(8px) rotateX(-5deg) scaleY(0.8);transform-origin:bottom}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item:hover{color:#8080f0}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item:nth-child(n+2){margin-left:15px}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item.activate{color:#fff !important}.model-layout-switch-bar .model-layout-switch-bar-content .model-layout-switch-item.activate::before{background:#000 !important}.model-layout-switch-bar.hidden{display:none}.follow-tooltip{z-index:99999999;position:absolute;left:-500px;padding:6px;background:rgba(25,25,25,0.3);color:rgba(255,255,255,0.8);font-size:12px;border-radius:2px}.context-menu{position:absolute;box-sizing:border-box;background-color:#fff;width:200px;padding:2px;border-radius:2px;box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);cursor:pointer;z-index:2}.context-menu ul{list-style:none;padding:0}.context-menu ul:last-child li{border-bottom:0px}.context-menu li{height:2rem;padding:0.5rem 0.5rem;box-sizing:border-box}.context-menu li:hover{background-color:lightgray}.context-menu li.disabled{color:#ccc;cursor:not-allowed}.context-menu li:last-child{border-bottom:1px solid #000}.toolbar{position:absolute;display:flex;box-sizing:border-box;height:68px;left:50%;bottom:40px;padding:8px 20px;border:rgba(153,153,153,0.8) 1px solid;border-radius:4px;background:rgba(255,255,255,0.8);transform:translate(-50%, 0);align-items:center;z-index:10;user-select:none}.toolbar .toolbar-group{display:flex;padding:0 2px;box-sizing:border-box}.toolbar .toolbar-group-division{width:1px;background-color:rgba(153,153,153,0.8);height:60%}.toolbar .toolbar-menu{display:flex;box-sizing:border-box;flex-direction:column;width:50px;height:50px;padding:3px 0;margin:0 2px;transition:all 0.3s;cursor:pointer;color:#666;border-radius:4px}.toolbar .toolbar-menu.active{color:#2c7be5}.toolbar .toolbar-menu .icon{width:24px;height:24px;margin:auto;font-size:24px;line-height:normal}.toolbar .toolbar-menu span{display:block;width:100%;margin:auto;font-size:0.75em;text-align:center;user-select:none}.toolbar .toolbar-menu:hover{color:#2c7be5;background-color:rgba(255,255,255,0.8)}.toolbar .toolbar-parent-menu{position:relative}.toolbar .toolbar-parent-menu:hover .toolbar-sub-menu{display:block}.toolbar .toolbar-parent-menu:hover .toolbar-sub-menu-list{background:rgba(255,255,255,0.8)}.toolbar .toolbar-parent-menu:after{content:\"\";position:absolute;box-sizing:border-box;width:0;height:0;right:2px;top:2px;border-width:4px;border-style:solid;border-top-color:#666;border-right-color:#666;border-bottom-color:transparent;border-left-color:transparent;border-radius:1px}.toolbar .toolbar-sub-menu{display:none;position:absolute;width:50px;bottom:100%}.toolbar .toolbar-sub-menu .toolbar-sub-menu-list{margin-bottom:2px;border-radius:4px}.toolbar .toolbar-sub-menu .toolbar-sub-menu-list .toolbar-menu{margin:0}.bottom-bar{position:absolute;bottom:0;right:0px;display:flex;color:#666;z-index:3;overflow:hidden;user-select:none}.bottom-bar i{font-size:18px;padding:3px;align-self:center;opacity:0.4;cursor:pointer;line-height:1}.bottom-bar i:hover{color:#2c7be5;opacity:1}.bottom-bar i.active{color:#2c7be5;opacity:1}.bottom-bar .fps{width:4rem}.bottom-bar span{align-self:center;padding:4px;font-size:14px}#statistics-tooltip,#tips-tooltip,#cameraInfo-tooltip{position:absolute;right:5px;bottom:30px;background:#666;color:white;padding:8px 8px 5px 8px;font-size:0.8rem;border-radius:4px;z-index:3;opacity:0.9;user-select:none}#statistics-tooltip p,#tips-tooltip p,#cameraInfo-tooltip p{padding-bottom:3px;margin:3px}#statistics-tooltip p span,#tips-tooltip p span,#cameraInfo-tooltip p span{float:left;margin-right:10px}.measurePointMarker{height:12px;width:12px;background:#ffffff;border:2px solid #00DAB7;border-radius:50%;position:absolute;top:0;left:0;pointer-events:none}.hide{display:none}.bim-viewer-spinner{position:absolute;display:flex;top:calc(50% - 20px);left:calc(50% - 20px);opacity:0.8;justify-content:center;align-items:center;z-index:10}.bim-viewer-spinner>div{font-size:3rem;animation:spin 1s infinite linear;color:#2c7be5}.bim-viewer-spinner.hidden{display:none}.svg-renderer{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none}.spinner{position:absolute;display:flex;width:100%;height:100%;opacity:0.8;background-color:#fff;justify-content:center;align-items:center;z-index:10}.spinner>div{font-size:3rem;animation:spin 1s infinite linear;color:#2c7be5}.spinner.hidden{display:none}.compare-markups-canvas{position:absolute;top:0;left:0;pointer-events:none;user-select:none}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}\n",""]),t.Z=a},93379:function(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},a=[],o=0;o<e.length;o++){var l=e[o],c=r.base?l[0]+r.base:l[0],u=s[c]||0,h="".concat(c," ").concat(u);s[c]=u+1;var p=n(h),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var m=i(d,r);r.byIndex=o,t.splice(o,0,{identifier:h,updater:m,references:1})}a.push(h)}return a}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<s.length;a++){var o=n(s[a]);t[o].references--}for(var l=r(e,i),c=0;c<s.length;c++){var u=n(s[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}s=l}}},90569:function(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},19216:function(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:function(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7795:function(e){e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},44589:function(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},20477:function(e){e.exports=function(e,t,n,r){var i=self||window;try{try{var s;try{s=new i.Blob([e])}catch(t){(s=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),s=s.getBlob()}var a=i.URL||i.webkitURL,o=a.createObjectURL(s),l=new i[t](o,n);return a.revokeObjectURL(o),l}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}},10349:function(e,t,n){e.exports=n(27385)},98235:function(e,t,n){e.exports=n(81522)},57647:function(e,t,n){e.exports=n(2626)},19389:function(e,t,n){e.exports=n(32209)},92381:function(e,t,n){e.exports=n(30888)},90646:function(e,t,n){e.exports=n(66449)},48216:function(e,t,n){e.exports=n(14122)},8571:function(e,t,n){e.exports=n(21086)},8010:function(e,t,n){e.exports=n(19632)},61539:function(e,t,n){e.exports=n(47895)},40703:function(e,t,n){e.exports=n(27759)},8244:function(e,t,n){e.exports=n(66515)},18033:function(e,t,n){e.exports=n(32726)},73324:function(e,t,n){e.exports=n(44442)},13464:function(e,t,n){e.exports=n(57478)},86981:function(e,t,n){e.exports=n(2636)},59863:function(e,t,n){e.exports=n(61218)},49804:function(e,t,n){e.exports=n(8145)},99595:function(e,t,n){e.exports=n(57152)},91829:function(e,t,n){e.exports=n(11408)},51791:function(e,t,n){e.exports=n(69447)},29898:function(e,t,n){e.exports=n(56211)},19178:function(e,t,n){e.exports=n(25376)},88946:function(e,t,n){e.exports=n(86942)},92399:function(e,t,n){e.exports=n(89430)},7488:function(e,t,n){e.exports=n(66594)},53706:function(e,t,n){e.exports=n(38096)},13004:function(e,t,n){e.exports=n(79595)},86526:function(e,t,n){e.exports=n(17579)},35704:function(e,t,n){e.exports=n(81493)},27525:function(e,t,n){e.exports=n(4111)},76555:function(e,t,n){e.exports=n(72858)},90143:function(e,t,n){e.exports=n(71777)},45181:function(e,t,n){e.exports=n(75319)},75548:function(e,t,n){e.exports=n(59788)},84705:function(e,t,n){e.exports=n(75425)},89221:function(e,t,n){e.exports=n(99465)},58218:function(e,t,n){e.exports=n(52740)},54847:function(e,t,n){e.exports=n(86672)},94185:function(e,t,n){e.exports=n(6489)},2668:function(e,t,n){e.exports=n(86183)},77726:function(e,t,n){e.exports=n(2753)},31634:function(e,t,n){e.exports=n(53850)},37265:function(e,t,n){e.exports=n(18260)},14051:function(e,t,n){e.exports=n(93376)},55243:function(e,t,n){e.exports=n(78421)},50429:function(e,t,n){e.exports=n(59122)},60312:function(e,t,n){n(82320)},35293:function(e,t,n){e.exports=n(40691)},73672:function(e,t,n){e.exports=n(75632)},67552:function(e,t,n){e.exports=n(60269)},3841:function(e,t,n){e.exports=n(76094)},2201:function(e,t,n){e.exports=n(70573)},57445:function(e,t,n){e.exports=n(73685)},39290:function(e,t,n){e.exports=n(36785)},54877:function(e,t,n){e.exports=n(23252)},88546:function(e,t,n){e.exports=n(27533)},66775:function(e,t,n){e.exports=n(39057)},55641:function(e,t,n){e.exports=n(30034)},52020:function(e,t,n){e.exports=n(84710)},39272:function(e,t,n){e.exports=n(74303)},62079:function(e,t,n){e.exports=n(93799)},92984:function(e,t,n){e.exports=n(55122)},31082:function(e,t,n){e.exports=n(54437)},10899:function(e,t,n){e.exports=n(91645)},34300:function(e,t,n){e.exports=n(53103)},35820:function(e,t,n){e.exports=n(29531)},24835:function(e,t,n){e.exports=n(10856)},34652:function(e,t,n){e.exports=n(21490)},9938:function(e,t,n){e.exports=n(24803)},23513:function(e,t,n){e.exports=n(65743)},17975:function(e,t,n){e.exports=n(33054)},52472:function(e,t,n){e.exports=n(86600)},48994:function(e,t,n){e.exports=n(9759)},40024:function(e,t,n){e.exports=n(71384)},81290:function(e,t,n){e.exports=n(87740)},98186:function(e,t,n){e.exports=n(58714)},44923:function(e,t,n){e.exports=n(82790)},37781:function(e,t,n){var r=n(52472),i=n(48994),s=n(92381),a=n(57445),o=n(35704),l=n(54877),c=n(67552),u=n(3841),h=n(35129),p=n(30231);function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(h),f=d(p);function g(e){return g="function"==typeof r&&"symbol"==typeof i?function(e){return typeof e}:function(e){return e&&"function"==typeof r&&e.constructor===r&&e!==r.prototype?"symbol":typeof e},g(e)}void 0!==s||("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self);function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v={exports:{}};!function(e,t){var n=function(e,t){return t?"other":1==e?"one":"other"},r=function(e,t){return t?"other":0==e||1==e?"one":"other"},i=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},s=function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},l=function(e,t){return"other"},c=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"};!function(t,n){a(n,"__esModule",{value:!0}),e.exports=n}(0,{_in:l,af:n,ak:r,am:i,an:n,ar:function(e,t){var n,r=String(e).split("."),i=Number(r[0])==e&&o(n=r[0]).call(n,-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":i>=3&&i<=10?"few":i>=11&&i<=99?"many":"other"},ars:function(e,t){var n,r=String(e).split("."),i=Number(r[0])==e&&o(n=r[0]).call(n,-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":i>=3&&i<=10?"few":i>=11&&i<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:n,ast:s,az:function(e,t){var n=String(e).split(".")[0],r=o(n).call(n,-1),i=o(n).call(n,-2),s=o(n).call(n,-3);return t?1==r||2==r||5==r||7==r||8==r||20==i||50==i||70==i||80==i?"one":3==r||4==r||100==s||200==s||300==s||400==s||500==s||600==s||700==s||800==s||900==s?"few":0==n||6==r||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},be:function(e,t){var n,r,i=String(e).split("."),s=Number(i[0])==e,a=s&&o(n=i[0]).call(n,-1),l=s&&o(r=i[0]).call(r,-2);return t?2!=a&&3!=a||12==l||13==l?"other":"few":1==a&&11!=l?"one":a>=2&&a<=4&&(l<12||l>14)?"few":s&&0==a||a>=5&&a<=9||l>=11&&l<=14?"many":"other"},bem:n,bez:n,bg:n,bho:r,bm:l,bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:l,br:function(e,t){var n,r,i,s=String(e).split("."),a=Number(s[0])==e,l=a&&o(n=s[0]).call(n,-1),c=a&&o(r=s[0]).call(r,-2),u=a&&o(i=s[0]).call(i,-6);return t?"other":1==l&&11!=c&&71!=c&&91!=c?"one":2==l&&12!=c&&72!=c&&92!=c?"two":(3==l||4==l||9==l)&&(c<10||c>19)&&(c<70||c>79)&&(c<90||c>99)?"few":0!=e&&a&&0==u?"many":"other"},brx:n,bs:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(r).call(r,-2),c=o(i).call(i,-1),u=o(i).call(i,-2);return t?"other":s&&1==a&&11!=l||1==c&&11!=u?"one":s&&a>=2&&a<=4&&(l<12||l>14)||c>=2&&c<=4&&(u<12||u>14)?"few":"other"},ca:function(e,t){var n=!String(e).split(".")[1];return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&n?"one":"other"},ce:n,ceb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(i).call(i,-1);return t?"other":s&&(1==r||2==r||3==r)||s&&4!=a&&6!=a&&9!=a||!s&&4!=l&&6!=l&&9!=l?"one":"other"},cgg:n,chr:n,ckb:n,cs:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e;return t||1!=e&&(i||0!=r&&1!=r)?"other":"one"},de:s,doi:i,dsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-2),l=o(i).call(i,-2);return t?"other":s&&1==a||1==l?"one":s&&2==a||2==l?"two":s&&(3==a||4==a)||3==l||4==l?"few":"other"},dv:n,dz:l,ee:n,el:n,en:function(e,t){var n,r,i=String(e).split("."),s=!i[1],a=Number(i[0])==e,l=a&&o(n=i[0]).call(n,-1),c=a&&o(r=i[0]).call(r,-2);return t?1==l&&11!=c?"one":2==l&&12!=c?"two":3==l&&13!=c?"few":"other":1==e&&s?"one":"other"},eo:n,es:n,et:s,eu:n,fa:i,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:s,fil:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(i).call(i,-1);return t?1==e?"one":"other":s&&(1==r||2==r||3==r)||s&&4!=a&&6!=a&&9!=a||!s&&4!=l&&6!=l&&9!=l?"one":"other"},fo:n,fr:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],s=o(r).call(r,-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=r&&0==s&&i?"many":"other"},fur:n,fy:s,ga:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},gl:s,gsw:n,gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:r,gv:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],s=o(r).call(r,-1),a=o(r).call(r,-2);return t?"other":i&&1==s?"one":i&&2==s?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:n,haw:n,he:function(e,t){var n,r=String(e).split("."),i=r[0],s=!r[1],a=Number(r[0])==e,l=a&&o(n=r[0]).call(n,-1);return t?"other":1==e&&s?"one":2==i&&s?"two":s&&(e<0||e>10)&&a&&0==l?"many":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(r).call(r,-2),c=o(i).call(i,-1),u=o(i).call(i,-2);return t?"other":s&&1==a&&11!=l||1==c&&11!=u?"one":s&&a>=2&&a<=4&&(l<12||l>14)||c>=2&&c<=4&&(u<12||u>14)?"few":"other"},hsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-2),l=o(i).call(i,-2);return t?"other":s&&1==a||1==l?"one":s&&2==a||2==l?"two":s&&(3==a||4==a)||3==l||4==l?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:s,id:l,ig:l,ii:l,io:s,is:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e,s=o(r).call(r,-1),a=o(r).call(r,-2);return t?"other":i&&1==s&&11!=a||!i?"one":"other"},it:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},iu:c,iw:function(e,t){var n,r=String(e).split("."),i=r[0],s=!r[1],a=Number(r[0])==e,l=a&&o(n=r[0]).call(n,-1);return t?"other":1==e&&s?"one":2==i&&s?"two":s&&(e<0||e>10)&&a&&0==l?"many":"other"},ja:l,jbo:l,jgo:n,ji:s,jmc:n,jv:l,jw:l,ka:function(e,t){var n=String(e).split(".")[0],r=o(n).call(n,-2);return t?1==n?"one":0==n||r>=2&&r<=20||40==r||60==r||80==r?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:n,kcg:n,kde:l,kea:l,kk:function(e,t){var n,r=String(e).split("."),i=Number(r[0])==e,s=i&&o(n=r[0]).call(n,-1);return t?6==s||9==s||i&&0==s&&0!=e?"many":"other":1==e?"one":"other"},kkj:n,kl:n,km:l,kn:i,ko:l,ks:n,ksb:n,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:n,kw:function(e,t){var n,r,i,s,a=String(e).split("."),l=Number(a[0])==e,c=l&&o(n=a[0]).call(n,-2),u=l&&o(r=a[0]).call(r,-3),h=l&&o(i=a[0]).call(i,-5),p=l&&o(s=a[0]).call(s,-6);return t?l&&e>=1&&e<=4||c>=1&&c<=4||c>=21&&c<=24||c>=41&&c<=44||c>=61&&c<=64||c>=81&&c<=84?"one":5==e||5==c?"many":"other":0==e?"zero":1==e?"one":2==c||22==c||42==c||62==c||82==c||l&&0==u&&(h>=1e3&&h<=2e4||4e4==h||6e4==h||8e4==h)||0!=e&&1e5==p?"two":3==c||23==c||43==c||63==c||83==c?"few":1==e||1!=c&&21!=c&&41!=c&&61!=c&&81!=c?"other":"many"},ky:n,lag:function(e,t){var n=String(e).split(".")[0];return t?"other":0==e?"zero":0!=n&&1!=n||0==e?"other":"one"},lb:n,lg:n,lij:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e;return t?11==e||8==e||i&&e>=80&&e<=89||i&&e>=800&&e<=899?"many":"other":1==e&&r?"one":"other"},lkt:l,ln:r,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var n,r,i=String(e).split("."),s=i[1]||"",a=Number(i[0])==e,l=a&&o(n=i[0]).call(n,-1),c=a&&o(r=i[0]).call(r,-2);return t?"other":1==l&&(c<11||c>19)?"one":l>=2&&l<=9&&(c<11||c>19)?"few":0!=s?"many":"other"},lv:function(e,t){var n,r,i=String(e).split("."),s=i[1]||"",a=s.length,l=Number(i[0])==e,c=l&&o(n=i[0]).call(n,-1),u=l&&o(r=i[0]).call(r,-2),h=o(s).call(s,-2),p=o(s).call(s,-1);return t?"other":l&&0==c||u>=11&&u<=19||2==a&&h>=11&&h<=19?"zero":1==c&&11!=u||2==a&&1==p&&11!=h||2!=a&&1==p?"one":"other"},mas:n,mg:r,mgo:n,mk:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(r).call(r,-2),c=o(i).call(i,-1),u=o(i).call(i,-2);return t?1==a&&11!=l?"one":2==a&&12!=l?"two":7!=a&&8!=a||17==l||18==l?"other":"many":s&&1==a&&11!=l||1==c&&11!=u?"one":"other"},ml:n,mn:n,mo:function(e,t){var n,r=String(e).split("."),i=!r[1],s=Number(r[0])==e&&o(n=r[0]).call(n,-2);return t?1==e?"one":"other":1==e&&i?"one":!i||0==e||s>=2&&s<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var n,r=String(e).split("."),i=Number(r[0])==e&&o(n=r[0]).call(n,-2);return t?"other":1==e?"one":0==e||i>=2&&i<=10?"few":i>=11&&i<=19?"many":"other"},my:l,nah:n,naq:c,nb:n,nd:n,ne:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:s,nn:n,nnh:n,no:n,nqo:l,nr:n,nso:r,ny:n,nyn:n,om:n,or:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:n,osa:l,pa:r,pap:n,pcm:i,pl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],s=o(r).call(r,-1),a=o(r).call(r,-2);return t?"other":1==e&&i?"one":i&&s>=2&&s<=4&&(a<12||a>14)?"few":i&&1!=r&&(0==s||1==s)||i&&s>=5&&s<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var n,r,i=String(e).split("."),s=i[1]||"",a=s.length,l=Number(i[0])==e,c=l&&o(n=i[0]).call(n,-1),u=l&&o(r=i[0]).call(r,-2),h=o(s).call(s,-2),p=o(s).call(s,-1);return t?"other":l&&0==c||u>=11&&u<=19||2==a&&h>=11&&h<=19?"zero":1==c&&11!=u||2==a&&1==p&&11!=h||2!=a&&1==p?"one":"other"},ps:n,pt:function(e,t){var n=String(e).split(".")[0];return t?"other":0==n||1==n?"one":"other"},pt_PT:s,rm:n,ro:function(e,t){var n,r=String(e).split("."),i=!r[1],s=Number(r[0])==e&&o(n=r[0]).call(n,-2);return t?1==e?"one":"other":1==e&&i?"one":!i||0==e||s>=2&&s<=19?"few":"other"},rof:n,root:l,ru:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],s=o(r).call(r,-1),a=o(r).call(r,-2);return t?"other":i&&1==s&&11!=a?"one":i&&s>=2&&s<=4&&(a<12||a>14)?"few":i&&0==s||i&&s>=5&&s<=9||i&&a>=11&&a<=14?"many":"other"},rwk:n,sah:l,saq:n,sat:c,sc:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},scn:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},sd:n,sdh:n,se:c,seh:n,ses:l,sg:l,sh:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(r).call(r,-2),c=o(i).call(i,-1),u=o(i).call(i,-2);return t?"other":s&&1==a&&11!=l||1==c&&11!=u?"one":s&&a>=2&&a<=4&&(l<12||l>14)||c>=2&&c<=4&&(u<12||u>14)?"few":"other"},shi:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},si:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"";return t?"other":0==e||1==e||0==r&&1==i?"one":"other"},sk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},sl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],s=o(r).call(r,-2);return t?"other":i&&1==s?"one":i&&2==s?"two":i&&(3==s||4==s)||!i?"few":"other"},sma:c,smi:c,smj:c,smn:c,sms:c,sn:n,so:n,sq:function(e,t){var n,r,i=String(e).split("."),s=Number(i[0])==e,a=s&&o(n=i[0]).call(n,-1),l=s&&o(r=i[0]).call(r,-2);return t?1==e?"one":4==a&&14!=l?"many":"other":1==e?"one":"other"},sr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(r).call(r,-2),c=o(i).call(i,-1),u=o(i).call(i,-2);return t?"other":s&&1==a&&11!=l||1==c&&11!=u?"one":s&&a>=2&&a<=4&&(l<12||l>14)||c>=2&&c<=4&&(u<12||u>14)?"few":"other"},ss:n,ssy:n,st:n,su:l,sv:function(e,t){var n,r,i=String(e).split("."),s=!i[1],a=Number(i[0])==e,l=a&&o(n=i[0]).call(n,-1),c=a&&o(r=i[0]).call(r,-2);return t?1!=l&&2!=l||11==c||12==c?"other":"one":1==e&&s?"one":"other"},sw:s,syr:n,ta:n,te:n,teo:n,th:l,ti:r,tig:n,tk:function(e,t){var n,r=String(e).split("."),i=Number(r[0])==e&&o(n=r[0]).call(n,-1);return t?6==i||9==i||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",s=!n[1],a=o(r).call(r,-1),l=o(i).call(i,-1);return t?1==e?"one":"other":s&&(1==r||2==r||3==r)||s&&4!=a&&6!=a&&9!=a||!s&&4!=l&&6!=l&&9!=l?"one":"other"},tn:n,to:l,tr:n,ts:n,tzm:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},ug:n,uk:function(e,t){var n,r,i=String(e).split("."),s=i[0],a=!i[1],l=Number(i[0])==e,c=l&&o(n=i[0]).call(n,-1),u=l&&o(r=i[0]).call(r,-2),h=o(s).call(s,-1),p=o(s).call(s,-2);return t?3==c&&13!=u?"few":"other":a&&1==h&&11!=p?"one":a&&h>=2&&h<=4&&(p<12||p>14)?"few":a&&0==h||a&&h>=5&&h<=9||a&&p>=11&&p<=14?"many":"other"},ur:s,uz:n,ve:n,vi:function(e,t){return t&&1==e?"one":"other"},vo:n,vun:n,wa:r,wae:n,wo:l,xh:n,xog:n,yi:s,yo:l,yue:l,zh:l,zu:i})}(v);var y=_(v.exports),b=l(c(u(null),v.exports,{default:y})),x={exports:{}};!function(e,t){var n="zero",r="one",i="two",s="few",o="many",l="other",c={cardinal:[r,l],ordinal:[l]},u={cardinal:[l],ordinal:[l]},h={cardinal:[r,s,o,l],ordinal:[l]},p={cardinal:[r,l],ordinal:[r,l]},d={cardinal:[r,i,l],ordinal:[l]};!function(t,n){a(n,"__esModule",{value:!0}),e.exports=n}(0,{_in:u,af:c,ak:c,am:c,an:c,ar:{cardinal:[n,r,i,s,o,l],ordinal:[l]},ars:{cardinal:[n,r,i,s,o,l],ordinal:[l]},as:{cardinal:[r,l],ordinal:[r,i,s,o,l]},asa:c,ast:c,az:{cardinal:[r,l],ordinal:[r,s,o,l]},be:{cardinal:[r,s,o,l],ordinal:[s,l]},bem:c,bez:c,bg:c,bho:c,bm:u,bn:{cardinal:[r,l],ordinal:[r,i,s,o,l]},bo:u,br:{cardinal:[r,i,s,o,l],ordinal:[l]},brx:c,bs:{cardinal:[r,s,l],ordinal:[l]},ca:{cardinal:[r,l],ordinal:[r,i,s,l]},ce:c,ceb:c,cgg:c,chr:c,ckb:c,cs:h,cy:{cardinal:[n,r,i,s,o,l],ordinal:[n,r,i,s,o,l]},da:c,de:c,doi:c,dsb:{cardinal:[r,i,s,l],ordinal:[l]},dv:c,dz:u,ee:c,el:c,en:{cardinal:[r,l],ordinal:[r,i,s,l]},eo:c,es:c,et:c,eu:c,fa:c,ff:c,fi:c,fil:p,fo:c,fr:{cardinal:[r,o,l],ordinal:[r,l]},fur:c,fy:c,ga:{cardinal:[r,i,s,o,l],ordinal:[r,l]},gd:{cardinal:[r,i,s,l],ordinal:[r,i,s,l]},gl:c,gsw:c,gu:{cardinal:[r,l],ordinal:[r,i,s,o,l]},guw:c,gv:{cardinal:[r,i,s,o,l],ordinal:[l]},ha:c,haw:c,he:{cardinal:[r,i,o,l],ordinal:[l]},hi:{cardinal:[r,l],ordinal:[r,i,s,o,l]},hr:{cardinal:[r,s,l],ordinal:[l]},hsb:{cardinal:[r,i,s,l],ordinal:[l]},hu:p,hy:p,ia:c,id:u,ig:u,ii:u,io:c,is:c,it:{cardinal:[r,l],ordinal:[o,l]},iu:d,iw:{cardinal:[r,i,o,l],ordinal:[l]},ja:u,jbo:u,jgo:c,ji:c,jmc:c,jv:u,jw:u,ka:{cardinal:[r,l],ordinal:[r,o,l]},kab:c,kaj:c,kcg:c,kde:u,kea:u,kk:{cardinal:[r,l],ordinal:[o,l]},kkj:c,kl:c,km:u,kn:c,ko:u,ks:c,ksb:c,ksh:{cardinal:[n,r,l],ordinal:[l]},ku:c,kw:{cardinal:[n,r,i,s,o,l],ordinal:[r,o,l]},ky:c,lag:{cardinal:[n,r,l],ordinal:[l]},lb:c,lg:c,lij:{cardinal:[r,l],ordinal:[o,l]},lkt:u,ln:c,lo:{cardinal:[l],ordinal:[r,l]},lt:h,lv:{cardinal:[n,r,l],ordinal:[l]},mas:c,mg:c,mgo:c,mk:{cardinal:[r,l],ordinal:[r,i,o,l]},ml:c,mn:c,mo:{cardinal:[r,s,l],ordinal:[r,l]},mr:{cardinal:[r,l],ordinal:[r,i,s,l]},ms:{cardinal:[l],ordinal:[r,l]},mt:h,my:u,nah:c,naq:d,nb:c,nd:c,ne:p,nl:c,nn:c,nnh:c,no:c,nqo:u,nr:c,nso:c,ny:c,nyn:c,om:c,or:{cardinal:[r,l],ordinal:[r,i,s,o,l]},os:c,osa:u,pa:c,pap:c,pcm:c,pl:h,prg:{cardinal:[n,r,l],ordinal:[l]},ps:c,pt:c,pt_PT:c,rm:c,ro:{cardinal:[r,s,l],ordinal:[r,l]},rof:c,root:u,ru:h,rwk:c,sah:u,saq:c,sat:d,sc:{cardinal:[r,l],ordinal:[o,l]},scn:{cardinal:[r,l],ordinal:[o,l]},sd:c,sdh:c,se:d,seh:c,ses:u,sg:u,sh:{cardinal:[r,s,l],ordinal:[l]},shi:{cardinal:[r,s,l],ordinal:[l]},si:c,sk:h,sl:{cardinal:[r,i,s,l],ordinal:[l]},sma:d,smi:d,smj:d,smn:d,sms:d,sn:c,so:c,sq:{cardinal:[r,l],ordinal:[r,o,l]},sr:{cardinal:[r,s,l],ordinal:[l]},ss:c,ssy:c,st:c,su:u,sv:p,sw:c,syr:c,ta:c,te:c,teo:c,th:u,ti:c,tig:c,tk:{cardinal:[r,l],ordinal:[s,l]},tl:p,tn:c,to:u,tr:c,ts:c,tzm:c,ug:c,uk:{cardinal:[r,s,o,l],ordinal:[s,l]},ur:c,uz:c,ve:c,vi:{cardinal:[l],ordinal:[r,l]},vo:c,vun:c,wa:c,wae:c,wo:u,xh:c,xog:c,yi:c,yo:u,yue:u,zh:u,zu:c})}(x);var T=_(x.exports),w=y||b,E=T||l(c(u(null),x.exports,{default:T})),S="object"===("undefined"==typeof Intl?"undefined":g(Intl))&&Intl.NumberFormat||f.default,I=function(e){return"in"===e?"_in":"pt-PT"===e?"pt_PT":e},M=m.default(S,(function(e){return w[I(e)]}),(function(e,t){return E[I(e)][t?"ordinal":"cardinal"]}));e.exports=M},30231:function(e,t,n){var r=n(57445);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r(e,i.key,i)}}var s=function(){function e(t,n){var r=n.minimumIntegerDigits,i=n.minimumFractionDigits,s=n.maximumFractionDigits,a=n.minimumSignificantDigits,o=n.maximumSignificantDigits;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._minID="number"==typeof r?r:1,this._minFD="number"==typeof i?i:0,this._maxFD="number"==typeof s?s:Math.max(this._minFD,3),"number"!=typeof a&&"number"!=typeof o||(this._minSD="number"==typeof a?a:1,this._maxSD="number"==typeof o?o:21)}var t,n,r;return t=e,(n=[{key:"resolvedOptions",value:function(){var e={minimumIntegerDigits:this._minID,minimumFractionDigits:this._minFD,maximumFractionDigits:this._maxFD};return"number"==typeof this._minSD&&(e.minimumSignificantDigits=this._minSD,e.maximumSignificantDigits=this._maxSD),e}},{key:"format",value:function(e){if(this._minSD){for(var t=String(e),n=0,r=0;r<t.length;++r){var i=t[r];i>="0"&&i<="9"&&++n}return n<this._minSD?e.toPrecision(this._minSD):n>this._maxSD?e.toPrecision(this._maxSD):t}return this._minFD>0?e.toFixed(this._minFD):0===this._maxFD?e.toFixed(0):String(e)}}])&&i(t.prototype,n),r&&i(t,r),e}();e.exports=s},35129:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t),n.d(t,{default:function(){return l}});var a=function(e){if(!e)return[];Array.isArray(e)||(e=[e]);for(var t={},n=0;n<e.length;++n){var i=e[n];if(i&&"object"===r(i)&&(i=String(i)),"string"!=typeof i){var s="Locales should be strings, ".concat(JSON.stringify(i)," isn't.");throw new TypeError(s)}if("*"!==i[0]){if(!i.split("-").every((function(e){return/[a-z0-9]+/i.test(e)}))){var a=JSON.stringify(i),o="The locale ".concat(a," is not a structurally valid BCP 47 language tag.");throw new RangeError(o)}t[i]=!0}}return Object.keys(t)},o=function(e){if(!e)return"cardinal";if("cardinal"===e||"ordinal"===e)return e;throw new RangeError("Not a valid plural type: "+JSON.stringify(e))};function l(e,t,n){var r=function(e){do{if(t(e))return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null},l=function(e){for(var t=a(e),n=0;n<t.length;++n){var i=r(t[n]);if(i)return i}return r("undefined"!=typeof navigator&&navigator&&(navigator.userLanguage||navigator.language)||"en-US")},c=function(){function c(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,c),this._locale=l(n),this._select=t(this._locale),this._type=o(r.type),this._nf=new e("en",r)}var u,h,p;return u=c,p=[{key:"supportedLocalesOf",value:function(e){return a(e).filter(r)}}],(h=[{key:"resolvedOptions",value:function(){var e=this._nf.resolvedOptions(),t=e.minimumIntegerDigits,r=e.minimumFractionDigits,i=e.maximumFractionDigits,s=e.minimumSignificantDigits,a=e.maximumSignificantDigits,o={locale:this._locale,minimumIntegerDigits:t,minimumFractionDigits:r,maximumFractionDigits:i,pluralCategories:n(this._locale,"ordinal"===this._type),type:this._type};return"number"==typeof s&&(o.minimumSignificantDigits=s,o.maximumSignificantDigits=a),o}},{key:"select",value:function(e){if(!(this instanceof c))throw new TypeError("select() called on incompatible ".concat(this));if("number"!=typeof e&&(e=Number(e)),!isFinite(e))return"other";var t=this._nf.format(Math.abs(e));return this._select(t,"ordinal"===this._type)}}])&&s(u.prototype,h),p&&s(u,p),c}();return Object.defineProperty(c,"prototype",{writable:!1}),c}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n.nc=void 0;var r={};!function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(n(37781));if("undefined"==typeof Intl)void 0!==n.g?n.g.Intl={PluralRules:t.default}:"undefined"!=typeof window?window.Intl={PluralRules:t.default}:{PluralRules:t.default},t.default.polyfill=!0;else if(Intl.PluralRules){var r=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(r).length<r.length&&(Intl.PluralRules=t.default,t.default.polyfill=!0)}else Intl.PluralRules=t.default,t.default.polyfill=!0}(),function(){n.d(r,{Il:function(){return Bh},Ty:function(){return Uh},SK:function(){return SX},DN:function(){return cm},Vi:function(){return DX},Om:function(){return M_},Vx:function(){return Sy},fD:function(){return mh},OE:function(){return Ay},c_:function(){return xy},gc:function(){return My},HI:function(){return pE},al:function(){return E_},qL:function(){return C_},Ud:function(){return sw},iu:function(){return aw},dy:function(){return g$},sz:function(){return I_},q7:function(){return Fh},DG:function(){return kh},ju:function(){return bv},Co:function(){return nf},WG:function(){return yv},uc:function(){return xv},HE:function(){return Hh},$p:function(){return Iy},j0:function(){return ef},g9:function(){return r_},Wd:function(){return Dh},WC:function(){return b_},x8:function(){return ky},cS:function(){return Ch},Qc:function(){return Oh},R8:function(){return bh},_u:function(){return T_},h:function(){return w_},WM:function(){return x_},HY:function(){return Lh},U$:function(){return Ph},Kl:function(){return Nh},GC:function(){return wy},Jh:function(){return _y},mA:function(){return tf},M8:function(){return Gm},RV:function(){return gy},n1:function(){return mf},Hu:function(){return df},Zs:function(){return y$},gb:function(){return uf},I:function(){return v$},JX:function(){return Mb},cz:function(){return zh},Jj:function(){return Gh},$$:function(){return jh},iA:function(){return Vh},jq:function(){return fh},ed:function(){return yh},y9:function(){return ph},uM:function(){return dh},pG:function(){return rf},cd:function(){return qh},oL:function(){return MX},Nk:function(){return kv},Qg:function(){return i_},o8:function(){return yy},HM:function(){return by},Ew:function(){return ff},PG:function(){return Sh},dl:function(){return BX},Ez:function(){return S_},_r:function(){return l_},J1:function(){return jX},d1:function(){return IX},kO:function(){return o_},Tg:function(){return Gv},ry:function(){return jv},Rg:function(){return Ah},fn:function(){return Rh},el:function(){return Ih},TF:function(){return uw},g:function(){return Mh},Bf:function(){return um},nu:function(){return D_},B3:function(){return Fv},k_:function(){return Uv}});var e={};n.r(e),n.d(e,{AsyncCompress:function(){return GS},AsyncDecompress:function(){return rI},AsyncDeflate:function(){return PS},AsyncGunzip:function(){return qS},AsyncGzip:function(){return GS},AsyncInflate:function(){return FS},AsyncUnzipInflate:function(){return DI},AsyncUnzlib:function(){return QS},AsyncZipDeflate:function(){return EI},AsyncZlib:function(){return $S},Compress:function(){return jS},DecodeUTF8:function(){return hI},Decompress:function(){return nI},Deflate:function(){return OS},EncodeUTF8:function(){return pI},Gunzip:function(){return HS},Gzip:function(){return jS},Inflate:function(){return kS},Unzip:function(){return CI},UnzipInflate:function(){return RI},UnzipPassThrough:function(){return AI},Unzlib:function(){return JS},Zip:function(){return SI},ZipDeflate:function(){return wI},ZipPassThrough:function(){return TI},Zlib:function(){return XS},compress:function(){return zS},compressSync:function(){return VS},decompress:function(){return iI},decompressSync:function(){return sI},deflate:function(){return NS},deflateSync:function(){return LS},gunzip:function(){return WS},gunzipSync:function(){return YS},gzip:function(){return zS},gzipSync:function(){return VS},inflate:function(){return US},inflateSync:function(){return BS},strFromU8:function(){return mI},strToU8:function(){return dI},unzip:function(){return OI},unzipSync:function(){return PI},unzlib:function(){return eI},unzlibSync:function(){return tI},zip:function(){return II},zipSync:function(){return MI},zlib:function(){return KS},zlibSync:function(){return ZS}});var t=n(93379),i=n.n(t),s=n(7795),a=n.n(s),o=n(90569),l=n.n(o),c=n(3565),u=n.n(c),h=n(19216),p=n.n(h),d=n(44589),m=n.n(d),f=n(14958),g={};g.styleTagTransform=m(),g.setAttributes=u(),g.insert=l().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=p();i()(f.Z,g),f.Z&&f.Z.locals&&f.Z.locals;var _=n(35820),v=n.n(_);const y=fetch;window.fetch=(...e)=>v().resolve(y(...e));var b=n(98235),x=n.n(b),T=n(51791),w=n.n(T),E=n(90143),S=n.n(E),I=n(35704),M=n.n(I),A=n(77726),R=n(54877),D=n(48994),C=n.n(D),O=n(10899),P=n.n(O),N=n(34300),L=n.n(N),k=n(10349),F=n.n(k),U=n(57445),B=n.n(U),j=n(13004),G=n.n(j),z=n(58218),V=n.n(z),H=n(67552),q=n.n(H),W=n(55243),Y=n(90646),X=n(2201),$=n.n(X),K=n(88946),Z=n.n(K),J=n(62079),Q=n.n(J),ee=n(98186),te=n(37265),ne=n(76555),re=n.n(ne),ie=n(73672),se=n(84705),ae=n.n(se),oe=n(73324),le=n.n(oe),ce=n(54847),ue=n.n(ce),he=n(23513),pe=n.n(he),de=n(89221),me=n.n(de),fe=n(99595),ge=n.n(fe),_e=n(48216),ve=n.n(_e),ye=n(8571),be=n.n(ye),xe=n(86526),Te=n.n(xe),we=n(14051),Ee=n(86981),Se=n.n(Ee),Ie=n(29898),Me=n.n(Ie),Ae=n(9938),Re=n.n(Ae),De=n(19178),Ce=n.n(De);n(60312);const Oe="146";const Pe=0,Ne=1,Le=2,ke=0,Fe=1,Ue=2,Be=0,je=1,Ge=2,ze=3,Ve=100,He=200,qe=301,We=302,Ye=303,Xe=304,$e=306,Ke=1e3,Ze=1001,Je=1002,Qe=1003,et=1004,tt=1005,nt=1006,rt=1007,it=1008,st=1009,at=1012,ot=1014,lt=1015,ct=1016,ut=1020,ht=1023,pt=1026,dt=1027,mt=33776,ft=33777,gt=33778,_t=33779,vt=2300,yt=2301,bt=2302,xt=2400,Tt=2401,wt=2402,Et=3e3,St=3001,It=3201,Mt="srgb",At="srgb-linear",Rt=7680,Dt=35044,Ct="300 es",Ot=1035;class Pt{addEventListener(e,t){var n;void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===T(n=r[e]).call(n,t)&&r[e].push(t)}hasEventListener(e,t){var n;if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==T(n=r[e]).call(n,t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=T(n).call(n,t);-1!==e&&E(n).call(n,e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=I(t).call(t,0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const Nt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Lt=1234567;const kt=Math.PI/180,Ft=180/Math.PI;function Ut(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Nt[255&e]+Nt[e>>8&255]+Nt[e>>16&255]+Nt[e>>24&255]+"-"+Nt[255&t]+Nt[t>>8&255]+"-"+Nt[t>>16&15|64]+Nt[t>>24&255]+"-"+Nt[63&n|128]+Nt[n>>8&255]+"-"+Nt[n>>16&255]+Nt[n>>24&255]+Nt[255&r]+Nt[r>>8&255]+Nt[r>>16&255]+Nt[r>>24&255]).toLowerCase()}function Bt(e,t,n){return Math.max(t,Math.min(n,e))}function jt(e,t){return(e%t+t)%t}function Gt(e,t,n){return(1-n)*e+n*t}function zt(e){return 0==(e&e-1)&&0!==e}function Vt(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Ht(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function qt(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function Wt(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var Yt=R({__proto__:null,DEG2RAD:kt,RAD2DEG:Ft,generateUUID:Ut,clamp:Bt,euclideanModulo:jt,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Gt,damp:function(e,t,n,r){return Gt(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(jt(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(Lt=e);let t=Lt+=1831565813;return t=A(t^t>>>15,1|t),t^=t+A(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*kt},radToDeg:function(e){return e*Ft},isPowerOfTwo:zt,ceilPowerOfTwo:Vt,floorPowerOfTwo:Ht,setQuaternionFromProperEuler:function(e,t,n,r,i){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((t+r)/2),u=a((t+r)/2),h=s((t-r)/2),p=a((t-r)/2),d=s((r-t)/2),m=a((r-t)/2);switch(i){case"XYX":e.set(o*u,l*h,l*p,o*c);break;case"YZY":e.set(l*p,o*u,l*h,o*c);break;case"ZXZ":e.set(l*h,l*p,o*u,o*c);break;case"XZX":e.set(o*u,l*m,l*d,o*c);break;case"YXY":e.set(l*d,o*u,l*m,o*c);break;case"ZYZ":e.set(l*m,l*d,o*u,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Wt,denormalize:qt});class Xt{constructor(e=0,t=0){Xt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*n-s*r+e.x,this.y=i*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[D](){yield this.x,yield this.y}}class $t{constructor(){$t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,n,r,i,s,a,o,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],u=n[7],h=n[2],p=n[5],d=n[8],m=r[0],f=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],T=r[8];return i[0]=s*m+a*_+o*b,i[3]=s*f+a*v+o*x,i[6]=s*g+a*y+o*T,i[1]=l*m+c*_+u*b,i[4]=l*f+c*v+u*x,i[7]=l*g+c*y+u*T,i[2]=h*m+p*_+d*b,i[5]=h*f+p*v+d*x,i[8]=h*g+p*y+d*T,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-n*i*c+n*a*o+r*i*l-r*s*o}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],u=c*s-a*l,h=a*o-c*i,p=l*i-s*o,d=t*u+n*h+r*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const m=1/d;return e[0]=u*m,e[1]=(r*l-c*n)*m,e[2]=(a*n-r*s)*m,e[3]=h*m,e[4]=(c*t-r*o)*m,e[5]=(r*i-a*t)*m,e[6]=p*m,e[7]=(n*o-l*t)*m,e[8]=(s*t-n*i)*m,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,s,a){const o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*s+l*a)+s+e,-r*l,r*o,-r*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],s=r[3],a=r[6],o=r[1],l=r[4],c=r[7];return r[0]=t*i+n*o,r[3]=t*s+n*l,r[6]=t*a+n*c,r[1]=-n*i+t*o,r[4]=-n*s+t*l,r[7]=-n*a+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function Kt(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function Zt(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function Jt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Qt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const en={[Mt]:{[At]:Jt},[At]:{[Mt]:Qt}},tn={legacyMode:!0,get workingColorSpace(){return At},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(this.legacyMode||t===n||!t||!n)return e;if(en[t]&&void 0!==en[t][n]){const r=en[t][n];return e.r=r(e.r),e.g=r(e.g),e.b=r(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},nn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rn={r:0,g:0,b:0},sn={h:0,s:0,l:0},an={h:0,s:0,l:0};function on(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function ln(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}class cn{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t="srgb"){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,tn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r="srgb-linear"){return this.r=e,this.g=t,this.b=n,tn.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r="srgb-linear"){if(e=jt(e,1),t=Bt(t,0,1),n=Bt(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=on(i,r,e+1/3),this.g=on(i,r,e),this.b=on(i,r,e-1/3)}return tn.toWorkingColorSpace(this,r),this}setStyle(e,t="srgb"){function n(t){void 0!==t&&O(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const i=r[1],s=r[2];switch(i){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,N(e[1],10))/255,this.g=Math.min(255,N(e[2],10))/255,this.b=Math.min(255,N(e[3],10))/255,tn.toWorkingColorSpace(this,t),n(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,N(e[1],10))/100,this.g=Math.min(100,N(e[2],10))/100,this.b=Math.min(100,N(e[3],10))/100,tn.toWorkingColorSpace(this,t),n(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const r=O(e[1])/360,i=O(e[2])/100,s=O(e[3])/100;return n(e[4]),this.setHSL(r,i,s,t)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=r[1],n=e.length;if(3===n)return this.r=N(e.charAt(0)+e.charAt(0),16)/255,this.g=N(e.charAt(1)+e.charAt(1),16)/255,this.b=N(e.charAt(2)+e.charAt(2),16)/255,tn.toWorkingColorSpace(this,t),this;if(6===n)return this.r=N(e.charAt(0)+e.charAt(1),16)/255,this.g=N(e.charAt(2)+e.charAt(3),16)/255,this.b=N(e.charAt(4)+e.charAt(5),16)/255,tn.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t="srgb"){const n=nn[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Jt(e.r),this.g=Jt(e.g),this.b=Jt(e.b),this}copyLinearToSRGB(e){return this.r=Qt(e.r),this.g=Qt(e.g),this.b=Qt(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e="srgb"){return tn.fromWorkingColorSpace(ln(this,rn),e),Bt(255*rn.r,0,255)<<16^Bt(255*rn.g,0,255)<<8^Bt(255*rn.b,0,255)<<0}getHexString(e="srgb"){var t;return I(t="000000"+this.getHex(e).toString(16)).call(t,-6)}getHSL(e,t="srgb-linear"){tn.fromWorkingColorSpace(ln(this,rn),t);const n=rn.r,r=rn.g,i=rn.b,s=Math.max(n,r,i),a=Math.min(n,r,i);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const e=s-a;switch(l=c<=.5?e/(s+a):e/(2-s-a),s){case n:o=(r-i)/e+(r<i?6:0);break;case r:o=(i-n)/e+2;break;case i:o=(n-r)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t="srgb-linear"){return tn.fromWorkingColorSpace(ln(this,rn),t),e.r=rn.r,e.g=rn.g,e.b=rn.b,e}getStyle(e="srgb"){return tn.fromWorkingColorSpace(ln(this,rn),e),e!==Mt?`color(${e} ${rn.r} ${rn.g} ${rn.b})`:`rgb(${255*rn.r|0},${255*rn.g|0},${255*rn.b|0})`}offsetHSL(e,t,n){return this.getHSL(sn),sn.h+=e,sn.s+=t,sn.l+=n,this.setHSL(sn.h,sn.s,sn.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(sn),e.getHSL(an);const n=Gt(sn.h,an.h,t),r=Gt(sn.s,an.s,t),i=Gt(sn.l,an.l,t);return this.setHSL(n,r,i),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[D](){yield this.r,yield this.g,yield this.b}}let un;cn.NAMES=nn;class hn{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===un&&(un=Zt("canvas")),un.width=e.width,un.height=e.height;const n=un.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=un}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=Zt("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*Jt(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){var t;const n=I(t=e.data).call(t,0);for(let e=0;e<n.length;e++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[e]=Math.floor(255*Jt(n[e]/255)):n[e]=Jt(n[e]);return{data:n,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class pn{constructor(e=null){this.isSource=!0,this.uuid=Ut(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(b(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(dn(r[t].image)):e.push(dn(r[t]))}else e=dn(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function dn(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?hn.getDataURL(e):e.data?{data:k(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let mn=0;class fn extends Pt{constructor(e=fn.DEFAULT_IMAGE,t=fn.DEFAULT_MAPPING,n=1001,r=1001,i=1006,s=1008,a=1023,o=1009,l=1,c=3e3){super(),this.isTexture=!0,U(this,"id",{value:mn++}),this.uuid=Ut(),this.name="",this.source=new pn(e),this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new Xt(0,0),this.repeat=new Xt(1,1),this.center=new Xt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,j(this).x,j(this).y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){var t;return this.name=e.name,this.source=e.source,this.mipmaps=I(t=e.mipmaps).call(t,0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),j(this).copy(j(e)),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(z(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,repeat:[j(this).x,j(this).y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==z(this.userData)&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ke:e.x=e.x-Math.floor(e.x);break;case Ze:e.x=e.x<0?0:1;break;case Je:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ke:e.y=e.y-Math.floor(e.y);break;case Ze:e.y=e.y<0?0:1;break;case Je:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}}fn.DEFAULT_IMAGE=null,fn.DEFAULT_MAPPING=300;class gn{constructor(e=0,t=0,n=0,r=1){gn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*i,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*i,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*i,this.w=s[3]*t+s[7]*n+s[11]*r+s[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const s=.01,a=.1,o=e.elements,l=o[0],c=o[4],u=o[8],h=o[1],p=o[5],d=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-h)<s&&Math.abs(u-m)<s&&Math.abs(d-f)<s){if(Math.abs(c+h)<a&&Math.abs(u+m)<a&&Math.abs(d+f)<a&&Math.abs(l+p+g-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(p+1)/2,_=(g+1)/2,v=(c+h)/4,y=(u+m)/4,b=(d+f)/4;return e>o&&e>_?e<s?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):o>_?o<s?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=v/r,i=b/r):_<s?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((f-d)*(f-d)+(u-m)*(u-m)+(h-c)*(h-c));return Math.abs(_)<.001&&(_=1),this.x=(f-d)/_,this.y=(u-m)/_,this.z=(h-c)/_,this.w=Math.acos((l+p+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[D](){yield this.x,yield this.y,yield this.z,yield this.w}}class _n extends Pt{constructor(e=1,t=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new gn(0,0,e,t),this.scissorTest=!1,this.viewport=new gn(0,0,e,t);const r={width:e,height:t,depth:1};this.texture=new fn(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:nt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=H({},e.texture.image);return this.texture.source=new pn(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class vn extends fn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Qe,this.minFilter=Qe,this.wrapR=Ze,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yn extends fn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Qe,this.minFilter=Qe,this.wrapR=Ze,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class bn{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,s,a){let o=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const h=i[s+0],p=i[s+1],d=i[s+2],m=i[s+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===a)return e[t+0]=h,e[t+1]=p,e[t+2]=d,void(e[t+3]=m);if(u!==m||o!==h||l!==p||c!==d){let e=1-a;const t=o*h+l*p+c*d+u*m,n=t>=0?1:-1,r=1-t*t;if(r>W){const i=Math.sqrt(r),s=Math.atan2(i,t*n);e=Math.sin(e*s)/i,a=Math.sin(a*s)/i}const i=a*n;if(o=o*e+h*i,l=l*e+p*i,c=c*e+d*i,u=u*e+m*i,e===1-a){const e=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,s){const a=n[r],o=n[r+1],l=n[r+2],c=n[r+3],u=i[s],h=i[s+1],p=i[s+2],d=i[s+3];return e[t]=a*d+c*u+o*p-l*h,e[t+1]=o*d+c*h+l*u-a*p,e[t+2]=l*d+c*p+a*h-o*u,e[t+3]=c*d-a*u-o*h-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,r=e._y,i=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(r/2),u=a(i/2),h=o(n/2),p=o(r/2),d=o(i/2);switch(s){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],s=t[1],a=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=n+a+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(i-l)*e,this._z=(s-r)*e}else if(n>a&&n>u){const e=2*Math.sqrt(1+n-a-u);this._w=(c-o)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(i+l)/e}else if(a>u){const e=2*Math.sqrt(1+a-n-u);this._w=(i-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+u-n-a);this._w=(s-r)/e,this._x=(i+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<W?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Bt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,s=e._w,a=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+s*a+r*l-i*o,this._y=r*c+s*o+i*a-n*l,this._z=i*c+s*l+n*o-r*a,this._w=s*c-n*a-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,s=this._w;let a=s*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=r,this._z=i,this;const o=1-a*a;if(o<=W){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=s*u+this._w*h,this._x=n*u+this._x*h,this._y=r*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[D](){yield this._x,yield this._y,yield this._z,yield this._w}}class xn{constructor(e=0,t=0,n=0){xn.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(wn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(wn.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,s=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*s,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*s,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*r-a*n,c=o*n+a*t-i*r,u=o*r+i*n-s*t,h=-i*t-s*n-a*r;return this.x=l*o+h*-i+c*-a-u*-s,this.y=c*o+h*-s+u*-i-l*-a,this.z=u*o+h*-a+l*-s-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,s=t.x,a=t.y,o=t.z;return this.x=r*o-i*a,this.y=i*s-n*o,this.z=n*a-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Tn.copy(this).projectOnVector(e),this.sub(Tn)}reflect(e){return this.sub(Tn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Bt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[D](){yield this.x,yield this.y,yield this.z}}const Tn=new xn,wn=new bn;class En{constructor(e=new xn(1/0,1/0,1/0),t=new xn(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,s=-1/0,a=-1/0;for(let o=0,l=e.length;o<l;o+=3){const l=e[o],c=e[o+1],u=e[o+2];l<t&&(t=l),c<n&&(n=c),u<r&&(r=u),l>i&&(i=l),c>s&&(s=c),u>a&&(a=u)}return this.min.set(t,n,r),this.max.set(i,s,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,s=-1/0,a=-1/0;for(let o=0,l=e.count;o<l;o++){const l=e.getX(o),c=e.getY(o),u=e.getZ(o);l<t&&(t=l),c<n&&(n=c),u<r&&(r=u),l>i&&(i=l),c>s&&(s=c),u>a&&(a=u)}return this.min.set(t,n,r),this.max.set(i,s,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=In.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n)if(t&&null!=n.attributes&&void 0!==n.attributes.position){const t=n.attributes.position;for(let n=0,r=t.count;n<r;n++)In.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),this.expandByPoint(In)}else null===n.boundingBox&&n.computeBoundingBox(),Mn.copy(n.boundingBox),Mn.applyMatrix4(e.matrixWorld),this.union(Mn);const r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,In),In.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Nn),Ln.subVectors(this.max,Nn),An.subVectors(e.a,Nn),Rn.subVectors(e.b,Nn),Dn.subVectors(e.c,Nn),Cn.subVectors(Rn,An),On.subVectors(Dn,Rn),Pn.subVectors(An,Dn);let t=[0,-Cn.z,Cn.y,0,-On.z,On.y,0,-Pn.z,Pn.y,Cn.z,0,-Cn.x,On.z,0,-On.x,Pn.z,0,-Pn.x,-Cn.y,Cn.x,0,-On.y,On.x,0,-Pn.y,Pn.x,0];return!!Un(t,An,Rn,Dn,Ln)&&(t=[1,0,0,0,1,0,0,0,1],!!Un(t,An,Rn,Dn,Ln)&&(kn.crossVectors(Cn,On),t=[kn.x,kn.y,kn.z],Un(t,An,Rn,Dn,Ln)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return In.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(In).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Sn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Sn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Sn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Sn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Sn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Sn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Sn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Sn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Sn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Sn=[new xn,new xn,new xn,new xn,new xn,new xn,new xn,new xn],In=new xn,Mn=new En,An=new xn,Rn=new xn,Dn=new xn,Cn=new xn,On=new xn,Pn=new xn,Nn=new xn,Ln=new xn,kn=new xn,Fn=new xn;function Un(e,t,n,r,i){for(let s=0,a=e.length-3;s<=a;s+=3){Fn.fromArray(e,s);const a=i.x*Math.abs(Fn.x)+i.y*Math.abs(Fn.y)+i.z*Math.abs(Fn.z),o=t.dot(Fn),l=n.dot(Fn),c=r.dot(Fn);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Bn=new En,jn=new xn,Gn=new xn;class zn{constructor(e=new xn,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Bn.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;jn.subVectors(e,this.center);const t=jn.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(jn,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(Gn.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(jn.copy(e.center).add(Gn)),this.expandByPoint(jn.copy(e.center).sub(Gn))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Vn=new xn,Hn=new xn,qn=new xn,Wn=new xn,Yn=new xn,Xn=new xn,$n=new xn;class Kn{constructor(e=new xn,t=new xn(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(Y(this).call(this,e,Vn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Vn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Vn.copy(this.direction).multiplyScalar(t).add(this.origin),Vn.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Hn.copy(e).add(t).multiplyScalar(.5),qn.copy(t).sub(e).normalize(),Wn.copy(this.origin).sub(Hn);const i=.5*e.distanceTo(t),s=-this.direction.dot(qn),a=Wn.dot(this.direction),o=-Wn.dot(qn),l=Wn.lengthSq(),c=Math.abs(1-s*s);let u,h,p,d;if(c>0)if(u=s*o-a,h=s*a-o,d=i*c,u>=0)if(h>=-d)if(h<=d){const e=1/c;u*=e,h*=e,p=u*(u+s*h+2*a)+h*(s*u+h+2*o)+l}else h=i,u=Math.max(0,-(s*h+a)),p=-u*u+h*(h+2*o)+l;else h=-i,u=Math.max(0,-(s*h+a)),p=-u*u+h*(h+2*o)+l;else h<=-d?(u=Math.max(0,-(-s*i+a)),h=u>0?-i:Math.min(Math.max(-i,-o),i),p=-u*u+h*(h+2*o)+l):h<=d?(u=0,h=Math.min(Math.max(-i,-o),i),p=h*(h+2*o)+l):(u=Math.max(0,-(s*i+a)),h=u>0?i:Math.min(Math.max(-i,-o),i),p=-u*u+h*(h+2*o)+l);else h=s>0?-i:i,u=Math.max(0,-(s*h+a)),p=-u*u+h*(h+2*o)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(qn).multiplyScalar(h).add(Hn),p}intersectSphere(e,t){Vn.subVectors(e.center,this.origin);const n=Vn.dot(this.direction),r=Vn.dot(Vn)-n*n,i=e.radius*e.radius;if(r>i)return null;const s=Math.sqrt(i-r),a=n-s,o=n+s;return a<0&&o<0?null:a<0?Y(this).call(this,o,t):Y(this).call(this,a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:Y(this).call(this,n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),n>s||i>r?null:((i>n||isNaN(n))&&(n=i),(s<r||isNaN(r))&&(r=s),u>=0?(a=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),n>o||a>r?null:((a>n||n!=n)&&(n=a),(o<r||r!=r)&&(r=o),r<0?null:Y(this).call(this,n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,Vn)}intersectTriangle(e,t,n,r,i){Yn.subVectors(t,e),Xn.subVectors(n,e),$n.crossVectors(Yn,Xn);let s,a=this.direction.dot($n);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Wn.subVectors(this.origin,e);const o=s*this.direction.dot(Xn.crossVectors(Wn,Xn));if(o<0)return null;const l=s*this.direction.dot(Yn.cross(Wn));if(l<0)return null;if(o+l>a)return null;const c=-s*Wn.dot($n);return c<0?null:Y(this).call(this,c/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Zn{constructor(){Zn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Zn).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Jn.setFromMatrixColumn(e,0).length(),i=1/Jn.setFromMatrixColumn(e,1).length(),s=1/Jn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,i=e.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=s*c,n=s*u,r=a*c,i=a*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=s*o}else if("YXZ"===e.order){const e=o*c,n=o*u,r=l*c,i=l*u;t[0]=e+i*a,t[4]=r*a-n,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=s*o}else if("ZXY"===e.order){const e=o*c,n=o*u,r=l*c,i=l*u;t[0]=e-i*a,t[4]=-s*u,t[8]=r+n*a,t[1]=n+r*a,t[5]=s*c,t[9]=i-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){const e=s*c,n=s*u,r=a*c,i=a*u;t[0]=o*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=s*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=a*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(er,e,tr)}lookAt(e,t,n){const r=this.elements;return ir.subVectors(e,t),0===ir.lengthSq()&&(ir.z=1),ir.normalize(),nr.crossVectors(n,ir),0===nr.lengthSq()&&(1===Math.abs(n.z)?ir.x+=1e-4:ir.z+=1e-4,ir.normalize(),nr.crossVectors(n,ir)),nr.normalize(),rr.crossVectors(ir,nr),r[0]=nr.x,r[4]=rr.x,r[8]=ir.x,r[1]=nr.y,r[5]=rr.y,r[9]=ir.y,r[2]=nr.z,r[6]=rr.z,r[10]=ir.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],u=n[5],h=n[9],p=n[13],d=n[2],m=n[6],f=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],T=r[4],w=r[8],E=r[12],S=r[1],I=r[5],M=r[9],A=r[13],R=r[2],D=r[6],C=r[10],O=r[14],P=r[3],N=r[7],L=r[11],k=r[15];return i[0]=s*x+a*S+o*R+l*P,i[4]=s*T+a*I+o*D+l*N,i[8]=s*w+a*M+o*C+l*L,i[12]=s*E+a*A+o*O+l*k,i[1]=c*x+u*S+h*R+p*P,i[5]=c*T+u*I+h*D+p*N,i[9]=c*w+u*M+h*C+p*L,i[13]=c*E+u*A+h*O+p*k,i[2]=d*x+m*S+f*R+g*P,i[6]=d*T+m*I+f*D+g*N,i[10]=d*w+m*M+f*C+g*L,i[14]=d*E+m*A+f*O+g*k,i[3]=_*x+v*S+y*R+b*P,i[7]=_*T+v*I+y*D+b*N,i[11]=_*w+v*M+y*C+b*L,i[15]=_*E+v*A+y*O+b*k,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],s=e[1],a=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+i*o*u-r*l*u-i*a*h+n*l*h+r*a*p-n*o*p)+e[7]*(+t*o*p-t*l*h+i*s*h-r*s*p+r*l*c-i*o*c)+e[11]*(+t*l*u-t*a*p-i*s*u+n*s*p+i*a*c-n*l*c)+e[15]*(-r*a*c-t*o*u+t*a*h+r*s*u-n*s*h+n*o*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],m=e[13],f=e[14],g=e[15],_=u*f*l-m*h*l+m*o*p-a*f*p-u*o*g+a*h*g,v=d*h*l-c*f*l-d*o*p+s*f*p+c*o*g-s*h*g,y=c*m*l-d*u*l+d*a*p-s*m*p-c*a*g+s*u*g,b=d*u*o-c*m*o-d*a*h+s*m*h+c*a*f-s*u*f,x=t*_+n*v+r*y+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/x;return e[0]=_*T,e[1]=(m*h*i-u*f*i-m*r*p+n*f*p+u*r*g-n*h*g)*T,e[2]=(a*f*i-m*o*i+m*r*l-n*f*l-a*r*g+n*o*g)*T,e[3]=(u*o*i-a*h*i-u*r*l+n*h*l+a*r*p-n*o*p)*T,e[4]=v*T,e[5]=(c*f*i-d*h*i+d*r*p-t*f*p-c*r*g+t*h*g)*T,e[6]=(d*o*i-s*f*i-d*r*l+t*f*l+s*r*g-t*o*g)*T,e[7]=(s*h*i-c*o*i+c*r*l-t*h*l-s*r*p+t*o*p)*T,e[8]=y*T,e[9]=(d*u*i-c*m*i-d*n*p+t*m*p+c*n*g-t*u*g)*T,e[10]=(s*m*i-d*a*i+d*n*l-t*m*l-s*n*g+t*a*g)*T,e[11]=(c*a*i-s*u*i-c*n*l+t*u*l+s*n*p-t*a*p)*T,e[12]=b*T,e[13]=(c*m*r-d*u*r+d*n*h-t*m*h-c*n*f+t*u*f)*T,e[14]=(d*a*r-s*m*r-d*n*o+t*m*o+s*n*f-t*a*f)*T,e[15]=(s*u*r-c*a*r+c*n*o-t*u*o-s*n*h+t*a*h)*T,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,s=e.x,a=e.y,o=e.z,l=i*s,c=i*a;return this.set(l*s+n,l*a-r*o,l*o+r*a,0,l*a+r*o,c*a+n,c*o-r*s,0,l*o-r*a,c*o+r*s,i*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,s){return this.set(1,n,i,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,s=t._y,a=t._z,o=t._w,l=i+i,c=s+s,u=a+a,h=i*l,p=i*c,d=i*u,m=s*c,f=s*u,g=a*u,_=o*l,v=o*c,y=o*u,b=n.x,x=n.y,T=n.z;return r[0]=(1-(m+g))*b,r[1]=(p+y)*b,r[2]=(d-v)*b,r[3]=0,r[4]=(p-y)*x,r[5]=(1-(h+g))*x,r[6]=(f+_)*x,r[7]=0,r[8]=(d+v)*T,r[9]=(f-_)*T,r[10]=(1-(h+m))*T,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Jn.set(r[0],r[1],r[2]).length();const s=Jn.set(r[4],r[5],r[6]).length(),a=Jn.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Qn.copy(this);const o=1/i,l=1/s,c=1/a;return Qn.elements[0]*=o,Qn.elements[1]*=o,Qn.elements[2]*=o,Qn.elements[4]*=l,Qn.elements[5]*=l,Qn.elements[6]*=l,Qn.elements[8]*=c,Qn.elements[9]*=c,Qn.elements[10]*=c,t.setFromRotationMatrix(Qn),n.x=i,n.y=s,n.z=a,this}makePerspective(e,t,n,r,i,s){const a=this.elements,o=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(s+i)/(s-i),p=-2*s*i/(s-i);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,s){const a=this.elements,o=1/(t-e),l=1/(n-r),c=1/(s-i),u=(t+e)*o,h=(n+r)*l,p=(s+i)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Jn=new xn,Qn=new Zn,er=new xn(0,0,0),tr=new xn(1,1,1),nr=new xn,rr=new xn,ir=new xn,sr=new Zn,ar=new bn;class or{constructor(e=0,t=0,n=0,r=or.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,i=r[0],s=r[4],a=r[8],o=r[1],l=r[5],c=r[9],u=r[2],h=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(Bt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Bt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(Bt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-Bt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Bt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Bt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return sr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(sr,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ar.setFromEuler(this),this.setFromQuaternion(ar,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[D](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}or.DefaultOrder="XYZ",or.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class lr{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let cr=0;const ur=new xn,hr=new bn,pr=new Zn,dr=new xn,mr=new xn,fr=new xn,gr=new bn,_r=new xn(1,0,0),vr=new xn(0,1,0),yr=new xn(0,0,1),br={type:"added"},xr={type:"removed"};class Tr extends Pt{constructor(){super(),this.isObject3D=!0,U(this,"id",{value:cr++}),this.uuid=Ut(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Tr.DefaultUp.clone();const e=new xn,t=new or,n=new bn,r=new xn(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),X(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Zn},normalMatrix:{value:new $t}}),this.matrix=new Zn,this.matrixWorld=new Zn,this.matrixAutoUpdate=Tr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=Tr.DefaultMatrixWorldAutoUpdate,this.layers=new lr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hr.setFromAxisAngle(e,t),this.quaternion.multiply(hr),this}rotateOnWorldAxis(e,t){return hr.setFromAxisAngle(e,t),this.quaternion.premultiply(hr),this}rotateX(e){return this.rotateOnAxis(_r,e)}rotateY(e){return this.rotateOnAxis(vr,e)}rotateZ(e){return this.rotateOnAxis(yr,e)}translateOnAxis(e,t){return ur.copy(e).applyQuaternion(this.quaternion),this.position.add(ur.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(_r,e)}translateY(e){return this.translateOnAxis(vr,e)}translateZ(e){return this.translateOnAxis(yr,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(pr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?dr.copy(e):dr.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),mr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?pr.lookAt(mr,dr,this.up):pr.lookAt(dr,mr,this.up),this.quaternion.setFromRotationMatrix(pr),r&&(pr.extractRotation(r.matrixWorld),hr.setFromRotationMatrix(pr),this.quaternion.premultiply(hr.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(br)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){var t;if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const n=T(t=this.children).call(t,e);var r;-1!==n&&(e.parent=null,E(r=this.children).call(r,n,1),e.dispatchEvent(xr));return this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(xr)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),pr.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),pr.multiply(e.parent.matrixWorld)),e.applyMatrix4(pr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mr,e,fr),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mr,gr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){const r=t[n];!0!==r.matrixWorldAutoUpdate&&!0!==e||r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){const n=e[t];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==z(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(b(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(b(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=s(e.geometries),r=s(e.materials),i=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),c=s(e.animations),u=s(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=r,n;function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(z(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}Tr.DefaultUp=new xn(0,1,0),Tr.DefaultMatrixAutoUpdate=!0,Tr.DefaultMatrixWorldAutoUpdate=!0;const wr=new xn,Er=new xn,Sr=new xn,Ir=new xn,Mr=new xn,Ar=new xn,Rr=new xn,Dr=new xn,Cr=new xn,Or=new xn;class Pr{constructor(e=new xn,t=new xn,n=new xn){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),wr.subVectors(e,t),r.cross(wr);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){wr.subVectors(r,t),Er.subVectors(n,t),Sr.subVectors(e,t);const s=wr.dot(wr),a=wr.dot(Er),o=wr.dot(Sr),l=Er.dot(Er),c=Er.dot(Sr),u=s*l-a*a;if(0===u)return i.set(-2,-1,-1);const h=1/u,p=(l*o-a*c)*h,d=(s*c-a*o)*h;return i.set(1-p-d,d,p)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ir),Ir.x>=0&&Ir.y>=0&&Ir.x+Ir.y<=1}static getUV(e,t,n,r,i,s,a,o){return this.getBarycoord(e,t,n,r,Ir),o.set(0,0),o.addScaledVector(i,Ir.x),o.addScaledVector(s,Ir.y),o.addScaledVector(a,Ir.z),o}static isFrontFacing(e,t,n,r){return wr.subVectors(n,t),Er.subVectors(e,t),wr.cross(Er).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return wr.subVectors(this.c,this.b),Er.subVectors(this.a,this.b),.5*wr.cross(Er).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pr.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return Pr.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Pr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let s,a;Mr.subVectors(r,n),Ar.subVectors(i,n),Dr.subVectors(e,n);const o=Mr.dot(Dr),l=Ar.dot(Dr);if(o<=0&&l<=0)return t.copy(n);Cr.subVectors(e,r);const c=Mr.dot(Cr),u=Ar.dot(Cr);if(c>=0&&u<=c)return t.copy(r);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return s=o/(o-c),t.copy(n).addScaledVector(Mr,s);Or.subVectors(e,i);const p=Mr.dot(Or),d=Ar.dot(Or);if(d>=0&&p<=d)return t.copy(i);const m=p*l-o*d;if(m<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(n).addScaledVector(Ar,a);const f=c*d-p*u;if(f<=0&&u-c>=0&&p-d>=0)return Rr.subVectors(i,r),a=(u-c)/(u-c+(p-d)),t.copy(r).addScaledVector(Rr,a);const g=1/(f+m+h);return s=m*g,a=h*g,t.copy(n).addScaledVector(Mr,s).addScaledVector(Ar,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Nr=0;class Lr extends Pt{constructor(){super(),this.isMaterial=!0,U(this,"id",{value:Nr++}),this.uuid=Ut(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=Ve,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Rt,this.stencilZFail=Rt,this.stencilZPass=Rt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),K(this)&&K(this).isTexture&&(n.map=K(this).toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),"{}"!==z(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(z(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class kr extends Lr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new cn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=K(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fr=new xn,Ur=new Xt;class Br{constructor(e,t,n){if(b(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Dt,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)Ur.fromBufferAttribute(this,t),Ur.applyMatrix3(e),this.setXY(t,Ur.x,Ur.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.applyMatrix3(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.applyMatrix4(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.applyNormalMatrix(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.transformDirection(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=qt(t,this.array)),t}setX(e,t){return this.normalized&&(t=Wt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=qt(t,this.array)),t}setY(e,t){return this.normalized&&(t=Wt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=qt(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Wt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=qt(t,this.array)),t}setW(e,t){return this.normalized&&(t=Wt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Wt(t,this.array),n=Wt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Wt(t,this.array),n=Wt(n,this.array),r=Wt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Wt(t,this.array),n=Wt(n,this.array),r=Wt(r,this.array),i=Wt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:k(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Dt&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class jr extends Br{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Gr extends Br{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class zr extends Br{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Vr=0;const Hr=new Zn,qr=new Tr,Wr=new xn,Yr=new En,Xr=new En,$r=new xn;class Kr extends Pt{constructor(){super(),this.isBufferGeometry=!0,U(this,"id",{value:Vr++}),this.uuid=Ut(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return b(e)?this.index=new(Kt(e)?Gr:jr)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new $t).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Hr.makeRotationFromQuaternion(e),this.applyMatrix4(Hr),this}rotateX(e){return Hr.makeRotationX(e),this.applyMatrix4(Hr),this}rotateY(e){return Hr.makeRotationY(e),this.applyMatrix4(Hr),this}rotateZ(e){return Hr.makeRotationZ(e),this.applyMatrix4(Hr),this}translate(e,t,n){return Hr.makeTranslation(e,t,n),this.applyMatrix4(Hr),this}scale(e,t,n){return Hr.makeScale(e,t,n),this.applyMatrix4(Hr),this}lookAt(e){return qr.lookAt(e),qr.updateMatrix(),this.applyMatrix4(qr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Wr).negate(),this.translate(Wr.x,Wr.y,Wr.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new zr(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new En);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new xn(-1/0,-1/0,-1/0),new xn(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Yr.setFromBufferAttribute(n),this.morphTargetsRelative?($r.addVectors(this.boundingBox.min,Yr.min),this.boundingBox.expandByPoint($r),$r.addVectors(this.boundingBox.max,Yr.max),this.boundingBox.expandByPoint($r)):(this.boundingBox.expandByPoint(Yr.min),this.boundingBox.expandByPoint(Yr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new zn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new xn,1/0);if(e){const n=this.boundingSphere.center;if(Yr.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Xr.setFromBufferAttribute(n),this.morphTargetsRelative?($r.addVectors(Yr.min,Xr.min),Yr.expandByPoint($r),$r.addVectors(Yr.max,Xr.max),Yr.expandByPoint($r)):(Yr.expandByPoint(Xr.min),Yr.expandByPoint(Xr.max))}Yr.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)$r.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared($r));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],a=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)$r.fromBufferAttribute(s,t),a&&(Wr.fromBufferAttribute(e,t),$r.add(Wr)),r=Math.max(r,n.distanceToSquared($r))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,s=t.uv.array,a=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Br(new Float32Array(4*a),4));const o=this.getAttribute("tangent").array,l=[],c=[];for(let e=0;e<a;e++)l[e]=new xn,c[e]=new xn;const u=new xn,h=new xn,p=new xn,d=new Xt,m=new Xt,f=new Xt,g=new xn,_=new xn;function v(e,t,n){u.fromArray(r,3*e),h.fromArray(r,3*t),p.fromArray(r,3*n),d.fromArray(s,2*e),m.fromArray(s,2*t),f.fromArray(s,2*n),h.sub(u),p.sub(u),m.sub(d),f.sub(d);const i=1/(m.x*f.y-f.x*m.y);isFinite(i)&&(g.copy(h).multiplyScalar(f.y).addScaledVector(p,-m.y).multiplyScalar(i),_.copy(p).multiplyScalar(m.x).addScaledVector(h,-f.x).multiplyScalar(i),l[e].add(g),l[t].add(g),l[n].add(g),c[e].add(_),c[t].add(_),c[n].add(_))}let y=this.groups;0===y.length&&(y=[{start:0,count:n.length}]);for(let e=0,t=y.length;e<t;++e){const t=y[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)v(n[e+0],n[e+1],n[e+2])}const b=new xn,x=new xn,T=new xn,w=new xn;function E(e){T.fromArray(i,3*e),w.copy(T);const t=l[e];b.copy(t),b.sub(T.multiplyScalar(T.dot(t))).normalize(),x.crossVectors(w,t);const n=x.dot(c[e])<0?-1:1;o[4*e]=b.x,o[4*e+1]=b.y,o[4*e+2]=b.z,o[4*e+3]=n}for(let e=0,t=y.length;e<t;++e){const t=y[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)E(n[e+0]),E(n[e+1]),E(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new Br(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new xn,i=new xn,s=new xn,a=new xn,o=new xn,l=new xn,c=new xn,u=new xn;if(e)for(let h=0,p=e.count;h<p;h+=3){const p=e.getX(h+0),d=e.getX(h+1),m=e.getX(h+2);r.fromBufferAttribute(t,p),i.fromBufferAttribute(t,d),s.fromBufferAttribute(t,m),c.subVectors(s,i),u.subVectors(r,i),c.cross(u),a.fromBufferAttribute(n,p),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,m),a.add(c),o.add(c),l.add(c),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(m,l.x,l.y,l.z)}else for(let e=0,a=t.count;e<a;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),c.subVectors(s,i),u.subVectors(r,i),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)$r.fromBufferAttribute(e,t),$r.normalize(),e.setXYZ(t,$r.x,$r.y,$r.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,s=new n.constructor(t.length*r);let a=0,o=0;for(let i=0,l=t.length;i<l;i++){a=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)s[o++]=n[a++]}return new Br(s,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Kr,n=this.index.array,r=this.attributes;for(const i in r){const s=e(r[i],n);t.setAttribute(i,s)}const i=this.morphAttributes;for(const r in i){const s=[],a=i[r];for(let t=0,r=a.length;t<r;t++){const r=e(a[t],n);s.push(r)}t.morphAttributes[r]=s}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),J(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:I(Array.prototype).call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],s=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];s.push(r.toJSON(e.data))}s.length>0&&(r[t]=s,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(z(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let e=0,t=s.length;e<t;e++){const t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=H({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const Zr=new Zn,Jr=new Kn,Qr=new zn,ei=new xn,ti=new xn,ni=new xn,ri=new xn,ii=new xn,si=new xn,ai=new xn,oi=new xn,li=new xn,ci=new Xt,ui=new Xt,hi=new Xt,pi=new xn,di=new xn;class mi extends Tr{constructor(e=new Kr,t=new kr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){var n;(super.copy(e,t),void 0!==e.morphTargetInfluences)&&(this.morphTargetInfluences=I(n=e.morphTargetInfluences).call(n));return void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=H({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=J(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Qr.copy(n.boundingSphere),Qr.applyMatrix4(i),!1===e.ray.intersectsSphere(Qr))return;if(Zr.copy(i).invert(),Jr.copy(e.ray).applyMatrix4(Zr),null!==n.boundingBox&&!1===Jr.intersectsBox(n.boundingBox))return;let s;const a=n.index,o=n.attributes.position,l=n.morphAttributes.position,c=n.morphTargetsRelative,u=n.attributes.uv,h=n.attributes.uv2,p=n.groups,d=n.drawRange;if(null!==a)if(b(r))for(let n=0,i=p.length;n<i;n++){const i=p[n],m=r[i.materialIndex];for(let n=Math.max(i.start,d.start),r=Math.min(a.count,Math.min(i.start+i.count,d.start+d.count));n<r;n+=3){const r=a.getX(n),p=a.getX(n+1),d=a.getX(n+2);s=fi(this,m,e,Jr,o,l,c,u,h,r,p,d),s&&(s.faceIndex=Math.floor(n/3),s.face.materialIndex=i.materialIndex,t.push(s))}}else{for(let n=Math.max(0,d.start),i=Math.min(a.count,d.start+d.count);n<i;n+=3){const i=a.getX(n),p=a.getX(n+1),d=a.getX(n+2);s=fi(this,r,e,Jr,o,l,c,u,h,i,p,d),s&&(s.faceIndex=Math.floor(n/3),t.push(s))}}else if(void 0!==o)if(b(r))for(let n=0,i=p.length;n<i;n++){const i=p[n],a=r[i.materialIndex];for(let n=Math.max(i.start,d.start),r=Math.min(o.count,Math.min(i.start+i.count,d.start+d.count));n<r;n+=3){s=fi(this,a,e,Jr,o,l,c,u,h,n,n+1,n+2),s&&(s.faceIndex=Math.floor(n/3),s.face.materialIndex=i.materialIndex,t.push(s))}}else{for(let n=Math.max(0,d.start),i=Math.min(o.count,d.start+d.count);n<i;n+=3){s=fi(this,r,e,Jr,o,l,c,u,h,n,n+1,n+2),s&&(s.faceIndex=Math.floor(n/3),t.push(s))}}}}function fi(e,t,n,r,i,s,a,o,l,c,u,h){ei.fromBufferAttribute(i,c),ti.fromBufferAttribute(i,u),ni.fromBufferAttribute(i,h);const p=e.morphTargetInfluences;if(s&&p){ai.set(0,0,0),oi.set(0,0,0),li.set(0,0,0);for(let e=0,t=s.length;e<t;e++){const t=p[e],n=s[e];0!==t&&(ri.fromBufferAttribute(n,c),ii.fromBufferAttribute(n,u),si.fromBufferAttribute(n,h),a?(ai.addScaledVector(ri,t),oi.addScaledVector(ii,t),li.addScaledVector(si,t)):(ai.addScaledVector(ri.sub(ei),t),oi.addScaledVector(ii.sub(ti),t),li.addScaledVector(si.sub(ni),t)))}ei.add(ai),ti.add(oi),ni.add(li)}e.isSkinnedMesh&&(e.boneTransform(c,ei),e.boneTransform(u,ti),e.boneTransform(h,ni));const d=function(e,t,n,r,i,s,a,o){let l;if(l=1===t.side?r.intersectTriangle(a,s,i,!0,o):r.intersectTriangle(i,s,a,2!==t.side,o),null===l)return null;di.copy(o),di.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(di);return c<n.near||c>n.far?null:{distance:c,point:di.clone(),object:e}}(e,t,n,r,ei,ti,ni,pi);if(d){o&&(ci.fromBufferAttribute(o,c),ui.fromBufferAttribute(o,u),hi.fromBufferAttribute(o,h),d.uv=Pr.getUV(pi,ei,ti,ni,ci,ui,hi,new Xt)),l&&(ci.fromBufferAttribute(l,c),ui.fromBufferAttribute(l,u),hi.fromBufferAttribute(l,h),d.uv2=Pr.getUV(pi,ei,ti,ni,ci,ui,hi,new Xt));const e={a:c,b:u,c:h,normal:new xn,materialIndex:0};Pr.getNormal(ei,ti,ni,e.normal),d.face=e}return d}class gi extends Kr{constructor(e=1,t=1,n=1,r=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:s};const a=this;r=Math.floor(r),i=Math.floor(i),s=Math.floor(s);const o=[],l=[],c=[],u=[];let h=0,p=0;function d(e,t,n,r,i,s,d,m,f,g,_){const v=s/f,y=d/g,b=s/2,x=d/2,T=m/2,w=f+1,E=g+1;let S=0,I=0;const M=new xn;for(let s=0;s<E;s++){const a=s*y-x;for(let o=0;o<w;o++){const h=o*v-b;M[e]=h*r,M[t]=a*i,M[n]=T,l.push(M.x,M.y,M.z),M[e]=0,M[t]=0,M[n]=m>0?1:-1,c.push(M.x,M.y,M.z),u.push(o/f),u.push(1-s/g),S+=1}}for(let e=0;e<g;e++)for(let t=0;t<f;t++){const n=h+t+w*e,r=h+t+w*(e+1),i=h+(t+1)+w*(e+1),s=h+(t+1)+w*e;o.push(n,r,s),o.push(r,i,s),I+=6}a.addGroup(p,I,_),p+=I,h+=S}d("z","y","x",-1,-1,n,t,e,s,i,0),d("z","y","x",1,-1,n,t,-e,s,i,1),d("x","z","y",1,1,e,n,t,r,s,2),d("x","z","y",1,-1,e,n,-t,r,s,3),d("x","y","z",1,-1,e,t,n,r,i,4),d("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(o),this.setAttribute("position",new zr(l,3)),this.setAttribute("normal",new zr(c,3)),this.setAttribute("uv",new zr(u,2))}static fromJSON(e){return new gi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function _i(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():b(i)?t[n][r]=I(i).call(i):t[n][r]=i}}return t}function vi(e){const t={};for(let n=0;n<e.length;n++){const r=_i(e[n]);for(const e in r)t[e]=r[e]}return t}const yi={clone:_i,merge:vi};class bi extends Lr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=_i(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=H({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=H({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}J(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return J(n).length>0&&(t.extensions=n),t}}class xi extends Tr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Zn,this.projectionMatrix=new Zn,this.projectionMatrixInverse=new Zn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Ti extends xi{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:H({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Ft*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*kt*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ft*Math.atan(Math.tan(.5*kt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,i,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*kt*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,a=s.fullHeight;i+=s.offsetX*r/e,t-=s.offsetY*n/a,r*=s.width/e,n*=s.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=H({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const wi=90;class Ei extends Tr{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n;const r=new Ti(wi,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new xn(1,0,0)),this.add(r);const i=new Ti(wi,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new xn(-1,0,0)),this.add(i);const s=new Ti(wi,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new xn(0,1,0)),this.add(s);const a=new Ti(wi,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new xn(0,-1,0)),this.add(a);const o=new Ti(wi,1,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new xn(0,0,1)),this.add(o);const l=new Ti(wi,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new xn(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,s,a,o,l]=this.children,c=e.getRenderTarget(),u=e.toneMapping,h=e.xr.enabled;e.toneMapping=0,e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,s),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,o),n.texture.generateMipmaps=p,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=u,e.xr.enabled=h,n.texture.needsPMREMUpdate=!0}}class Si extends fn{constructor(e,t,n,r,i,s,a,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:qe,n,r,i,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Ii extends _n{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new Si(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:nt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new gi(5,5,5),i=new bi({name:"CubemapFromEquirect",uniforms:_i(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const s=new mi(r,i),a=t.minFilter;t.minFilter===it&&(t.minFilter=nt);return new Ei(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}const Mi=new xn,Ai=new xn,Ri=new $t;class Di{constructor(e=new xn(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Mi.subVectors(n,t).cross(Ai.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Mi),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Ri.getNormalMatrix(e),r=this.coplanarPoint(Mi).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Ci=new zn,Oi=new xn;class Pi{constructor(e=new Di,t=new Di,n=new Di,r=new Di,i=new Di,s=new Di){this.planes=[e,t,n,r,i,s]}set(e,t,n,r,i,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],s=n[2],a=n[3],o=n[4],l=n[5],c=n[6],u=n[7],h=n[8],p=n[9],d=n[10],m=n[11],f=n[12],g=n[13],_=n[14],v=n[15];return t[0].setComponents(a-r,u-o,m-h,v-f).normalize(),t[1].setComponents(a+r,u+o,m+h,v+f).normalize(),t[2].setComponents(a+i,u+l,m+p,v+g).normalize(),t[3].setComponents(a-i,u-l,m-p,v-g).normalize(),t[4].setComponents(a-s,u-c,m-d,v-_).normalize(),t[5].setComponents(a+s,u+c,m+d,v+_).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Ci.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ci)}intersectsSprite(e){return Ci.center.set(0,0,0),Ci.radius=.7071067811865476,Ci.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ci)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Oi.x=r.normal.x>0?e.max.x:e.min.x,Oi.y=r.normal.y>0?e.max.y:e.min.y,Oi.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Oi)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Ni(){let e=null,t=!1,n=null,r=null;function i(t,s){n(t,s),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Li(e,t){const n=t.isWebGL2,r=new ee;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const s=r.get(t);void 0===s?r.set(t,function(t,r){const i=t.array,s=t.usage,a=e.createBuffer();let o;if(e.bindBuffer(r,a),e.bufferData(r,i,s),t.onUploadCallback(),i instanceof Float32Array)o=5126;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");o=5131}else o=5123;else if(i instanceof Int16Array)o=5122;else if(i instanceof Uint32Array)o=5125;else if(i instanceof Int32Array)o=5124;else if(i instanceof Int8Array)o=5120;else if(i instanceof Uint8Array)o=5121;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=5121}return{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):s.version<t.version&&(!function(t,r,i){const s=r.array,a=r.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,s):(n?e.bufferSubData(i,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count):e.bufferSubData(i,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count)),a.count=-1)}(s.buffer,t,i),s.version=t.version)}}}class ki extends Kr{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,s=t/2,a=Math.floor(n),o=Math.floor(r),l=a+1,c=o+1,u=e/a,h=t/o,p=[],d=[],m=[],f=[];for(let e=0;e<c;e++){const t=e*h-s;for(let n=0;n<l;n++){const r=n*u-i;d.push(r,-t,0),m.push(0,0,1),f.push(n/a),f.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),s=t+1+l*e;p.push(n,r,s),p.push(r,i,s)}this.setIndex(p),this.setAttribute("position",new zr(d,3)),this.setAttribute("normal",new zr(m,3)),this.setAttribute("uv",new zr(f,2))}static fromJSON(e){return new ki(e.width,e.height,e.widthSegments,e.heightSegments)}}const Fi={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Ui={common:{diffuse:{value:new cn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new $t},uv2Transform:{value:new $t},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new cn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new cn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new $t}},sprite:{diffuse:{value:new cn(16777215)},opacity:{value:1},center:{value:new Xt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new $t}}},Bi={basic:{uniforms:vi([Ui.common,Ui.specularmap,Ui.envmap,Ui.aomap,Ui.lightmap,Ui.fog]),vertexShader:Fi.meshbasic_vert,fragmentShader:Fi.meshbasic_frag},lambert:{uniforms:vi([Ui.common,Ui.specularmap,Ui.envmap,Ui.aomap,Ui.lightmap,Ui.emissivemap,Ui.bumpmap,Ui.normalmap,Ui.displacementmap,Ui.fog,Ui.lights,{emissive:{value:new cn(0)}}]),vertexShader:Fi.meshlambert_vert,fragmentShader:Fi.meshlambert_frag},phong:{uniforms:vi([Ui.common,Ui.specularmap,Ui.envmap,Ui.aomap,Ui.lightmap,Ui.emissivemap,Ui.bumpmap,Ui.normalmap,Ui.displacementmap,Ui.fog,Ui.lights,{emissive:{value:new cn(0)},specular:{value:new cn(1118481)},shininess:{value:30}}]),vertexShader:Fi.meshphong_vert,fragmentShader:Fi.meshphong_frag},standard:{uniforms:vi([Ui.common,Ui.envmap,Ui.aomap,Ui.lightmap,Ui.emissivemap,Ui.bumpmap,Ui.normalmap,Ui.displacementmap,Ui.roughnessmap,Ui.metalnessmap,Ui.fog,Ui.lights,{emissive:{value:new cn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Fi.meshphysical_vert,fragmentShader:Fi.meshphysical_frag},toon:{uniforms:vi([Ui.common,Ui.aomap,Ui.lightmap,Ui.emissivemap,Ui.bumpmap,Ui.normalmap,Ui.displacementmap,Ui.gradientmap,Ui.fog,Ui.lights,{emissive:{value:new cn(0)}}]),vertexShader:Fi.meshtoon_vert,fragmentShader:Fi.meshtoon_frag},matcap:{uniforms:vi([Ui.common,Ui.bumpmap,Ui.normalmap,Ui.displacementmap,Ui.fog,{matcap:{value:null}}]),vertexShader:Fi.meshmatcap_vert,fragmentShader:Fi.meshmatcap_frag},points:{uniforms:vi([Ui.points,Ui.fog]),vertexShader:Fi.points_vert,fragmentShader:Fi.points_frag},dashed:{uniforms:vi([Ui.common,Ui.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Fi.linedashed_vert,fragmentShader:Fi.linedashed_frag},depth:{uniforms:vi([Ui.common,Ui.displacementmap]),vertexShader:Fi.depth_vert,fragmentShader:Fi.depth_frag},normal:{uniforms:vi([Ui.common,Ui.bumpmap,Ui.normalmap,Ui.displacementmap,{opacity:{value:1}}]),vertexShader:Fi.meshnormal_vert,fragmentShader:Fi.meshnormal_frag},sprite:{uniforms:vi([Ui.sprite,Ui.fog]),vertexShader:Fi.sprite_vert,fragmentShader:Fi.sprite_frag},background:{uniforms:{uvTransform:{value:new $t},t2D:{value:null}},vertexShader:Fi.background_vert,fragmentShader:Fi.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0}},vertexShader:Fi.backgroundCube_vert,fragmentShader:Fi.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Fi.cube_vert,fragmentShader:Fi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Fi.equirect_vert,fragmentShader:Fi.equirect_frag},distanceRGBA:{uniforms:vi([Ui.common,Ui.displacementmap,{referencePosition:{value:new xn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Fi.distanceRGBA_vert,fragmentShader:Fi.distanceRGBA_frag},shadow:{uniforms:vi([Ui.lights,Ui.fog,{color:{value:new cn(0)},opacity:{value:1}}]),vertexShader:Fi.shadow_vert,fragmentShader:Fi.shadow_frag}};function ji(e,t,n,r,i,s,a){const o=new cn(0);let l,c,u=!0===s?0:1,h=null,p=0,d=null;function m(e,t){r.buffers.color.setClear(e.r,e.g,e.b,t,a)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),u=t,m(o,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,m(o,u)},render:function(r,s){let a=!1,f=!0===s.isScene?s.background:null;if(f&&f.isTexture){f=(s.backgroundBlurriness>0?n:t).get(f)}const g=e.xr,_=g.getSession&&g.getSession();_&&"additive"===_.environmentBlendMode&&(f=null),null===f?m(o,u):f&&f.isColor&&(m(f,1),a=!0),(e.autoClear||a)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.mapping===$e)?(void 0===c&&(c=new mi(new gi(1,1,1),new bi({name:"BackgroundCubeMaterial",uniforms:_i(Bi.backgroundCube.uniforms),vertexShader:Bi.backgroundCube.vertexShader,fragmentShader:Bi.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},U(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=f,c.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=s.backgroundBlurriness,h===f&&p===f.version&&d===e.toneMapping||(c.material.needsUpdate=!0,h=f,p=f.version,d=e.toneMapping),c.layers.enableAll(),r.unshift(c,c.geometry,c.material,0,0,null)):f&&f.isTexture&&(void 0===l&&(l=new mi(new ki(2,2),new bi({name:"BackgroundMaterial",uniforms:_i(Bi.background.uniforms),vertexShader:Bi.background.vertexShader,fragmentShader:Bi.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),U(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),l.material.uniforms.uvTransform.value.copy(f.matrix),h===f&&p===f.version&&d===e.toneMapping||(l.material.needsUpdate=!0,h=f,p=f.version,d=e.toneMapping),l.layers.enableAll(),r.unshift(l,l.geometry,l.material,0,0,null))}}}function Gi(e,t,n,r){const i=e.getParameter(34921),s=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==s,o={},l=d(null);let c=l,u=!1;function h(t){return r.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function p(t){return r.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function d(e){const t=[],n=[],r=[];for(let e=0;e<i;e++)t[e]=0,n[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function m(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function f(e){g(e,0)}function g(n,i){const s=c.newAttributes,a=c.enabledAttributes,o=c.attributeDivisors;if(s[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),o[n]!==i){(r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),o[n]=i}}function _(){const t=c.newAttributes,n=c.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function v(t,n,i,s,a,o){!0!==r.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,n,i,s,a,o):e.vertexAttribIPointer(t,n,i,a,o)}function y(){b(),u=!0,c!==l&&(c=l,h(c.object))}function b(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,p,y,b){let x=!1;if(a){const t=function(t,n,i){const a=!0===i.wireframe;let l=o[t.id];void 0===l&&(l={},o[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let u=c[a];void 0===u&&(u=d(r.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),c[a]=u);return u}(y,p,l);c!==t&&(c=t,h(c.object)),x=function(e,t,n,r){const i=c.attributes,s=t.attributes;let a=0;const o=n.getAttributes();for(const t in o){if(o[t].location>=0){const n=i[t];let r=s[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;a++}}return c.attributesNum!==a||c.index!==r}(i,y,p,b),x&&function(e,t,n,r){const i={},s=t.attributes;let a=0;const o=n.getAttributes();for(const t in o){if(o[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,a++}}c.attributes=i,c.attributesNum=a,c.index=r}(i,y,p,b)}else{const e=!0===l.wireframe;c.geometry===y.id&&c.program===p.id&&c.wireframe===e||(c.geometry=y.id,c.program=p.id,c.wireframe=e,x=!0)}null!==b&&n.update(b,34963),(x||u)&&(u=!1,function(i,s,a,o){if(!1===r.isWebGL2&&(i.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),u=s.defaultAttributeValues;for(const t in c){const r=c[t];if(r.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&i.instanceMatrix&&(s=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(s=i.instanceColor)),void 0!==s){const t=s.normalized,a=s.itemSize,l=n.get(s);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,l=n.stride,p=s.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)g(r.location+e,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<r.locationSize;e++)f(r.location+e);e.bindBuffer(34962,c);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,u,t,l*h,(p+a/r.locationSize*e)*h)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)g(r.location+e,s.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)f(r.location+e);e.bindBuffer(34962,c);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,u,t,a*h,a/r.locationSize*e*h)}}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r.location,n);break;case 3:e.vertexAttrib3fv(r.location,n);break;case 4:e.vertexAttrib4fv(r.location,n);break;default:e.vertexAttrib1fv(r.location,n)}}}}_()}(i,l,p,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){y();for(const e in o){const t=o[e];for(const e in t){const n=t[e];for(const e in n)p(n[e].object),delete n[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;const t=o[e.id];for(const e in t){const n=t[e];for(const e in n)p(n[e].object),delete n[e];delete t[e]}delete o[e.id]},releaseStatesOfProgram:function(e){for(const t in o){const n=o[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)p(r[e].object),delete r[e];delete n[e.id]}},initAttributes:m,enableAttribute:f,disableUnusedAttributes:_}}function zi(e,t,n,r){const i=r.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,r){e.drawArrays(s,t,r),n.update(r,s,1)},this.renderInstances=function(r,a,o){if(0===o)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,r,a,o),n.update(a,s,o)}}function Vi(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const o=i(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,u=e.getParameter(34930),h=e.getParameter(35660),p=e.getParameter(3379),d=e.getParameter(34076),m=e.getParameter(34921),f=e.getParameter(36347),g=e.getParameter(36348),_=e.getParameter(36349),v=h>0,y=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?e.getParameter(36183):0}}function Hi(e){const t=this;let n=null,r=0,i=!1,s=!1;const a=new Di,o=new $t,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=r+4*s,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=r;t!==s;++t,n+=4)a.copy(e[t]).applyMatrix4(i,o),a.normal.toArray(c,n),c[n+3]=a.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,s){const a=0!==e.length||t||0!==r||i;return i=t,n=u(e,s,0),r=e.length,a},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(t,a,o){const h=t.clippingPlanes,p=t.clipIntersection,d=t.clipShadows,m=e.get(t);if(!i||null===h||0===h.length||s&&!d)s?u(null):c();else{const e=s?0:r,t=4*e;let i=m.clippingState||null;l.value=i,i=u(h,a,t,o);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=e}}}function qi(e){let t=new ee;function n(e,t){return t===Ye?e.mapping=qe:t===Xe&&(e.mapping=We),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const s=i.mapping;if(s===Ye||s===Xe){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const s=i.image;if(s&&s.height>0){const a=new Ii(s.height/2);return a.fromEquirectangularTexture(e,i),t.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new ee}}}Bi.physical={uniforms:vi([Bi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Xt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new cn(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new cn(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new cn(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Fi.meshphysical_vert,fragmentShader:Fi.meshphysical_frag};class Wi extends xi{constructor(e=-1,t=1,n=1,r=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:H({},e.view),this}setViewOffset(e,t,n,r,i,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,s=n+e,a=r+t,o=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,a,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=H({},this.view)),t}}const Yi=[.125,.215,.35,.446,.526,.582],Xi=20,$i=new Wi,Ki=new cn;let Zi=null;const Ji=(1+Math.sqrt(5))/2,Qi=1/Ji,es=[new xn(1,1,1),new xn(-1,1,1),new xn(1,1,-1),new xn(-1,1,-1),new xn(0,Ji,Qi),new xn(0,Ji,-Qi),new xn(Qi,0,Ji),new xn(-Qi,0,Ji),new xn(Ji,Qi,0),new xn(-Ji,Qi,0)];class ts{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){Zi=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=ss(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=is(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(te(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Zi),e.scissorTest=!1,rs(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===qe||e.mapping===We?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Zi=this._renderer.getRenderTarget();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:nt,minFilter:nt,generateMipmaps:!1,type:ct,format:ht,encoding:Et,depthBuffer:!1},r=ns(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ns(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const s=e-4+1+Yi.length;for(let a=0;a<s;a++){const s=Math.pow(2,i);n.push(s);let o=1/s;a>e-4?o=Yi[a-e+4-1]:0===a&&(o=0),r.push(o);const l=1/(s-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],p=6,d=6,m=3,f=2,g=1,_=new Float32Array(m*d*p),v=new Float32Array(f*d*p),y=new Float32Array(g*d*p);for(let e=0;e<p;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];_.set(r,m*d*e),v.set(h,f*d*e);const i=[e,e,e,e,e,e];y.set(i,g*d*e)}const b=new Kr;b.setAttribute("position",new Br(_,m)),b.setAttribute("uv",new Br(v,f)),b.setAttribute("faceIndex",new Br(y,g)),t.push(b),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(Xi),i=new xn(0,1,0);return new bi({name:"SphericalGaussianBlur",defines:{n:Xi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:as(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){const t=new mi(this._lodPlanes[0],e);this._renderer.compile(t,$i)}_sceneToCubeUV(e,t,n,r){const i=new Ti(90,1,t,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(Ki),o.toneMapping=0,o.autoClear=!1;const u=new kr({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),h=new mi(new gi,u);let p=!1;const d=e.background;d?d.isColor&&(u.color.copy(d),e.background=null,p=!0):(u.color.copy(Ki),p=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(i.up.set(0,s[t],0),i.lookAt(a[t],0,0)):1===n?(i.up.set(0,0,s[t]),i.lookAt(0,a[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,a[t]));const l=this._cubeSize;rs(r,n*l,t>2?l:0,l,l),o.setRenderTarget(r),p&&o.render(h,i),o.render(e,i)}h.geometry.dispose(),h.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=d}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===qe||e.mapping===We;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=ss()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=is());const i=r?this._cubemapMaterial:this._equirectMaterial,s=new mi(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const a=this._cubeSize;rs(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,$i)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=es[(t-1)%es.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new mi(this._lodPlanes[r],l),u=l.uniforms,h=this._sizeLods[n]-1,p=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,d=i/p,m=isFinite(i)?1+Math.floor(3*d):Xi;m>Xi&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let g=0;for(let e=0;e<Xi;++e){const t=e/d,n=Math.exp(-t*t/2);f.push(n),0===e?g+=n:e<m&&(g+=2*n)}for(let e=0;e<f.length;e++)f[e]=f[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=f,u.latitudinal.value="latitudinal"===s,a&&(u.poleAxis.value=a);const{_lodMax:_}=this;u.dTheta.value=p,u.mipInt.value=_-n;const v=this._sizeLods[r];rs(t,3*v*(r>_-4?r-_+4:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(t),o.render(c,$i)}}function ns(e,t,n){const r=new _n(e,t,n);return r.texture.mapping=$e,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function rs(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function is(){return new bi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:as(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function ss(){return new bi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:as(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function as(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function os(e){let t=new ee,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,a=s===Ye||s===Xe,o=s===qe||s===We;if(a||o){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new ts(e)),r=a?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const s=i.image;if(a&&s&&s.height>0||o&&s&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(s)){null===n&&(n=new ts(e));const s=a?n.fromEquirectangular(i):n.fromCubemap(i);return t.set(i,s),i.addEventListener("dispose",r),s.texture}return null}}}return i},dispose:function(){t=new ee,null!==n&&(n.dispose(),n=null)}}}function ls(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function cs(e,t,n,r){const i={},s=new ee;function a(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const e in o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",a),delete i[o.id];const l=s.get(o);l&&(t.remove(l),s.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],s=e[t+2];n.push(r,i,i,s,s,r)}}else{const e=i.array;a=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}const o=new(Kt(n)?Gr:jr)(n,1);o.version=a;const l=s.get(e);l&&t.remove(l),s.set(e,o)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e<r;e++)t.update(n[e],34962)}},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return s.get(e)}}}function us(e,t,n,r){const i=r.isWebGL2;let s,a,o;this.setMode=function(e){s=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(s,r,a,t*o),n.update(r,s,1)},this.renderInstances=function(r,l,c){if(0===c)return;let u,h;if(i)u=e,h="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](s,l,a,r*o,c),n.update(l,s,c)}}function hs(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function ps(e,t){return e[0]-t[0]}function ds(e,t){return Math.abs(t[1])-Math.abs(e[1])}function ms(e,t,n){const r={},i=new Float32Array(8),s=new ee,a=new gn,o=[];for(let e=0;e<8;e++)o[e]=[e,0];return{update:function(l,c,u,h){const p=l.morphTargetInfluences;if(!0===t.isWebGL2){const r=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,i=void 0!==r?r.length:0;let o=s.get(c);if(void 0===o||o.count!==i){void 0!==o&&o.texture.dispose();const e=void 0!==c.morphAttributes.position,n=void 0!==c.morphAttributes.normal,r=void 0!==c.morphAttributes.color,l=c.morphAttributes.position||[],u=c.morphAttributes.normal||[],h=c.morphAttributes.color||[];let p=0;!0===e&&(p=1),!0===n&&(p=2),!0===r&&(p=3);let d=c.attributes.position.count*p,m=1;d>t.maxTextureSize&&(m=Math.ceil(d/t.maxTextureSize),d=t.maxTextureSize);const f=new Float32Array(d*m*4*i),g=new vn(f,d,m,i);g.type=lt,g.needsUpdate=!0;const _=4*p;for(let t=0;t<i;t++){const i=l[t],s=u[t],o=h[t],c=d*m*4*t;for(let t=0;t<i.count;t++){const l=t*_;!0===e&&(a.fromBufferAttribute(i,t),f[c+l+0]=a.x,f[c+l+1]=a.y,f[c+l+2]=a.z,f[c+l+3]=0),!0===n&&(a.fromBufferAttribute(s,t),f[c+l+4]=a.x,f[c+l+5]=a.y,f[c+l+6]=a.z,f[c+l+7]=0),!0===r&&(a.fromBufferAttribute(o,t),f[c+l+8]=a.x,f[c+l+9]=a.y,f[c+l+10]=a.z,f[c+l+11]=4===o.itemSize?a.w:1)}}o={count:i,texture:g,size:new Xt(d,m)},s.set(c,o),c.addEventListener("dispose",(function e(){g.dispose(),s.delete(c),c.removeEventListener("dispose",e)}))}let l=0;for(let e=0;e<p.length;e++)l+=p[e];const u=c.morphTargetsRelative?1:1-l;h.getUniforms().setValue(e,"morphTargetBaseInfluence",u),h.getUniforms().setValue(e,"morphTargetInfluences",p),h.getUniforms().setValue(e,"morphTargetsTexture",o.texture,n),h.getUniforms().setValue(e,"morphTargetsTextureSize",o.size)}else{const t=void 0===p?0:p.length;let n=r[c.id];if(void 0===n||n.length!==t){n=[];for(let e=0;e<t;e++)n[e]=[e,0];r[c.id]=n}for(let e=0;e<t;e++){const t=n[e];t[0]=e,t[1]=p[e]}ne(n).call(n,ds);for(let e=0;e<8;e++)e<t&&n[e][1]?(o[e][0]=n[e][0],o[e][1]=n[e][1]):(o[e][0]=ie,o[e][1]=0);ne(o).call(o,ps);const s=c.morphAttributes.position,a=c.morphAttributes.normal;let l=0;for(let e=0;e<8;e++){const t=o[e],n=t[0],r=t[1];n!==ie&&r?(s&&c.getAttribute("morphTarget"+e)!==s[n]&&c.setAttribute("morphTarget"+e,s[n]),a&&c.getAttribute("morphNormal"+e)!==a[n]&&c.setAttribute("morphNormal"+e,a[n]),i[e]=r,l+=r):(s&&!0===c.hasAttribute("morphTarget"+e)&&c.deleteAttribute("morphTarget"+e),a&&!0===c.hasAttribute("morphNormal"+e)&&c.deleteAttribute("morphNormal"+e),i[e]=0)}const u=c.morphTargetsRelative?1:1-l;h.getUniforms().setValue(e,"morphTargetBaseInfluence",u),h.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function fs(e,t,n,r){let i=new ee;function s(e){const t=e.target;t.removeEventListener("dispose",s),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(e){const a=r.render.frame,o=e.geometry,l=t.get(e,o);return i.get(l)!==a&&(t.update(l),i.set(l,a)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",s)&&e.addEventListener("dispose",s),n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),l},dispose:function(){i=new ee}}}const gs=new fn,_s=new vn,vs=new yn,ys=new Si,bs=[],xs=[],Ts=new Float32Array(16),ws=new Float32Array(9),Es=new Float32Array(4);function Ss(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let s=bs[i];if(void 0===s&&(s=new Float32Array(i),bs[i]=s),0!==t){r.toArray(s,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(s,i)}return s}function Is(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Ms(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function As(e,t){let n=xs[t];void 0===n&&(n=new Int32Array(t),xs[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Rs(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ds(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Is(n,t))return;e.uniform2fv(this.addr,t),Ms(n,t)}}function Cs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Is(n,t))return;e.uniform3fv(this.addr,t),Ms(n,t)}}function Os(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Is(n,t))return;e.uniform4fv(this.addr,t),Ms(n,t)}}function Ps(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Is(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ms(n,t)}else{if(Is(n,r))return;Es.set(r),e.uniformMatrix2fv(this.addr,!1,Es),Ms(n,r)}}function Ns(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Is(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ms(n,t)}else{if(Is(n,r))return;ws.set(r),e.uniformMatrix3fv(this.addr,!1,ws),Ms(n,r)}}function Ls(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Is(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ms(n,t)}else{if(Is(n,r))return;Ts.set(r),e.uniformMatrix4fv(this.addr,!1,Ts),Ms(n,r)}}function ks(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Fs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Is(n,t))return;e.uniform2iv(this.addr,t),Ms(n,t)}}function Us(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Is(n,t))return;e.uniform3iv(this.addr,t),Ms(n,t)}}function Bs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Is(n,t))return;e.uniform4iv(this.addr,t),Ms(n,t)}}function js(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Gs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Is(n,t))return;e.uniform2uiv(this.addr,t),Ms(n,t)}}function zs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Is(n,t))return;e.uniform3uiv(this.addr,t),Ms(n,t)}}function Vs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Is(n,t))return;e.uniform4uiv(this.addr,t),Ms(n,t)}}function Hs(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(t||gs,i)}function qs(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||vs,i)}function Ws(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||ys,i)}function Ys(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||_s,i)}function Xs(e,t){e.uniform1fv(this.addr,t)}function $s(e,t){const n=Ss(t,this.size,2);e.uniform2fv(this.addr,n)}function Ks(e,t){const n=Ss(t,this.size,3);e.uniform3fv(this.addr,n)}function Zs(e,t){const n=Ss(t,this.size,4);e.uniform4fv(this.addr,n)}function Js(e,t){const n=Ss(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Qs(e,t){const n=Ss(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ea(e,t){const n=Ss(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function ta(e,t){e.uniform1iv(this.addr,t)}function na(e,t){e.uniform2iv(this.addr,t)}function ra(e,t){e.uniform3iv(this.addr,t)}function ia(e,t){e.uniform4iv(this.addr,t)}function sa(e,t){e.uniform1uiv(this.addr,t)}function aa(e,t){e.uniform2uiv(this.addr,t)}function oa(e,t){e.uniform3uiv(this.addr,t)}function la(e,t){e.uniform4uiv(this.addr,t)}function ca(e,t,n){const r=this.cache,i=t.length,s=As(n,i);Is(r,s)||(e.uniform1iv(this.addr,s),Ms(r,s));for(let e=0;e!==i;++e)n.setTexture2D(t[e]||gs,s[e])}function ua(e,t,n){const r=this.cache,i=t.length,s=As(n,i);Is(r,s)||(e.uniform1iv(this.addr,s),Ms(r,s));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||vs,s[e])}function ha(e,t,n){const r=this.cache,i=t.length,s=As(n,i);Is(r,s)||(e.uniform1iv(this.addr,s),Ms(r,s));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||ys,s[e])}function pa(e,t,n){const r=this.cache,i=t.length,s=As(n,i);Is(r,s)||(e.uniform1iv(this.addr,s),Ms(r,s));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||_s,s[e])}class da{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Rs;case 35664:return Ds;case 35665:return Cs;case 35666:return Os;case 35674:return Ps;case 35675:return Ns;case 35676:return Ls;case 5124:case 35670:return ks;case 35667:case 35671:return Fs;case 35668:case 35672:return Us;case 35669:case 35673:return Bs;case 5125:return js;case 36294:return Gs;case 36295:return zs;case 36296:return Vs;case 35678:case 36198:case 36298:case 36306:case 35682:return Hs;case 35679:case 36299:case 36307:return qs;case 35680:case 36300:case 36308:case 36293:return Ws;case 36289:case 36303:case 36311:case 36292:return Ys}}(t.type)}}class ma{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Xs;case 35664:return $s;case 35665:return Ks;case 35666:return Zs;case 35674:return Js;case 35675:return Qs;case 35676:return ea;case 5124:case 35670:return ta;case 35667:case 35671:return na;case 35668:case 35672:return ra;case 35669:case 35673:return ia;case 5125:return sa;case 36294:return aa;case 36295:return oa;case 36296:return la;case 35678:case 36198:case 36298:case 36306:case 35682:return ca;case 35679:case 36299:case 36307:return ua;case 35680:case 36300:case 36308:case 36293:return ha;case 36289:case 36303:case 36311:case 36292:return pa}}(t.type)}}class fa{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,s=r.length;i!==s;++i){const s=r[i];s.setValue(e,t[s.id],n)}}}const ga=/(\w+)(\])?(\[|\.)?/g;function _a(e,t){e.seq.push(t),K(e)[t.id]=t}function va(e,t,n){const r=e.name,i=r.length;for(ga.lastIndex=0;;){const s=ga.exec(r),a=ga.lastIndex;let o=s[1];const l="]"===s[2],c=s[3];if(l&&(o|=0),void 0===c||"["===c&&a+2===i){_a(n,void 0===c?new da(o,e,t):new ma(o,e,t));break}{let e=K(n)[o];void 0===e&&(e=new fa(o),_a(n,e)),n=e}}}class ya{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,35718);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);va(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=K(this)[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,s=t.length;i!==s;++i){const s=t[i],a=n[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function ba(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let xa=0;function Ta(e,t,n){var r;const i=e.getShaderParameter(t,35713),s=se(r=e.getShaderInfoLog(t)).call(r);if(i&&""===s)return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const r=N(a[1]);return n.toUpperCase()+"\n\n"+s+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let e=i;e<s;e++){const i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return s}function wa(e,t){const n=function(e){switch(e){case Et:return["Linear","( value )"];case St:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Ea(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Sa(e){return""!==e}function Ia(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Ma(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Aa=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ra(e){return e.replace(Aa,Da)}function Da(e,t){const n=Fi[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Ra(n)}const Ca=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Oa(e){return e.replace(Ca,Pa)}function Pa(e,t,n,r){let i="";for(let e=N(t);e<N(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function Na(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function La(e,t,n,r){const i=e.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case qe:case We:t="ENVMAP_TYPE_CUBE";break;case $e:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===We&&(t="ENVMAP_MODE_REFRACTION");return t}(n),h=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),p=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=te(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),d=n.isWebGL2?"":function(e){const t=[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return oe(t).call(t,Sa).join("\n")}(n),m=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),f=i.createProgram();let g,_,v=n.glslVersion?"#version "+n.glslVersion+"\n":"";var y,b,x,T;n.isRawShaderMaterial?(g=oe(y=[m]).call(y,Sa).join("\n"),g.length>0&&(g+="\n"),_=oe(b=[d,m]).call(b,Sa).join("\n"),_.length>0&&(_+="\n")):(g=oe(x=[Na(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",K(n)?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"]).call(x,Sa).join("\n"),_=oe(T=[d,Na(n),"#define SHADER_NAME "+n.shaderName,m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",K(n)?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Fi.tonemapping_pars_fragment:"",0!==n.toneMapping?Ea("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Fi.encodings_pars_fragment,wa("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"]).call(T,Sa).join("\n"));a=Ra(a),a=Ia(a,n),a=Ma(a,n),o=Ra(o),o=Ia(o,n),o=Ma(o,n),a=Oa(a),o=Oa(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(v="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,_=["#define varying in",n.glslVersion===Ct?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Ct?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_);const w=v+_+o,E=ba(i,35633,v+g+a),S=ba(i,35632,w);if(i.attachShader(f,E),i.attachShader(f,S),void 0!==n.index0AttributeName?i.bindAttribLocation(f,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(f,0,"position"),i.linkProgram(f),e.debug.checkShaderErrors){var I,M,A;const e=se(I=i.getProgramInfoLog(f)).call(I),t=se(M=i.getShaderInfoLog(E)).call(M),n=se(A=i.getShaderInfoLog(S)).call(A);let r=!0,s=!0;if(!1===i.getProgramParameter(f,35714)){r=!1;const t=Ta(i,E,"vertex"),n=Ta(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==n||(s=!1);s&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:_}})}let R,D;return i.deleteShader(E),i.deleteShader(S),this.getUniforms=function(){return void 0===R&&(R=new ya(i,f)),R},this.getAttributes=function(){return void 0===D&&(D=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),s=r.name;let a=1;35674===r.type&&(a=2),35675===r.type&&(a=3),35676===r.type&&(a=4),n[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}(i,f)),D},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(f),this.program=void 0},this.name=n.shaderName,this.id=xa++,this.cacheKey=t,this.usedTimes=1,this.program=f,this.vertexShader=E,this.fragmentShader=S,this}let ka=0;class Fa{constructor(){this.shaderCache=new ce,this.materialCache=new ce}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new he,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new Ua(e),t.set(e,n)),n}}class Ua{constructor(e){this.id=ka++,this.code=e,this.usedTimes=0}}function Ba(e,t,n,r,i,s,a){const o=new lr,l=new Fa,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,p=i.vertexTextures;let d=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(s,o,c,f,g){const _=f.fog,v=g.geometry,y=s.isMeshStandardMaterial?f.environment:null,b=(s.isMeshStandardMaterial?n:t).get(s.envMap||y),x=b&&b.mapping===$e?b.image.height:null,T=m[s.type];null!==s.precision&&(d=i.getMaxPrecision(s.precision),d!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",d,"instead."));const w=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,E=void 0!==w?w.length:0;let S,I,M,A,R=0;if(void 0!==v.morphAttributes.position&&(R=1),void 0!==v.morphAttributes.normal&&(R=2),void 0!==v.morphAttributes.color&&(R=3),T){const e=Bi[T];S=e.vertexShader,I=e.fragmentShader}else S=s.vertexShader,I=s.fragmentShader,l.update(s),M=l.getVertexShaderID(s),A=l.getFragmentShaderID(s);const D=e.getRenderTarget(),C=s.alphaTest>0,O=s.clearcoat>0,P=s.iridescence>0;return{isWebGL2:u,shaderID:T,shaderName:s.type,vertexShader:S,fragmentShader:I,defines:s.defines,customVertexShaderID:M,customFragmentShaderID:A,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:d,instancing:!0===g.isInstancedMesh,instancingColor:!0===g.isInstancedMesh&&null!==g.instanceColor,supportsVertexTextures:p,outputEncoding:null===D?e.outputEncoding:!0===D.isXRRenderTarget?D.texture.encoding:Et,map:!!K(s),matcap:!!s.matcap,envMap:!!b,envMapMode:b&&b.mapping,envMapCubeUVHeight:x,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!K(s)&&!0===K(s).isVideoTexture&&K(s).encoding===St,clearcoat:O,clearcoatMap:O&&!!s.clearcoatMap,clearcoatRoughnessMap:O&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!s.clearcoatNormalMap,iridescence:P,iridescenceMap:P&&!!s.iridescenceMap,iridescenceThicknessMap:P&&!!s.iridescenceThicknessMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&1===s.blending,alphaMap:!!s.alphaMap,alphaTest:C,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!v.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!v.attributes.color&&4===v.attributes.color.itemSize,vertexUvs:!!(K(s)||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(K(s)||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!_,useFog:!0===s.fog,fogExp2:_&&_.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==v.morphAttributes.position,morphNormals:void 0!==v.morphAttributes.normal,morphColors:void 0!==v.morphAttributes.color,morphTargetsCount:E,morphTextureStride:R,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:!!s.depthPacking,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){o.disableAll(),t.isWebGL2&&o.enable(0);t.supportsVertexTextures&&o.enable(1);t.instancing&&o.enable(2);t.instancingColor&&o.enable(3);K(t)&&o.enable(4);t.matcap&&o.enable(5);t.envMap&&o.enable(6);t.lightMap&&o.enable(7);t.aoMap&&o.enable(8);t.emissiveMap&&o.enable(9);t.bumpMap&&o.enable(10);t.normalMap&&o.enable(11);t.objectSpaceNormalMap&&o.enable(12);t.tangentSpaceNormalMap&&o.enable(13);t.clearcoat&&o.enable(14);t.clearcoatMap&&o.enable(15);t.clearcoatRoughnessMap&&o.enable(16);t.clearcoatNormalMap&&o.enable(17);t.iridescence&&o.enable(18);t.iridescenceMap&&o.enable(19);t.iridescenceThicknessMap&&o.enable(20);t.displacementMap&&o.enable(21);t.specularMap&&o.enable(22);t.roughnessMap&&o.enable(23);t.metalnessMap&&o.enable(24);t.gradientMap&&o.enable(25);t.alphaMap&&o.enable(26);t.alphaTest&&o.enable(27);t.vertexColors&&o.enable(28);t.vertexAlphas&&o.enable(29);t.vertexUvs&&o.enable(30);t.vertexTangents&&o.enable(31);t.uvsVertexOnly&&o.enable(32);e.push(o.mask),o.disableAll(),t.fog&&o.enable(0);t.useFog&&o.enable(1);t.flatShading&&o.enable(2);t.logarithmicDepthBuffer&&o.enable(3);t.skinning&&o.enable(4);t.morphTargets&&o.enable(5);t.morphNormals&&o.enable(6);t.morphColors&&o.enable(7);t.premultipliedAlpha&&o.enable(8);t.shadowMapEnabled&&o.enable(9);t.physicallyCorrectLights&&o.enable(10);t.doubleSided&&o.enable(11);t.flipSided&&o.enable(12);t.useDepthPacking&&o.enable(13);t.dithering&&o.enable(14);t.specularIntensityMap&&o.enable(15);t.specularColorMap&&o.enable(16);t.transmission&&o.enable(17);t.transmissionMap&&o.enable(18);t.thicknessMap&&o.enable(19);t.sheen&&o.enable(20);t.sheenColorMap&&o.enable(21);t.sheenRoughnessMap&&o.enable(22);t.decodeVideoTexture&&o.enable(23);t.opaque&&o.enable(24);e.push(o.mask)}(n,t),n.push(e.outputEncoding)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=m[e.type];let n;if(t){const e=Bi[t];n=yi.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e<t;e++){const t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new La(e,n,t,s),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=T(c).call(c,e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function ja(){let e=new ee;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new ee}}}function Ga(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function za(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Va(){const e=[];let t=0;const n=[],r=[],i=[];function s(n,r,i,s,a,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,a,o,l,c){const u=s(e,t,a,o,l,c);a.transmission>0?r.push(u):!0===a.transparent?i.push(u):n.push(u)},unshift:function(e,t,a,o,l,c){const u=s(e,t,a,o,l,c);a.transmission>0?r.unshift(u):!0===a.transparent?i.unshift(u):n.unshift(u)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&ne(n).call(n,e||Ga),r.length>1&&ne(r).call(r,t||za),i.length>1&&ne(i).call(i,t||za)}}}function Ha(){let e=new ee;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new Va,e.set(t,[i])):n>=r.length?(i=new Va,r.push(i)):i=r[n],i},dispose:function(){e=new ee}}}function qa(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new xn,color:new cn};break;case"SpotLight":n={position:new xn,direction:new xn,color:new cn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new xn,color:new cn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new xn,skyColor:new cn,groundColor:new cn};break;case"RectAreaLight":n={color:new cn,position:new xn,halfWidth:new xn,halfHeight:new xn}}return e[t.id]=n,n}}}let Wa=0;function Ya(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(K(t)?1:0)-(K(e)?1:0)}function Xa(e,t){const n=new qa,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let e=0;e<9;e++)i.probe.push(new xn);const s=new xn,a=new Zn,o=new Zn;return{setup:function(s,a){let o=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let u=0,h=0,p=0,d=0,m=0,f=0,g=0,_=0,v=0,y=0;ne(s).call(s,Ya);const b=!0!==a?Math.PI:1;for(let e=0,t=s.length;e<t;e++){const t=s[e],a=t.color,x=t.intensity,T=t.distance,w=t.shadow&&K(t.shadow)?K(t.shadow).texture:null;if(t.isAmbientLight)o+=a.r*x*b,l+=a.g*x*b,c+=a.b*x*b;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],x);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*b),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[u]=n,i.directionalShadowMap[u]=w,i.directionalShadowMatrix[u]=t.shadow.matrix,f++}i.directional[u]=e,u++}else if(t.isSpotLight){const e=n.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(a).multiplyScalar(x*b),e.distance=T,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,i.spot[p]=e;const s=t.shadow;if(K(t)&&(i.spotLightMap[v]=K(t),v++,s.updateMatrices(t),t.castShadow&&y++),i.spotLightMatrix[p]=s.matrix,t.castShadow){const e=r.get(t);e.shadowBias=s.bias,e.shadowNormalBias=s.normalBias,e.shadowRadius=s.radius,e.shadowMapSize=s.mapSize,i.spotShadow[p]=e,i.spotShadowMap[p]=w,_++}p++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(a).multiplyScalar(x),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[d]=e,d++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*b),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[h]=n,i.pointShadowMap[h]=w,i.pointShadowMatrix[h]=t.shadow.matrix,g++}i.point[h]=e,h++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(x*b),e.groundColor.copy(t.groundColor).multiplyScalar(x*b),i.hemi[m]=e,m++}}d>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Ui.LTC_FLOAT_1,i.rectAreaLTC2=Ui.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Ui.LTC_HALF_1,i.rectAreaLTC2=Ui.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=l,i.ambient[2]=c;const x=i.hash;x.directionalLength===u&&x.pointLength===h&&x.spotLength===p&&x.rectAreaLength===d&&x.hemiLength===m&&x.numDirectionalShadows===f&&x.numPointShadows===g&&x.numSpotShadows===_&&x.numSpotMaps===v||(i.directional.length=u,i.spot.length=p,i.rectArea.length=d,i.point.length=h,i.hemi.length=m,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=g,i.spotLightMatrix.length=_+v-y,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=y,x.directionalLength=u,x.pointLength=h,x.spotLength=p,x.rectAreaLength=d,x.hemiLength=m,x.numDirectionalShadows=f,x.numPointShadows=g,x.numSpotShadows=_,x.numSpotMaps=v,i.version=Wa++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,p=e.length;t<p;t++){const p=e[t];if(p.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(p.matrixWorld),s.setFromMatrixPosition(p.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(h),n++}else if(p.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(p.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(p.matrixWorld),s.setFromMatrixPosition(p.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(h),l++}else if(p.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(p.matrixWorld),e.position.applyMatrix4(h),o.identity(),a.copy(p.matrixWorld),a.premultiply(h),o.extractRotation(a),e.halfWidth.set(.5*p.width,0,0),e.halfHeight.set(0,.5*p.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(p.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(p.matrixWorld),e.position.applyMatrix4(h),r++}else if(p.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(p.matrixWorld),e.direction.transformDirection(h),u++}}},state:i}}function $a(e,t){const n=new Xa(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Ka(e,t){let n=new ee;return{get:function(r,i=0){const s=n.get(r);let a;return void 0===s?(a=new $a(e,t),n.set(r,[a])):i>=s.length?(a=new $a(e,t),s.push(a)):a=s[i],a},dispose:function(){n=new ee}}}class Za extends Lr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=K(e),this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Ja extends Lr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new xn,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=K(e),this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Qa(e,t,n){let r=new Pi;const i=new Xt,s=new Xt,a=new gn,o=new Za({depthPacking:It}),l=new Ja,c={},u=n.maxTextureSize,h={0:1,1:0,2:2},p=new bi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=p.clone();d.defines.HORIZONTAL_PASS=1;const m=new Kr;m.setAttribute("position",new Br(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new mi(m,p),g=this;function _(n,r){const s=t.update(f);p.defines.VSM_SAMPLES!==n.blurSamples&&(p.defines.VSM_SAMPLES=n.blurSamples,d.defines.VSM_SAMPLES=n.blurSamples,p.needsUpdate=!0,d.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new _n(i.x,i.y)),p.uniforms.shadow_pass.value=K(n).texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,s,p,f,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(K(n)),e.clear(),e.renderBufferDirect(r,null,s,d,f,null)}function v(t,n,r,i,s,a){let u=null;const p=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(u=void 0!==p?p:!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&b(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const e=u.uuid,t=n.uuid;let r=c[e];void 0===r&&(r={},c[e]=r);let i=r[t];void 0===i&&(i=u.clone(),r[t]=i),u=i}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=3===a?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],u.alphaMap=n.alphaMap,u.alphaTest=n.alphaTest,u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.displacementMap=n.displacementMap,u.displacementScale=n.displacementScale,u.displacementBias=n.displacementBias,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===r.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(r.matrixWorld),u.nearDistance=i,u.farDistance=s),u}function y(n,i,s,a,o){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(b(i)){const t=r.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],u=i[c.materialIndex];if(u&&u.visible){const t=v(n,u,a,s.near,s.far,o);e.renderBufferDirect(s,null,r,t,n,c)}}}else if(i.visible){const t=v(n,i,a,s.near,s.far,o);e.renderBufferDirect(s,null,r,t,n,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)y(l[e],i,s,a,o)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,o){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.state;p.setBlending(0),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(let l=0,c=t.length;l<c;l++){const c=t[l],h=c.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;i.copy(h.mapSize);const d=h.getFrameExtents();if(i.multiply(d),s.copy(h.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/d.x),i.x=s.x*d.x,h.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/d.y),i.y=s.y*d.y,h.mapSize.y=s.y)),null===K(h)){const e=3!==this.type?{minFilter:Qe,magFilter:Qe}:{};h.map=new _n(i.x,i.y,e),K(h).texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(K(h)),e.clear();const m=h.getViewportCount();for(let e=0;e<m;e++){const t=h.getViewport(e);a.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),p.viewport(a),h.updateMatrices(c,e),r=h.getFrustum(),y(n,o,h.camera,c,this.type)}!0!==h.isPointLightShadow&&3===this.type&&_(h,o),h.needsUpdate=!1}g.needsUpdate=!1,e.setRenderTarget(l,c,h)}}function eo(e,t,n){const r=n.isWebGL2;const i=new function(){let t=!1;const n=new gn;let r=null;const i=new gn(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,s,a,o){!0===o&&(t*=a,r*=a,s*=a),n.set(t,r,s,a),!1===i.equals(n)&&(e.clearColor(t,r,s,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},s=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(e){e?z(2929):V(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:default:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},a=new function(){let t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,c=null;return{setTest:function(e){t||(e?z(2960):V(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&s===a||(e.stencilFunc(t,n,a),r=t,i=n,s=a)},setOp:function(t,n,r){a===t&&o===n&&l===r||(e.stencilOp(t,n,r),a=t,o=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,c=null}}},o=new ee,l=new ee;let c={},u={},h=new ee,p=[],d=null,m=!1,f=null,g=null,_=null,v=null,y=null,b=null,x=null,w=!1,E=null,S=null,I=null,M=null,A=null;const R=e.getParameter(35661);let D=!1,C=0;const P=e.getParameter(7938);-1!==T(P).call(P,"WebGL")?(C=O(/^WebGL (\d)/.exec(P)[1]),D=C>=1):-1!==T(P).call(P,"OpenGL ES")&&(C=O(/^OpenGL ES (\d)/.exec(P)[1]),D=C>=2);let N=null,L={};const k=e.getParameter(3088),F=e.getParameter(2978),U=(new gn).fromArray(k),B=(new gn).fromArray(F);function j(t,n,r){const i=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<r;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,i);return s}const G={};function z(t){!0!==c[t]&&(e.enable(t),c[t]=!0)}function V(t){!1!==c[t]&&(e.disable(t),c[t]=!1)}G[3553]=j(3553,3553,1),G[34067]=j(34067,34069,6),i.setClear(0,0,0,1),s.setClear(1),a.setClear(0),z(2929),s.setFunc(3),Y(!1),X(1),z(2884),W(0);const H={[Ve]:32774,101:32778,102:32779};if(r)H[103]=32775,H[104]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(H[103]=e.MIN_EXT,H[104]=e.MAX_EXT)}const q={[He]:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function W(t,n,r,i,s,a,o,l){if(0!==t){if(!1===m&&(z(3042),m=!0),5===t)s=s||n,a=a||r,o=o||i,n===g&&s===y||(e.blendEquationSeparate(H[n],H[s]),g=n,y=s),r===_&&i===v&&a===b&&o===x||(e.blendFuncSeparate(q[r],q[i],q[a],q[o]),_=r,v=i,b=a,x=o),f=t,w=null;else if(t!==f||l!==w){if(g===Ve&&y===Ve||(e.blendEquation(32774),g=Ve,y=Ve),l)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,769,0,1);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFuncSeparate(0,769,0,1);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}_=null,v=null,b=null,x=null,f=t,w=l}}else!0===m&&(V(3042),m=!1)}function Y(t){E!==t&&(t?e.frontFace(2304):e.frontFace(2305),E=t)}function X(t){0!==t?(z(2884),t!==S&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):V(2884),S=t}function $(t,n,r){t?(z(32823),M===n&&A===r||(e.polygonOffset(n,r),M=n,A=r)):V(32823)}return{buffers:{color:i,depth:s,stencil:a},enable:z,disable:V,bindFramebuffer:function(t,n){return u[t]!==n&&(e.bindFramebuffer(t,n),u[t]=n,r&&(36009===t&&(u[36160]=n),36160===t&&(u[36009]=n)),!0)},drawBuffers:function(r,i){let s=p,a=!1;if(r)if(s=h.get(i),void 0===s&&(s=[],h.set(i,s)),r.isWebGLMultipleRenderTargets){const e=r.texture;if(s.length!==e.length||36064!==s[0]){for(let t=0,n=e.length;t<n;t++)s[t]=36064+t;s.length=e.length,a=!0}}else 36064!==s[0]&&(s[0]=36064,a=!0);else 1029!==s[0]&&(s[0]=1029,a=!0);a&&(n.isWebGL2?e.drawBuffers(s):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:W,setMaterial:function(e,t){2===e.side?V(2884):z(2884);let n=1===e.side;t&&(n=!n),Y(n),1===e.blending&&!1===e.transparent?W(0):W(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),s.setFunc(e.depthFunc),s.setTest(e.depthTest),s.setMask(e.depthWrite),i.setMask(e.colorWrite);const r=e.stencilWrite;a.setTest(r),r&&(a.setMask(e.stencilWriteMask),a.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),a.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),$(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?z(32926):V(32926)},setFlipSided:Y,setCullFace:X,setLineWidth:function(t){t!==I&&(D&&e.lineWidth(t),I=t)},setPolygonOffset:$,setScissorTest:function(e){e?z(3089):V(3089)},activeTexture:function(t){void 0===t&&(t=33984+R-1),N!==t&&(e.activeTexture(t),N=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===N?33984+R-1:N);let i=L[r];void 0===i&&(i={type:void 0,texture:void 0},L[r]=i),i.type===t&&i.texture===n||(N!==r&&(e.activeTexture(r),N=r),e.bindTexture(t,n||G[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=L[N];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,n){let r=l.get(n);void 0===r&&(r=new ee,l.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=l.get(n).get(t);o.get(t)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),o.set(t,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===U.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),U.copy(t))},viewport:function(t){!1===B.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===r&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),c={},N=null,L={},u={},h=new ee,p=[],d=null,m=!1,f=null,g=null,_=null,v=null,y=null,b=null,x=null,w=!1,E=null,S=null,I=null,M=null,A=null,U.set(0,0,e.canvas.width,e.canvas.height),B.set(0,0,e.canvas.width,e.canvas.height),i.reset(),s.reset(),a.reset()}}}function to(e,t,n,r,i,s,a){const o=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,p=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,d=/OculusBrowser/g.test("undefined"==typeof navigator?"":navigator.userAgent),m=new ee;let f;const g=new ee;let _=!1;try{_="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function v(e,t){return _?new OffscreenCanvas(e,t):Zt("canvas")}function y(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?Ht:Math.floor,s=r(i*e.width),a=r(i*e.height);void 0===f&&(f=v(s,a));const o=n?v(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(e,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return zt(e.width)&&zt(e.height)}function T(e,t){return e.generateMipmaps&&t&&e.minFilter!==Qe&&e.minFilter!==nt}function w(t){e.generateMipmap(t)}function E(n,r,i,s,a=!1){if(!1===o)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;return 6403===r&&(5126===i&&(l=33326),5131===i&&(l=33325),5121===i&&(l=33321)),33319===r&&(5126===i&&(l=33328),5131===i&&(l=33327),5121===i&&(l=33323)),6408===r&&(5126===i&&(l=34836),5131===i&&(l=34842),5121===i&&(l=s===St&&!1===a?35907:32856),32819===i&&(l=32854),32820===i&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||t.get("EXT_color_buffer_float"),l}function S(e,t,n){return!0===T(e,n)||e.isFramebufferTexture&&e.minFilter!==Qe&&e.minFilter!==nt?te(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&b(e.image)?t.mipmaps.length:1}function I(e){return e===Qe||e===et||e===tt?9728:9729}function M(e){const t=e.target;t.removeEventListener("dispose",M),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=g.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&R(e),0===J(i).length&&g.delete(n)}r.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function A(t){const n=t.target;n.removeEventListener("dispose",A),function(t){const n=t.texture,i=r.get(t),s=r.get(n);void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),a.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t]);else{if(e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let t=0;t<i.__webglColorRenderbuffer.length;t++)i.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(i.__webglColorRenderbuffer[t]);i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);i.__webglTexture&&(e.deleteTexture(i.__webglTexture),a.memory.textures--),r.remove(n[t])}r.remove(n),r.remove(t)}(n)}function R(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete g.get(i)[n.__cacheKey],a.memory.textures--}let D=0;function C(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=a.render.frame;m.get(e)!==t&&(m.set(e,t),e.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&i.__version!==e.version){const n=e.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void k(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(3553,i.__webglTexture,33984+t)}const O={[Ke]:10497,[Ze]:33071,[Je]:33648},P={[Qe]:9728,[et]:9984,[tt]:9986,[nt]:9729,[rt]:9985,[it]:9987};function N(n,s,a){if(a?(e.texParameteri(n,10242,O[s.wrapS]),e.texParameteri(n,10243,O[s.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,O[s.wrapR]),e.texParameteri(n,10240,P[s.magFilter]),e.texParameteri(n,10241,P[s.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),s.wrapS===Ze&&s.wrapT===Ze||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,I(s.magFilter)),e.texParameteri(n,10241,I(s.minFilter)),s.minFilter!==Qe&&s.minFilter!==nt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const a=t.get("EXT_texture_filter_anisotropic");if(s.type===lt&&!1===t.has("OES_texture_float_linear"))return;if(!1===o&&s.type===ct&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||r.get(s).__currentAnisotropy)&&(e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy)}}function L(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",M));const i=n.source;let s=g.get(i);void 0===s&&(s={},g.set(i,s));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(n);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,r=!0),s[o].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&R(n)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return r}function k(t,i,a){let l=3553;(i.isDataArrayTexture||i.isCompressedArrayTexture)&&(l=35866),i.isData3DTexture&&(l=32879);const c=L(t,i),h=i.source;n.bindTexture(l,t.__webglTexture,33984+a);const p=r.get(h);if(h.version!==p.__version||!0===c){n.activeTexture(33984+a),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),e.pixelStorei(37443,0);const t=function(e){return!o&&(e.wrapS!==Ze||e.wrapT!==Ze||e.minFilter!==Qe&&e.minFilter!==nt)}(i)&&!1===x(i.image);let r=y(i.image,t,!1,u);r=z(i,r);const d=x(r)||o,m=s.convert(i.format,i.encoding);let f,g=s.convert(i.type),_=E(i.internalFormat,m,g,i.encoding,i.isVideoTexture);N(l,i,d);const v=i.mipmaps,b=o&&!0!==i.isVideoTexture,I=void 0===p.__version||!0===c,M=S(i,r,d);if(i.isDepthTexture)_=6402,o?_=i.type===lt?36012:i.type===ot?33190:i.type===ut?35056:33189:i.type===lt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===pt&&6402===_&&i.type!==at&&i.type!==ot&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=ot,g=s.convert(i.type)),i.format===dt&&6402===_&&(_=34041,i.type!==ut&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=ut,g=s.convert(i.type))),I&&(b?n.texStorage2D(3553,1,_,r.width,r.height):n.texImage2D(3553,0,_,r.width,r.height,0,m,g,null));else if(i.isDataTexture)if(v.length>0&&d){b&&I&&n.texStorage2D(3553,M,_,v[0].width,v[0].height);for(let e=0,t=v.length;e<t;e++)f=v[e],b?n.texSubImage2D(3553,e,0,0,f.width,f.height,m,g,f.data):n.texImage2D(3553,e,_,f.width,f.height,0,m,g,f.data);i.generateMipmaps=!1}else b?(I&&n.texStorage2D(3553,M,_,r.width,r.height),n.texSubImage2D(3553,0,0,0,r.width,r.height,m,g,r.data)):n.texImage2D(3553,0,_,r.width,r.height,0,m,g,r.data);else if(i.isCompressedTexture)if(i.isCompressedArrayTexture){b&&I&&n.texStorage3D(35866,M,_,v[0].width,v[0].height,r.depth);for(let e=0,t=v.length;e<t;e++)f=v[e],i.format!==ht?null!==m?b?n.compressedTexSubImage3D(35866,e,0,0,0,f.width,f.height,r.depth,m,f.data,0,0):n.compressedTexImage3D(35866,e,_,f.width,f.height,r.depth,0,f.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):b?n.texSubImage3D(35866,e,0,0,0,f.width,f.height,r.depth,m,g,f.data):n.texImage3D(35866,e,_,f.width,f.height,r.depth,0,m,g,f.data)}else{b&&I&&n.texStorage2D(3553,M,_,v[0].width,v[0].height);for(let e=0,t=v.length;e<t;e++)f=v[e],i.format!==ht?null!==m?b?n.compressedTexSubImage2D(3553,e,0,0,f.width,f.height,m,f.data):n.compressedTexImage2D(3553,e,_,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):b?n.texSubImage2D(3553,e,0,0,f.width,f.height,m,g,f.data):n.texImage2D(3553,e,_,f.width,f.height,0,m,g,f.data)}else if(i.isDataArrayTexture)b?(I&&n.texStorage3D(35866,M,_,r.width,r.height,r.depth),n.texSubImage3D(35866,0,0,0,0,r.width,r.height,r.depth,m,g,r.data)):n.texImage3D(35866,0,_,r.width,r.height,r.depth,0,m,g,r.data);else if(i.isData3DTexture)b?(I&&n.texStorage3D(32879,M,_,r.width,r.height,r.depth),n.texSubImage3D(32879,0,0,0,0,r.width,r.height,r.depth,m,g,r.data)):n.texImage3D(32879,0,_,r.width,r.height,r.depth,0,m,g,r.data);else if(i.isFramebufferTexture){if(I)if(b)n.texStorage2D(3553,M,_,r.width,r.height);else{let e=r.width,t=r.height;for(let r=0;r<M;r++)n.texImage2D(3553,r,_,e,t,0,m,g,null),e>>=1,t>>=1}}else if(v.length>0&&d){b&&I&&n.texStorage2D(3553,M,_,v[0].width,v[0].height);for(let e=0,t=v.length;e<t;e++)f=v[e],b?n.texSubImage2D(3553,e,0,0,m,g,f):n.texImage2D(3553,e,_,m,g,f);i.generateMipmaps=!1}else b?(I&&n.texStorage2D(3553,M,_,r.width,r.height),n.texSubImage2D(3553,0,0,0,m,g,r)):n.texImage2D(3553,0,_,m,g,r);T(i,d)&&w(l),p.__version=h.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}function F(t,i,a,o,l){const c=s.convert(a.format,a.encoding),u=s.convert(a.type),h=E(a.internalFormat,c,u,a.encoding);r.get(i).__hasExternalTextures||(32879===l||35866===l?n.texImage3D(l,0,h,i.width,i.height,i.depth,0,c,u,null):n.texImage2D(l,0,h,i.width,i.height,0,c,u,null)),n.bindFramebuffer(36160,t),G(i)?p.framebufferTexture2DMultisampleEXT(36160,o,l,r.get(a).__webglTexture,0,j(i)):(3553===l||l>=34069&&l<=34074)&&e.framebufferTexture2D(36160,o,l,r.get(a).__webglTexture,0),n.bindFramebuffer(36160,null)}function U(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){let i=33189;if(r||G(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===lt?i=36012:t.type===ot&&(i=33190));const r=j(n);G(n)?p.renderbufferStorageMultisampleEXT(36161,r,i,n.width,n.height):e.renderbufferStorageMultisample(36161,r,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=j(n);r&&!1===G(n)?e.renderbufferStorageMultisample(36161,i,35056,n.width,n.height):G(n)?p.renderbufferStorageMultisampleEXT(36161,i,35056,n.width,n.height):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i<t.length;i++){const a=t[i],o=s.convert(a.format,a.encoding),l=s.convert(a.type),c=E(a.internalFormat,o,l,a.encoding),u=j(n);r&&!1===G(n)?e.renderbufferStorageMultisample(36161,u,c,n.width,n.height):G(n)?p.renderbufferStorageMultisampleEXT(36161,u,c,n.width,n.height):e.renderbufferStorage(36161,c,n.width,n.height)}}e.bindRenderbuffer(36161,null)}function B(t){const i=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),C(i.depthTexture,0);const s=r.get(i.depthTexture).__webglTexture,a=j(i);if(i.depthTexture.format===pt)G(i)?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,s,0,a):e.framebufferTexture2D(36160,36096,3553,s,0);else{if(i.depthTexture.format!==dt)throw new Error("Unknown depthTexture format");G(i)?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,s,0,a):e.framebufferTexture2D(36160,33306,3553,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(36160,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),U(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),U(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(36160,null)}function j(e){return Math.min(h,e.samples)}function G(e){const n=r.get(e);return o&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function z(e,n){const r=e.encoding,i=e.format,s=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===Ot||r!==Et&&(r===St?!1===o?!0===t.has("EXT_sRGB")&&i===ht?(e.format=Ot,e.minFilter=nt,e.generateMipmaps=!1):n=hn.sRGBToLinear(n):i===ht&&s===st||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",r)),n}this.allocateTextureUnit=function(){const e=D;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),D+=1,e},this.resetTextureUnits=function(){D=0},this.setTexture2D=C,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):n.bindTexture(35866,i.__webglTexture,33984+t)},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):n.bindTexture(32879,i.__webglTexture,33984+t)},this.setTextureCube=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?function(t,i,a){if(6!==i.image.length)return;const l=L(t,i),u=i.source;n.bindTexture(34067,t.__webglTexture,33984+a);const h=r.get(u);if(u.version!==h.__version||!0===l){n.activeTexture(33984+a),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),e.pixelStorei(37443,0);const t=i.isCompressedTexture||i.image[0].isCompressedTexture,r=i.image[0]&&i.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=t||r?r?i.image[e].image:i.image[e]:y(i.image[e],!1,!0,c),p[e]=z(i,p[e]);const d=p[0],m=x(d)||o,f=s.convert(i.format,i.encoding),g=s.convert(i.type),_=E(i.internalFormat,f,g,i.encoding),v=o&&!0!==i.isVideoTexture,b=void 0===h.__version||!0===l;let I,M=S(i,d,m);if(N(34067,i,m),t){v&&b&&n.texStorage2D(34067,M,_,d.width,d.height);for(let e=0;e<6;e++){I=p[e].mipmaps;for(let t=0;t<I.length;t++){const r=I[t];i.format!==ht?null!==f?v?n.compressedTexSubImage2D(34069+e,t,0,0,r.width,r.height,f,r.data):n.compressedTexImage2D(34069+e,t,_,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v?n.texSubImage2D(34069+e,t,0,0,r.width,r.height,f,g,r.data):n.texImage2D(34069+e,t,_,r.width,r.height,0,f,g,r.data)}}}else{I=i.mipmaps,v&&b&&(I.length>0&&M++,n.texStorage2D(34067,M,_,p[0].width,p[0].height));for(let e=0;e<6;e++)if(r){v?n.texSubImage2D(34069+e,0,0,0,p[e].width,p[e].height,f,g,p[e].data):n.texImage2D(34069+e,0,_,p[e].width,p[e].height,0,f,g,p[e].data);for(let t=0;t<I.length;t++){const r=I[t].image[e].image;v?n.texSubImage2D(34069+e,t+1,0,0,r.width,r.height,f,g,r.data):n.texImage2D(34069+e,t+1,_,r.width,r.height,0,f,g,r.data)}}else{v?n.texSubImage2D(34069+e,0,0,0,f,g,p[e]):n.texImage2D(34069+e,0,_,f,g,p[e]);for(let t=0;t<I.length;t++){const r=I[t];v?n.texSubImage2D(34069+e,t+1,0,0,f,g,r.image[e]):n.texImage2D(34069+e,t+1,_,f,g,r.image[e])}}}T(i,m)&&w(34067),h.__version=u.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}(a,t,i):n.bindTexture(34067,a.__webglTexture,33984+i)},this.rebindTextures=function(e,t,n){const i=r.get(e);void 0!==t&&F(i.__webglFramebuffer,e,e.texture,36064,3553),void 0!==n&&B(e)},this.setupRenderTarget=function(t){const l=t.texture,c=r.get(t),u=r.get(l);t.addEventListener("dispose",A),!0!==t.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=e.createTexture()),u.__version=l.version,a.memory.textures++);const h=!0===t.isWebGLCubeRenderTarget,p=!0===t.isWebGLMultipleRenderTargets,d=x(t)||o;if(h){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(c.__webglFramebuffer=e.createFramebuffer(),p)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&t.samples>0&&!1===G(t)){const r=p?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,c.__webglMultisampledFramebuffer);for(let n=0;n<r.length;n++){const i=r[n];c.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer[n]);const a=s.convert(i.format,i.encoding),o=s.convert(i.type),l=E(i.internalFormat,a,o,i.encoding,!0===t.isXRRenderTarget),u=j(t);e.renderbufferStorageMultisample(36161,u,l,t.width,t.height),e.framebufferRenderbuffer(36160,36064+n,36161,c.__webglColorRenderbuffer[n])}e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),U(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(36160,null)}}if(h){n.bindTexture(34067,u.__webglTexture),N(34067,l,d);for(let e=0;e<6;e++)F(c.__webglFramebuffer[e],t,l,36064,34069+e);T(l,d)&&w(34067),n.unbindTexture()}else if(p){const e=t.texture;for(let i=0,s=e.length;i<s;i++){const s=e[i],a=r.get(s);n.bindTexture(3553,a.__webglTexture),N(3553,s,d),F(c.__webglFramebuffer,t,s,36064+i,3553),T(s,d)&&w(3553)}n.unbindTexture()}else{let e=3553;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(o?e=t.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(e,u.__webglTexture),N(e,l,d),F(c.__webglFramebuffer,t,l,36064,e),T(l,d)&&w(e),n.unbindTexture()}t.depthBuffer&&B(t)},this.updateRenderTargetMipmap=function(e){const t=x(e)||o,i=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let s=0,a=i.length;s<a;s++){const a=i[s];if(T(a,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,i=r.get(a).__webglTexture;n.bindTexture(t,i),w(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(o&&t.samples>0&&!1===G(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,a=t.height;let o=16384;const l=[],c=t.stencilBuffer?33306:36096,u=r.get(t),h=!0===t.isWebGLMultipleRenderTargets;if(h)for(let t=0;t<i.length;t++)n.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,null),n.bindFramebuffer(36160,u.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,null,0);n.bindFramebuffer(36008,u.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,u.__webglFramebuffer);for(let n=0;n<i.length;n++){l.push(36064+n),t.depthBuffer&&l.push(c);const p=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===p&&(t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024)),h&&e.framebufferRenderbuffer(36008,36064,36161,u.__webglColorRenderbuffer[n]),!0===p&&(e.invalidateFramebuffer(36008,[c]),e.invalidateFramebuffer(36009,[c])),h){const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(36009,36064,3553,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,9728),d&&e.invalidateFramebuffer(36008,l)}if(n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),h)for(let t=0;t<i.length;t++){n.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,u.__webglColorRenderbuffer[t]);const s=r.get(i[t]).__webglTexture;n.bindFramebuffer(36160,u.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,s,0)}n.bindFramebuffer(36009,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=B,this.setupFrameBufferTexture=F,this.useMultisampledRTT=G}function no(e,t,n){const r=n.isWebGL2;return{convert:function(n,i=null){let s;if(n===st)return 5121;if(1017===n)return 32819;if(1018===n)return 32820;if(1010===n)return 5120;if(1011===n)return 5122;if(n===at)return 5123;if(1013===n)return 5124;if(n===ot)return 5125;if(n===lt)return 5126;if(n===ct)return r?5131:(s=t.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(1021===n)return 6406;if(n===ht)return 6408;if(1024===n)return 6409;if(1025===n)return 6410;if(n===pt)return 6402;if(n===dt)return 34041;if(1028===n)return 6403;if(1022===n)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(n===Ot)return s=t.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(1029===n)return 36244;if(1030===n)return 33319;if(1031===n)return 33320;if(1033===n)return 36249;if(n===mt||n===ft||n===gt||n===_t)if(i===St){if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(n===mt)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===ft)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===gt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===_t)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=t.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(n===mt)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ft)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===gt)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===_t)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(s=t.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(35840===n)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return s=t.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===n||37496===n){if(s=t.get("WEBGL_compressed_texture_etc"),null===s)return null;if(37492===n)return i===St?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(37496===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(s=t.get("WEBGL_compressed_texture_astc"),null===s)return null;if(37808===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return i===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===n){if(s=t.get("EXT_texture_compression_bptc"),null===s)return null;if(36492===n)return i===St?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}return n===ut?r?34042:(s=t.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}class ro extends Ti{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class io extends Tr{constructor(){super(),this.isGroup=!0,this.type="Group"}}const so={type:"move"};class ao{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new io,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new io,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new xn,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new xn),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new io,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new xn,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new xn),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(const r of de(c=e.hand).call(c)){var c;const e=t.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const e=new io;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[r.jointName]=e,l.add(e)}const i=l.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],a=r.position.distanceTo(i.position),o=.02,u=.005;l.inputState.pinching&&a>o+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(so)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==s),this}}class oo extends fn{constructor(e,t,n,r,i,s,a,o,l,c){if((c=void 0!==c?c:pt)!==pt&&c!==dt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===pt&&(n=ot),void 0===n&&c===dt&&(n=ut),super(null,r,i,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:Qe,this.minFilter=void 0!==o?o:Qe,this.flipY=!1,this.generateMipmaps=!1}}class lo extends Pt{constructor(e,t){super();const n=this;let r=null,i=1,s=null,a="local-floor",o=null,l=null,c=null,u=null,h=null,p=null;const d=t.getContextAttributes();let m=null,f=null;const g=[],v=[],y=new Ti;y.layers.enable(1),y.viewport=new gn;const b=new Ti;b.layers.enable(2),b.viewport=new gn;const x=[y,b],w=new ro;w.layers.enable(1),w.layers.enable(2);let E=null,S=null;function I(e){const t=T(v).call(v,e.inputSource);if(-1===t)return;const n=g[t];void 0!==n&&n.dispatchEvent({type:e.type,data:e.inputSource})}function M(){r.removeEventListener("select",I),r.removeEventListener("selectstart",I),r.removeEventListener("selectend",I),r.removeEventListener("squeeze",I),r.removeEventListener("squeezestart",I),r.removeEventListener("squeezeend",I),r.removeEventListener("end",M),r.removeEventListener("inputsourceschange",A);for(let e=0;e<g.length;e++){const t=v[e];null!==t&&(v[e]=null,g[e].disconnect(t))}E=null,S=null,e.setRenderTarget(m),h=null,u=null,c=null,r=null,f=null,P.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function A(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=T(v).call(v,n);r>=0&&(v[r]=null,g[r].dispatchEvent({type:"disconnected",data:n}))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=T(v).call(v,n);if(-1===r){for(let e=0;e<g.length;e++){if(e>=v.length){v.push(n),r=e;break}if(null===v[e]){v[e]=n,r=e;break}}if(-1===r)break}const i=g[r];i&&i.dispatchEvent({type:"connected",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=g[e];return void 0===t&&(t=new ao,g[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=g[e];return void 0===t&&(t=new ao,g[e]=t),t.getGripSpace()},this.getHand=function(e){let t=g[e];return void 0===t&&(t=new ao,g[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o||s},this.setReferenceSpace=function(e){o=e},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=function(l){try{const p=this;r=l;const g=function(){if(null!==r){function l(){if(void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||d.antialias,alpha:d.alpha,depth:d.depth,stencil:d.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:h}),f=new _n(h.framebufferWidth,h.framebufferHeight,{format:ht,type:st,encoding:e.outputEncoding,stencilBuffer:d.stencil})}else{let n=null,s=null,a=null;d.depth&&(a=d.stencil?35056:33190,n=d.stencil?dt:pt,s=d.stencil?ut:ot);const o={colorFormat:32856,depthFormat:a,scaleFactor:i};c=new XRWebGLBinding(r,t),u=c.createProjectionLayer(o),r.updateRenderState({layers:[u]}),f=new _n(u.textureWidth,u.textureHeight,{format:ht,type:st,depthTexture:new oo(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:d.stencil,encoding:e.outputEncoding,samples:d.antialias?4:0});e.properties.get(f).__ignoreDepthValues=u.ignoreDepthValues}return f.isXRRenderTarget=!0,p.setFoveation(1),o=null,_.resolve(r.requestReferenceSpace(a)).then((function(e){s=e,P.setContext(r),P.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}))}m=e.getRenderTarget(),r.addEventListener("select",I),r.addEventListener("selectstart",I),r.addEventListener("selectend",I),r.addEventListener("squeeze",I),r.addEventListener("squeezestart",I),r.addEventListener("squeezeend",I),r.addEventListener("end",M),r.addEventListener("inputsourceschange",A);const g=function(){if(!0!==d.xrCompatible)return _.resolve(t.makeXRCompatible()).then((function(){}))}();return g&&g.then?g.then(l):l()}}();return _.resolve(g&&g.then?g.then((function(){})):void 0)}catch(e){return _.reject(e)}};const R=new xn,D=new xn;function C(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;w.near=b.near=y.near=e.near,w.far=b.far=y.far=e.far,E===w.near&&S===w.far||(r.updateRenderState({depthNear:w.near,depthFar:w.far}),E=w.near,S=w.far);const t=e.parent,n=w.cameras;C(w,t);for(let e=0;e<n.length;e++)C(n[e],t);w.matrixWorld.decompose(w.position,w.quaternion,w.scale),e.matrix.copy(w.matrix),e.matrix.decompose(e.position,e.quaternion,e.scale);const i=e.children;for(let e=0,t=i.length;e<t;e++)i[e].updateMatrixWorld(!0);2===n.length?function(e,t,n){R.setFromMatrixPosition(t.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const r=R.distanceTo(D),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(s[8]+1)/s[0],p=a*u,d=a*h,m=r/(-u+h),f=m*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=a+m,_=o+m,v=p-f,y=d+(r-f),b=l*o/_*g,x=c*o/_*g;e.projectionMatrix.makePerspective(v,y,b,x,g,_)}(w,y,b):w.projectionMatrix.copy(y.projectionMatrix)},this.getCamera=function(){return w},this.getFoveation=function(){return null!==u?u.fixedFoveation:null!==h?h.fixedFoveation:void 0},this.setFoveation=function(e){null!==u&&(u.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)};let O=null;const P=new Ni;P.setAnimationLoop((function(t,n){if(l=n.getViewerPose(o||s),p=n,null!==l){const t=l.views;null!==h&&(e.setRenderTargetFramebuffer(f,h.framebuffer),e.setRenderTarget(f));let n=!1;t.length!==w.cameras.length&&(w.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let s=null;if(null!==h)s=h.getViewport(i);else{const t=c.getViewSubImage(u,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(f,t.colorTexture,u.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(f))}let a=x[r];void 0===a&&(a=new Ti,a.layers.enable(r),a.viewport=new gn,x[r]=a),a.matrix.fromArray(i.transform.matrix),a.projectionMatrix.fromArray(i.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&w.matrix.copy(a.matrix),!0===n&&w.cameras.push(a)}}for(let e=0;e<g.length;e++){const t=v[e],r=g[e];null!==t&&void 0!==r&&r.update(t,n,o||s)}O&&O(t,n),p=null})),this.setAnimationLoop=function(e){O=e},this.dispose=function(){}}}function co(e,t){function n(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),K(r)&&(K(n).value=K(r)),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,1===r.side&&(n.bumpScale.value*=-1)),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),1===r.side&&n.normalScale.value.negate()),r.specularMap&&(n.specularMap.value=r.specularMap),r.alphaTest>0&&(n.alphaTest.value=r.alphaTest);const i=t.get(r).envMap;if(i&&(n.envMap.value=i,n.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,n.reflectivity.value=r.reflectivity,n.ior.value=r.ior,n.refractionRatio.value=r.refractionRatio),r.lightMap){n.lightMap.value=r.lightMap;const t=!0!==e.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=r.lightMapIntensity*t}let s,a;r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),K(r)?s=K(r):r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap?s=r.clearcoatRoughnessMap:r.iridescenceMap?s=r.iridescenceMap:r.iridescenceThicknessMap?s=r.iridescenceThicknessMap:r.specularIntensityMap?s=r.specularIntensityMap:r.specularColorMap?s=r.specularColorMap:r.transmissionMap?s=r.transmissionMap:r.thicknessMap?s=r.thicknessMap:r.sheenColorMap?s=r.sheenColorMap:r.sheenRoughnessMap&&(s=r.sheenRoughnessMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,i,s,a){r.isMeshBasicMaterial||r.isMeshLambertMaterial?n(e,r):r.isMeshToonMaterial?(n(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,r)):r.isMeshPhongMaterial?(n(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,r)):r.isMeshStandardMaterial?(n(e,r),function(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap);n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap);t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}(e,r),r.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap);t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,r,a)):r.isMeshMatcapMaterial?(n(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,r)):r.isMeshDepthMaterial?n(e,r):r.isMeshDistanceMaterial?(n(e,r),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?n(e,r):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,K(t)&&(K(e).value=K(t));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let i;K(t)?i=K(t):t.alphaMap&&(i=t.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,s):r.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,K(t)&&(K(e).value=K(t));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let n;K(t)?n=K(t):t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function uo(e,t,n,r){let i={},s={},a=[];const o=n.isWebGL2?e.getParameter(35375):0;function l(e,t,n){const r=e.value;if(void 0===n[t])return n[t]="number"==typeof r?r:r.clone(),!0;if("number"==typeof r){if(n[t]!==r)return n[t]=r,!0}else{const e=n[t];if(!1===e.equals(r))return e.copy(r),!0}return!1}function c(e){const t=e.value,n={boundary:0,storage:0};return"number"==typeof t?(n.boundary=4,n.storage=4):t.isVector2?(n.boundary=8,n.storage=8):t.isVector3||t.isColor?(n.boundary=16,n.storage=12):t.isVector4?(n.boundary=16,n.storage=16):t.isMatrix3?(n.boundary=48,n.storage=48):t.isMatrix4?(n.boundary=64,n.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),n}function u(t){const n=t.target;n.removeEventListener("dispose",u);const r=T(a).call(a,n.__bindingPointIndex);E(a).call(a,r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete s[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,h){let p=i[n.id];void 0===p&&(!function(e){const t=e.uniforms;let n=0;const r=16;let i=0;for(let e=0,s=t.length;e<s;e++){const s=t[e],a=c(s);if(s.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),s.__offset=n,e>0){i=n%r;const e=r-i;0!==i&&e-a.boundary<0&&(n+=r-i,s.__offset=n)}n+=a.storage}i=n%r,i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),p=function(t){const n=function(){for(let e=0;e<o;e++)if(-1===T(a).call(a,e))return a.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,s=t.usage;return e.bindBuffer(35345,r),e.bufferData(35345,i,s),e.bindBuffer(35345,null),e.bindBufferBase(35345,n,r),r}(n),i[n.id]=p,n.addEventListener("dispose",u));const d=h.program;r.updateUBOMapping(n,d);const m=t.render.frame;s[n.id]!==m&&(!function(t){const n=i[t.id],r=t.uniforms,s=t.__cache;e.bindBuffer(35345,n);for(let t=0,n=r.length;t<n;t++){const n=r[t];if(!0===l(n,t,s)){const t=n.value,r=n.__offset;"number"==typeof t?(n.__data[0]=t,e.bufferSubData(35345,r,n.__data)):(n.value.isMatrix3?(n.__data[0]=n.value.elements[0],n.__data[1]=n.value.elements[1],n.__data[2]=n.value.elements[2],n.__data[3]=n.value.elements[0],n.__data[4]=n.value.elements[3],n.__data[5]=n.value.elements[4],n.__data[6]=n.value.elements[5],n.__data[7]=n.value.elements[0],n.__data[8]=n.value.elements[6],n.__data[9]=n.value.elements[7],n.__data[10]=n.value.elements[8],n.__data[11]=n.value.elements[0]):t.toArray(n.__data),e.bufferSubData(35345,r,n.__data))}}e.bindBuffer(35345,null)}(n),s[n.id]=m)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);a=[],i={},s={}}}}function ho(e={}){this.isWebGLRenderer=!0;const t=void 0!==e.canvas?e.canvas:function(){const e=Zt("canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0===e.depth||e.depth,i=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,a=void 0===e.premultipliedAlpha||e.premultipliedAlpha,o=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let u;u=null!==n?n.getContextAttributes().alpha:void 0!==e.alpha&&e.alpha;let h=null,p=null;const d=[],m=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Et,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,X(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const f=this;let g=!1,_=0,v=0,y=null,x=-1,T=null;const w=new gn,E=new gn;let S=null,I=t.width,M=t.height,A=1,R=null,D=null;const C=new gn(0,0,I,M),O=new gn(0,0,I,M);let P=!1;const N=new Pi;let L=!1,k=!1,F=null;const U=new Zn,B=new Xt,j=new xn,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function z(){return null===y?A:1}let V,H,q,W,Y,$,Z,J,Q,ee,te,re,ie,se,ae,oe,le,ue,he,pe,de,me,ge,ve,ye=n;function be(e,n){for(let r=0;r<e.length;r++){const i=e[r],s=t.getContext(i,n);if(null!==s)return s}return null}try{const e={alpha:!0,depth:r,stencil:i,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:o,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r146"),t.addEventListener("webglcontextlost",we,!1),t.addEventListener("webglcontextrestored",Ee,!1),t.addEventListener("webglcontextcreationerror",Se,!1),null===ye){const t=["webgl2","webgl","experimental-webgl"];if(!0===f.isWebGL1Renderer&&t.shift(),ye=be(t,e),null===ye)throw be(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ye.getShaderPrecisionFormat&&(ye.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function xe(){V=new ls(ye),H=new Vi(ye,V,e),V.init(H),me=new no(ye,V,H),q=new eo(ye,V,H),W=new hs,Y=new ja,$=new to(ye,V,q,Y,H,me,W),Z=new qi(f),J=new os(f),Q=new Li(ye,H),ge=new Gi(ye,V,Q,H),ee=new cs(ye,Q,W,ge),te=new fs(ye,ee,Q,W),he=new ms(ye,H,$),oe=new Hi(Y),re=new Ba(f,Z,J,V,H,ge,oe),ie=new co(f,Y),se=new Ha,ae=new Ka(V,H),ue=new ji(f,Z,J,q,te,u,a),le=new Qa(f,te,H),ve=new uo(ye,W,H,q),pe=new zi(ye,V,W,H),de=new us(ye,V,W,H),W.programs=re.programs,f.capabilities=H,f.extensions=V,f.properties=Y,f.renderLists=se,f.shadowMap=le,f.state=q,f.info=W}xe();const Te=new lo(f,ye);function we(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function Ee(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;const e=W.autoReset,t=le.enabled,n=le.autoUpdate,r=le.needsUpdate,i=le.type;xe(),W.autoReset=e,le.enabled=t,le.autoUpdate=n,le.needsUpdate=r,le.type=i}function Se(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Ie(e){const t=e.target;t.removeEventListener("dispose",Ie),function(e){(function(e){const t=Y.get(e).programs;void 0!==t&&(fe(t).call(t,(function(e){re.releaseProgram(e)})),e.isShaderMaterial&&re.releaseShaderCache(e))})(e),Y.remove(e)}(t)}this.xr=Te,this.getContext=function(){return ye},this.getContextAttributes=function(){return ye.getContextAttributes()},this.forceContextLoss=function(){const e=V.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=V.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return A},this.setPixelRatio=function(e){void 0!==e&&(A=e,this.setSize(I,M,!1))},this.getSize=function(e){return e.set(I,M)},this.setSize=function(e,n,r){Te.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(I=e,M=n,t.width=Math.floor(e*A),t.height=Math.floor(n*A),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(I*A,M*A).floor()},this.setDrawingBufferSize=function(e,n,r){I=e,M=n,A=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(w)},this.getViewport=function(e){return e.copy(C)},this.setViewport=function(e,t,n,r){e.isVector4?C.set(e.x,e.y,e.z,e.w):C.set(e,t,n,r),q.viewport(w.copy(C).multiplyScalar(A).floor())},this.getScissor=function(e){return e.copy(O)},this.setScissor=function(e,t,n,r){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,r),q.scissor(E.copy(O).multiplyScalar(A).floor())},this.getScissorTest=function(){return P},this.setScissorTest=function(e){q.setScissorTest(P=e)},this.setOpaqueSort=function(e){R=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(ue.getClearColor())},this.setClearColor=function(){ue.setClearColor.apply(ue,arguments)},this.getClearAlpha=function(){return ue.getClearAlpha()},this.setClearAlpha=function(){ue.setClearAlpha.apply(ue,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;e&&(r|=16384),t&&(r|=256),n&&(r|=1024),ye.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",we,!1),t.removeEventListener("webglcontextrestored",Ee,!1),t.removeEventListener("webglcontextcreationerror",Se,!1),se.dispose(),ae.dispose(),Y.dispose(),Z.dispose(),J.dispose(),te.dispose(),ge.dispose(),ve.dispose(),re.dispose(),Te.dispose(),Te.removeEventListener("sessionstart",Ae),Te.removeEventListener("sessionend",Re),F&&(F.dispose(),F=null),De.stop()},this.renderBufferDirect=function(e,t,n,r,i,s){null===t&&(t=G);const a=i.isMesh&&i.matrixWorld.determinant()<0,o=function(e,t,n,r,i){!0!==t.isScene&&(t=G);$.resetTextureUnits();const s=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=null===y?f.outputEncoding:!0===y.isXRRenderTarget?y.texture.encoding:Et,l=(r.isMeshStandardMaterial?J:Z).get(r.envMap||a),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!r.normalMap&&!!n.attributes.tangent,h=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,g=r.toneMapped?f.toneMapping:0,_=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==_?_.length:0,b=Y.get(r),w=p.state.lights;if(!0===L&&(!0===k||e!==T)){const t=e===T&&r.id===x;oe.setState(r,e,t)}let E=!1;r.version===b.__version?b.needsLights&&b.lightsStateVersion!==w.state.version||b.outputEncoding!==o||i.isInstancedMesh&&!1===b.instancing?E=!0:i.isInstancedMesh||!0!==b.instancing?i.isSkinnedMesh&&!1===b.skinning?E=!0:i.isSkinnedMesh||!0!==b.skinning?b.envMap!==l||!0===r.fog&&b.fog!==s?E=!0:void 0===b.numClippingPlanes||b.numClippingPlanes===oe.numPlanes&&b.numIntersection===oe.numIntersection?(b.vertexAlphas!==c||b.vertexTangents!==u||b.morphTargets!==h||b.morphNormals!==d||b.morphColors!==m||b.toneMapping!==g||!0===H.isWebGL2&&b.morphTargetsCount!==v)&&(E=!0):E=!0:E=!0:E=!0:(E=!0,b.__version=r.version);let S=b.currentProgram;!0===E&&(S=Le(r,t,i));let I=!1,R=!1,D=!1;const C=S.getUniforms(),O=b.uniforms;q.useProgram(S.program)&&(I=!0,R=!0,D=!0);r.id!==x&&(x=r.id,R=!0);if(I||T!==e){if(C.setValue(ye,"projectionMatrix",e.projectionMatrix),H.logarithmicDepthBuffer&&C.setValue(ye,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),T!==e&&(T=e,R=!0,D=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const t=K(C).cameraPosition;void 0!==t&&t.setValue(ye,j.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&C.setValue(ye,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&C.setValue(ye,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){C.setOptional(ye,i,"bindMatrix"),C.setOptional(ye,i,"bindMatrixInverse");const e=i.skeleton;e&&(H.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),C.setValue(ye,"boneTexture",e.boneTexture,$),C.setValue(ye,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const P=n.morphAttributes;(void 0!==P.position||void 0!==P.normal||void 0!==P.color&&!0===H.isWebGL2)&&he.update(i,n,r,S);(R||b.receiveShadow!==i.receiveShadow)&&(b.receiveShadow=i.receiveShadow,C.setValue(ye,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(O.envMap.value=l,O.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);R&&(C.setValue(ye,"toneMappingExposure",f.toneMappingExposure),b.needsLights&&(U=D,(N=O).ambientLightColor.needsUpdate=U,N.lightProbe.needsUpdate=U,N.directionalLights.needsUpdate=U,N.directionalLightShadows.needsUpdate=U,N.pointLights.needsUpdate=U,N.pointLightShadows.needsUpdate=U,N.spotLights.needsUpdate=U,N.spotLightShadows.needsUpdate=U,N.rectAreaLights.needsUpdate=U,N.hemisphereLights.needsUpdate=U),s&&!0===r.fog&&ie.refreshFogUniforms(O,s),ie.refreshMaterialUniforms(O,r,A,M,F),ya.upload(ye,b.uniformsList,O,$));var N,U;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(ya.upload(ye,b.uniformsList,O,$),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&C.setValue(ye,"center",i.center);if(C.setValue(ye,"modelViewMatrix",i.modelViewMatrix),C.setValue(ye,"normalMatrix",i.normalMatrix),C.setValue(ye,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++)if(H.isWebGL2){const n=e[t];ve.update(n,S),_e(ve).call(ve,n,S)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return S}(e,t,n,r,i);q.setMaterial(r,a);let l=n.index;const c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let u,h=1;!0===r.wireframe&&(l=ee.getWireframeAttribute(n),h=2),ge.setup(i,r,o,n,l);let d=pe;null!==l&&(u=Q.get(l),d=de,d.setIndex(u));const m=null!==l?l.count:c.count,g=n.drawRange.start*h,_=n.drawRange.count*h,v=null!==s?s.start*h:0,b=null!==s?s.count*h:1/0,w=Math.max(g,v),E=Math.min(m,g+_,v+b)-1,S=Math.max(0,E-w+1);if(0!==S){if(i.isMesh)!0===r.wireframe?(q.setLineWidth(r.wireframeLinewidth*z()),d.setMode(1)):d.setMode(4);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),q.setLineWidth(e*z()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(w,S,i.count);else if(n.isInstancedBufferGeometry){const e=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(w,S,e)}else d.render(w,S)}},this.compile=function(e,t){function n(e,t,n){!0===e.transparent&&2===e.side?(e.side=1,e.needsUpdate=!0,Le(e,t,n),e.side=0,e.needsUpdate=!0,Le(e,t,n),e.side=2):Le(e,t,n)}p=ae.get(e),p.init(),m.push(p),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(p.pushLight(e),e.castShadow&&p.pushShadow(e))})),p.setupLights(f.physicallyCorrectLights),e.traverse((function(t){const r=t.material;if(r)if(b(r))for(let i=0;i<r.length;i++){n(r[i],e,t)}else n(r,e,t)})),m.pop(),p=null};let Me=null;function Ae(){De.stop()}function Re(){De.start()}const De=new Ni;function Ce(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)p.pushLight(e),e.castShadow&&p.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||N.intersectsSprite(e)){r&&j.setFromMatrixPosition(e.matrixWorld).applyMatrix4(U);const t=te.update(e),i=e.material;i.visible&&h.push(e,t,i,n,j.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==W.render.frame&&(e.skeleton.update(),e.skeleton.frame=W.render.frame),!e.frustumCulled||N.intersectsObject(e))){r&&j.setFromMatrixPosition(e.matrixWorld).applyMatrix4(U);const t=te.update(e),i=e.material;if(b(i)){const r=t.groups;for(let s=0,a=r.length;s<a;s++){const a=r[s],o=i[a.materialIndex];o&&o.visible&&h.push(e,t,o,n,j.z,a)}}else i.visible&&h.push(e,t,i,n,j.z,null)}const i=e.children;for(let e=0,s=i.length;e<s;e++)Ce(i[e],t,n,r)}function Oe(e,t,n,r){const i=e.opaque,a=e.transmissive,o=e.transparent;p.setupLightsView(n),a.length>0&&function(e,t,n){const r=H.isWebGL2;null===F&&(F=new _n(1,1,{generateMipmaps:!0,type:V.has("EXT_color_buffer_half_float")?ct:st,minFilter:it,samples:r&&!0===s?4:0}));f.getDrawingBufferSize(B),r?F.setSize(B.x,B.y):F.setSize(Ht(B.x),Ht(B.y));const i=f.getRenderTarget();f.setRenderTarget(F),f.clear();const a=f.toneMapping;f.toneMapping=0,Pe(e,t,n),f.toneMapping=a,$.updateMultisampleRenderTarget(F),$.updateRenderTargetMipmap(F),f.setRenderTarget(i)}(i,t,n),r&&q.viewport(w.copy(r)),i.length>0&&Pe(i,t,n),a.length>0&&Pe(a,t,n),o.length>0&&Pe(o,t,n),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function Pe(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.object,o=s.geometry,l=null===r?s.material:r,c=s.group;a.layers.test(n.layers)&&Ne(a,t,n,o,l,c)}}function Ne(e,t,n,r,i,s){e.onBeforeRender(f,t,n,r,i,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(f,t,n,r,e,s),!0===i.transparent&&2===i.side?(i.side=1,i.needsUpdate=!0,f.renderBufferDirect(n,t,r,i,e,s),i.side=0,i.needsUpdate=!0,f.renderBufferDirect(n,t,r,i,e,s),i.side=2):f.renderBufferDirect(n,t,r,i,e,s),e.onAfterRender(f,t,n,r,i,s)}function Le(e,t,n){!0!==t.isScene&&(t=G);const r=Y.get(e),i=p.state.lights,s=p.state.shadowsArray,a=i.state.version,o=re.getParameters(e,i.state,s,t,n),l=re.getProgramCacheKey(o);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?J:Z).get(e.envMap||r.environment),void 0===c&&(e.addEventListener("dispose",Ie),c=new ce,r.programs=c);let u=c.get(l);if(void 0!==u){if(r.currentProgram===u&&r.lightsStateVersion===a)return ke(e,o),u}else o.uniforms=re.getUniforms(e),e.onBuild(n,o,f),e.onBeforeCompile(o,f),u=re.acquireProgram(o,l),c.set(l,u),r.uniforms=o.uniforms;const h=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=oe.uniform),ke(e,o),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotLightMatrix.value=i.state.spotLightMatrix,h.spotLightMap.value=i.state.spotLightMap,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);const d=u.getUniforms(),m=ya.seqWithValue(d.seq,h);return r.currentProgram=u,r.uniformsList=m,u}function ke(e,t){const n=Y.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}De.setAnimationLoop((function(e){Me&&Me(e)})),"undefined"!=typeof self&&De.setContext(self),this.setAnimationLoop=function(e){Me=e,Te.setAnimationLoop(e),null===e?De.stop():De.start()},Te.addEventListener("sessionstart",Ae),Te.addEventListener("sessionend",Re),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===g)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===Te.enabled&&!0===Te.isPresenting&&(!0===Te.cameraAutoUpdate&&Te.updateCamera(t),t=Te.getCamera()),!0===e.isScene&&e.onBeforeRender(f,e,t,y),p=ae.get(e,m.length),p.init(),m.push(p),U.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),N.setFromProjectionMatrix(U),k=this.localClippingEnabled,L=oe.init(this.clippingPlanes,k,t),h=se.get(e,d.length),h.init(),d.push(h),Ce(e,t,0,f.sortObjects),h.finish(),!0===f.sortObjects&&ne(h).call(h,R,D),!0===L&&oe.beginShadows();const n=p.state.shadowsArray;if(le.render(n,e,t),!0===L&&oe.endShadows(),!0===this.info.autoReset&&this.info.reset(),ue.render(h,e),p.setupLights(f.physicallyCorrectLights),t.isArrayCamera){const n=t.cameras;for(let t=0,r=n.length;t<r;t++){const r=n[t];Oe(h,e,r,r.viewport)}}else Oe(h,e,t);null!==y&&($.updateMultisampleRenderTarget(y),$.updateRenderTargetMipmap(y)),!0===e.isScene&&e.onAfterRender(f,e,t),ge.resetDefaultState(),x=-1,T=null,m.pop(),p=m.length>0?m[m.length-1]:null,d.pop(),h=d.length>0?d[d.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return y},this.setRenderTargetTextures=function(e,t,n){Y.get(e.texture).__webglTexture=t,Y.get(e.depthTexture).__webglTexture=n;const r=Y.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===V.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=Y.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){y=e,_=t,v=n;let r=!0,i=null,s=!1,a=!1;if(e){const n=Y.get(e);void 0!==n.__useDefaultFramebuffer?(q.bindFramebuffer(36160,null),r=!1):void 0===n.__webglFramebuffer?$.setupRenderTarget(e):n.__hasExternalTextures&&$.rebindTextures(e,Y.get(e.texture).__webglTexture,Y.get(e.depthTexture).__webglTexture);const o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=Y.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=l[t],s=!0):i=H.isWebGL2&&e.samples>0&&!1===$.useMultisampledRTT(e)?Y.get(e).__webglMultisampledFramebuffer:l,w.copy(e.viewport),E.copy(e.scissor),S=e.scissorTest}else w.copy(C).multiplyScalar(A).floor(),E.copy(O).multiplyScalar(A).floor(),S=P;if(q.bindFramebuffer(36160,i)&&H.drawBuffers&&r&&q.drawBuffers(e,i),q.viewport(w),q.scissor(E),q.setScissorTest(S),s){const r=Y.get(e.texture);ye.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}else if(a){const r=Y.get(e.texture),i=t||0;ye.framebufferTextureLayer(36160,36064,r.__webglTexture,n||0,i)}x=-1},this.readRenderTargetPixels=function(e,t,n,r,i,s,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=Y.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){q.bindFramebuffer(36160,o);try{const a=e.texture,o=a.format,l=a.type;if(o!==ht&&me.convert(o)!==ye.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===ct&&(V.has("EXT_color_buffer_half_float")||H.isWebGL2&&V.has("EXT_color_buffer_float"));if(!(l===st||me.convert(l)===ye.getParameter(35738)||l===lt&&(H.isWebGL2||V.has("OES_texture_float")||V.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ye.readPixels(t,n,r,i,me.convert(o),me.convert(l),s)}finally{const e=null!==y?Y.get(y).__webglFramebuffer:null;q.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),s=Math.floor(t.image.height*r);$.setTexture2D(t,0),ye.copyTexSubImage2D(3553,n,0,0,e.x,e.y,i,s),q.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,s=t.image.height,a=me.convert(n.format),o=me.convert(n.type);$.setTexture2D(n,0),ye.pixelStorei(37440,n.flipY),ye.pixelStorei(37441,n.premultiplyAlpha),ye.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ye.texSubImage2D(3553,r,e.x,e.y,i,s,a,o,t.image.data):t.isCompressedTexture?ye.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):ye.texSubImage2D(3553,r,e.x,e.y,a,o,t.image),0===r&&n.generateMipmaps&&ye.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(f.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=e.max.x-e.min.x+1,a=e.max.y-e.min.y+1,o=e.max.z-e.min.z+1,l=me.convert(r.format),c=me.convert(r.type);let u;if(r.isData3DTexture)$.setTexture3D(r,0),u=32879;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");$.setTexture2DArray(r,0),u=35866}ye.pixelStorei(37440,r.flipY),ye.pixelStorei(37441,r.premultiplyAlpha),ye.pixelStorei(3317,r.unpackAlignment);const h=ye.getParameter(3314),p=ye.getParameter(32878),d=ye.getParameter(3316),m=ye.getParameter(3315),g=ye.getParameter(32877),_=n.isCompressedTexture?n.mipmaps[0]:n.image;ye.pixelStorei(3314,_.width),ye.pixelStorei(32878,_.height),ye.pixelStorei(3316,e.min.x),ye.pixelStorei(3315,e.min.y),ye.pixelStorei(32877,e.min.z),n.isDataTexture||n.isData3DTexture?ye.texSubImage3D(u,i,t.x,t.y,t.z,s,a,o,l,c,_.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ye.compressedTexSubImage3D(u,i,t.x,t.y,t.z,s,a,o,l,_.data)):ye.texSubImage3D(u,i,t.x,t.y,t.z,s,a,o,l,c,_),ye.pixelStorei(3314,h),ye.pixelStorei(32878,p),ye.pixelStorei(3316,d),ye.pixelStorei(3315,m),ye.pixelStorei(32877,g),0===i&&r.generateMipmaps&&ye.generateMipmap(u),q.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?$.setTextureCube(e,0):e.isData3DTexture?$.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?$.setTexture2DArray(e,0):$.setTexture2D(e,0),q.unbindTexture()},this.resetState=function(){_=0,v=0,y=null,q.reset(),ge.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends ho{}).prototype.isWebGL1Renderer=!0;class po{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new cn(e),this.near=t,this.far=n}clone(){return new po(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class mo extends Tr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.backgroundBlurriness=this.backgroundBlurriness),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class fo{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Dt,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ut()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){var t;(void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ut()),void 0===e.arrayBuffers[this.array.buffer._uuid])&&(e.arrayBuffers[this.array.buffer._uuid]=I(t=this.array).call(t,0).buffer);const n=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(n,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ut()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=k(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const go=new xn;class _o{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)go.fromBufferAttribute(this,t),go.applyMatrix4(e),this.setXYZ(t,go.x,go.y,go.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)go.fromBufferAttribute(this,t),go.applyNormalMatrix(e),this.setXYZ(t,go.x,go.y,go.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)go.fromBufferAttribute(this,t),go.transformDirection(e),this.setXYZ(t,go.x,go.y,go.z);return this}setX(e,t){return this.normalized&&(t=Wt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Wt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Wt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Wt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=qt(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=qt(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=qt(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=qt(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Wt(t,this.array),n=Wt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Wt(t,this.array),n=Wt(n,this.array),r=Wt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Wt(t,this.array),n=Wt(n,this.array),r=Wt(r,this.array),i=Wt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Br(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new _o(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class vo extends Lr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new cn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=K(e),this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const yo=new xn,bo=new gn,xo=new gn,To=new xn,wo=new Zn;class Eo extends mi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Zn,this.bindMatrixInverse=new Zn}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new gn,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,r=this.geometry;bo.fromBufferAttribute(r.attributes.skinIndex,e),xo.fromBufferAttribute(r.attributes.skinWeight,e),yo.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const r=xo.getComponent(e);if(0!==r){const i=bo.getComponent(e);wo.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(To.copy(yo).applyMatrix4(wo),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}class So extends Tr{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Io extends fn{constructor(e=null,t=1,n=1,r,i,s,a,o,l=1003,c=1003,u,h){super(null,s,a,o,l,c,r,i,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Mo=new Zn,Ao=new Zn;class Ro{constructor(e=[],t=[]){this.uuid=Ut(),this.bones=I(e).call(e,0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Zn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Zn;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){const i=e[r]?e[r].matrixWorld:Ao;Mo.multiplyMatrices(i,t[r]),Mo.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new Ro(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Vt(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Io(t,e,e,ht,lt);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new So),this.bones.push(i),this.boneInverses.push((new Zn).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const s=n[r];e.boneInverses.push(s.toArray())}return e}}class Do extends Br{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Co=new Zn,Oo=new Zn,Po=[],No=new Zn,Lo=new mi;class ko extends mi{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Do(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1;for(let e=0;e<n;e++)this.setMatrixAt(e,No)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(Lo.geometry=this.geometry,Lo.material=this.material,void 0!==Lo.material)for(let i=0;i<r;i++){this.getMatrixAt(i,Co),Oo.multiplyMatrices(n,Co),Lo.matrixWorld=Oo,Lo.raycast(e,Po);for(let e=0,n=Po.length;e<n;e++){const n=Po[e];n.instanceId=i,n.object=this,t.push(n)}Po.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new Do(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class Fo extends Lr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new cn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Uo=new xn,Bo=new xn,jo=new Zn,Go=new Kn,zo=new zn;class Vo extends Tr{constructor(e=new Kr,t=new Fo){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)Uo.fromBufferAttribute(t,e-1),Bo.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Uo.distanceTo(Bo);e.setAttribute("lineDistance",new zr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),zo.copy(n.boundingSphere),zo.applyMatrix4(r),zo.radius+=i,!1===e.ray.intersectsSphere(zo))return;jo.copy(r).invert(),Go.copy(e.ray).applyMatrix4(jo);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=new xn,c=new xn,u=new xn,h=new xn,p=this.isLineSegments?2:1,d=n.index,m=n.attributes.position;if(null!==d){for(let n=Math.max(0,s.start),r=Math.min(d.count,s.start+s.count)-1;n<r;n+=p){const r=d.getX(n),i=d.getX(n+1);l.fromBufferAttribute(m,r),c.fromBufferAttribute(m,i);if(Go.distanceSqToSegment(l,c,h,u)>o)continue;h.applyMatrix4(this.matrixWorld);const s=e.ray.origin.distanceTo(h);s<e.near||s>e.far||t.push({distance:s,point:u.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),r=Math.min(m.count,s.start+s.count)-1;n<r;n+=p){l.fromBufferAttribute(m,n),c.fromBufferAttribute(m,n+1);if(Go.distanceSqToSegment(l,c,h,u)>o)continue;h.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(h);r<e.near||r>e.far||t.push({distance:r,point:u.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=J(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const Ho=new xn,qo=new xn;class Wo extends Vo{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)Ho.fromBufferAttribute(t,e),qo.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Ho.distanceTo(qo);e.setAttribute("lineDistance",new zr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Yo extends Vo{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Xo extends Lr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new cn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=K(e),this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const $o=new Zn,Ko=new Kn,Zo=new zn,Jo=new xn;class Qo extends Tr{constructor(e=new Kr,t=new Xo){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zo.copy(n.boundingSphere),Zo.applyMatrix4(r),Zo.radius+=i,!1===e.ray.intersectsSphere(Zo))return;$o.copy(r).invert(),Ko.copy(e.ray).applyMatrix4($o);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);n<i;n++){const i=l.getX(n);Jo.fromBufferAttribute(c,i),el(Jo,i,o,r,e,t,this)}}else{for(let n=Math.max(0,s.start),i=Math.min(c.count,s.start+s.count);n<i;n++)Jo.fromBufferAttribute(c,n),el(Jo,n,o,r,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=J(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function el(e,t,n,r,i,s,a){const o=Ko.distanceSqToPoint(e);if(o<n){const n=new xn;Ko.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,object:a})}}class tl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let s;s=t||e*n[i-1];let a,o=0,l=i-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),a=n[r]-s,a<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(i-1);const c=n[r];return(r+(s-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const s=this.getPoint(r),a=this.getPoint(i),o=t||(s.isVector2?new Xt:new xn);return o.copy(a).sub(s).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new xn,r=[],i=[],s=[],a=new xn,o=new Zn;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new xn)}i[0]=new xn,s[0]=new xn;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),h=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),s[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),a.crossVectors(r[t-1],r[t]),a.length()>W){a.normalize();const e=Math.acos(Bt(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(o.makeRotationAxis(a,e))}s[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(Bt(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.makeRotationAxis(r[n],t*n)),s[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class nl extends tl{constructor(e=0,t=0,n=1,r=1,i=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t){const n=t||new Xt,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<W;for(;i<0;)i+=r;for(;i>r;)i-=r;i<W&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);const a=this.aStartAngle+e*i;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=l-this.aY;o=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class rl extends nl{constructor(e,t,n,r,i,s){super(e,t,n,n,r,i,s),this.isArcCurve=!0,this.type="ArcCurve"}}function il(){let e=0,t=0,n=0,r=0;function i(i,s,a,o){e=i,t=a,n=-3*i+3*s-2*a-o,r=2*i-2*s+a+o}return{initCatmullRom:function(e,t,n,r,s){i(t,n,s*(n-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,s,a,o){let l=(t-e)/s-(n-e)/(s+a)+(n-t)/a,c=(n-t)/a-(r-t)/(a+o)+(r-n)/o;l*=a,c*=a,i(t,n,l,c)},calc:function(i){const s=i*i;return e+t*i+n*s+r*(s*i)}}}const sl=new xn,al=new il,ol=new il,ll=new il;function cl(e,t,n,r,i){const s=.5*(r-t),a=.5*(i-n),o=e*e;return(2*n-2*r+s+a)*(e*o)+(-3*n+3*r-2*s-a)*o+s*e+n}function ul(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function hl(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class pl extends tl{constructor(e=new Xt,t=new Xt,n=new Xt,r=new Xt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Xt){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(hl(e,r.x,i.x,s.x,a.x),hl(e,r.y,i.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class dl extends tl{constructor(e=new Xt,t=new Xt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Xt){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Xt;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ml extends tl{constructor(e=new Xt,t=new Xt,n=new Xt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Xt){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(ul(e,r.x,i.x,s.x),ul(e,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class fl extends tl{constructor(e=new xn,t=new xn,n=new xn){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new xn){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(ul(e,r.x,i.x,s.x),ul(e,r.y,i.y,s.y),ul(e,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class gl extends tl{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Xt){const n=t,r=this.points,i=(r.length-1)*e,s=Math.floor(i),a=i-s,o=r[0===s?s:s-1],l=r[s],c=r[s>r.length-2?r.length-1:s+1],u=r[s>r.length-3?r.length-1:s+2];return n.set(cl(a,o.x,l.x,c.x,u.x),cl(a,o.y,l.y,c.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Xt).fromArray(n))}return this}}var _l=R({__proto__:null,ArcCurve:rl,CatmullRomCurve3:class extends tl{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new xn){const n=t,r=this.points,i=r.length,s=(i-(this.closed?0:1))*e;let a,o,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?a=r[(l-1)%i]:(sl.subVectors(r[0],r[1]).add(r[0]),a=sl);const u=r[l%i],h=r[(l+1)%i];if(this.closed||l+2<i?o=r[(l+2)%i]:(sl.subVectors(r[i-1],r[i-2]).add(r[i-1]),o=sl),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(u),e),n=Math.pow(u.distanceToSquared(h),e),r=Math.pow(h.distanceToSquared(o),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),al.initNonuniformCatmullRom(a.x,u.x,h.x,o.x,t,n,r),ol.initNonuniformCatmullRom(a.y,u.y,h.y,o.y,t,n,r),ll.initNonuniformCatmullRom(a.z,u.z,h.z,o.z,t,n,r)}else"catmullrom"===this.curveType&&(al.initCatmullRom(a.x,u.x,h.x,o.x,this.tension),ol.initCatmullRom(a.y,u.y,h.y,o.y,this.tension),ll.initCatmullRom(a.z,u.z,h.z,o.z,this.tension));return n.set(al.calc(c),ol.calc(c),ll.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new xn).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},CubicBezierCurve:pl,CubicBezierCurve3:class extends tl{constructor(e=new xn,t=new xn,n=new xn,r=new xn){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new xn){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(hl(e,r.x,i.x,s.x,a.x),hl(e,r.y,i.y,s.y,a.y),hl(e,r.z,i.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},EllipseCurve:nl,LineCurve:dl,LineCurve3:class extends tl{constructor(e=new xn,t=new xn){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new xn){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},QuadraticBezierCurve:ml,QuadraticBezierCurve3:fl,SplineCurve:gl});class vl extends tl{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new dl(t,e))}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,s=this.curves[i],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const s=i[r],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,o=s.getPoints(a);for(let e=0;e<o.length;e++){const r=o[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new _l[n.type]).fromJSON(n))}return this}}class yl extends vl{constructor(e){super(),this.type="Path",this.currentPoint=new Xt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new dl(this.currentPoint.clone(),new Xt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new ml(this.currentPoint.clone(),new Xt(e,t),new Xt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,s){const a=new pl(this.currentPoint.clone(),new Xt(e,t),new Xt(n,r),new Xt(i,s));return this.curves.push(a),this.currentPoint.set(i,s),this}splineThru(e){var t;const n=ye(t=[this.currentPoint.clone()]).call(t,e),r=new gl(n);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,n,r,i,s),this}absarc(e,t,n,r,i,s){return this.absellipse(e,t,n,n,r,i,s),this}ellipse(e,t,n,r,i,s,a,o){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,s,a,o),this}absellipse(e,t,n,r,i,s,a,o){const l=new nl(e,t,n,r,i,s,a,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class bl extends Kr{constructor(e=1,t=1,n=1,r=8,i=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:a,thetaLength:o};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],u=[],h=[],p=[];let d=0;const m=[],f=n/2;let g=0;function _(n){const i=d,s=new Xt,m=new xn;let _=0;const v=!0===n?e:t,y=!0===n?1:-1;for(let e=1;e<=r;e++)u.push(0,f*y,0),h.push(0,y,0),p.push(.5,.5),d++;const b=d;for(let e=0;e<=r;e++){const t=e/r*o+a,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=f*y,m.z=v*n,u.push(m.x,m.y,m.z),h.push(0,y,0),s.x=.5*n+.5,s.y=.5*i*y+.5,p.push(s.x,s.y),d++}for(let e=0;e<r;e++){const t=i+e,r=b+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),_+=3}l.addGroup(g,_,!0===n?1:2),g+=_}!function(){const s=new xn,_=new xn;let v=0;const y=(t-e)/n;for(let l=0;l<=i;l++){const c=[],g=l/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*o+a,l=Math.sin(i),m=Math.cos(i);_.x=v*l,_.y=-g*n+f,_.z=v*m,u.push(_.x,_.y,_.z),s.set(l,y,m).normalize(),h.push(s.x,s.y,s.z),p.push(t,1-g),c.push(d++)}m.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=m[t][e],r=m[t+1][e],i=m[t+1][e+1],s=m[t][e+1];c.push(n,r,s),c.push(r,i,s),v+=6}l.addGroup(g,v,0),g+=v}(),!1===s&&(e>0&&_(!0),t>0&&_(!1)),this.setIndex(c),this.setAttribute("position",new zr(u,3)),this.setAttribute("normal",new zr(h,3)),this.setAttribute("uv",new zr(p,2))}static fromJSON(e){return new bl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}const xl=new xn,Tl=new xn,wl=new xn,El=new Pr;class Sl extends Kr{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,r=Math.pow(10,n),i=Math.cos(kt*t),s=e.getIndex(),a=e.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},p=[];for(let e=0;e<o;e+=3){s?(l[0]=s.getX(e),l[1]=s.getX(e+1),l[2]=s.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:o}=El;if(t.fromBufferAttribute(a,l[0]),n.fromBufferAttribute(a,l[1]),o.fromBufferAttribute(a,l[2]),El.getNormal(wl),u[0]=`${Math.round(t.x*r)},${Math.round(t.y*r)},${Math.round(t.z*r)}`,u[1]=`${Math.round(n.x*r)},${Math.round(n.y*r)},${Math.round(n.z*r)}`,u[2]=`${Math.round(o.x*r)},${Math.round(o.y*r)},${Math.round(o.z*r)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],r=u[t],s=El[c[e]],a=El[c[t]],o=`${n}_${r}`,d=`${r}_${n}`;d in h&&h[d]?(wl.dot(h[d].normal)<=i&&(p.push(s.x,s.y,s.z),p.push(a.x,a.y,a.z)),h[d]=null):o in h||(h[o]={index0:l[e],index1:l[t],normal:wl.clone()})}}for(const e in h)if(h[e]){const{index0:t,index1:n}=h[e];xl.fromBufferAttribute(a,t),Tl.fromBufferAttribute(a,n),p.push(xl.x,xl.y,xl.z),p.push(Tl.x,Tl.y,Tl.z)}this.setAttribute("position",new zr(p,3))}}}class Il extends yl{constructor(e){super(e),this.uuid=Ut(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new yl).fromJSON(n))}return this}}const Ml=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Al(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,u,h,p,d;if(r&&(s=function(e,t,n,r){const i=[];let s,a,o,l,c;for(s=0,a=t.length;s<a;s++)o=t[s]*r,l=s<a-1?t[s+1]*r:e.length,c=Al(e,o,l,r,!1),c===c.next&&(c.steiner=!0),i.push(Bl(c));for(ne(i).call(i,Ll),s=0;s<i.length;s++)n=kl(i[s],n);return n}(e,t,s,n)),e.length>80*n){o=c=e[0],l=u=e[1];for(let t=n;t<i;t+=n)h=e[t],p=e[t+1],h<o&&(o=h),p<l&&(l=p),h>c&&(c=h),p>u&&(u=p);d=Math.max(c-o,u-l),d=0!==d?32767/d:0}return Dl(s,a,n,o,l,d,0),a};function Al(e,t,n,r,i){let s,a;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(s=t;s<n;s+=r)a=$l(s,e[s],e[s+1],a);else for(s=n-r;s>=t;s-=r)a=$l(s,e[s],e[s+1],a);return a&&Vl(a,a.next)&&(Kl(a),a=a.next),a}function Rl(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Vl(r,r.next)&&0!==zl(r.prev,r,r.next))r=r.next;else{if(Kl(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Dl(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=Ul(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,s,a,o,l,c=1;do{for(n=e,e=null,s=null,a=0;n;){for(a++,r=n,o=0,t=0;t<c&&(o++,r=r.nextZ,r);t++);for(l=c;o>0||l>0&&r;)0!==o&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;n=r}s.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,s);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?Ol(e,r,i,s):Cl(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Kl(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Dl(e=Pl(Rl(e),t,n),t,n,r,i,s,2):2===a&&Nl(e,t,n,r,i,s):Dl(Rl(e),t,n,r,i,s,1);break}}function Cl(e){const t=e.prev,n=e,r=e.next;if(zl(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,c=r.y,u=i<s?i<a?i:a:s<a?s:a,h=o<l?o<c?o:c:l<c?l:c,p=i>s?i>a?i:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&jl(i,o,s,l,a,c,m.x,m.y)&&zl(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Ol(e,t,n,r){const i=e.prev,s=e,a=e.next;if(zl(i,s,a)>=0)return!1;const o=i.x,l=s.x,c=a.x,u=i.y,h=s.y,p=a.y,d=o<l?o<c?o:c:l<c?l:c,m=u<h?u<p?u:p:h<p?h:p,f=o>l?o>c?o:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,_=Ul(d,m,t,n,r),v=Ul(f,g,t,n,r);let y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=m&&y.y<=g&&y!==i&&y!==a&&jl(o,u,l,h,c,p,y.x,y.y)&&zl(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,b.x>=d&&b.x<=f&&b.y>=m&&b.y<=g&&b!==i&&b!==a&&jl(o,u,l,h,c,p,b.x,b.y)&&zl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=d&&y.x<=f&&y.y>=m&&y.y<=g&&y!==i&&y!==a&&jl(o,u,l,h,c,p,y.x,y.y)&&zl(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=g&&b!==i&&b!==a&&jl(o,u,l,h,c,p,b.x,b.y)&&zl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Pl(e,t,n){let r=e;do{const i=r.prev,s=r.next.next;!Vl(i,s)&&Hl(i,r,r.next,s)&&Yl(i,s)&&Yl(s,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),Kl(r),Kl(r.next),r=e=s),r=r.next}while(r!==e);return Rl(r)}function Nl(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Gl(a,e)){let o=Xl(a,e);return a=Rl(a,a.next),o=Rl(o,o.next),Dl(a,t,n,r,i,s,0),void Dl(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function Ll(e,t){return e.x-t.x}function kl(e,t){const n=function(e,t){let n,r=t,i=-1/0;const s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){const e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===s))return n}r=r.next}while(r!==t);if(!n)return null;const o=n,l=n.x,c=n.y;let u,h=1/0;r=n;do{s>=r.x&&r.x>=l&&s!==r.x&&jl(a<c?s:i,a,l,c,a<c?i:s,a,r.x,r.y)&&(u=Math.abs(a-r.y)/(s-r.x),Yl(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&Fl(n,r)))&&(n=r,h=u)),r=r.next}while(r!==o);return n}(e,t);if(!n)return t;const r=Xl(n,e);return Rl(r,r.next),Rl(n,n.next)}function Fl(e,t){return zl(e.prev,e,t.prev)<0&&zl(t.next,e,e.next)<0}function Ul(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Bl(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function jl(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function Gl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Hl(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Yl(e,t)&&Yl(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(zl(e.prev,e,t.prev)||zl(e,t.prev,t))||Vl(e,t)&&zl(e.prev,e,e.next)>0&&zl(t.prev,t,t.next)>0)}function zl(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Vl(e,t){return e.x===t.x&&e.y===t.y}function Hl(e,t,n,r){const i=Wl(zl(e,t,n)),s=Wl(zl(e,t,r)),a=Wl(zl(n,r,e)),o=Wl(zl(n,r,t));return i!==s&&a!==o||(!(0!==i||!ql(e,n,t))||(!(0!==s||!ql(e,r,t))||(!(0!==a||!ql(n,e,r))||!(0!==o||!ql(n,t,r)))))}function ql(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Wl(e){return e>0?1:e<0?-1:0}function Yl(e,t){return zl(e.prev,e,e.next)<0?zl(e,t,e.next)>=0&&zl(e,e.prev,t)>=0:zl(e,t,e.prev)<0||zl(e,e.next,t)<0}function Xl(e,t){const n=new Zl(e.i,e.x,e.y),r=new Zl(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function $l(e,t,n,r){const i=new Zl(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Kl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Zl(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Jl{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Jl.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];Ql(e),ec(n,e);let s=e.length;fe(t).call(t,Ql);for(let e=0;e<t.length;e++)r.push(s),s+=t[e].length,ec(n,t[e]);const a=Ml(n,r);for(let e=0;e<a.length;e+=3)i.push(I(a).call(a,e,e+3));return i}}function Ql(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ec(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class tc extends Kr{constructor(e=new Il([new Xt(.5,.5),new Xt(-.5,.5),new Xt(-.5,-.5),new Xt(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=b(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++){s(e[t])}function s(e){const s=[],a=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,h=void 0!==t.bevelSize?t.bevelSize:u-.1,p=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3;const m=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:nc;let g,_,v,y,b,x=!1;m&&(g=m.getSpacedPoints(o),x=!0,c=!1,_=m.computeFrenetFrames(o,!1),v=new xn,y=new xn,b=new xn),c||(d=0,u=0,h=0,p=0);const T=e.extractPoints(a);let w=T.shape;const E=T.holes;if(!Jl.isClockWise(w)){w=xe(w).call(w);for(let e=0,t=E.length;e<t;e++){const t=E[e];Jl.isClockWise(t)&&(E[e]=xe(t).call(t))}}const S=Jl.triangulateShape(w,E),I=w;for(let e=0,t=E.length;e<t;e++){const t=E[e];w=ye(w).call(w,t)}function M(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}const A=w.length,R=S.length;function D(e,t,n){let r,i,s;const a=e.x-t.x,o=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=a*a+o*o,h=a*c-o*l;if(Math.abs(h)>W){const h=Math.sqrt(u),p=Math.sqrt(l*l+c*c),d=t.x-o/h,m=t.y+a/h,f=((n.x-c/p-d)*c-(n.y+l/p-m)*l)/(a*c-o*l);r=d+a*f-e.x,i=m+o*f-e.y;const g=r*r+i*i;if(g<=2)return new Xt(r,i);s=Math.sqrt(g/2)}else{let e=!1;a>W?l>W&&(e=!0):a<-W?l<-W&&(e=!0):we(o)===we(c)&&(e=!0),e?(r=-o,i=a,s=Math.sqrt(u)):(r=a,i=o,s=Math.sqrt(u/2))}return new Xt(r/s,i/s)}const C=[];for(let e=0,t=I.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),C[e]=D(I[e],I[n],I[r]);const O=[];let P,N=ye(C).call(C);for(let e=0,t=E.length;e<t;e++){const t=E[e];P=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),P[e]=D(t[e],t[r],t[i]);O.push(P),N=ye(N).call(N,P)}for(let e=0;e<d;e++){const t=e/d,n=u*Math.cos(t*Math.PI/2),r=h*Math.sin(t*Math.PI/2)+p;for(let e=0,t=I.length;e<t;e++){const t=M(I[e],C[e],r);F(t.x,t.y,-n)}for(let e=0,t=E.length;e<t;e++){const t=E[e];P=O[e];for(let e=0,i=t.length;e<i;e++){const i=M(t[e],P[e],r);F(i.x,i.y,-n)}}}const L=h+p;for(let e=0;e<A;e++){const t=c?M(w[e],N[e],L):w[e];x?(y.copy(_.normals[0]).multiplyScalar(t.x),v.copy(_.binormals[0]).multiplyScalar(t.y),b.copy(g[0]).add(y).add(v),F(b.x,b.y,b.z)):F(t.x,t.y,0)}for(let e=1;e<=o;e++)for(let t=0;t<A;t++){const n=c?M(w[t],N[t],L):w[t];x?(y.copy(_.normals[e]).multiplyScalar(n.x),v.copy(_.binormals[e]).multiplyScalar(n.y),b.copy(g[e]).add(y).add(v),F(b.x,b.y,b.z)):F(n.x,n.y,l/o*e)}for(let e=d-1;e>=0;e--){const t=e/d,n=u*Math.cos(t*Math.PI/2),r=h*Math.sin(t*Math.PI/2)+p;for(let e=0,t=I.length;e<t;e++){const t=M(I[e],C[e],r);F(t.x,t.y,l+n)}for(let e=0,t=E.length;e<t;e++){const t=E[e];P=O[e];for(let e=0,i=t.length;e<i;e++){const i=M(t[e],P[e],r);x?F(i.x,i.y+g[o-1].y,g[o-1].x+n):F(i.x,i.y,l+n)}}}function k(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=o+2*d;e<n;e++){const n=A*e,s=A*(e+1);B(t+r+n,t+i+n,t+i+s,t+r+s)}}}function F(e,t,n){s.push(e),s.push(t),s.push(n)}function U(e,t,i){j(e),j(t),j(i);const s=r.length/3,a=f.generateTopUV(n,r,s-3,s-2,s-1);G(a[0]),G(a[1]),G(a[2])}function B(e,t,i,s){j(e),j(t),j(s),j(t),j(i),j(s);const a=r.length/3,o=f.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);G(o[0]),G(o[1]),G(o[3]),G(o[1]),G(o[2]),G(o[3])}function j(e){r.push(s[3*e+0]),r.push(s[3*e+1]),r.push(s[3*e+2])}function G(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(c){let e=0,t=A*e;for(let e=0;e<R;e++){const n=S[e];U(n[2]+t,n[1]+t,n[0]+t)}e=o+2*d,t=A*e;for(let e=0;e<R;e++){const n=S[e];U(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<R;e++){const t=S[e];U(t[2],t[1],t[0])}for(let e=0;e<R;e++){const t=S[e];U(t[0]+A*o,t[1]+A*o,t[2]+A*o)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;k(I,t),t+=I.length;for(let e=0,n=E.length;e<n;e++){const n=E[e];k(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new zr(r,3)),this.setAttribute("uv",new zr(i,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],b(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);n.options=H({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new _l[r.type]).fromJSON(r)),new tc(n,e.options)}}const nc={generateTopUV:function(e,t,n,r,i){const s=t[3*n],a=t[3*n+1],o=t[3*r],l=t[3*r+1],c=t[3*i],u=t[3*i+1];return[new Xt(s,a),new Xt(o,l),new Xt(c,u)]},generateSideWallUV:function(e,t,n,r,i,s){const a=t[3*n],o=t[3*n+1],l=t[3*n+2],c=t[3*r],u=t[3*r+1],h=t[3*r+2],p=t[3*i],d=t[3*i+1],m=t[3*i+2],f=t[3*s],g=t[3*s+1],_=t[3*s+2];return Math.abs(o-u)<Math.abs(a-c)?[new Xt(a,1-l),new Xt(c,1-h),new Xt(p,1-m),new Xt(f,1-_)]:[new Xt(o,1-l),new Xt(u,1-h),new Xt(d,1-m),new Xt(g,1-_)]}};class rc extends Kr{constructor(e=new Il([new Xt(0,.5),new Xt(-.5,-.5),new Xt(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],s=[];let a=0,o=0;if(!1===b(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(a,o,t),a+=o,o=0;function l(e){const a=r.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===Jl.isClockWise(c)&&(c=xe(c).call(c));for(let e=0,t=u.length;e<t;e++){const t=u[e];!0===Jl.isClockWise(t)&&(u[e]=xe(t).call(t))}const h=Jl.triangulateShape(c,u);for(let e=0,t=u.length;e<t;e++){const t=u[e];c=ye(c).call(c,t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];r.push(t.x,t.y,0),i.push(0,0,1),s.push(t.x,t.y)}for(let e=0,t=h.length;e<t;e++){const t=h[e],r=t[0]+a,i=t[1]+a,s=t[2]+a;n.push(r,i,s),o+=3}}this.setIndex(n),this.setAttribute("position",new zr(r,3)),this.setAttribute("normal",new zr(i,3)),this.setAttribute("uv",new zr(s,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],b(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new rc(n,e.curveSegments)}}class ic extends Kr{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const c=[],u=new xn,h=new xn,p=[],d=[],m=[],f=[];for(let p=0;p<=n;p++){const g=[],_=p/n;let v=0;0==p&&0==s?v=.5/t:p==n&&o==Math.PI&&(v=-.5/t);for(let n=0;n<=t;n++){const o=n/t;u.x=-e*Math.cos(r+o*i)*Math.sin(s+_*a),u.y=e*Math.cos(s+_*a),u.z=e*Math.sin(r+o*i)*Math.sin(s+_*a),d.push(u.x,u.y,u.z),h.copy(u).normalize(),m.push(h.x,h.y,h.z),f.push(o+v,1-_),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=c[e][r+1],i=c[e][r],a=c[e+1][r],l=c[e+1][r+1];(0!==e||s>0)&&p.push(t,i,l),(e!==n-1||o<Math.PI)&&p.push(i,a,l)}this.setIndex(p),this.setAttribute("position",new zr(d,3)),this.setAttribute("normal",new zr(m,3)),this.setAttribute("uv",new zr(f,2))}static fromJSON(e){return new ic(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class sc extends Kr{constructor(e=1,t=.4,n=8,r=6,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],o=[],l=[],c=new xn,u=new xn,h=new xn;for(let s=0;s<=n;s++)for(let p=0;p<=r;p++){const d=p/r*i,m=s/n*Math.PI*2;u.x=(e+t*Math.cos(m))*Math.cos(d),u.y=(e+t*Math.cos(m))*Math.sin(d),u.z=t*Math.sin(m),a.push(u.x,u.y,u.z),c.x=e*Math.cos(d),c.y=e*Math.sin(d),h.subVectors(u,c).normalize(),o.push(h.x,h.y,h.z),l.push(p/r),l.push(s/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,a=(r+1)*(e-1)+t,o=(r+1)*e+t;s.push(n,i,o),s.push(i,a,o)}this.setIndex(s),this.setAttribute("position",new zr(a,3)),this.setAttribute("normal",new zr(o,3)),this.setAttribute("uv",new zr(l,2))}static fromJSON(e){return new sc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class ac extends Lr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new cn(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=K(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class oc extends ac{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Xt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,U(this,"reflectivity",{get:function(){return Bt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new cn(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new cn(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new cn(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class lc extends Lr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new cn(16777215),this.specular=new cn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=K(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class cc extends Lr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class uc extends Lr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new cn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=K(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class hc extends Fo{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function pc(e,t,n){return mc(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):I(e).call(e,t,n)}function dc(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):I(Array.prototype).call(e)}function mc(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fc(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return ne(n).call(n,(function(t,n){return e[t]-e[n]})),n}function gc(e,t,n){const r=e.length,i=new e.constructor(r);for(let s=0,a=0;a!==r;++s){const r=n[s]*t;for(let n=0;n!==t;++n)i[a++]=e[r+n]}return i}function _c(e,t,n,r){let i=1,s=e[0];for(;void 0!==s&&void 0===s[r];)s=e[i++];if(void 0===s)return;let a=s[r];if(void 0!==a)if(b(a))do{a=s[r],void 0!==a&&(t.push(s.time),n.push.apply(n,a)),s=e[i++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[r],void 0!==a&&(t.push(s.time),a.toArray(n,n.length)),s=e[i++]}while(void 0!==s);else do{a=s[r],void 0!==a&&(t.push(s.time),n.push(a)),s=e[i++]}while(void 0!==s)}class vc{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let s;n:{r:if(!(e<r)){for(let s=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===s)break;if(i=r,r=t[++n],e<r)break t}s=t.length;break n}if(e>=i)break e;{const a=t[1];e<a&&(n=2,i=a);for(let s=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===s)break;if(r=i,i=t[--n-1],e>=i)break t}s=n,n=0}}for(;n<s;){const r=n+s>>>1;e<t[r]?s=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class yc extends vc{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:xt,endingEnd:xt}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,s=e+1,a=r[i],o=r[s];if(void 0===a)switch(this.getSettings_().endingStart){case Tt:i=e,a=2*t-n;break;case wt:i=r.length-2,a=t+r[i]-r[i+1];break;default:i=e,a=n}if(void 0===o)switch(this.getSettings_().endingEnd){case Tt:s=e,o=2*n-t;break;case wt:s=1,o=n+r[1]-r[0];break;default:s=e-1,o=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(o-n),this._offsetPrev=i*c,this._offsetNext=s*c}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-t)/(r-t),m=d*d,f=m*d,g=-h*f+2*h*m-h*d,_=(1+h)*f+(-1.5-2*h)*m+(-.5+h)*d+1,v=(-1-p)*f+(1.5+p)*m+.5*d,y=p*f-p*m;for(let e=0;e!==a;++e)i[e]=g*s[c+e]+_*s[l+e]+v*s[o+e]+y*s[u+e];return i}}class bc extends vc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=(n-t)/(r-t),u=1-c;for(let e=0;e!==a;++e)i[e]=s[l+e]*u+s[o+e]*c;return i}}class xc extends vc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Tc{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=dc(t,this.TimeBufferType),this.values=dc(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:dc(e.times,Array),values:dc(de(e),Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new xc(this.times,de(this),this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new bc(this.times,de(this),this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new yc(this.times,de(this),this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case vt:t=this.InterpolantFactoryMethodDiscrete;break;case yt:t=this.InterpolantFactoryMethodLinear;break;case bt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return vt;case this.InterpolantFactoryMethodLinear:return yt;case this.InterpolantFactoryMethodSmooth:return bt}}getValueSize(){return de(this).length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,s=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==s&&n[s]>t;)--s;if(++s,0!==i||s!==r){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=pc(n,i,s),this.values=pc(de(this),i*e,s*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=de(this),i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,s),e=!1;break}s=r}if(void 0!==r&&mc(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=pc(this.times),t=pc(de(this)),n=this.getValueSize(),r=this.getInterpolation()===bt,i=e.length-1;let s=1;for(let a=1;a<i;++a){let i=!1;const o=e[a];if(o!==e[a+1]&&(1!==a||o!==e[0]))if(r)i=!0;else{const e=a*n,r=e-n,s=e+n;for(let a=0;a!==n;++a){const n=t[e+a];if(n!==t[r+a]||n!==t[s+a]){i=!0;break}}}if(i){if(a!==s){e[s]=e[a];const r=a*n,i=s*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++s}}if(i>0){e[s]=e[i];for(let e=i*n,r=s*n,a=0;a!==n;++a)t[r+a]=t[e+a];++s}return s!==e.length?(this.times=pc(e,0,s),this.values=pc(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=pc(this.times,0),t=pc(de(this),0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Tc.prototype.TimeBufferType=Float32Array,Tc.prototype.ValueBufferType=Float32Array,Tc.prototype.DefaultInterpolation=yt;class wc extends Tc{}wc.prototype.ValueTypeName="bool",wc.prototype.ValueBufferType=Array,wc.prototype.DefaultInterpolation=vt,wc.prototype.InterpolantFactoryMethodLinear=void 0,wc.prototype.InterpolantFactoryMethodSmooth=void 0;class Ec extends Tc{}Ec.prototype.ValueTypeName="color";class Sc extends Tc{}Sc.prototype.ValueTypeName="number";class Ic extends vc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-t)/(r-t);let l=e*a;for(let e=l+a;l!==e;l+=4)bn.slerpFlat(i,0,s,l-a,s,l,o);return i}}class Mc extends Tc{InterpolantFactoryMethodLinear(e){return new Ic(this.times,de(this),this.getValueSize(),e)}}Mc.prototype.ValueTypeName="quaternion",Mc.prototype.DefaultInterpolation=yt,Mc.prototype.InterpolantFactoryMethodSmooth=void 0;class Ac extends Tc{}Ac.prototype.ValueTypeName="string",Ac.prototype.ValueBufferType=Array,Ac.prototype.DefaultInterpolation=vt,Ac.prototype.InterpolantFactoryMethodLinear=void 0,Ac.prototype.InterpolantFactoryMethodSmooth=void 0;class Rc extends Tc{}Rc.prototype.ValueTypeName="vector";class Dc{constructor(e,t=-1,n,r=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Ut(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Cc(n[e]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(Tc.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,s=[];for(let e=0;e<i;e++){let a=[],o=[];a.push((e+i-1)%i,e,(e+1)%i),o.push(0,1,0);const l=fc(a);a=gc(a,1,l),o=gc(o,1,l),r||0!==a[0]||(a.push(i),o.push(o[0])),s.push(new Sc(".morphTargetInfluences["+t[e].name+"]",a,o).scale(1/n))}return new this(e,-1,s)}static findByName(e,t){let n=e;if(!b(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.name.match(i);if(s&&s.length>1){const e=s[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const s=[];for(const e in r)s.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const s=[],a=[];_c(n,s,a,r),0!==s.length&&i.push(new e(t,s,a))}},r=[],i=e.name||"default",s=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const i=Ie(l[e]);if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(const n in e){const e=[],s=[];for(let r=0;r!==i[t].morphTargets.length;++r){const r=i[t];e.push(r.time),s.push(r.morphTarget===n?1:0)}r.push(new Sc(".morphTargetInfluence["+n+"]",e,s))}o=e.length*s}else{const s=".bones["+t[e].name+"]";n(Rc,s+".position",i,"pos",r),n(Mc,s+".quaternion",i,"rot",r),n(Rc,s+".scale",i,"scl",r)}}if(0===r.length)return null;return new this(i,o,r,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++){var e;se(e=this.tracks[t]).call(e,0,this.duration)}return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Cc(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Sc;case"vector":case"vector2":case"vector3":case"vector4":return Rc;case"color":return Ec;case"quaternion":return Mc;case"bool":case"boolean":return wc;case"string":return Ac}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];_c(Ie(e),t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,de(e),e.interpolation)}const Oc={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Pc{constructor(e,t,n){const r=this;let i,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===s&&void 0!==r.onStart&&r.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=T(l).call(l,e);return-1!==t&&E(l).call(l,t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const Nc=new Pc;class Lc{constructor(e){this.manager=void 0!==e?e:Nc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new _((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const kc={};class Fc extends Error{constructor(e,t){super(e),this.response=t}}class Uc extends Lc{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=Oc.get(e);if(void 0!==i)return this.manager.itemStart(e),Ae((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==kc[e])return void kc[e].push({onLoad:t,onProgress:n,onError:r});kc[e]=[],kc[e].push({onLoad:t,onProgress:n,onError:r});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=kc[e],r=t.body.getReader(),i=t.headers.get("Content-Length"),s=i?N(i):0,a=0!==s;let o=0;const l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{o+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw new Fc(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(a),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{Oc.add(e,t);const n=kc[e];delete kc[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=kc[e];if(void 0===n)throw this.manager.itemError(e),t;delete kc[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Bc extends Lc{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Oc.get(e);if(void 0!==s)return i.manager.itemStart(e),Ae((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a=Zt("img");function o(){c(),Oc.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==I(e).call(e,0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class jc extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=new Si,s=new Bc(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function o(n){s.load(e[n],(function(e){i.images[n]=e,a++,6===a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let t=0;t<e.length;++t)o(t);return i}}class Gc extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Io,a=new Uc(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){const n=i.parse(e);n&&(void 0!==n.image?s.image=n.image:void 0!==n.data&&(s.image.width=n.width,s.image.height=n.height,s.image.data=n.data),s.wrapS=void 0!==n.wrapS?n.wrapS:Ze,s.wrapT=void 0!==n.wrapT?n.wrapT:Ze,s.magFilter=void 0!==n.magFilter?n.magFilter:nt,s.minFilter=void 0!==n.minFilter?n.minFilter:nt,s.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(s.encoding=n.encoding),void 0!==n.flipY&&(s.flipY=n.flipY),void 0!==n.format&&(s.format=n.format),void 0!==n.type&&(s.type=n.type),void 0!==n.mipmaps&&(s.mipmaps=n.mipmaps,s.minFilter=it),1===n.mipmapCount&&(s.minFilter=nt),void 0!==n.generateMipmaps&&(s.generateMipmaps=n.generateMipmaps),s.needsUpdate=!0,t&&t(s,n))}),n,r),s}}class zc extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=new fn,s=new Bc(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class Vc extends Tr{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new cn(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}class Hc extends Vc{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Tr.DefaultUp),this.updateMatrix(),this.groundColor=new cn(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const qc=new Zn,Wc=new xn,Yc=new xn;class Xc{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Xt(512,512),this.map=null,this.mapPass=null,this.matrix=new Zn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Pi,this._frameExtents=new Xt(1,1),this._viewportCount=1,this._viewports=[new gn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Wc.setFromMatrixPosition(e.matrixWorld),t.position.copy(Wc),Yc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Yc),t.updateMatrixWorld(),qc.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(qc),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(qc)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){K(this)&&K(this).dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class $c extends Xc{constructor(){super(new Ti(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*Ft*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Kc extends Vc{constructor(e,t,n=0,r=Math.PI/3,i=0,s=1){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Tr.DefaultUp),this.updateMatrix(),this.target=new Tr,this.distance=n,this.angle=r,this.penumbra=i,this.decay=s,this.map=null,this.shadow=new $c}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Zc=new Zn,Jc=new xn,Qc=new xn;class eu extends Xc{constructor(){super(new Ti(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Xt(4,2),this._viewportCount=6,this._viewports=[new gn(2,1,1,1),new gn(0,1,1,1),new gn(3,1,1,1),new gn(1,1,1,1),new gn(3,0,1,1),new gn(1,0,1,1)],this._cubeDirections=[new xn(1,0,0),new xn(-1,0,0),new xn(0,0,1),new xn(0,0,-1),new xn(0,1,0),new xn(0,-1,0)],this._cubeUps=[new xn(0,1,0),new xn(0,1,0),new xn(0,1,0),new xn(0,1,0),new xn(0,0,1),new xn(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),Jc.setFromMatrixPosition(e.matrixWorld),n.position.copy(Jc),Qc.copy(n.position),Qc.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Qc),n.updateMatrixWorld(),r.makeTranslation(-Jc.x,-Jc.y,-Jc.z),Zc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Zc)}}class tu extends Vc{constructor(e,t,n=0,r=1){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new eu}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class nu extends Xc{constructor(){super(new Wi(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ru extends Vc{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Tr.DefaultUp),this.updateMatrix(),this.target=new Tr,this.shadow=new nu}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class iu extends Vc{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class su{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=De(e).call(e,"/");return-1===t?"./":I(e).call(e,0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class au extends Lc{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Oc.get(e);if(void 0!==s)return i.manager.itemStart(e),Ae((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,H(i.options,{colorSpaceConversion:"none"}))})).then((function(n){Oc.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}class ou{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=lu(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=lu();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function lu(){return("undefined"==typeof performance?Date:performance).now()}const cu="\\[\\]\\.:\\/",uu=new RegExp("[\\[\\]\\.:\\/]","g"),hu="[^\\[\\]\\.:\\/]",pu="[^"+cu.replace("\\.","")+"]",du=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",hu)+/(WCOD+)?/.source.replace("WCOD",pu)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hu)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hu)+"$"),mu=["material","materials","bones","map"];class fu{constructor(e,t,n){this.path=t,this.parsedPath=n||fu.parseTrackName(t),this.node=fu.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new fu.Composite(e,t,n):new fu(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(uu,"")}static parseTrackName(e){var t;const n=du.exec(e);if(null===n)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&De(t=r.nodeName).call(t,".");if(void 0!==i&&-1!==i){const e=r.nodeName.substring(i+1);-1!==T(mu).call(mu,e)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const s=n(i.children);if(s)return s}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){_e(this).call(this),this.getValue(e,t)}_setValue_unbound(e,t){_e(this).call(this),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=fu.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=K(e);break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!K(e.material))return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=K(e.material);break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const s=e[r];if(void 0===s){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):b(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}fu.Composite=class{constructor(e,t,n){const r=n||fu.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){_e(this).call(this);const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n){var t;_e(t=e[n]).call(t)}}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},fu.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},fu.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},fu.prototype.GetterByBindingType=[fu.prototype._getValue_direct,fu.prototype._getValue_array,fu.prototype._getValue_arrayElement,fu.prototype._getValue_toArray],fu.prototype.SetterByBindingTypeAndVersioning=[[fu.prototype._setValue_direct,fu.prototype._setValue_direct_setNeedsUpdate,fu.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[fu.prototype._setValue_array,fu.prototype._setValue_array_setNeedsUpdate,fu.prototype._setValue_array_setMatrixWorldNeedsUpdate],[fu.prototype._setValue_arrayElement,fu.prototype._setValue_arrayElement_setNeedsUpdate,fu.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[fu.prototype._setValue_fromArray,fu.prototype._setValue_fromArray_setNeedsUpdate,fu.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);class gu{constructor(e,t,n=0,r=1/0){this.ray=new Kn(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new lr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return vu(e,this,n,t),ne(n).call(n,_u),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)vu(e[r],this,n,t);return ne(n).call(n,_u),n}}function _u(e,t){return e.distance-t.distance}function vu(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)vu(r[e],t,n,!0)}}class yu{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Bt(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const bu=new Xt;class xu{constructor(e=new Xt(1/0,1/0),t=new Xt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=bu.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return bu.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}class Tu extends Wo{constructor(e=10,t=10,n=4473924,r=8947848){n=new cn(n),r=new cn(r);const i=t/2,s=e/t,a=e/2,o=[],l=[];for(let e=0,c=0,u=-a;e<=t;e++,u+=s){o.push(-a,0,u,a,0,u),o.push(u,0,-a,u,0,a);const t=e===i?n:r;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new Kr;c.setAttribute("position",new zr(o,3)),c.setAttribute("color",new zr(l,3));super(c,new Fo({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const wu=new En;class Eu extends Wo{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new Kr;i.setIndex(new Br(n,1)),i.setAttribute("position",new Br(r,3)),super(i,new Fo({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&wu.setFromObject(this.object),wu.isEmpty())return;const t=wu.min,n=wu.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const Su=new xn;let Iu,Mu;class Au extends Tr{constructor(e=new xn(0,0,1),t=new xn(0,0,0),n=1,r=16776960,i=.2*n,s=.2*i){super(),this.type="ArrowHelper",void 0===Iu&&(Iu=new Kr,Iu.setAttribute("position",new zr([0,0,0,0,1,0],3)),Mu=new bl(0,.5,1,5,1),Mu.translate(0,-.5,0)),this.position.copy(t),this.line=new Vo(Iu,new Fo({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new mi(Mu,new kr({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Su.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Su,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Ru{constructor(){this.type="ShapePath",this.color=new cn,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new yl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,s){return this.currentPath.bezierCurveTo(e,t,n,r,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,s=0;s<n;i=s++){let n=t[i],a=t[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>W){if(l<0&&(n=t[s],o=-o,a=t[i],l=-l),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const n=Jl.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,s,a;const o=[];if(1===r.length)return s=r[0],a=new Il,a.curves=s.curves,o.push(a),o;let l=!n(r[0].getPoints());l=e?!l:l;const c=[],u=[];let h,p,d=[],m=0;u[m]=void 0,d[m]=[];for(let t=0,a=r.length;t<a;t++)s=r[t],h=s.getPoints(),i=n(h),i=e?!i:i,i?(!l&&u[m]&&m++,u[m]={s:new Il,p:h},u[m].s.curves=s.curves,l&&m++,d[m]=[]):d[m].push({h:s,p:h[0]});if(!u[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new Il;i.curves=r.curves,t.push(i)}return t}(r);if(u.length>1){let e=!1,n=0;for(let e=0,t=u.length;e<t;e++)c[e]=[];for(let r=0,i=u.length;r<i;r++){const i=d[r];for(let s=0;s<i.length;s++){const a=i[s];let o=!0;for(let i=0;i<u.length;i++)t(a.p,u[i].p)&&(r!==i&&n++,o?(o=!1,c[i].push(a)):e=!0);o&&c[r].push(a)}}n>0&&!1===e&&(d=c)}for(let e=0,t=u.length;e<t;e++){a=u[e].s,o.push(a),p=d[e];for(let e=0,t=p.length;e<t;e++)a.holes.push(p[e].h)}return o}}const Du=Cu();function Cu(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,s[e]=t|n}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=1199570944,a[32]=2147483648;for(let e=33;e<63;++e)a[e]=2147483648+(e-32<<23);a[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}var Ou=R({__proto__:null,toHalfFloat:function(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Bt(e,-65504,65504),Du.floatView[0]=e;const t=Du.uint32View[0],n=t>>23&511;return Du.baseTable[n]+((8388607&t)>>Du.shiftTable[n])},fromHalfFloat:function(e){const t=e>>10;return Du.uint32View[0]=Du.mantissaTable[Du.offsetTable[t]+(1023&e)]+Du.exponentTable[t],Du.floatView[0]}});"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Oe}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Oe);const Pu=new Zn,Nu=new Kn,Lu=new zn,ku=new xn,Fu=new xn,Uu=new xn,Bu=new xn,ju=new xn,Gu=new xn,zu=new xn,Vu=new xn,Hu=new xn,qu=new Xt,Wu=new Xt,Yu=new Xt,Xu=new xn,$u=new xn;function Ku(e,t,n,r,i,s,a,o,l,c,u,h){ku.fromBufferAttribute(i,c),Fu.fromBufferAttribute(i,u),Uu.fromBufferAttribute(i,h);const p=e.morphTargetInfluences;if(s&&p){zu.set(0,0,0),Vu.set(0,0,0),Hu.set(0,0,0);for(let e=0,t=s.length;e<t;e++){const t=p[e],n=s[e];0!==t&&(Bu.fromBufferAttribute(n,c),ju.fromBufferAttribute(n,u),Gu.fromBufferAttribute(n,h),a?(zu.addScaledVector(Bu,t),Vu.addScaledVector(ju,t),Hu.addScaledVector(Gu,t)):(zu.addScaledVector(Bu.sub(ku),t),Vu.addScaledVector(ju.sub(Fu),t),Hu.addScaledVector(Gu.sub(Uu),t)))}ku.add(zu),Fu.add(Vu),Uu.add(Hu)}e.isSkinnedMesh&&(e.boneTransform(c,ku),e.boneTransform(u,Fu),e.boneTransform(h,Uu));const d=function(e,t,n,r,i,s,a,o){let l;if(l=1===t.side?r.intersectTriangle(a,s,i,!0,o):r.intersectTriangle(i,s,a,2!==t.side,o),null===l)return null;$u.copy(o),$u.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo($u);return c<n.near||c>n.far?null:{distance:c,point:$u.clone(),object:e}}(e,t,n,r,ku,Fu,Uu,Xu);if(d){o&&(qu.fromBufferAttribute(o,c),Wu.fromBufferAttribute(o,u),Yu.fromBufferAttribute(o,h),d.uv=Pr.getUV(Xu,ku,Fu,Uu,qu,Wu,Yu,new Xt)),l&&(qu.fromBufferAttribute(l,c),Wu.fromBufferAttribute(l,u),Yu.fromBufferAttribute(l,h),d.uv2=Pr.getUV(Xu,ku,Fu,Uu,qu,Wu,Yu,new Xt));const e={a:c,b:u,c:h,normal:new xn,materialIndex:0};Pr.getNormal(ku,Fu,Uu,e.normal),d.face=e}return d}mi.prototype.raycast=function(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Lu.copy(n.boundingSphere),Lu.applyMatrix4(i),!1===e.ray.intersectsSphere(Lu))return;if(Pu.copy(i).invert(),Nu.copy(e.ray).applyMatrix4(Pu),null!==n.boundingBox&&!1===Nu.intersectsBox(n.boundingBox))return;let s;const a=n.index,o=n.attributes.position,l=n.morphAttributes.position,c=n.morphTargetsRelative,u=n.attributes.uv,h=n.attributes.uv2,p=n.groups,d=n.drawRange,m=t.length;if(null!==a)if(x()(r))for(let n=0,i=p.length;n<i;n++){const i=p[n],f=r[i.materialIndex];for(let n=Math.max(i.start,d.start),r=Math.min(a.count,Math.min(i.start+i.count,d.start+d.count));n<r;n+=3){const r=a.getX(n),p=a.getX(n+1),d=a.getX(n+2);if(s=Ku(this,f,e,Nu,o,l,c,u,h,r,p,d),s&&(s.faceIndex=Math.floor(n/3),s.face.materialIndex=i.materialIndex,t.push(s)),t.length-m>=1)return}}else{for(let n=Math.max(0,d.start),i=Math.min(a.count,d.start+d.count);n<i;n+=3){const i=a.getX(n),p=a.getX(n+1),d=a.getX(n+2);if(s=Ku(this,r,e,Nu,o,l,c,u,h,i,p,d),s&&(s.faceIndex=Math.floor(n/3),t.push(s)),t.length-m>=1)return}}else if(void 0!==o)if(x()(r))for(let n=0,i=p.length;n<i;n++){const i=p[n],a=r[i.materialIndex];for(let n=Math.max(i.start,d.start),r=Math.min(o.count,Math.min(i.start+i.count,d.start+d.count));n<r;n+=3){if(s=Ku(this,a,e,Nu,o,l,c,u,h,n,n+1,n+2),s&&(s.faceIndex=Math.floor(n/3),s.face.materialIndex=i.materialIndex,t.push(s)),t.length-m>=1)return}}else{for(let n=Math.max(0,d.start),i=Math.min(o.count,d.start+d.count);n<i;n+=3){if(s=Ku(this,r,e,Nu,o,l,c,u,h,n,n+1,n+2),s&&(s.faceIndex=Math.floor(n/3),t.push(s)),t.length-m>=1)return}}};const Zu=new zn,Ju=new xn,Qu=new xn,eh=new xn,th=new xn;function nh(e,t,n,r,i,s,a){Ju.fromBufferAttribute(t,r).applyMatrix4(e.matrixWorld),Qu.fromBufferAttribute(t,i).applyMatrix4(e.matrixWorld);if(n.ray.distanceSqToSegment(Ju,Qu,th,eh)>s)return!1;const o=n.ray.origin.distanceTo(th);return!(o<n.near||o>n.far)&&(a.push({distance:o,point:eh.clone(),index:r,object:e}),!0)}Vo.prototype.raycast=function(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zu.copy(n.boundingSphere),Zu.applyMatrix4(r),Zu.radius+=i,!1===e.ray.intersectsSphere(Zu))return;const a=i*i,o=this.isLineSegments?2:1,l=n.index,c=n.attributes.position,u=t.length;if(null!==l){const n=this.userData.batches;if(n&&n.length>0&&n[0].boundingSphere)for(let i=0;i<n.length;i++){const s=n[i];if(Zu.copy(s.boundingSphere),Zu.applyMatrix4(r),!1!==e.ray.intersectsSphere(Zu))for(let n=s.indexStart,r=s.indexStart+s.indexCount;n<r;n+=o){if(nh(this,c,e,l.getX(n),l.getX(n+1),a,t)&&(t[t.length-1].index=n,t.length-u>=1))return}}else{for(let n=Math.max(0,s.start),r=Math.min(l.count,s.start+s.count)-1;n<r;n+=o){if(nh(this,c,e,l.getX(n),l.getX(n+1),a,t)&&(t[t.length-1].index=n,t.length-u>=1))return}}}else{const n=this.userData.batches;if(n&&n.length>0&&n[0].boundingSphere)for(let i=0;i<n.length;i++){const s=n[i];if(Zu.copy(s.boundingSphere),Zu.applyMatrix4(r),!1!==e.ray.intersectsSphere(Zu))for(let n=s.positionStart,r=s.positionStart+s.positionCount;n<r;n+=o)if(nh(this,c,e,n,n+1,a,t)&&t.length-u>=1)return}else{for(let n=Math.max(0,s.start),r=Math.min(c.count,s.start+s.count)-1;n<r;n+=o)if(nh(this,c,e,n,n+1,a,t)&&t.length-u>=1)return}}};const rh=new zn,ih=new xn;function sh(e,t,n,r,i,s){const a=r.ray.distanceSqToPoint(e);if(a<n){const n=new xn;r.ray.closestPointToPoint(e,n);const o=r.ray.origin.distanceTo(n);if(o<r.near||o>r.far)return;i.push({distance:o,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:s})}}Qo.prototype.raycast=function(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),rh.copy(n.boundingSphere),rh.applyMatrix4(r),rh.radius+=i,!1===e.ray.intersectsSphere(rh))return;const a=i*i,o=n.index,l=n.attributes.position,c=t.length;if(null!==o){for(let n=Math.max(0,s.start),i=Math.min(o.count,s.start+s.count);n<i;n++){const i=o.getX(n);if(ih.fromBufferAttribute(l,i).applyMatrix4(r),sh(ih,i,a,e,t,this),t.length-c>=1)return}}else{for(let n=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);n<i;n++)if(ih.fromBufferAttribute(l,n).applyMatrix4(r),sh(ih,n,a,e,t,this),t.length-c>=1)return}};class ah{constructor(){this.id=0,this.object=null,this.z=0,this.renderOrder=0}}class oh{constructor(){this.id=0,this.v1=new lh,this.v2=new lh,this.v3=new lh,this.normalModel=new xn,this.vertexNormalsModel=[new xn,new xn,new xn],this.vertexNormalsLength=0,this.color=new cn,this.material=null,this.uvs=[new Xt,new Xt,new Xt],this.z=0,this.renderOrder=0}}class lh{constructor(){this.position=new xn,this.positionWorld=new xn,this.positionScreen=new gn,this.visible=!0}copy(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)}}class ch{constructor(){this.id=0,this.v1=new lh,this.v2=new lh,this.vertexColors=[new cn,new cn],this.material=null,this.z=0,this.renderOrder=0}}class uh{constructor(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new Xt,this.material=null,this.renderOrder=0}}class hh{constructor(){let e,t,n,r,i,s,a,o,l,c,u,h=0,p=0,d=0,m=0,f=0;const g={objects:[],lights:[],elements:[]},_=new xn,v=new gn,y=new En(new xn(-1,-1,-1),new xn(1,1,1)),x=new En,T=new Array(3),w=new Zn,E=new Zn,S=new Zn,I=new Pi,M=[],A=[],R=[],D=[],C=[];const O=new function(){const e=[],t=[],s=[];let l=null;const c=new $t;function h(e){const t=e.position,n=e.positionWorld,r=e.positionScreen;n.copy(t).applyMatrix4(u),r.copy(n).applyMatrix4(E);const i=1/r.w;r.x*=i,r.y*=i,r.z*=i,e.visible=r.x>=-1&&r.x<=1&&r.y>=-1&&r.y<=1&&r.z>=-1&&r.z<=1}function d(e,t,n){return!0===e.visible||!0===t.visible||!0===n.visible||(T[0]=e.positionScreen,T[1]=t.positionScreen,T[2]=n.positionScreen,y.intersectsBox(x.setFromPoints(T)))}function f(e,t,n){return(n.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(n.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0}return{setObject:function(n){l=n,c.getNormalMatrix(l.matrixWorld),e.length=0,t.length=0,s.length=0},projectVertex:h,checkTriangleVisibility:d,checkBackfaceCulling:f,pushVertex:function(e,t,i){n=function(){if(r===p){const e=new lh;return A.push(e),p++,r++,e}return A[r++]}(),n.position.set(e,t,i),h(n)},pushNormal:function(t,n,r){e.push(t,n,r)},pushColor:function(e,n,r){t.push(e,n,r)},pushUv:function(e,t){s.push(e,t)},pushLine:function(e,n){const r=A[e],i=A[n];r.positionScreen.copy(r.position).applyMatrix4(S),i.positionScreen.copy(i.position).applyMatrix4(S),!0===function(e,t){let n=0,r=1;const i=e.z+e.w,s=t.z+t.w,a=-e.z+e.w,o=-t.z+t.w;return i>=0&&s>=0&&a>=0&&o>=0||!(i<0&&s<0||a<0&&o<0)&&(i<0?n=Math.max(n,i/(i-s)):s<0&&(r=Math.min(r,i/(i-s))),a<0?n=Math.max(n,a/(a-o)):o<0&&(r=Math.min(r,a/(a-o))),!(r<n)&&(e.lerp(t,n),t.lerp(e,1-r),!0))}(r.positionScreen,i.positionScreen)&&(r.positionScreen.multiplyScalar(1/r.positionScreen.w),i.positionScreen.multiplyScalar(1/i.positionScreen.w),a=function(){if(o===m){const e=new ch;return D.push(e),m++,o++,e}return D[o++]}(),a.id=l.id,a.v1.copy(r),a.v2.copy(i),a.z=Math.max(r.positionScreen.z,i.positionScreen.z),a.renderOrder=l.renderOrder,a.material=l.material,l.material.vertexColors&&(a.vertexColors[0].fromArray(t,3*e),a.vertexColors[1].fromArray(t,3*n)),g.elements.push(a))},pushTriangle:function(n,r,a,o){const u=A[n],h=A[r],p=A[a];if(!1!==d(u,h,p)&&(2===o.side||!0===f(u,h,p))){i=k(),i.id=l.id,i.v1.copy(u),i.v2.copy(h),i.v3.copy(p),i.z=(u.positionScreen.z+h.positionScreen.z+p.positionScreen.z)/3,i.renderOrder=l.renderOrder,_.subVectors(p.position,h.position),v.subVectors(u.position,h.position),_.cross(v),i.normalModel.copy(_),i.normalModel.applyMatrix3(c).normalize();for(let t=0;t<3;t++){const n=i.vertexNormalsModel[t];n.fromArray(e,3*arguments[t]),n.applyMatrix3(c).normalize();i.uvs[t].fromArray(s,2*arguments[t])}i.vertexNormalsLength=3,i.material=o,o.vertexColors&&i.color.fromArray(t,3*n),g.elements.push(i)}}}};function P(e){if(!1===e.visible)return;if(e.isLight)g.lights.push(e);else if(e.isMesh||e.isLine||e.isPoints){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===I.intersectsObject(e))return;N(e)}else if(e.isSprite){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===I.intersectsSprite(e))return;N(e)}const t=e.children;for(let e=0,n=t.length;e<n;e++)P(t[e])}function N(n){e=function(){if(t===h){const e=new ah;return M.push(e),h++,t++,e}return M[t++]}(),e.id=n.id,e.object=n,_.setFromMatrixPosition(n.matrixWorld),_.applyMatrix4(E),e.z=_.z,e.renderOrder=n.renderOrder,g.objects.push(e)}function L(e,t,n){const r=1/e.w;e.z*=r,e.z>=-1&&e.z<=1&&(l=function(){if(c===f){const e=new uh;return C.push(e),f++,c++,e}return C[c++]}(),l.id=t.id,l.x=e.x*r,l.y=e.y*r,l.z=e.z,l.renderOrder=t.renderOrder,l.object=t,l.rotation=t.rotation,l.scale.x=t.scale.x*Math.abs(l.x-(e.x+n.projectionMatrix.elements[0])/(e.w+n.projectionMatrix.elements[12])),l.scale.y=t.scale.y*Math.abs(l.y-(e.y+n.projectionMatrix.elements[5])/(e.w+n.projectionMatrix.elements[13])),l.material=t.material,g.elements.push(l))}function k(){if(s===d){const e=new oh;return R.push(e),d++,s++,e}return R[s++]}function F(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}this.projectScene=function(e,n,i,a){var l;(s=0,o=0,c=0,g.elements.length=0,!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===n.parent&&!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),w.copy(n.matrixWorldInverse),E.multiplyMatrices(n.projectionMatrix,w),I.setFromProjectionMatrix(E),t=0,g.objects.length=0,g.lights.length=0,P(e),!0===i)&&ne(l=g.objects).call(l,F);const h=g.objects;for(let e=0,t=h.length;e<t;e++){const t=h[e].object,i=t.geometry;if(O.setObject(t),u=t.matrixWorld,r=0,t.isMesh){let e=t.material;const n=b(e),r=i.attributes,s=i.groups;if(void 0===r.position)continue;const a=r.position.array;for(let e=0,n=a.length;e<n;e+=3){let n=a[e],r=a[e+1],s=a[e+2];const o=i.morphAttributes.position;if(void 0!==o){const l=i.morphTargetsRelative,c=t.morphTargetInfluences;for(let t=0,i=o.length;t<i;t++){const i=c[t];if(0===i)continue;const u=o[t];l?(n+=u.getX(e/3)*i,r+=u.getY(e/3)*i,s+=u.getZ(e/3)*i):(n+=(u.getX(e/3)-a[e])*i,r+=(u.getY(e/3)-a[e+1])*i,s+=(u.getZ(e/3)-a[e+2])*i)}}O.pushVertex(n,r,s)}if(void 0!==r.normal){const e=r.normal.array;for(let t=0,n=e.length;t<n;t+=3)O.pushNormal(e[t],e[t+1],e[t+2])}if(void 0!==r.color){const e=r.color.array;for(let t=0,n=e.length;t<n;t+=3)O.pushColor(e[t],e[t+1],e[t+2])}if(void 0!==r.uv){const e=r.uv.array;for(let t=0,n=e.length;t<n;t+=2)O.pushUv(e[t],e[t+1])}if(null!==i.index){const r=i.index.array;if(s.length>0)for(let i=0;i<s.length;i++){const a=s[i];if(e=!0===n?t.material[a.materialIndex]:t.material,void 0!==e)for(let t=a.start,n=a.start+a.count;t<n;t+=3)O.pushTriangle(r[t],r[t+1],r[t+2],e)}else for(let t=0,n=r.length;t<n;t+=3)O.pushTriangle(r[t],r[t+1],r[t+2],e)}else if(s.length>0)for(let r=0;r<s.length;r++){const i=s[r];if(e=!0===n?t.material[i.materialIndex]:t.material,void 0!==e)for(let t=i.start,n=i.start+i.count;t<n;t+=3)O.pushTriangle(t,t+1,t+2,e)}else for(let t=0,n=a.length/3;t<n;t+=3)O.pushTriangle(t,t+1,t+2,e)}else if(t.isLine){S.multiplyMatrices(E,u);const e=i.attributes;if(void 0!==e.position){const n=e.position.array;for(let e=0,t=n.length;e<t;e+=3)O.pushVertex(n[e],n[e+1],n[e+2]);if(void 0!==e.color){const t=e.color.array;for(let e=0,n=t.length;e<n;e+=3)O.pushColor(t[e],t[e+1],t[e+2])}if(null!==i.index){const e=i.index.array;for(let t=0,n=e.length;t<n;t+=2)O.pushLine(e[t],e[t+1])}else{const e=t.isLineSegments?2:1;for(let t=0,r=n.length/3-1;t<r;t+=e)O.pushLine(t,t+1)}}}else if(t.isPoints){S.multiplyMatrices(E,u);const e=i.attributes;if(void 0!==e.position){const r=e.position.array;for(let e=0,i=r.length;e<i;e+=3)v.set(r[e],r[e+1],r[e+2],1),v.applyMatrix4(S),L(v,t,n)}}else t.isSprite&&(t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),v.set(u.elements[12],u.elements[13],u.elements[14],1),v.applyMatrix4(E),L(v,t,n))}var p;!0===a&&ne(p=g.elements).call(p,F);return g}}}class ph extends Tr{constructor(e){super(),this.isSVGObject=!0,this.node=e}}class dh{constructor(){let e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f=0,g=null,_=1;const v=this,y=new xu,b=new xu,x=new cn,T=new cn,w=new cn,E=new cn,S=new cn,I=new xn,M=new xn,A=new xn,R=new $t,D=new Zn,C=new Zn,O=[],P=new hh,N=document.createElementNS("http://www.w3.org/2000/svg","svg");function L(){for(f=0;N.childNodes.length>0;)N.removeChild(N.childNodes[0])}function k(e){return null!==g?e.toFixed(g):e}function F(e,t,n){let r=t.scale.x*s,i=t.scale.y*a;n.isPointsMaterial&&(r*=n.size,i*=n.size);const o="M"+k(e.x-.5*r)+","+k(e.y-.5*i)+"h"+k(r)+"v"+k(i)+"h"+k(-r)+"z";let l="";(n.isSpriteMaterial||n.isPointsMaterial)&&(l="fill:"+n.color.getStyle()+";fill-opacity:"+n.opacity),G(l,o)}function U(e,t,n){const r="M"+k(e.positionScreen.x)+","+k(e.positionScreen.y)+"L"+k(t.positionScreen.x)+","+k(t.positionScreen.y);if(n.isLineBasicMaterial){let e="fill:none;stroke:"+n.color.getStyle()+";stroke-opacity:"+n.opacity+";stroke-width:"+n.linewidth+";stroke-linecap:"+n.linecap;n.isLineDashedMaterial&&(e=e+";stroke-dasharray:"+n.dashSize+","+n.gapSize),G(e,r)}}function B(e,t,r,i,s){v.info.render.vertices+=3,v.info.render.faces++;const a="M"+k(e.positionScreen.x)+","+k(e.positionScreen.y)+"L"+k(t.positionScreen.x)+","+k(t.positionScreen.y)+"L"+k(r.positionScreen.x)+","+k(r.positionScreen.y)+"z";let o="";s.isMeshBasicMaterial?(x.copy(s.color),s.vertexColors&&x.multiply(i.color)):s.isMeshLambertMaterial||s.isMeshPhongMaterial||s.isMeshStandardMaterial?(T.copy(s.color),s.vertexColors&&T.multiply(i.color),x.copy(w),M.copy(e.positionWorld).add(t.positionWorld).add(r.positionWorld).divideScalar(3),function(e,t,n,r){for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.color;if(s.isDirectionalLight){const e=I.setFromMatrixPosition(s.matrixWorld).normalize();let t=n.dot(e);if(t<=0)continue;t*=s.intensity,r.r+=a.r*t,r.g+=a.g*t,r.b+=a.b*t}else if(s.isPointLight){const e=I.setFromMatrixPosition(s.matrixWorld);let i=n.dot(I.subVectors(e,t).normalize());if(i<=0)continue;if(i*=0==s.distance?1:1-Math.min(t.distanceTo(e)/s.distance,1),0==i)continue;i*=s.intensity,r.r+=a.r*i,r.g+=a.g*i,r.b+=a.b*i}}}(n,M,i.normalModel,x),x.multiply(T).add(s.emissive)):s.isMeshNormalMaterial&&(A.copy(i.normalModel).applyMatrix3(R).normalize(),x.setRGB(A.x,A.y,A.z).multiplyScalar(.5).addScalar(.5)),o=s.wireframe?"fill:none;stroke:"+x.getStyle()+";stroke-opacity:"+s.opacity+";stroke-width:"+s.wireframeLinewidth+";stroke-linecap:"+s.wireframeLinecap+";stroke-linejoin:"+s.wireframeLinejoin:"fill:"+x.getStyle()+";fill-opacity:"+s.opacity,G(o,a)}function j(e,t,n){let r=t.x-e.x,i=t.y-e.y;const s=r*r+i*i;if(0===s)return;const a=n/Math.sqrt(s);r*=a,i*=a,t.x+=r,t.y+=i,e.x-=r,e.y-=i}function G(e,t){p===e?h+=t:(z(),p=e,h=t)}function z(){h&&(u=function(e){if(null==O[e])return O[e]=document.createElementNS("http://www.w3.org/2000/svg","path"),0==_&&O[e].setAttribute("shape-rendering","crispEdges"),O[e];return O[e]}(f++),u.setAttribute("d",h),u.setAttribute("style",p),N.appendChild(u)),h="",p=""}this.domElement=N,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.overdraw=.5,this.info={render:{vertices:0,faces:0}},this.setQuality=function(e){switch(e){case"high":_=1;break;case"low":_=0}},this.setClearColor=function(e,t){d=e,m=t},this.setPixelRatio=function(){},this.setSize=function(e,t){r=e,i=t,s=r/2,a=i/2,N.setAttribute("viewBox",-s+" "+-a+" "+r+" "+i),N.setAttribute("width",r),N.setAttribute("height",i),y.min.set(-s,-a),y.max.set(s,a)},this.getSize=function(){return{width:r,height:i}},this.setPrecision=function(e){g=e},this.clear=function(){if(L(),"number"==typeof d){const e=function(e){const t={};return t.r=(e>>16&255)/255,t.g=(e>>8&255)/255,t.b=(255&e)/255,t}(d);N.style.backgroundColor=`rgba(${e.r}, ${e.g}, ${e.b}, ${m})`}else N.style.backgroundColor=d.getStyle()},this.render=function(r,i){if(i instanceof xi==!1)return void console.error("THREE.SVGRenderer.render: camera is not an instance of Camera.");const u=r.background;u&&u.isColor?(L(),N.style.backgroundColor=u.getStyle()):!0===this.autoClear&&this.clear(),v.info.render.vertices=0,v.info.render.faces=0,D.copy(i.matrixWorldInverse),C.multiplyMatrices(i.projectionMatrix,D),e=P.projectScene(r,i,this.sortObjects,this.sortElements),t=e.elements,n=e.lights,R.getNormalMatrix(i.matrixWorldInverse),function(e){w.setRGB(0,0,0),E.setRGB(0,0,0),S.setRGB(0,0,0);for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.color;n.isAmbientLight?(w.r+=r.r,w.g+=r.g,w.b+=r.b):n.isDirectionalLight?(E.r+=r.r,E.g+=r.g,E.b+=r.b):n.isPointLight&&(S.r+=r.r,S.g+=r.g,S.b+=r.b)}}(n),h="",p="";for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.material;if(void 0!==r&&0!==r.opacity)if(b.makeEmpty(),n instanceof uh)o=n,o.x*=s,o.y*=-a,F(o,n,r);else if(n instanceof ch)o=n.v1,l=n.v2,o.positionScreen.x*=s,o.positionScreen.y*=-a,l.positionScreen.x*=s,l.positionScreen.y*=-a,b.setFromPoints([o.positionScreen,l.positionScreen]),!0===y.intersectsBox(b)&&U(o,l,r);else if(n instanceof oh){if(o=n.v1,l=n.v2,c=n.v3,o.positionScreen.z<-1||o.positionScreen.z>1)continue;if(l.positionScreen.z<-1||l.positionScreen.z>1)continue;if(c.positionScreen.z<-1||c.positionScreen.z>1)continue;o.positionScreen.x*=s,o.positionScreen.y*=-a,l.positionScreen.x*=s,l.positionScreen.y*=-a,c.positionScreen.x*=s,c.positionScreen.y*=-a,this.overdraw>0&&(j(o.positionScreen,l.positionScreen,this.overdraw),j(l.positionScreen,c.positionScreen,this.overdraw),j(c.positionScreen,o.positionScreen,this.overdraw)),b.setFromPoints([o.positionScreen,l.positionScreen,c.positionScreen]),!0===y.intersectsBox(b)&&B(o,l,c,n,r)}}z(),r.traverseVisible((function(e){if(e.isSVGObject){if(I.setFromMatrixPosition(e.matrixWorld),I.applyMatrix4(C),I.z<-1||I.z>1)return;const t=I.x*s,n=-I.y*a,r=e.node;r.setAttribute("transform",`translate(${t}, ${n}) rotate(${e.rotation.z})`),N.appendChild(r)}}))}}}const mh={enableNavCube:!0,enableAxisGizmo:!0,enableToolbar:!0,enableBottomBar:!0,enableContextMenu:!0,enableSpinner:!0,containerId:"myCanvas",units:"meters"},fh={enableNavCube:!1,enableAxisGizmo:!1,enableToolbar:!1,enableBottomBar:!1,enableContextMenu:!1,containerId:"myCanvas"};function gh(e,t,n){return t in e?U(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _h=n(2668),vh=n.n(_h);let yh,bh;function xh(e){return{type:e}}!function(e){e[e.NONE=-1]="NONE",e[e.ROTATE=0]="ROTATE",e[e.DOLLY=1]="DOLLY",e[e.PAN=2]="PAN",e[e.TOUCH_ROTATE=3]="TOUCH_ROTATE",e[e.TOUCH_DOLLY=4]="TOUCH_DOLLY"}(yh||(yh={})),function(e){e.LEFT="ArrowLeft",e.UP="ArrowUp",e.RIGHT="ArrowRight",e.BOTTOM="ArrowDown"}(bh||(bh={}));const Th={movable:!1,startDistBetweenFingers:0,scale:1},wh=2*Math.PI,Eh=1e-6;class Sh extends Pt{constructor(e,t,n=!1){var r;super(),gh(this,"object",void 0),gh(this,"domElement",void 0),gh(this,"isVRMode",void 0),gh(this,"enabled",!0),gh(this,"target",new xn),gh(this,"enableZoom",!1),gh(this,"enablePan",!1),gh(this,"enableRotate",!0),gh(this,"state",yh.NONE),gh(this,"rotateSpeed",1),gh(this,"zoomSpeed",1),gh(this,"panSpeed",1),gh(this,"scale",1),gh(this,"minZoom",0),gh(this,"maxZoom",1/0),gh(this,"screenSpacePanning",!0),gh(this,"autoRotate",!0),gh(this,"controlsHelper",void 0),gh(this,"autoRotateSpeed",2),gh(this,"enableDamping",!1),gh(this,"dampingFactor",.05),gh(this,"minAzimuthAngle",-1/0),gh(this,"maxAzimuthAngle",1/0),gh(this,"minPolarAngle",0),gh(this,"maxPolarAngle",Math.PI),gh(this,"minDistance",0),gh(this,"maxDistance",1/0),gh(this,"keyPanSpeed",7),gh(this,"minFov",50),gh(this,"maxFov",95),gh(this,"zoomChanged",!1),gh(this,"panOffset",new xn),gh(this,"pointerPositions",{}),gh(this,"rotateStart",new Xt),gh(this,"rotateEnd",new Xt),gh(this,"rotateDelta",new Xt),gh(this,"dollyStart",new Xt),gh(this,"dollyEnd",new Xt),gh(this,"dollyDelta",new Xt),gh(this,"panStart",new Xt),gh(this,"panEnd",new Xt),gh(this,"panDelta",new Xt),gh(this,"pointers",[]),gh(this,"spherical",new yu),gh(this,"sphericalDelta",new yu),gh(this,"domElementKeyEvents",void 0),gh(this,"quat",void 0),gh(this,"update",function(e){const t=new xn,n=new xn,r=new bn;return function(){const i=e.quat,s=i.clone().invert(),a=e.object.position;t.copy(a).sub(e.target),t.applyQuaternion(i),e.spherical.setFromVector3(t),e.autoRotate&&e.state===yh.NONE&&(e.isVRMode?e.sphericalDelta.theta+=wh/60/60*e.autoRotateSpeed:e.sphericalDelta.theta-=wh/60/60*e.autoRotateSpeed),e.enableDamping?(e.spherical.theta+=e.sphericalDelta.theta*e.dampingFactor,e.spherical.phi+=e.sphericalDelta.phi*e.dampingFactor):(e.spherical.theta+=e.sphericalDelta.theta,e.spherical.phi+=e.sphericalDelta.phi);let o=e.minAzimuthAngle,l=e.maxAzimuthAngle;return isFinite(o)&&isFinite(l)&&(o<-Math.PI?o+=wh:o>Math.PI&&(o-=wh),l<-Math.PI?l+=wh:l>Math.PI&&(l-=wh),e.spherical.theta=o<=l?Math.max(o,Math.min(l,e.spherical.theta)):e.spherical.theta>(o+l)/2?Math.max(o,e.spherical.theta):Math.min(l,e.spherical.theta)),e.spherical.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,e.spherical.phi)),e.spherical.makeSafe(),e.spherical.radius*=e.scale,e.spherical.radius=Math.max(e.minDistance,Math.min(e.maxDistance,e.spherical.radius)),!0===e.enableDamping?e.target.addScaledVector(e.panOffset,e.dampingFactor):e.target.add(e.panOffset),t.setFromSpherical(e.spherical),t.applyQuaternion(s),a.copy(e.target).add(t),e.object.lookAt(e.target),!0===e.enableDamping?(e.sphericalDelta.theta*=1-e.dampingFactor,e.sphericalDelta.phi*=1-e.dampingFactor,e.panOffset.multiplyScalar(1-e.dampingFactor)):(e.sphericalDelta.set(0,0,0),e.panOffset.set(0,0,0)),e.scale=1,!!(e.zoomChanged||n.distanceToSquared(e.object.position)>Eh||8*(1-r.dot(e.object.quaternion))>Eh)&&(e.dispatchEvent(xh("change")),n.copy(e.object.position),r.copy(e.object.quaternion),e.zoomChanged=!1,!0)}}(this)),gh(this,"onContextMenu",(r=this,e=>{!1!==r.enabled&&e.preventDefault()})),gh(this,"onPointerDown",function(e){return t=>{!1!==e.enabled&&(0===e.pointers.length&&(e.domElement.setPointerCapture(t.pointerId),e.domElement.addEventListener("pointermove",e.onPointerMove),e.domElement.addEventListener("pointerup",e.onPointerUp)),e.addPointer(t),"touch"===t.pointerType?e.onTouchStart(t):e.onMouseDown(t))}}(this)),gh(this,"onPointerMove",function(e){return t=>{!1!==e.enabled&&("touch"===t.pointerType?e.onTouchMove(t):e.onMouseMove(t))}}(this)),gh(this,"onPointerUp",function(e){return t=>{e.removePointer(t),0===e.pointers.length&&(e.domElement.releasePointerCapture(t.pointerId),e.domElement.removeEventListener("pointermove",e.onPointerMove),e.domElement.removeEventListener("pointerup",e.onPointerUp)),"touch"===t.pointerType&&e.handlerTouchEnd(t),e.dispatchEvent(xh("end")),e.state=yh.NONE}}(this)),gh(this,"onPointerCancel",function(e){return t=>{e.removePointer(t),e.handlerTouchEnd(t)}}(this)),gh(this,"onMouseWheel",function(e){return t=>{!1!==e.enabled&&!1!==e.enableZoom&&e.state===yh.NONE&&(t.preventDefault(),t.stopPropagation(),e.dispatchEvent(xh("start")),e.handleMouseWheel(t),e.dispatchEvent(xh("end")))}}(this)),gh(this,"pan",function(e){const t=new xn;return function(n,r){const i=e.domElement;if(e.object instanceof Ti){const s=e.object.position;t.copy(s).sub(e.target);let a=t.length();a*=Math.tan(e.object.fov/2*Math.PI/180),e.panLeft(2*n*a/i.clientHeight,e.object.matrix),e.panUp(2*r*a/i.clientHeight,e.object.matrix)}else console.warn("WARNING: VRControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1}}(this)),gh(this,"panLeft",function(e){const t=new xn;return function(n,r){t.setFromMatrixColumn(r,0),t.multiplyScalar(-n),e.panOffset.add(t)}}(this)),gh(this,"panUp",function(e){const t=new xn;return function(n,r){!0===e.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(e.object.up,t)),t.multiplyScalar(n),e.panOffset.add(t)}}(this)),gh(this,"onKeyDown",(e=>{!1!==this.enabled&&!1!==this.enablePan&&this.handleKeyDown(e)})),this.object=e,this.domElement=t,this.isVRMode=n,this.quat=(new bn).setFromUnitVectors(this.object.up,new xn(0,1,0)),this.domElement&&this.domElement.style&&(this.domElement.style.touchAction="none"),this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerCancel),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this.domElementKeyEvents&&this.domElementKeyEvents.removeEventListener("keydown",this.onKeyDown)}addPointer(e){this.pointers.push(e)}removePointer(e){delete this.pointerPositions[e.pointerId];for(let n=0;n<this.pointers.length;n++){var t;if(this.pointers[n].pointerId==e.pointerId)return void S()(t=this.pointers).call(t,n,1)}}getDist(e,t){return vh()(t[0]-e[0],t[1]-e[1])}trackPointer(e){let t=this.pointerPositions[e.pointerId];void 0===t&&(t=new Xt,this.pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}onTouchStart(e){switch(this.trackPointer(e),this.pointers.length){case 1:if(!1===this.enableRotate)return;this.handleTouchStartRotate(),this.state=yh.TOUCH_ROTATE;break;case 2:this.handleTouchStartDolly(this.pointers),this.state=yh.TOUCH_DOLLY;break;default:this.state=yh.NONE}this.state!==yh.NONE&&this.dispatchEvent(xh("start"))}onMouseDown(e){switch(e.button){case 0:if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=yh.ROTATE;break;case 1:if(!1===this.enableZoom)return;this.handleMouseDownDolly(e),this.state=yh.DOLLY;break;case 2:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=yh.PAN}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=yh.ROTATE}break;default:this.state=yh.NONE}this.state!==yh.NONE&&this.dispatchEvent(xh("start"))}onTouchMove(e){switch(this.trackPointer(e),this.state){case yh.TOUCH_ROTATE:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e);break;case yh.TOUCH_DOLLY:this.handleTouchMoveDolly(e)}}onMouseMove(e){if(!1!==this.enabled)switch(this.state){case yh.ROTATE:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case yh.DOLLY:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e);break;case yh.PAN:if(!1===this.enablePan)return;this.handleMouseMovePan(e)}}handlerTouchEnd(e){Th.movable=!1,Th.scale=1}handleMouseWheel(e){const t=Math.pow(.95,this.zoomSpeed);e.deltaY<0?this.dollyIn(t):e.deltaY>0&&this.dollyOut(t),this.update()}handleMouseDownRotate(e){this.rotateStart.set(e.clientX,e.clientY)}handleMouseDownDolly(e){this.dollyStart.set(e.clientX,e.clientY)}handleMouseDownPan(e){this.panStart.set(e.clientX,e.clientY)}handleTouchStartRotate(){if(1===this.pointers.length)this.rotateStart.set(this.pointers[0].pageX,this.pointers[0].pageY);else{const e=.5*(this.pointers[0].pageX+this.pointers[1].pageX),t=.5*(this.pointers[0].pageY+this.pointers[1].pageY);this.rotateStart.set(e,t)}}handleTouchStartDolly(e){if(e.length<2)return;const t=e[0],n=e[1];Th.startDistBetweenFingers=this.getDist([t.pageX,t.pageY],[n.pageX,n.pageY]),Th.movable=!0,Th.scale=1}updateRotate(){const e=this.isVRMode,t=this.sphericalDelta;this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;e?(t.theta+=2*Math.PI*this.rotateDelta.x/n.clientHeight,t.phi+=2*Math.PI*this.rotateDelta.y/n.clientHeight):(t.theta-=2*Math.PI*this.rotateDelta.x/n.clientHeight,t.phi-=2*Math.PI*this.rotateDelta.y/n.clientHeight),this.rotateStart.copy(this.rotateEnd)}handleMouseMoveRotate(e){this.rotateEnd.set(e.clientX,e.clientY),this.updateRotate()}dollyOut(e){this.object instanceof Ti?this.scale/=e:(console.warn("WARNING: VRControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}dollyIn(e){this.object instanceof Ti?this.scale*=e:(console.warn("WARNING: VRControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}handleMouseMoveDolly(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart);const t=Math.pow(.95,this.zoomSpeed);this.dollyDelta.y>0?this.dollyOut(t):this.dollyIn(t),this.dollyStart.copy(this.dollyEnd)}handleMouseMovePan(e){this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}getSecondPointerPosition(e){const t=e.pointerId===this.pointers[0].pointerId?this.pointers[1]:this.pointers[0];return this.pointerPositions[t.pointerId]}handleTouchMoveRotate(e){if(1==this.pointers.length)this.rotateEnd.set(e.pageX,e.pageY);else{const t=this.getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this.rotateEnd.set(n,r)}this.updateRotate()}updateFov(e){const t=this.object;if(!(t&&t instanceof Ti))return void console.warn("WARNING: VRControls.js encountered an unknown camera type - updateFov disabled.");const n=this.minFov,r=this.maxFov,i=e=>{let i=t.fov+e;i=Math.min(i,r),i=Math.max(i,n),t.fov!==i&&(t.fov=i,t.updateProjectionMatrix(),this.dispatchEvent({type:"change"}))},s=e/20;for(let e=0;e<20;++e)Re()((()=>i(s)),5*e);var a;this.autoRotate&&(null===(a=this.controlsHelper)||void 0===a||a.delayAutoRotate())}handleTouchMoveDolly(e){if(!Th.movable||this.pointers.length<2)return;const t=this.getSecondPointerPosition(e),n=[e.pageX,e.pageY],r=[t.x,t.y],i=Th.startDistBetweenFingers,s=this.getDist(n,r);if(!i||!s||Math.abs(i-s)<10)return;let a=s/i;console.log(a);a=Math.min(a,3),a=Math.max(a,1/3);const o=a-Th.scale;if(Math.abs(o)<.05)return;let l=0;l=o>0?10*-o:10*(Th.scale/a-1),this.updateFov(l),Th.scale=a}handleKeyDown(e){let t=!1;switch(e.code){case bh.UP:this.pan(0,this.keyPanSpeed),t=!0;break;case bh.BOTTOM:this.pan(0,-this.keyPanSpeed),t=!0;break;case bh.LEFT:this.pan(this.keyPanSpeed,0),t=!0;break;case bh.RIGHT:this.pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}listenToKeyEvents(e){e.addEventListener("keydown",this.onKeyDown),this.domElementKeyEvents=e}}const Ih=!1,Mh=!1,Ah=10,Rh=11,Dh="gemini-viewer-icon",Ch="keydown",Oh="keyup",Ph="mousemove",Nh="mouseup",Lh="mousedown",kh="Escape",Fh="Enter",Uh="axis-section-plane",Bh="axis-section-plane-control",jh="section-plane",Gh="section-plane-control",zh="section-box",Vh="plane-section-boxface",Hh=-1e3;let qh;!function(e){e.ObjectsBoxSection="ObjectsBoxSection",e.PickPlaneSection="PickPlaneSection",e.AxisPlaneSection="AxisPlaneSection"}(qh||(qh={}));var Wh=n(57647),Yh=n.n(Wh),Xh=n(52020),$h=n.n(Xh),Kh=n(88546),Zh=n.n(Kh),Jh=n(66775),Qh=n.n(Jh),ep=n(31082),tp=n.n(ep),np=n(39290),rp=n.n(np),ip=n(13464),sp=n.n(ip),ap=n(44923),op=n.n(ap),lp=n(91829),cp=n.n(lp),up=n(50429),hp=n.n(up),pp=n(34652),dp=n.n(pp),mp=n(9873),fp=n.n(mp),gp=n(24835),_p=n(61539),vp=n.n(_p),yp=n(53706),bp=n.n(yp),xp=n(55641),Tp=n(39272),wp=n.n(Tp),Ep=n(52472),Sp=n.n(Ep);function Ip(e){return Ip="function"==typeof Ep&&"symbol"==typeof D?function(e){return typeof e}:function(e){return e&&"function"==typeof Ep&&e.constructor===Ep&&e!==Ep.prototype?"symbol":typeof e},Ip(e)}function Mp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ap(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),U(e,r.key,r)}}function Rp(e,t,n){return t&&Ap(e.prototype,t),n&&Ap(e,n),U(e,"prototype",{writable:!1}),e}function Dp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Cp=n(3841),Op=n.n(Cp),Pp=n(92984),Np=n.n(Pp);function Lp(e,t){return Lp=Pp||function(e,t){return e.__proto__=t,e},Lp(e,t)}function kp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Cp(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),U(e,"prototype",{writable:!1}),t&&Lp(e,t)}function Fp(e,t){if(t&&("object"===Ip(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Dp(e)}function Up(e){return Up=Pp?Tp:function(e){return e.__proto__||Tp(e)},Up(e)}function Bp(e,t,n){return t in e?U(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jp,Gp=n(19389);function zp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vp(e){return function(e){if(b(e))return e}(e)||function(e){if(void 0!==Ep&&null!=Gp(e)||null!=e["@@iterator"])return k(e)}(e)||function(e,t){var n;if(e){if("string"==typeof e)return zp(e,t);var r=I(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?k(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zp(e,t):void 0}}(e)||function(){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 Hp(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function qp(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=Hp(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=Hp(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}var Wp={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Yp=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Mp(this,e),this.init(t,n)}return Rp(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Wp,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){var i,s;return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]=ye(i=ye(s="".concat(n)).call(s,this.prefix," ")).call(i,e[0])),this.logger[t](e))}},{key:"create",value:function(t){var n;return new e(this.logger,qp(qp({},{prefix:ye(n="".concat(this.prefix,":")).call(n,t,":")}),this.options))}}]),e}(),Xp=new Yp,$p=function(){function e(){Mp(this,e),this.observers={}}return Rp(e,[{key:"on",value:function(e,t){var n,r=this;return fe(n=e.split(" ")).call(n,(function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){var n;this.observers[e]&&(t?this.observers[e]=oe(n=this.observers[e]).call(n,(function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i,s=ye(i=[]).call(i,this.observers[e]);fe(s).call(s,(function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var a,o=ye(a=[]).call(a,this.observers["*"]);fe(o).call(o,(function(t){var r;t.apply(t,ye(r=[e]).call(r,n))}))}}}]),e}();function Kp(){var e,t,n=new _((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function Zp(e){return null==e?"":""+e}function Jp(e,t,n){fe(e).call(e,(function(e){t[e]&&(n[e]=t[e])}))}function Qp(e,t,n){var r;function i(e){return e&&T(e).call(e,"###")>-1?e.replace(/###/g,"."):e}function s(){return!e||"string"==typeof e}for(var a="string"!=typeof t?ye(r=[]).call(r,t):t.split(".");a.length>1;){if(s())return{};var o=i(a.shift());!e[o]&&n&&(e[o]=new n),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return s()?{}:{obj:e,k:i(a.shift())}}function ed(e,t,n){var r=Qp(e,t,Object);r.obj[r.k]=n}function td(e,t){var n=Qp(e,t),r=n.obj,i=n.k;if(r)return r[i]}function nd(e,t,n){var r=td(e,n);return void 0!==r?r:td(t,n)}function rd(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):rd(e[r],t[r],n):e[r]=t[r]);return e}function id(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var sd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function ad(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return sd[e]})):e}var od="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&T(jp=window.navigator.userAgent).call(jp,"MSIE")>-1,ld=[" ",",","?","!",";"];function cd(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=cd(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=cd(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}function hd(e){var t=function(){if("undefined"==typeof Reflect||!gp)return!1;if(gp.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gp(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Up(e);if(t){var i=Up(this).constructor;n=gp(r,arguments,i)}else n=r.apply(this,arguments);return Fp(this,n)}}function pd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,s=0;s<r.length;++s){if(!i)return;if("string"==typeof i[r[s]]&&s+1<r.length)return;if(void 0===i[r[s]]){for(var a=2,o=I(r).call(r,s,s+a).join(n),l=i[o];void 0===l&&r.length>s+a;)a++,l=i[o=I(r).call(r,s,s+a).join(n)];if(void 0===l)return;if(_p(t).call(t,o)){if("string"==typeof l)return l;if(o&&"string"==typeof l[o])return l[o]}var c=I(r).call(r,s+a).join(n);return c?pd(l,c,n):void 0}i=i[r[s]]}return i}}var dd=function(e){kp(n,e);var t=hd(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Mp(this,n),r=t.call(this),od&&$p.call(Dp(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return Rp(n,[{key:"addNamespaces",value:function(e){var t;T(t=this.options.ns).call(t,e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t,n,r=T(t=this.options.ns).call(t,e);r>-1&&E(n=this.options.ns).call(n,r,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=ye(a).call(a,n)),n&&"string"==typeof n&&(a=ye(a).call(a,i?n.split(i):n)),T(e).call(e,".")>-1&&(a=e.split("."));var o=td(this.data,a);return o||!s||"string"!=typeof n?o:pd(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[e,t];n&&(a=ye(a).call(a,s?n.split(s):n)),T(e).call(e,".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),ed(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];T(e).call(e,".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var o=td(this.data,a)||{};r?rd(o,n,i):o=ud(ud({},o),n),ed(this.data,a,o),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?ud(ud({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e),n=t&&J(t)||[];return!!Ee(n).call(n,(function(e){return t[e]&&J(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}($p),md={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var s=this;return fe(e).call(e,(function(e){s.processors[e]&&(t=s.processors[e].process(t,n,r,i))})),t}};function fd(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function gd(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=fd(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=fd(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}function _d(e){var t=function(){if("undefined"==typeof Reflect||!gp)return!1;if(gp.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gp(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Up(e);if(t){var i=Up(this).constructor;n=gp(r,arguments,i)}else n=r.apply(this,arguments);return Fp(this,n)}}var vd={},yd=function(e){kp(n,e);var t=_d(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Mp(this,n),r=t.call(this),od&&$p.call(Dp(r)),Jp(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Dp(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=Xp.create("translator"),r}return Rp(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],s=n&&T(e).call(e,n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=oe(ld).call(ld,(function(e){return T(t).call(t,e)<0&&T(n).call(n,e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(K(r).call(r,(function(e){return"?"===e?"\\?":e})).join("|"),")")),s=!i.test(e);if(!s){var a=T(e).call(e,n);a>0&&!i.test(e.substring(0,a))&&(s=!0)}return s}(e,n,r));if(s&&!a){var o,l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:i};var c=e.split(n);(n!==r||n===r&&T(o=this.options.ns).call(o,c[0])>-1)&&(i=c.shift()),e=c.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==Ip(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";b(e)||(e=[String(e)]);var s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],t),l=o.key,c=o.namespaces,u=c[c.length-1],h=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(p){var d,m,f,g,_=t.nsSeparator||this.options.nsSeparator;return s?(v.res=ye(f=ye(g="".concat(u)).call(g,_)).call(f,l),v):ye(d=ye(m="".concat(u)).call(m,_)).call(d,l)}return s?(v.res=l,v):l}var v=this.resolve(e,t),y=v&&v.res,x=v&&v.usedKey||l,w=v&&v.exactUsedKey||l,E=Object.prototype.toString.apply(y),S=["[object Number]","[object Function]","[object RegExp]"],I=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,A="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(M&&y&&A&&T(S).call(S,E)<0&&("string"!=typeof I||"[object Array]"!==E)){if(!t.returnObjects&&!this.options.returnObjects){var R;this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,y,gd(gd({},t),{},{ns:c})):ye(R="key '".concat(l," (")).call(R,this.language,")' returned an object instead of string.");return s?(v.res=D,v):D}if(a){var C="[object Array]"===E,O=C?[]:{},P=C?w:x;for(var N in y)if(Object.prototype.hasOwnProperty.call(y,N)){var L,k,F=ye(L=ye(k="".concat(P)).call(k,a)).call(L,N);O[N]=this.translate(F,gd(gd({},t),{joinArrays:!1,ns:c})),O[N]===F&&(O[N]=y[N])}y=O}}else if(M&&"string"==typeof I&&"[object Array]"===E)(y=y.join(I))&&(y=this.extendTranslation(y,e,t,r));else{var U,B=!1,j=!1,G=void 0!==t.count&&"string"!=typeof t.count,z=n.hasDefaultValue(t),V=G?this.pluralResolver.getSuffix(h,t.count,t):"",H=t["defaultValue".concat(V)]||t.defaultValue;!this.isValidLookup(y)&&z&&(B=!0,y=H),this.isValidLookup(y)||(j=!0,y=l);var q=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,W=q&&j?void 0:y,Y=z&&H!==y&&this.options.updateMissing;if(j||B||Y){if(this.logger.log(Y?"updateKey":"missingKey",h,u,l,Y?H:y),a){var X=this.resolve(l,gd(gd({},t),{},{keySeparator:!1}));X&&X.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var $=[],K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&K&&K[0])for(var Z=0;Z<K.length;Z++)$.push(K[Z]);else"all"===this.options.saveMissingTo?$=this.languageUtils.toResolveHierarchy(t.lng||this.language):$.push(t.lng||this.language);var J=function(e,n,r){var s=z&&r!==y?r:W;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,s,Y,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,s,Y,t),i.emit("missingKey",e,u,n,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&G?fe($).call($,(function(e){var n;fe(n=i.pluralResolver.getSuffixes(e,t)).call(n,(function(n){J([e],l+n,t["defaultValue".concat(n)]||H)}))})):J($,l,H))}y=this.extendTranslation(y,e,t,v,r),j&&y===l&&this.options.appendNamespaceToMissingKey&&(y=ye(U="".concat(u,":")).call(U,l)),(j||B)&&this.options.parseMissingKeyHandler&&(y="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(l,B?y:void 0):this.options.parseMissingKeyHandler(y))}return s?(v.res=y,v):y}},{key:"extendTranslation",value:function(e,t,n,r,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,gd(gd({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(gd(gd({},n),{interpolation:gd(gd({},this.options.interpolation),n.interpolation)}));var a,o="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(o){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=gd(gd({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),o){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return i&&i[0]===r[0]&&!n.context?(s.logger.warn(ye(o="It seems you are nesting recursively key: ".concat(r[0]," in key: ")).call(o,t[0])),null):s.translate.apply(s,ye(r).call(r,[t]))}),n)),n.interpolation&&this.interpolator.reset()}var h=n.postProcess||this.options.postProcess,p="string"==typeof h?[h]:h;return null!=e&&p&&p.length&&!1!==n.applyPostProcessor&&(e=md.handle(p,e,t,this.options&&this.options.postProcessPassResolved?gd({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,s,a=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),fe(e).call(e,(function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,o),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=ye(u).call(u,a.options.fallbackNS));var h=void 0!==o.count&&"string"!=typeof o.count,p=h&&!o.ordinal&&0===o.count&&a.pluralResolver.shouldUseIntlApi(),d=void 0!==o.context&&("string"==typeof o.context||"number"==typeof o.context)&&""!==o.context,m=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);fe(u).call(u,(function(e){var l;if(!a.isValidLookup(t)){var u,f,g;if(s=e,!vd[ye(l="".concat(m[0],"-")).call(l,e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(s))vd[ye(u="".concat(m[0],"-")).call(u,e)]=!0,a.logger.warn(ye(f=ye(g='key "'.concat(n,'" for languages "')).call(g,m.join(", "),'" won\'t get resolved as namespace "')).call(f,s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");fe(m).call(m,(function(n){if(!a.isValidLookup(t)){i=n;var s,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,o);else{var u;h&&(u=a.pluralResolver.getSuffix(n,o.count,o));var m="_zero";if(h&&(l.push(c+u),p&&l.push(c+m)),d){var f,g,_=ye(f=ye(g="".concat(c)).call(g,a.options.contextSeparator)).call(f,o.context);l.push(_),h&&(l.push(_+u),p&&l.push(_+m))}}for(;s=l.pop();)a.isValidLookup(t)||(r=s,t=a.getResource(n,e,s,o))}}))}}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:s}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}($p);function bd(e){return e.charAt(0).toUpperCase()+I(e).call(e,1)}var xd=function(){function e(t){Mp(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xp.create("languageUtils")}return Rp(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||T(e).call(e,"-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||T(e).call(e,"-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&T(e).call(e,"-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=K(n).call(n,(function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),T(t).call(t,n[1].toLowerCase())>-1&&(n[1]=bd(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),T(t).call(t,n[1].toLowerCase())>-1&&(n[1]=bd(n[1].toLowerCase())),T(t).call(t,n[2].toLowerCase())>-1&&(n[2]=bd(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){var t;return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||T(t=this.supportedLngs).call(t,e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(fe(e).call(e,(function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&fe(e).call(e,(function(e){var r;if(!t){var i=n.getLanguagePartFromCode(e);if(n.isSupportedCode(i))return t=i;t=Ee(r=n.options.supportedLngs).call(r,(function(e){if(0===T(e).call(e,i))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],s=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&T(e).call(e,"-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),fe(r).call(r,(function(e){T(i).call(i,e)<0&&s(n.formatLanguageCode(e))})),i}}]),e}(),Td=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],wd={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},Ed=["v1","v2","v3"],Sd={zero:0,one:1,two:2,few:3,many:4,other:5};function Id(){var e={};return fe(Td).call(Td,(function(t){var n;fe(n=t.lngs).call(n,(function(n){e[n]={numbers:t.nr,plurals:wd[t.fc]}}))})),e}var Md=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Mp(this,e),this.languageUtils=t,this.options=n,this.logger=Xp.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Id()}return Rp(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return K(n=this.getSuffixes(e,r)).call(n,(function(e){var n;return ye(n="".concat(t)).call(n,e)}))}},{key:"getSuffixes",value:function(e){var t,n,r,i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.getRule(e,s);return a?this.shouldUseIntlApi()?K(n=ne(r=a.resolvedOptions().pluralCategories).call(r,(function(e,t){return Sd[e]-Sd[t]}))).call(n,(function(e){var t;return ye(t="".concat(i.options.prepend)).call(t,e)})):K(t=a.numbers).call(t,(function(t){return i.getSuffix(e,t,s)})):[]}},{key:"getSuffix",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getRule(e,r);return i?this.shouldUseIntlApi()?ye(n="".concat(this.options.prepend)).call(n,i.select(t)):this.getSuffixRetroCompatible(i,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var s=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!lp(Ed).call(Ed,this.options.compatibilityJSON)}}]),e}();function Ad(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rd(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=Ad(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=Ad(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}var Dd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Mp(this,e),this.logger=Xp.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Rp(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:ad,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?id(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?id(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?id(t.nestingPrefix):t.nestingPrefixEscaped||id("$t("),this.nestingSuffix=t.nestingSuffix?id(t.nestingSuffix):t.nestingSuffixEscaped||id(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e,t,n,r,i,s=ye(e="".concat(this.prefix,"(.+?)")).call(e,this.suffix);this.regexp=new RegExp(s,"g");var a=ye(t=ye(n=ye(r="".concat(this.prefix)).call(r,this.unescapePrefix,"(.+?)")).call(n,this.unescapeSuffix)).call(t,this.suffix);this.regexpUnescape=new RegExp(a,"g");var o=ye(i="".concat(this.nestingPrefix,"(.+?)")).call(i,this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,s,a,o=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){var i,s;if(T(e).call(e,o.formatSeparator)<0){var a=nd(t,l,e);return o.alwaysFormat?o.format(a,void 0,n,Rd(Rd(Rd({},r),t),{},{interpolationkey:e})):a}var c=e.split(o.formatSeparator),u=se(i=c.shift()).call(i),h=se(s=c.join(o.formatSeparator)).call(s);return o.format(nd(t,l,u),h,n,Rd(Rd(Rd({},r),t),{},{interpolationkey:u}))};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,d=[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return o.escapeValue?c(o.escape(e)):c(e)}}];return fe(d).call(d,(function(t){for(a=0;i=t.regex.exec(e);){var n,l=se(n=i[1]).call(n);if(void 0===(s=u(l)))if("function"==typeof h){var c=h(e,i,r);s="string"==typeof c?c:""}else if(r&&r.hasOwnProperty(l))s="";else{if(p){s=i[0];continue}var d;o.logger.warn(ye(d="missed to pass in variable ".concat(l," for interpolating ")).call(d,e)),s=""}else"string"==typeof s||o.useRawValueToEscape||(s=Zp(s));var m=t.safeValue(s);if(e=e.replace(i[0],m),p?(t.regex.lastIndex+=m.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=o.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Rd({},s);function o(e,t){var n=this.nestingOptionsSeparator;if(T(e).call(e,n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=Rd(Rd({},t),a))}catch(t){var s,o;return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),ye(s=ye(o="".concat(e)).call(o,n)).call(s,i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l,c,u,h=[],p=!1;if(-1!==T(l=n[0]).call(l,this.formatSeparator)&&!/{.*}/.test(n[1])){var d,m=K(d=n[1].split(this.formatSeparator)).call(d,(function(e){return se(e).call(e)}));n[1]=m.shift(),h=m,p=!0}if((r=t(o.call(this,se(c=n[1]).call(c),a),a))&&n[0]===e&&"string"!=typeof r)return r;if("string"!=typeof r&&(r=Zp(r)),!r)this.logger.warn(ye(u="missed to resolve ".concat(n[1]," for nesting ")).call(u,e)),r="";p&&(r=yp(h).call(h,(function(e,t){var r;return i.format(e,t,s.lng,Rd(Rd({},s),{},{interpolationkey:se(r=n[1]).call(r)}))}),se(r).call(r))),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Cd(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function Od(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=Cd(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=Cd(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}var Pd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Mp(this,e),this.logger=Xp.create("formatter"),this.options=t,this.formats={number:function(e,t,n){return new Intl.NumberFormat(t,n).format(e)},currency:function(e,t,n){return new Intl.NumberFormat(t,Od(Od({},n),{},{style:"currency"})).format(e)},datetime:function(e,t,n){return new Intl.DateTimeFormat(t,Od({},n)).format(e)},relativetime:function(e,t,n){return new Intl.RelativeTimeFormat(t,Od({},n)).format(e,n.range||"day")},list:function(e,t,n){return new Intl.ListFormat(t,Od({},n)).format(e)}},this.init(t)}return Rp(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){var n;this.formats[se(n=e.toLowerCase()).call(n)]=t}},{key:"format",value:function(e,t,n,r){var i=this,s=t.split(this.formatSeparator);return yp(s).call(s,(function(e,t){var s=function(e){var t,n=se(t=e.toLowerCase()).call(t),r={};if(T(e).call(e,"(")>-1){var i,s=e.split("(");n=se(i=s[0].toLowerCase()).call(i);var a=s[1].substring(0,s[1].length-1);if("currency"===n&&T(a).call(a,":")<0)r.currency||(r.currency=se(a).call(a));else if("relativetime"===n&&T(a).call(a,":")<0)r.range||(r.range=se(a).call(a));else{var o=a.split(";");fe(o).call(o,(function(e){if(e){var t=Vp(e.split(":")),n=t[0],i=I(t).call(t,1).join(":");r[se(n).call(n)]||(r[se(n).call(n)]=se(i).call(i)),"false"===se(i).call(i)&&(r[se(n).call(n)]=!1),"true"===se(i).call(i)&&(r[se(n).call(n)]=!0),isNaN(se(i).call(i))||(r[se(n).call(n)]=N(se(i).call(i),10))}}))}}return{formatName:n,formatOptions:r}}(t),a=s.formatName,o=s.formatOptions;if(i.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[a](e,u,Od(Od(Od({},o),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}();function Nd(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ld(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=Nd(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=Nd(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}function kd(e){var t=function(){if("undefined"==typeof Reflect||!gp)return!1;if(gp.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gp(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Up(e);if(t){var i=Up(this).constructor;n=gp(r,arguments,i)}else n=r.apply(this,arguments);return Fp(this,n)}}var Fd=function(e){kp(n,e);var t=kd(n);function n(e,r,i){var s,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Mp(this,n),s=t.call(this),od&&$p.call(Dp(s)),s.backend=e,s.store=r,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=Xp.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,a.backend,a),s}return Rp(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,s={},a={},o={},l={};return fe(e).call(e,(function(e){var r=!0;fe(t).call(t,(function(t){var o,c=ye(o="".concat(e,"|")).call(o,t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[c]=2:i.state[c]<0||(1===i.state[c]?void 0===a[c]&&(a[c]=!0):(i.state[c]=1,r=!1,void 0===a[c]&&(a[c]=!0),void 0===s[c]&&(s[c]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(o[e]=!0)})),(J(s).length||J(a).length)&&this.queue.push({pending:a,pendingCount:J(a).length,loaded:{},errors:[],callback:r}),{toLoad:J(s),pending:J(a),toLoadLanguages:J(o),toLoadNamespaces:J(l)}}},{key:"loaded",value:function(e,t,n){var r,i,s=e.split("|"),a=s[0],o=s[1];t&&this.emit("failedLoading",a,o,t),n&&this.store.addResourceBundle(a,o,n),this.state[e]=t?-1:2;var l={};fe(r=this.queue).call(r,(function(n){var r,i,s,c,u,h,p,d;(r=n.loaded,i=o,u=Qp(r,[a],Object),h=u.obj,p=u.k,h[p]=h[p]||[],s&&(h[p]=ye(c=h[p]).call(c,i)),s||h[p].push(i),function(e,t){delete e.pending[t],e.pendingCount--}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done)||(fe(d=J(n.loaded)).call(d,(function(e){l[e]||(l[e]={});var t=J(l[e]);t.length&&fe(t).call(t,(function(n){void 0!==t[n]&&(l[e][n]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",l),this.queue=oe(i=this.queue).call(i,(function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:s,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(o,l){if(o&&l&&i<5)Ae((function(){r.read.call(r,e,t,n,i+1,2*s,a)}),s);else{if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a(o,l)}}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,i,s);if(!a.toLoad.length)return a.pending.length||s(),null;fe(n=a.toLoad).call(n,(function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(function(r,a){var o,l,c,u;r&&t.logger.warn(ye(o=ye(l="".concat(n,"loading namespace ")).call(l,s," for language ")).call(o,i," failed"),r),!r&&a&&t.logger.log(ye(c=ye(u="".concat(n,"loaded namespace ")).call(u,s," for language ")).call(c,i),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var s,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn(ye(s='did not save key "'.concat(n,'" as the namespace "')).call(s,t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,Ld(Ld({},a),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}($p);function Ud(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Ip(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Ip(e[2])||"object"===Ip(e[3])){var n,r=e[3]||e[2];fe(n=J(r)).call(n,(function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Bd(e){var t,n;("string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&T(t=e.supportedLngs).call(t,"cimode")<0)&&(e.supportedLngs=ye(n=e.supportedLngs).call(n,["cimode"]));return e}function jd(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)fe(n=jd(Object(r),!0)).call(n,(function(t){Bp(e,t,r[t])}));else if(Jh)X(e,Jh(r));else{var i;fe(i=jd(Object(r))).call(i,(function(t){U(e,t,Kh(r,t))}))}}return e}function zd(e){var t=function(){if("undefined"==typeof Reflect||!gp)return!1;if(gp.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gp(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Up(e);if(t){var i=Up(this).constructor;n=gp(r,arguments,i)}else n=r.apply(this,arguments);return Fp(this,n)}}function Vd(){}function Hd(e){var t=xp(Tp(e));fe(t).call(t,(function(t){var n;"function"==typeof e[t]&&(e[t]=_e(n=e[t]).call(n,e))}))}var qd=function(e){kp(n,e);var t=zd(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Mp(this,n),e=t.call(this),od&&$p.call(Dp(e)),e.options=Bd(r),e.services={},e.logger=Xp,e.modules={external:[]},Hd(Dp(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),Fp(e,Dp(e));Ae((function(){e.init(r,i)}),0)}return e}return Rp(n,[{key:"init",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;("function"==typeof n&&(r=n,n={}),!n.defaultNS&&n.ns)&&("string"==typeof n.ns?n.defaultNS=n.ns:T(e=n.ns).call(e,"translation")<0&&(n.defaultNS=n.ns[0]));var i=Ud();function s(e){return e?"function"==typeof e?new e:e:null}if(this.options=Gd(Gd(Gd({},i),this.options),Bd(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Gd(Gd({},i.interpolation),this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){var a,o,l;this.modules.logger?Xp.init(s(this.modules.logger),this.options):Xp.init(null,this.options),this.modules.formatter?l=this.modules.formatter:"undefined"!=typeof Intl&&(l=Pd);var c=new xd(this.options);this.store=new dd(this.options.resources,this.options);var u,h=this.services;if(h.logger=Xp,h.resourceStore=this.store,h.languageUtils=c,h.pluralResolver=new Md(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format))h.formatter=s(l),h.formatter.init(h,this.options),this.options.interpolation.format=_e(u=h.formatter.format).call(u,h.formatter);h.interpolator=new Dd(this.options),h.utils={hasLoadedNamespace:_e(a=this.hasLoadedNamespace).call(a,this)},h.backendConnector=new Fd(s(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(function(e){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];t.emit.apply(t,ye(n=[e]).call(n,i))})),this.modules.languageDetector&&(h.languageDetector=s(this.modules.languageDetector),h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=s(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new yd(this.services,this.options),this.translator.on("*",(function(e){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];t.emit.apply(t,ye(n=[e]).call(n,i))})),fe(o=this.modules.external).call(o,(function(e){e.init&&e.init(t)}))}if(this.format=this.options.interpolation.format,r||(r=Vd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&"dev"!==p[0]&&(this.options.lng=p[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];fe(d).call(d,(function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}}));var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];fe(m).call(m,(function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var f=Kp(),g=function(){var e,n=function(e,n){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),f.resolve(n),r(e,n)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,_e(e=t.t).call(e,t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?g():Ae(g,0),f}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vd,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var s,a=[],o=function(e){if(e){var n=t.services.languageUtils.toResolveHierarchy(e);fe(n).call(n,(function(e){T(a).call(a,e)<0&&a.push(e)}))}};if(i)o(i);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);fe(l).call(l,(function(e){return o(e)}))}if(this.options.preload)fe(s=this.options.preload).call(s,(function(e){return o(e)}));this.services.backendConnector.load(a,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=Kp();return e||(e=this.languages),t||(t=this.options.ns),n||(n=Vd),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&md.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){var t;if(e&&this.languages&&!(T(t=["cimode","dev"]).call(t,e)>-1))for(var n=0;n<this.languages.length;n++){var r,i=this.languages[n];if(!(T(r=["cimode","dev"]).call(r,i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=Kp();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},s=function(s){e||s||!n.services.languageDetector||(s=[]);var a="string"==typeof s?s:n.services.languageUtils.getBestMatchFromCodes(s);a&&(n.language||i(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,s){s?(i(s),n.translator.changeLanguage(s),n.isLanguageChangingTo=void 0,n.emit("languageChanged",s),n.logger.log("languageChanged",s)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var s,a,o;if("object"!==Ip(i)){for(var l,c=arguments.length,u=new Array(c>2?c-2:0),h=2;h<c;h++)u[h-2]=arguments[h];o=r.options.overloadTranslationOptionHandler(ye(l=[t,i]).call(l,u))}else o=Gd({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns;var p=r.options.keySeparator||".",d=n?ye(s=ye(a="".concat(n)).call(a,p)).call(s,t):t;return r.t(d,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r,i=t.services.backendConnector.state[ye(r="".concat(e,"|")).call(r,n)];return-1===i||2===i};if(n.precheck){var o=n.precheck(this,a);if(void 0!==o)return o}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||i&&!a(s,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=Kp();return this.options.ns?("string"==typeof e&&(e=[e]),fe(e).call(e,(function(e){var t;T(t=n.options.ns).call(t,e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),_.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Kp();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=oe(e).call(e,(function(e){return T(r).call(r,e)<0}));return i.length?(this.options.preload=ye(r).call(r,i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),_.resolve())}},{key:"dir",value:function(e){var t;if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return T(n).call(n,this.services.languageUtils.getLanguagePartFromCode(e))>-1||T(t=e.toLowerCase()).call(t,"-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e,t,r=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vd,a=Gd(Gd(Gd({},this.options),i),{isClone:!0}),o=new n(a),l=["store","services","language"];return fe(l).call(l,(function(e){o[e]=r[e]})),o.services=Gd({},this.services),o.services.utils={hasLoadedNamespace:_e(e=o.hasLoadedNamespace).call(e,o)},o.translator=new yd(o.services,o.options),o.translator.on("*",(function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];o.emit.apply(o,ye(t=[e]).call(t,r))})),o.init(a,s),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:_e(t=o.hasLoadedNamespace).call(t,o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}($p);Bp(qd,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new qd(e,t)}));var Wd=qd.createInstance();Wd.createInstance=qd.createInstance;Wd.createInstance,Wd.init,Wd.loadResources,Wd.reloadResources,Wd.use,Wd.changeLanguage,Wd.getFixedT;var Yd=Wd.t,Xd=(Wd.exists,Wd.setDefaultNamespace,Wd.hasLoadedNamespace,Wd.loadNamespaces,Wd.loadLanguages,Wd),$d=function(){var e=0,t=document.createElement("div");function n(e){return t.appendChild(e.dom),e}function r(n){for(var r=0;r<t.children.length;r++)t.children[r].style.display=r===n?"block":"none";e=n}t.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",(function(n){n.preventDefault(),r(++e%t.children.length)}),!1);var i=Wh(),s=i,a=0,o=n(new $d.Panel("FPS","#0ff","#002")),l=n(new $d.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=n(new $d.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:t,addPanel:n,showPanel:r,begin:function(){i=Wh()},end:function(){a++;var e=Wh();if(l.update(e-i,200),e>=s+1e3&&(o.update(1e3*a/(e-s),100),s=e,a=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:t,setMode:r}};$d.Panel=function(e,t,n){var r=1/0,i=0,s=Math.round,a=s(window.devicePixelRatio||1),o=80*a,l=48*a,c=3*a,u=2*a,h=3*a,p=15*a,d=74*a,m=30*a,f=document.createElement("canvas");f.width=o,f.height=l,f.style.cssText="width:80px;height:48px";var g=f.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=n,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,c,u),g.fillRect(h,p,d,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(h,p,d,m),{dom:f,update:function(l,_){r=Math.min(r,l),i=Math.max(i,l),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,o,p),g.fillStyle=t,g.fillText(s(l)+" "+e+" ("+s(r)+"-"+s(i)+")",c,u),g.drawImage(f,h+a,p,d-a,m,h,p,d-a,m),g.fillRect(h+d-a,p,a,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(h+d-a,p,a,s((1-l/_)*m))}}};var Kd=$d;function Zd(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}class Jd{constructor(e,t,n=document.body){this.container=n,gh(this,"element",void 0),gh(this,"header",void 0),gh(this,"body",void 0),gh(this,"isFollowing",!1),gh(this,"diffX",0),gh(this,"diffY",0),gh(this,"start",(e=>{this.isFollowing=!0,this.diffX=e.clientX-this.element.offsetLeft,this.diffY=e.clientY-this.element.offsetTop})),gh(this,"stop",(()=>{this.isFollowing=!1})),gh(this,"follow",(e=>{if(!this.isFollowing)return;const t=e.clientX-this.diffX,n=e.clientY-this.diffY;t<this.container.offsetLeft?this.element.style.left=this.container.clientLeft+"px":t>this.container.clientWidth-this.element.clientWidth?this.element.style.left=this.container.clientWidth-this.element.clientWidth+"px":this.element.style.left=t+"px",n<this.container.offsetTop?this.element.style.top=this.container.clientTop+"px":n>this.container.clientHeight-this.element.clientHeight?this.element.style.top=this.container.clientHeight-this.element.clientHeight+"px":this.element.style.top=n+"px"})),this.element=document.createElement("div"),this.element.id=e,this.element.classList.add("pop-panel");const r=document.createElement("div");r.classList.add("pop-panel-header"),r.append(t),this.element.appendChild(r),this.header=r;const i=document.createElement("div");i.classList.add("pop-panel-body"),this.element.appendChild(i),this.body=i,r.addEventListener(Lh,this.start),r.addEventListener(Nh,this.stop),this.container.addEventListener(Ph,this.follow),this.container.appendChild(this.element)}destroy(){this.container.removeEventListener(Ph,this.follow),this.element.removeEventListener(Lh,this.start),this.element.removeEventListener(Nh,this.stop),this.container.removeChild(this.element)}}class Qd extends Jd{constructor(e){super("axis-section-pop-panel","轴向剖切",e),gh(this,"axis","x"),gh(this,"activeItem",void 0),gh(this,"groupSelectNode",void 0),gh(this,"activeSelectNode",void 0),gh(this,"isVisible",!0),gh(this,"eventBus",Zd()),this.createGroupSelectLayout(),this.addGroupSelectItems(),this.createActiveSelectLayout(),this.addActiveItems()}createGroupSelectLayout(){const e=document.createElement("div");e.classList.add("pop-panel-group-select"),this.body.appendChild(e),this.groupSelectNode=e}addGroupSelectItems(){const e=(e,t,n=!1)=>{const r=document.createElement("div");return r.classList.add("pop-panel-item"),r.setAttribute("itemName",e),r.append(t),n&&r.classList.add("active"),this.groupSelectNode&&this.groupSelectNode.appendChild(r),r},t=(e,t)=>s=>{s.stopPropagation(),this.activeItem!==e&&(n.classList.remove("active"),r.classList.remove("active"),i.classList.remove("active"),this.activeItem=e,t.classList.add("active"),this.eventBus.emit("axis",e))},n=e(Mm.X,"X",!0);n.onclick=t(Mm.X,n);const r=e(Mm.Y,"Y");r.onclick=t(Mm.Y,r);const i=e(Mm.Z,"Z");i.onclick=t(Mm.Z,i)}createActiveSelectLayout(){const e=document.createElement("div");e.classList.add("pop-panel-active-select"),this.body.appendChild(e),this.activeSelectNode=e}addActiveItems(){const e=(e,t)=>{const n=document.createElement("i");n.classList.add(Dh),n.classList.add(t),e.innerHTML="",e.appendChild(n)},t=((t,n,r="")=>{const i=document.createElement("div");return i.classList.add("pop-panel-item"),n&&i.setAttribute("title",n),i.setAttribute("itemName",t),i.setAttribute("isActive","false"),e(i,r),i})("visible","隐藏剖切面","icon-hidesectionplane");t.onclick=()=>{this.isVisible=!this.isVisible,this.isVisible?(e(t,"icon-hidesectionplane"),t.setAttribute("title","隐藏剖切面")):(e(t,"icon-showsectionplane"),t.setAttribute("title","显示剖切面")),this.eventBus.emit("visible",this.isVisible)}}}var em=n(35293),tm=n.n(em),nm=n(7488),rm=n.n(nm);const im=n(14179);im.setLevel("info");class sm extends Tr{constructor(e){super(),this.isSVGObject=!0,this.node=e}}const am="#7fffbf";let om;!function(e){e.Dot="Dot",e.Square="Square",e.Triangle="Triangle",e.Cross="Cross",e.Perpendicular="Perpendicular"}(om||(om={}));class lm{static createSVGObject(e){return new sm(e)}static createPointMarker(e=10){return lm.createSnapIcon(om.Dot,am,e,"#ffffff","2")}static createSnapIcon(e,t="none",n=10,r="#7fffbf",i="2"){const s=document.createElementNS("http://www.w3.org/2000/svg","path");let a=n,o="";switch(e){case om.Dot:a=n/3,o=`\n M ${-a}, 0\n a ${a}, ${a} 0 1, 0 ${2*a}, 0\n a ${a}, ${a} 0 1, 0 -${2*a}, 0\n `;break;case om.Square:a=n/1.2,o=`\n M ${-a/2}, ${-a/2}\n h ${a}\n v ${a}\n h ${-a}\n z\n `;break;case om.Triangle:a=n/2,o=`\n M 0, ${-a}\n L ${-.87*a}, ${a/2}\n L ${.87*a}, ${a/2}\n z\n `;break;case om.Cross:a=n/1.2,o=`\n M ${-a/2}, ${-a/2}\n L ${a/2}, ${a/2}\n M ${a/2}, ${-a/2}\n L ${-a/2}, ${a/2}\n `;break;case om.Perpendicular:a=n,o=`\n M 0, 0\n L ${-a/2}, 0\n M 0, 0\n L 0, ${a/2}\n M ${a/2}, ${a/2}\n L ${-a/2}, ${a/2}\n M ${-a/2}, ${a/2}\n L ${-a/2}, ${-a/2}\n `}s.setAttribute("d",o);const l=`fill: ${t}; stroke: ${r}; stroke-width: ${i};`;return s.setAttribute("style",l),this.createSVGObject(s)}static createLine(e=6,t="#fff000",n=2.5){const r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttribute("x1",""+-e),r.setAttribute("y1","0"),r.setAttribute("x2",`${e}`),r.setAttribute("y2","0");const i=`stroke: ${t}; stroke-width: ${n};`;return r.setAttribute("style",i),this.createSVGObject(r)}static createLabel(e,t="#ffffff",n=14,r=7){const i=document.createElementNS("http://www.w3.org/2000/svg","text");i.innerHTML=e,i.setAttribute("x","0"),i.setAttribute("y",`${r}`);const s=`font-size: ${n}; text-anchor: middle; fill: ${t};`;return i.setAttribute("style",s),this.createSVGObject(i)}}class cm{static isFullScreen(){return!!(document.fullscreenElement||document.mozFullScreenElement)}static fullScreen(e=document.documentElement){(e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen||e.msRequestFullscreen).call(e)}static exitFullscreen(){(document.exitFullscreen||document.mozCancelFullscreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)}static displayPointMarker(e,t,n=1e3,r=10){const i=lm.createPointMarker(r);return i.position.set(t.x,t.y,t.z),e.add(i),n&&Re()((()=>{e.remove(i)}),n),i}static joinStrings(...e){return e.join("")}static numberToString(e){let t=2;return Math.abs(e)<1e-6?t=2:Math.abs(e)<1e-5?t=7:Math.abs(e)<1e-4?t=6:Math.abs(e)<.001?t=5:Math.abs(e)<.01?t=4:Math.abs(e)<.1&&(t=3),e.toFixed(t)}static hexToBase64(e){var t;return btoa(Z()(t=e.match(/\w{2}/g)||[]).call(t,(function(e){return String.fromCharCode(L()(e,16))})).join(""))}static vectorToString(e){return e instanceof xn?`(${this.numberToString(e.x)}, ${this.numberToString(e.y)}, ${this.numberToString(e.z)})`:`(${this.numberToString(e.x)}, ${this.numberToString(e.y)})`}static arrayToVector2(e){return e?e instanceof Xt?e:x()(e)&&e.length>=2?new Xt(e[0],e[1]):void 0:e}static arrayToVector3(e){return e?e instanceof xn?e:x()(e)&&e.length>=2?new xn(e[0],e[1],e.length>2?e[2]:0):void 0:e}static arrayToEuler(e){return e?e instanceof or?e:x()(e)&&e.length>=3?new or(e[0],e[1],e[2]):void 0:e}static arrayOrObjectToVector3(e){if(!e)return e;if(e instanceof xn)return e;if(e instanceof Xt)return new xn(e.x,e.y,0);if(x()(e)&&e.length>=2)return new xn(e[0],e[1],e[2]||0);const t=e;return null!=t.x&&null!=t.y?new xn(t.x,t.y,t.z||0):void 0}static isVectorValid(e){let t=e&&!isNaN(e.x)&&!isNaN(e.y)&&isFinite(e.x)&&isFinite(e.y);return t&&e instanceof xn&&(t=!isNaN(e.z)&&isFinite(e.z)),t}static isBoxValid(e){return e&&!e.isEmpty()&&this.isVectorValid(e.min)&&this.isVectorValid(e.max)}static isMatrixValid(e){const t=e&&e.elements;if(!t||t.length<16)return!1;for(let e=0;e<16;++e){const n=t[e];if(tm()(n))return!1}return!0}static guid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}static expandBoxByScale(e,t){const n=new xn;e.getCenter(n);const r=(e.max.x-e.min.x)*t,i=(e.max.y-e.min.y)*t,s=(e.max.z-e.min.z)*t,a=new xn(n.x-r/2,n.y-i/2,n.z-s/2),o=new xn(n.x+r/2,n.y+i/2,n.z+s/2);e.set(a,o)}static expandBoxByMinSize(e,t){const n=new xn;e.getCenter(n);const r=e.max.x-e.min.x,i=e.max.y-e.min.y,s=e.max.z-e.min.z;r<t&&(e.min.setX(n.x-t/2),e.max.setX(n.x+t/2)),i<t&&(e.min.setY(n.y-t/2),e.max.setY(n.y+t/2)),s<t&&(e.min.setZ(n.z-t/2),e.max.setZ(n.z+t/2))}static generateRandomInt(e,t){return Math.floor(Math.random()*(t-e+1))+e}static roundNumber(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}static convertDecimalToHex(e){if(null==e)return"#ffffff";const t=e.toString(16);return`#${rm()(t).call(t,6,"0")}`}static canvasToImage(e){const t=e.toDataURL(),n=new Image;return n.src=t,new(v())((e=>{n.onload=function(){e(n)}}))}static printMemory(e){const t=performance.memory;if(!t)return void im.warn("[CommonUtils] performance.memory is not available in this browser");const n=(t.jsHeapSizeLimit/1048576).toFixed(2),r=(t.totalJSHeapSize/1048576).toFixed(2),i=(t.usedJSHeapSize/1048576).toFixed(2);im.info(`[CommonUtils] ${e}. jsHeapSizeLimit: ${n}M , totalJSHeapSize: ${r}M , usedJSHeapSize: ${i}M `)}}const um=(e,t,n)=>{const{default:r,active:i}=t;n?(e.remove(r),e.add(i||r)):(i&&e.remove(i),e.add(r))};class hm{constructor(e,t,n,r,i){gh(this,"object",void 0),gh(this,"camera",void 0),gh(this,"targetPixelHeight",100),gh(this,"canvasHeight",800),this.camera=e,this.object=n,this.targetPixelHeight=r,this.canvasHeight=i,this.adjustSize(),t.addEventListener("change",(()=>{this.adjustSize()}))}adjustSize(){const e=new En;if(this.object.updateMatrix(),e.expandByObject(this.object),!e)return;const t=e.max.x-e.min.x,n=this.camera.position.distanceTo(this.object.position),r=pm(t,n,this.canvasHeight);if(Math.abs(r-this.targetPixelHeight)<5)return;let i=this.object.scale.x;i*=this.targetPixelHeight/r,this.object.scale.set(i,i,i),this.object.updateMatrix()}}const pm=(e,t,n=800,r=45)=>{const i=r*(Math.PI/180);return n*(e/(2*Math.tan(i/2)*t))};var dm=n(31634),mm=n.n(dm);function fm(e,t=!1){const n=null!==e[0].index,r=new he(J(e[0].attributes)),i=new he(J(e[0].morphAttributes)),s={},a={},o=e[0].morphTargetsRelative,l=new Kr;let c=0;for(let u=0;u<e.length;++u){const h=e[u];let p=0;if(n!==(null!==h.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const e in h.attributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===s[e]&&(s[e]=[]),s[e].push(h.attributes[e]),p++}if(p!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". Make sure all geometries have the same number of attributes."),null;if(o!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const e in h.morphAttributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[e]&&(a[e]=[]),a[e].push(h.morphAttributes[e])}if(t){let e;if(n)e=h.index.count;else{if(void 0===h.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". The geometry must have either an index or a position attribute"),null;e=h.attributes.position.count}l.addGroup(c,e,u),c+=e}}if(n){let t=0;const n=[];for(let r=0;r<e.length;++r){const i=e[r].index;for(let e=0;e<i.count;++e)n.push(i.getX(e)+t);t+=e[r].attributes.position.count}l.setIndex(n)}for(const e in s){const t=gm(s[e]);if(!t)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+e+" attribute."),null;l.setAttribute(e,t)}for(const e in a){const t=a[e][0].length;if(0===t)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[e]=[];for(let n=0;n<t;++n){const t=[];for(let r=0;r<a[e].length;++r)t.push(a[e][r][n]);const r=gm(t);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+e+" morphAttribute."),null;l.morphAttributes[e].push(r)}}return l}function gm(e){let t,n,r,i=0;for(let s=0;s<e.length;++s){const a=e[s];if(a.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=a.array.length}const s=new t(i);let a=0;for(let t=0;t<e.length;++t)s.set(e[t].array,a),a+=e[t].array.length;return new Br(s,n,r)}let _m=4;const vm=new cn(0,.855,.718),ym=new cn(1,1,0),bm=new cn(1,0,0),xm=new cn(0,1,0),Tm=new cn(0,0,1);var wm;!function(e){e.None="",e.TranslateX="TranslateX",e.TranslateY="TranslateY",e.TranslateZ="TranslateZ",e.RotateX="RotateX",e.RotateY="RotateY",e.RotateZ="RotateZ"}(wm||(wm={}));class Em{constructor(e,t,n,r){gh(this,"isOpen",!1),gh(this,"scene",void 0),gh(this,"camera",void 0),gh(this,"renderer",void 0),gh(this,"controls",void 0),gh(this,"isSectionObjectVisible",!0),gh(this,"gizmo",new io),gh(this,"objectPixelSizeHelper",void 0),gh(this,"canvasHeight",800),gh(this,"boxMin",new xn),gh(this,"boxMax",new xn),gh(this,"group",new io),gh(this,"hoverGroup",new io),gh(this,"planes",[]),gh(this,"vertices",[new xn,new xn,new xn,new xn]),gh(this,"pointMarkers",[]),gh(this,"face",void 0),gh(this,"lines",[]),gh(this,"raycaster",new gu),gh(this,"mousePosition",new Xt),gh(this,"activeFace",void 0),gh(this,"activeMarker",void 0),gh(this,"isMouseDown",!1),gh(this,"activeActionType",wm.None),gh(this,"lastCanvasPos",void 0),gh(this,"onMouseMove",(e=>{if(!this.isSectionObjectVisible)return;const t=(e,t=!1)=>{var n;const r=Se()(n=this.gizmo.children).call(n,(t=>t.userData.actionType===e));if(!r||0===r.children.length)return;const i=r.children[0].material,s=r.children.length>1?r.children[1]:void 0;t?(i.color.set(ym),e!==wm.RotateX&&e!==wm.RotateY&&e!==wm.RotateZ||s&&(s.visible=!0)):e===wm.TranslateX?i.color.set(bm):e===wm.TranslateY?i.color.set(xm):e===wm.TranslateZ?i.color.set(Tm):e===wm.RotateX?(i.color.set(bm),s&&(s.visible=!1)):e===wm.RotateY?(i.color.set(xm),s&&(s.visible=!1)):e===wm.RotateZ&&(i.color.set(Tm),s&&(s.visible=!1))};this.updateMouseAndRay(e);const n=[this.gizmo,this.face],r=this.raycaster.intersectObjects(n,!0);if(r.length<=0)return this.activeActionType!==wm.None&&(t(this.activeActionType,!1),this.activeActionType=wm.None),this.activeFace&&(this.activeFace.setActive(!1),this.activeFace=void 0),this.renderer.domElement.style.cursor="auto",void(this.gizmo.visible=!1);const i=r[0].object;if(i instanceof Im){const e=i;this.activeActionType!==wm.None&&(t(this.activeActionType,!1),this.activeActionType=wm.None),this.activeFace||(e.setActive(!0),this.activeFace=e)}else{var s;const e=(null===(s=i.parent)||void 0===s?void 0:s.userData.actionType)||wm.None;this.activeActionType!==e&&(this.activeActionType!==wm.None&&t(this.activeActionType,!1),t(e,!0),this.activeActionType=e)}this.gizmo.visible=!0,this.renderer.domElement.style.cursor="pointer"})),gh(this,"onMouseDown",(e=>{if(e.stopPropagation(),!this.isSectionObjectVisible)return;if(!(0===e.button))return;this.isMouseDown=!0,this.updateMouseAndRay(e);this.raycaster.intersectObjects([this.gizmo],!0).length>0&&this.dragStart()})),gh(this,"dragMove",(e=>{const t=new xn(1,0,0),n=new xn(0,1,0),r=new xn(0,0,1),i=this.getCanvasPos(e);if(!this.isMouseDown)return;if(!this.lastCanvasPos)return void(this.lastCanvasPos=[i[0],i[1]]);const s=this.lastCanvasPos;switch(this.activeActionType){case wm.TranslateX:this.dragTranslateSectionPlane(t,s,i);break;case wm.TranslateY:this.dragTranslateSectionPlane(n,s,i);break;case wm.TranslateZ:this.dragTranslateSectionPlane(r,s,i);break;case wm.RotateX:this.dragRotateSectionPlane(t,s,i);break;case wm.RotateY:this.dragRotateSectionPlane(n,s,i);break;case wm.RotateZ:this.dragRotateSectionPlane(r,s,i)}this.lastCanvasPos=[i[0],i[1]],this.renderer.render(this.scene,this.camera)})),gh(this,"dragUp",(()=>{this.isMouseDown=!1,this.controls.enablePan=!0,this.controls.enableZoom=!0,this.controls.enableRotate=!0,this.lastCanvasPos=void 0,window.removeEventListener("pointermove",this.dragMove),window.removeEventListener("pointerup",this.dragUp),window.addEventListener("pointermove",this.onMouseMove)})),this.scene=e,this.camera=t,this.renderer=n,this.controls=r}setSectionPlane(e){e=e.clone(),cm.expandBoxByScale(e,1.2);const t=e.max,n=e.min,r=t.x-n.x+t.y-n.y+t.z-n.z;cm.expandBoxByMinSize(e,r/3);const i=(e.min.y+e.max.y)/2;this.boxMin.set(e.min.x,i,e.min.z),this.boxMax.set(e.max.x,i,e.max.z),_m=r/300}rotatePlane(e,t){this.gizmo.rotateOnAxis(e,t),this.group.rotateOnAxis(e,t),this.updatePlanes()}movePlaneToCenter(e){this.gizmo.position.set(e.x,e.y,e.z),this.group.position.set(e.x,e.y,e.z),this.updatePlanes()}setSectionObjectVisible(e){this.isSectionObjectVisible=e,this.group.visible=e,this.gizmo.visible=e,this.renderer.render(this.scene,this.camera)}open(){this.initSectionPlane(),this.setSectionObjectVisible(this.isSectionObjectVisible),this.addMouseListener(),this.isOpen=!0}close(){this.isOpen=!1,this.removeMouseListener(),this.clearSectionPlane()}reset(){this.close(),this.open()}setMatrix(e){var t;this.group.applyMatrix4(e),this.gizmo.applyMatrix4(e),ge()(t=this.planes).call(t,(t=>t.applyMatrix4(e)))}initSectionPlane(){this.group=new io,this.initOrUpdateVertices(),this.initGizmo(),this.updateHoverVisibles(),this.initControllerMarkers(),this.initOrUpdateFace(),this.initOrUpdateLines(),this.initPlanes(),this.scene.add(this.gizmo),this.scene.add(this.group)}initPlanes(){this.planes=[],this.planes.push(new Di(new xn(0,-1,0)),new Di(new xn(-1,0,0)),new Di(new xn(0,0,1)),new Di(new xn(1,0,0)),new Di(new xn(0,0,-1))),this.updatePlanes()}updatePlanes(){const e=new Zn;let t,n;e.makeRotationFromQuaternion(this.gizmo.quaternion);const r=this.gizmo.position;n=new xn(0,-1,0).applyMatrix4(e),this.planes[0].setFromNormalAndCoplanarPoint(n,r),n=new xn(-1,0,0).applyMatrix4(e),t=this.pointMarkers[0].position.clone(),t=this.localToWorldVec(t,!1),this.planes[1].setFromNormalAndCoplanarPoint(n,t.add(r)),n=new xn(0,0,1).applyMatrix4(e),t=this.pointMarkers[1].position.clone(),t=this.localToWorldVec(t,!1),this.planes[2].setFromNormalAndCoplanarPoint(n,t.add(r)),n=new xn(1,0,0).applyMatrix4(e),t=this.pointMarkers[2].position.clone(),t=this.localToWorldVec(t,!1),this.planes[3].setFromNormalAndCoplanarPoint(n,t.add(r)),n=new xn(0,0,-1).applyMatrix4(e),t=this.pointMarkers[3].position.clone(),t=this.localToWorldVec(t,!1),this.planes[4].setFromNormalAndCoplanarPoint(n,t.add(r))}initOrUpdateVertices(){const e=this.boxMax.y;this.vertices[0].set(this.boxMin.x,e,this.boxMin.z),this.vertices[1].set(this.boxMin.x,e,this.boxMax.z),this.vertices[2].set(this.boxMax.x,e,this.boxMax.z),this.vertices[3].set(this.boxMax.x,e,this.boxMin.z)}initControllerMarkers(){const e=(e,t,n)=>{const r=new ic(_m),i=new lc({color:vm});i.depthTest=!1;const s=new mi(r,i);s.name=n,s.position.set((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2),this.pointMarkers.push(s),this.group.add(s),s.visible=!1},t=this.vertices,n=this.gizmo.position;e(t[0].clone().sub(n),t[1].clone().sub(n),"xLeft"),e(t[1].clone().sub(n),t[2].clone().sub(n),"zFront"),e(t[2].clone().sub(n),t[3].clone().sub(n),"xRight"),e(t[3].clone().sub(n),t[0].clone().sub(n),"zBack")}updateControllerMarkers(){const e=(e,t,n)=>{n.position.set((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2)},t=this.vertices,n=this.gizmo.position;e(t[0].clone().sub(n),t[1].clone().sub(n),this.pointMarkers[0]),e(t[1].clone().sub(n),t[2].clone().sub(n),this.pointMarkers[1]),e(t[2].clone().sub(n),t[3].clone().sub(n),this.pointMarkers[2]),e(t[3].clone().sub(n),t[0].clone().sub(n),this.pointMarkers[3])}initOrUpdateFace(){var e;const t=e=>e.clone().sub(this.group.position),n=Z()(e=this.vertices).call(e,(e=>t(e)));if(this.face)this.face.setFromPoints(n);else{let e=0;this.face=new Im("yUp",[n[e++],n[e++],n[e++],n[e++]]),this.group.add(this.face)}}updateHoverVisibles(){this.gizmo.position.setX((this.boxMin.x+this.boxMax.x)/2),this.gizmo.position.setY(this.boxMax.y),this.gizmo.position.setZ((this.boxMin.z+this.boxMax.z)/2),this.group.position.setX((this.boxMin.x+this.boxMax.x)/2),this.group.position.setY(this.boxMax.y),this.group.position.setZ((this.boxMin.z+this.boxMax.z)/2)}initGizmo(){const e={arrowHead:new bl(0,_m,3*_m),axis:new bl(_m/5,_m/5,20*_m),pickableAxis:new bl(_m,_m,23*_m),curve:new sc(12*_m,_m/5,8,12,Math.PI/2),pickableCurve:new sc(12*_m,_m,6,4,Math.PI/2),hoop:new sc(12*_m,_m/5,8,64,2*Math.PI),sphere:new ic(_m)},t={red:new lc({color:bm,depthTest:!1}),green:new lc({color:xm,depthTest:!1}),blue:new lc({color:Tm,depthTest:!1}),center:new lc({color:vm,depthTest:!1}),highlight:new lc({color:ym,depthTest:!1}),pickable:new kr({wireframe:!0,transparent:!0,opacity:0,side:1})},n=new Zn;n.makeScale(.6,.6,.6);const r=(e,t)=>{const n=new Zn;return n.makeRotationAxis(new xn(...t),Yt.degToRad(e)),n},i=(e,t,n)=>{const r=new Zn;return r.makeTranslation(e,t,n),r},s=(e,t=n)=>{const r=new Zn;return r.multiplyMatrices(e,t),r},a=(n,r,i)=>{const s=new mi(e.curve,i.clone()),a=new mi(e.hoop,t.highlight.clone());a.visible=!1;const o=new mi(e.pickableCurve,t.pickable.clone()),l=new io;l.userData.actionType=n,l.add(s,a,o),l.applyMatrix4(r),this.gizmo.add(l)};let o=s(r(90,[1,0,0]),r(90,[0,1,0]));a(wm.RotateX,o,t.red),o=r(90,[0,0,1]),a(wm.RotateZ,o,t.blue);const l=(n,r,i,s)=>{const a=fm([e.arrowHead.clone().applyMatrix4(i),e.axis.clone().applyMatrix4(r)]),o=new mi(a,s),l=e.pickableAxis.clone().applyMatrix4(r),c=new mi(l,t.pickable),u=new io;u.userData.actionType=n,u.add(o,c),this.gizmo.add(u)},c=10*_m,u=2*c;let h=s(r(90,[0,0,1]),i(0,c,0)),p=s(r(90,[0,0,1]),i(0,u,0));l(wm.TranslateX,h,p,t.red),h=i(0,c,0),p=s(r(0,[1,0,0]),i(0,u,0)),l(wm.TranslateY,h,p,t.green),h=s(r(90,[1,0,0]),i(0,c,0)),p=s(r(90,[1,0,0]),i(0,u,0)),l(wm.TranslateZ,h,p,t.blue);const d=new mi(e.sphere,t.center);d.userData.actionType=wm.None,this.gizmo.add(d),this.gizmo.visible=!1,this.objectPixelSizeHelper||(this.objectPixelSizeHelper=new hm(this.camera,this.controls,this.gizmo,200,this.canvasHeight));const m=this.objectPixelSizeHelper;Re()((()=>{m.adjustSize(),this.renderer.render(this.scene,this.camera)}),0)}initOrUpdateLines(){const e=this.vertices;if(this.lines&&0!==this.lines.length){let t=0;const n=this.gizmo.position;this.lines[t].setFromPoints([e[t].clone().sub(n),e[++t].clone().sub(n)]),this.lines[t].setFromPoints([e[t].clone().sub(n),e[++t].clone().sub(n)]),this.lines[t].setFromPoints([e[t].clone().sub(n),e[++t].clone().sub(n)]),this.lines[t].setFromPoints([e[t].clone().sub(n),e[0].clone().sub(n)])}else{const t=this.face;if(!t)throw Error("Need to init Face first!");const n=this.gizmo.position;this.lines.push(new Sm([e[0].clone().sub(n),e[1].clone().sub(n)],[t]),new Sm([e[1].clone().sub(n),e[2].clone().sub(n)],[t]),new Sm([e[2].clone().sub(n),e[3].clone().sub(n)],[t]),new Sm([e[3].clone().sub(n),e[0].clone().sub(n)],[t])),this.group.add(...this.lines)}}clearSectionPlane(){this.scene.remove(this.group),this.scene.remove(this.gizmo),this.renderer.domElement.style.cursor=""}addMouseListener(){window.addEventListener("pointermove",this.onMouseMove),window.addEventListener("pointerdown",this.onMouseDown)}removeMouseListener(){window.removeEventListener("pointermove",this.onMouseMove),window.removeEventListener("pointerdown",this.onMouseDown)}updateMouseAndRay(e){const t=this.renderer.domElement,n=t.clientWidth,r=t.clientHeight;this.mousePosition.setX(e.offsetX/n*2-1),this.mousePosition.setY(-e.offsetY/r*2+1),this.raycaster.setFromCamera(this.mousePosition,this.camera)}getCanvasPos(e){return[e.clientX,e.clientY]}localToWorldVec(e,t=!0){const n=new Zn;let r=e.clone();return n.makeRotationFromQuaternion(this.group.quaternion),r=r.applyMatrix4(n),t&&r.normalize(),r}getTranslationPlane(e){let t;const n=e.clone(),r=Math.abs(e.x);return t=r>Math.abs(e.y)&&r>Math.abs(e.z)?n.cross(new xn(0,1,0)):n.cross(new xn(1,0,0)),t=t.cross(e),t.normalize(),t}getPointerPlaneIntersect(e,t,n=0){let r;const i=new gn(0,0,0,1),s=new Zn;i.setX(e[0]/window.innerWidth*2-1),i.setY(-(e[1]/window.innerHeight*2-1)),s.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),s.invert(),i.applyMatrix4(s),i.multiplyScalar(1/i.w);const a=new xn(i.x,i.y,i.z),o=this.camera.position;a.sub(o);const l=this.gizmo.position,c=-l.dot(t)-n,u=t.dot(a);if(Math.abs(u)>1e-4){const e=-(t.dot(o)+c)/u;return r=a.multiplyScalar(e),r=r.add(o),r=r.sub(l),r}im.info("[Section] Can't get the intersection. dot=",u)}dragTranslateSectionPlane(e,t,n){var r;if(!this.gizmo.visible)return;const i=this.localToWorldVec(e),s=this.getTranslationPlane(i),a=this.getPointerPlaneIntersect(t,s);let o=this.getPointerPlaneIntersect(n,s);if(!a)return;if(!o)return;o=o.sub(a);const l=o.dot(i),c=new Zn;c.makeTranslation(i.x*l,i.y*l,i.z*l),this.group.applyMatrix4(c),this.gizmo.applyMatrix4(c),ge()(r=this.planes).call(r,(e=>{e.applyMatrix4(c)}))}dragRotateSectionPlane(e,t,n){if(!this.gizmo.visible)return;let r=new xn,i=0;const s=this.localToWorldVec(e);let a=this.getPointerPlaneIntersect(t,s),o=this.getPointerPlaneIntersect(n,s);if(!(a&&o)){const e=this.getTranslationPlane(s);a=this.getPointerPlaneIntersect(t,e,1),o=this.getPointerPlaneIntersect(n,e,1),a&&o&&(i=a.dot(s),a.setX(a.x-i*s.x),a.setY(a.y-i*s.y),a.setZ(a.z-i*s.z),i=o.dot(s),o.setX(o.x-i*s.x),o.setY(o.y-i*s.y),o.setZ(o.z-i*s.z))}if(a&&o){a.normalize(),o.normalize(),i=a.dot(o),i=Yt.clamp(i,-1,1);let t=Math.acos(i);r=a.cross(o),r.dot(s)<0&&(t=-t),this.gizmo.rotateOnAxis(e,t),this.group.rotateOnAxis(e,t),this.updatePlanes()}}updatePosition(){this.updateHoverVisibles(),this.initOrUpdateVertices(),this.initOrUpdateLines(),this.updateControllerMarkers(),this.updatePlanes(),this.initOrUpdateFace()}dragStart(){this.controls.enablePan=!1,this.controls.enableZoom=!1,this.controls.enableRotate=!1,im.info("[Section] dragStart"),window.removeEventListener("pointermove",this.onMouseMove),window.addEventListener("pointermove",this.dragMove),window.addEventListener("pointerup",this.dragUp)}}class Sm extends Wo{constructor(e,t){super(),gh(this,"normalMaterial",new Fo({color:7951688})),gh(this,"activeMaterial",new Fo({color:vm})),ge()(t).call(t,(e=>e.lines.push(this))),this.geometry=new Kr,this.geometry.setFromPoints(e),this.normalMaterial.depthTest=!1,this.activeMaterial.depthTest=!1,this.material=this.normalMaterial}setFromPoints(e){this.geometry.setFromPoints(e)}setActive(e){this.material=e?this.activeMaterial:this.normalMaterial}}class Im extends mi{constructor(e,t){super(),gh(this,"axis",void 0),gh(this,"lines",[]),this.name=Vh,this.axis=e,this.lines=[],this.geometry=new Kr,this.geometry.setFromPoints(t),this.geometry.setIndex([0,3,2,0,2,1]),this.geometry.computeVertexNormals(),this.material=new kr({colorWrite:!1,depthWrite:!1,side:2})}setFromPoints(e){this.geometry.setFromPoints(e)}setActive(e){var t;ge()(t=this.lines).call(t,(t=>{t.setActive(e)}))}}let Mm;!function(e){e.X="x",e.Y="y",e.Z="z"}(Mm||(Mm={}));class Am{constructor(e,t,n){if(this.container=n,gh(this,"bimViewer",void 0),gh(this,"camera",void 0),gh(this,"controls",void 0),gh(this,"scene",void 0),gh(this,"renderer",void 0),gh(this,"objectIds",void 0),gh(this,"sectionPlane",void 0),gh(this,"isShowSectionPlane",!0),gh(this,"popPanel",void 0),gh(this,"axisInfoMap",void 0),this.bimViewer=e,!e.camera||!e.renderer||!e.controls)throw new Error("Invalid bimViewer!");this.camera=e.camera,this.scene=e.scene,this.renderer=e.renderer,this.controls=e.controls,this.objectIds=t,this.axisInfoMap={[Mm.X]:{normal:new xn(1,0,0)},[Mm.Y]:{normal:new xn(0,1,0)},[Mm.Z]:{normal:new xn(0,0,1)}}}getRotateParam(e){const t=this.axisInfoMap[e].normal,n=new xn(0,1,0);let r;r=1===t.y||-1===t.y?new xn(1,0,0):n.clone().cross(t);return[r,Math.acos(t.dot(n))]}initPlane(e){const[t,n]=this.getRotateParam(e);this.sectionPlane&&(this.cancelSection(),this.sectionPlane.close()),this.sectionPlane=new Em(this.scene,this.camera,this.renderer,this.controls),this.sectionPlane.setSectionPlane(this.bimViewer.bbox),this.sectionPlane.open(),this.sectionPlane.rotatePlane(t,n),this.enableSection()}open(){this.initPlane(Mm.X),this.popPanel=new Qd(this.container);const e=this.popPanel.eventBus;e.on("visible",(e=>{e?this.showSectionPlane():this.hideSectionPlane()})),e.on("axis",(e=>{this.initPlane(e),this.renderer.render(this.scene,this.camera)}))}close(){this.sectionPlane&&(this.sectionPlane.close(),this.sectionPlane=void 0),this.popPanel&&(this.popPanel.destroy(),this.popPanel=void 0),this.cancelSection()}enableSection(){var e;ge()(e=this.objectIds).call(e,(e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t,n;if(cp()(t=["Mesh","LineSegments"]).call(t,e.type))if(x()(e.material))ge()(n=e.material).call(n,(e=>{var t;e.clippingPlanes=null===(t=this.sectionPlane)||void 0===t?void 0:t.planes,e.clipIntersection=!0}));else if(e.material){var r;e.material.clippingPlanes=null===(r=this.sectionPlane)||void 0===r?void 0:r.planes,e.material.clipIntersection=!0}}))}))}cancelSection(){var e;ge()(e=this.objectIds).call(e,(e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t,n;cp()(t=["Mesh","LineSegments"]).call(t,e.type)&&(x()(e.material)?ge()(n=e.material).call(n,(e=>{e.clippingPlanes=[]})):e.material&&(e.material.clippingPlanes=[]))}))}))}showSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!0,this.sectionPlane.setSectionObjectVisible(!0))}hideSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!1,this.sectionPlane.setSectionObjectVisible(!1))}}class Rm{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Dm=new Wi(-1,1,1,-1,0,1),Cm=new Kr;Cm.setAttribute("position",new zr([-1,3,0,-1,-1,0,3,-1,0],3)),Cm.setAttribute("uv",new zr([0,2,0,0,2,0],2));class Om{constructor(e){this._mesh=new mi(Cm,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Dm)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}const Pm={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new Xt(.001953125,0)},cKernel:{value:[]}},vertexShader:"\n\n\t\tuniform vec2 uImageIncrement;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float cKernel[ KERNEL_SIZE_INT ];\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec2 uImageIncrement;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec2 imageCoord = vUv;\n\t\t\tvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\n\n\t\t\tfor( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {\n\n\t\t\t\tsum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];\n\t\t\t\timageCoord += uImageIncrement;\n\n\t\t\t}\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}",buildKernel:function(e){let t=2*Math.ceil(3*e)+1;t>25&&(t=25);const n=.5*(t-1),r=new Array(t);let i=0;for(let s=0;s<t;++s)r[s]=Nm(s-n,e),i+=r[s];for(let e=0;e<t;++e)r[e]/=i;return r}};function Nm(e,t){return Math.exp(-e*e/(2*t*t))}class Lm extends Rm{constructor(e=1,t=25,n=4){super(),this.renderTargetX=new _n,this.renderTargetX.texture.name="BloomPass.x",this.renderTargetY=new _n,this.renderTargetY.texture.name="BloomPass.y",this.combineUniforms=yi.clone(km.uniforms),this.combineUniforms.strength.value=e,this.materialCombine=new bi({uniforms:this.combineUniforms,vertexShader:km.vertexShader,fragmentShader:km.fragmentShader,blending:2,transparent:!0}),void 0===Pm&&console.error("THREE.BloomPass relies on ConvolutionShader");const r=Pm;this.convolutionUniforms=yi.clone(r.uniforms),this.convolutionUniforms.uImageIncrement.value=Lm.blurX,this.convolutionUniforms.cKernel.value=Pm.buildKernel(n),this.materialConvolution=new bi({uniforms:this.convolutionUniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,defines:{KERNEL_SIZE_FLOAT:t.toFixed(1),KERNEL_SIZE_INT:t.toFixed(0)}}),this.needsSwap=!1,this.fsQuad=new Om(null)}render(e,t,n,r,i){i&&e.state.buffers.stencil.setTest(!1),this.fsQuad.material=this.materialConvolution,this.convolutionUniforms.tDiffuse.value=n.texture,this.convolutionUniforms.uImageIncrement.value=Lm.blurX,e.setRenderTarget(this.renderTargetX),e.clear(),this.fsQuad.render(e),this.convolutionUniforms.tDiffuse.value=this.renderTargetX.texture,this.convolutionUniforms.uImageIncrement.value=Lm.blurY,e.setRenderTarget(this.renderTargetY),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCombine,this.combineUniforms.tDiffuse.value=this.renderTargetY.texture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.clear&&e.clear(),this.fsQuad.render(e)}setSize(e,t){this.renderTargetX.setSize(e,t),this.renderTargetY.setSize(e,t)}dispose(){this.renderTargetX.dispose(),this.renderTargetY.dispose(),this.materialCombine.dispose(),this.materialConvolution.dispose(),this.fsQuad.dispose()}}const km={uniforms:{tDiffuse:{value:null},strength:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float strength;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = strength * texel;\n\n\t\t}"};Lm.blurX=new Xt(.001953125,0),Lm.blurY=new Xt(0,.001953125);const Fm={NavCube:{front:"Front",back:"Back",top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ContextMenu:{viewFitAll:"View Fit All",hideAll:"Hide All",showAll:"Show All",xRayAll:"X-Ray",xRayNone:"X-Ray None",selectNone:"Select None",resetView:"Reset View",viewFitEntity:"View Fit",hideEntity:"Hide",hideOthers:"Hide Others",xRayEntity:"X-Ray",xRayOthers:"X-Ray Others",select:"Select",deselect:"Undo Select",showSectionPlane:"Show Section Plane",showSectionBox:"Show Section Box",showAxisSection:"Show Axis Section",hideSectionPlane:"Hide Section Plane",hideSectionBox:"Hide Section Box",hideAxisSection:"Hide Axis Section",undoSection:"Undo Section"},ProgressBar:{Download:"Download",Creating:"Creating",Loading:"Loading",Parsing:"Parsing"},Toolbar:{homeView:"Home",orthoView:"Ortho View",measurement:"Measure",distanceMeasurement:"Distance Measurement",areaMeasurement:"Area Measurement",coordinateMeasurement:"Coordinate Measurement",clearMeasurement:"Clear Measurement",markup:"Markup",markupArrow:"Arrow",markupRect:"Rect",markupCloudRect:"CloudRect",markupPolyLine:"PolyLine",markupCloudLine:"CloudLine",markupEllipse:"Ellipse",markupCircle:"Circle",markupDot:"Dot",markupText:"Text",markupX:"X",markupStroke:"Stroke Style",markupLineWidth:"Line Width",markupLineWidth2:"Line Width 2",markupLineWidth5:"Line Width 5",markupLineWidth10:"Line Width 10",markupFontSize:"Font Size",markupFontSize14:"14",markupFontSize18:"18",markupFontSize24:"24",clearMarkup:"Clear Markup",quitMarkup:"Quit markup",section:"Section",axisSection:"Axis Section",pickSectionPlane:"Pick Section Plane",sectionBox:"Section Box",bimTree:"BIM Tree",viewpoint:"Viewpoint",annotation:"Annotation",property:"Property",settings:"Settings",compared:"Compared",quitCompare:"Quit compare",fullscreen:"Full Screen"},Tooltip:{measure:"Pick a point to continue, pressing ESC to exit",areaMeasurement:"Pick a point to continue, pressing ESC to exit, right click to finish",section:"Click to pick a section plane"},PopPanel:{reset:"Reset"}},Um={NavCube:{front:"前",back:"后",top:"上",bottom:"下",left:"左",right:"右"},ContextMenu:{viewFitAll:"缩放视口到所有模型",hideAll:"全部隐藏",showAll:"全部显示",xRayAll:"全部应用 X 光模式",xRayNone:"清除 X 光模式",selectNone:"清空选择",resetView:"重置视图",viewFitEntity:"缩放视口到实体",hideEntity:"隐藏",hideOthers:"隐藏其他 (隔离)",xRayEntity:"应用 X 光模式",xRayOthers:"对其他实体应用 X 光模式",select:"选择",deselect:"取消选择",showSectionPlane:"显示剖切面",showSectionBox:"显示剖切盒",showAxisSection:"显示轴向剖切",hideSectionPlane:"隐藏剖切面",hideSectionBox:"隐藏剖切盒",hideAxisSection:"隐藏轴向剖切",undoSection:"取消剖切"},ProgressBar:{Download:"正在下载",Loading:"正在加载",Parsing:"正在解析",Creating:"正在创建"},Toolbar:{homeView:"主视图",orthoView:"正交视图",measurement:"测量",distanceMeasurement:"距离测量",areaMeasurement:"面积测量",angleMeasurement:"角度测量",coordinateMeasurement:"坐标测量",clearMeasurement:"清除测量",markup:"批注",markupArrow:"箭头",markupRect:"矩形框",markupCloudRect:"云线框",markupPolyLine:"多段线",markupCloudLine:"云线",markupEllipse:"椭圆",markupCircle:"圆",markupDot:"点",markupText:"文字",markupX:"叉号",markupStroke:"画笔颜色",markupLineWidth:"线宽",markupLineWidth2:"线宽 2",markupLineWidth5:"线宽 5",markupLineWidth10:"线宽 10",markupFontSize:"字号",markupFontSize14:"14",markupFontSize18:"18",markupFontSize24:"24",clearMarkup:"清除批注",quitMarkup:"退出批注",section:"剖切",axisSection:"轴向剖切",pickSectionPlane:"面剖切",sectionBox:"剖切盒",bimTree:"BIM树",viewpoint:"视点",annotation:"批注",property:"属性",settings:"设置",compared:"图纸对比",quitCompare:"退出图纸对比",fullscreen:"全屏",layers:"图层",zoomToRectangle:"框选放大"},Tooltip:{measure:"点击继续测量, ESC 取消测量",areaMeasurement:"点击继续测量, ESC 取消测量,右键完成测量",section:"点击确定剖切面"},PopPanel:{reset:"重置"}};class Bm{constructor(e){gh(this,"id",void 0),gh(this,"container",void 0),gh(this,"element",void 0),gh(this,"handleClick",void 0),gh(this,"context",void 0),gh(this,"itemList",[]),this.id=e.id||"gemini-context-menu",this.container=e.container||document.body,this.context=e.context||{},this.element=this.createMenuUI(e.items||[]),this.handleClick=()=>{this.hide()},!1!==e.hideOnMouseDown&&document.addEventListener("click",this.handleClick),this.hide()}isEnable(e){return e.getEnabled?e.getEnabled(this.context):void 0===e.enabled||e.enabled}isShown(e){return e.getShown?e.getShown(this.context):void 0===e.shown||e.shown}getTitle(e){return e.title||e.getTitle&&e.getTitle(this.context)||""}createMenuUI(e){const t=document.createElement("div");t.id=this.id,t.classList.add("context-menu");const n=this.createMenuGroup(e);return t.append(...n),this.container.appendChild(t),t}createMenuGroup(e){return(0,mp.map)(e,(e=>{const t=document.createElement("ul");return(0,mp.forEach)(e,(e=>{const n=this.createMenuItem(e);t.append(n)})),t}))}createMenuItem(e){const t=document.createElement("li");return t.innerHTML=this.getTitle(e),t.onclick=()=>e.doAction&&e.doAction(this.context),this.isEnable(e)?t.classList.remove("disabled"):t.classList.add("disabled"),this.isShown(e)?t.removeAttribute("hidden"):t.setAttribute("hidden",""),this.itemList.push([e,t]),t}updateMenuItems(){(0,mp.forEach)(this.itemList,(([e,t])=>{this.isEnable(e)?t.classList.remove("disabled"):t.classList.add("disabled"),this.isShown(e)?t.removeAttribute("hidden"):t.setAttribute("hidden",""),t.innerHTML=this.getTitle(e)}))}showMenuElement(e,t){const n=this.element.offsetHeight,r=this.element.offsetWidth;t+n>window.innerHeight&&(t=window.innerHeight-n-5),e+r>window.innerWidth&&(e=window.innerWidth-r-5),this.element.style.left=e+"px",this.element.style.top=t+"px"}show(e,t){this.updateMenuItems(),this.element.removeAttribute("hidden"),this.showMenuElement(e,t)}hide(){this.element.setAttribute("hidden","")}destroy(){document.removeEventListener("click",this.handleClick),this.container.removeChild(this.element)}}const jm=1e-15;class Gm{static roundNumber(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}static floorNumber(e,t){return Math.floor(e*Math.pow(10,t))/Math.pow(10,t)}static AreNumbersEqual(e,t,n=1e-7){return Math.abs(e-t)<n*Math.max(1,Math.abs(e),Math.abs(t))}static AreVector2sEqual(e,t,n=1e-7){return Gm.AreNumbersEqual(e.x,t.x,n)&&Gm.AreNumbersEqual(e.y,t.y,n)}static AreVector3sEqual(e,t,n=1e-7){return Gm.AreNumbersEqual(e.x,t.x,n)&&Gm.AreNumbersEqual(e.y,t.y,n)&&Gm.AreNumbersEqual(e.z,t.z,n)}static areNumbersClose(e,t,n=1e-9,r=1e-12){return Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r)}static areVector2sClose(e,t,n=1e-9,r=1e-12){return this.areNumbersClose(e.x,t.x,n,r)&&this.areNumbersClose(e.y,t.y,n,r)}static areVectorsClose(e,t,n=1e-9,r=1e-12){return this.areNumbersClose(e.x,t.x,n,r)&&this.areNumbersClose(e.y,t.y,n,r)&&this.areNumbersClose(e.z,t.z,n,r)}static getArcAngleSpanRad(e,t){const n=2*Math.PI;return Gm.areNumbersClose(e,t,jm)?0:(e%=n,Gm.areNumbersClose(e,t%n,jm)?n:(Gm.areNumbersClose(t,n,jm)&&(t%=n),t<e&&(t+=n),t-e))}static getIntegerPartLength(e){return(e=Math.abs(e))<1?0:Math.ceil(mm()(Math.abs(e)+1))}static getRelativeEps(e,t=1e-7){const n=Gm.getIntegerPartLength(e);return Math.max(Math.pow(10,n)*t,t)}static getVector2RelativeEps(e,t=1e-7){return Math.min(Gm.getRelativeEps(e.x,t),Gm.getRelativeEps(e.y,t))}static getControlPointByTwoPoints(e,t){const n=(new Xt).subVectors(t,e),r=n.angle(),i=n.length(),s=Yt.degToRad(45),a=i/2/Math.cos(s);return new Xt(e.x+a*Math.cos(s-r),e.y-a*Math.sin(s-r))}}class zm{constructor(e,t){gh(this,"current",void 0),gh(this,"next",void 0),gh(this,"inNormal",void 0),gh(this,"outNormal",void 0),this.current=e,this.next=t,this.inNormal=this.inwardsNormal(),this.outNormal=this.outwardsNormal()}outwardsNormal(){const e=this.inwardsNormal();return[-e[0],-e[1]]}inwardsNormal(){const e=this.next[0]-this.current[0],t=this.next[1]-this.current[1],n=Math.sqrt(e*e+t*t);if(0===n)throw new Error("Vertices overlap");return[-t/n,e/n]}offset(e,t){return zm.offsetEdge(this.current,this.next,e,t)}inverseOffset(e,t){return zm.offsetEdge(this.next,this.current,e,t)}inverse(){return new zm(this.next,this.current)}static offsetEdge(e,t,n,r){return new zm([e[0]+n,e[1]+r],[t[0]+n,t[1]+r])}}var Vm=n(19456);const Hm=x(),qm=(e,t)=>e[0]===t[0]&&e[1]===t[1],Wm=e=>x()(e)&&e.length,Ym=(e,t=0,n=!1)=>{let r,i;if(Wm(e)&&"number"==typeof e[0][0]){let t=0;const s=e;for(r=0,i=s.length;r<i;r++){const e=s[r],n=s[(r+1)%i];t+=e[0]*n[1],t-=n[0]*e[1]}(!n&&t>0||n&&t<0)&&Te()(s).call(s)}else for(r=0,i=e.length;r<i;r++)Ym(e[r],t+1,r>0);if(0===t&&Wm(e)&&Wm(e[0])&&"number"==typeof e[0][0][0]){var s;const t=M()(s=e[0]).call(s,0,1)[0];e[0].pop(),e[0].push([t[0],t[1]])}return e};class Xm{constructor(e,t=5){if(gh(this,"vertices",void 0),gh(this,"edges",void 0),gh(this,"arcSegments",void 0),gh(this,"distance",void 0),this.distance=0,this.arcSegments=t,!Hm(e))throw new Error("Offset requires at least one coodinate to work with");this.edges=[],Hm(e)&&"number"==typeof e[0]?this.vertices=e:(this.vertices=Ym(e),this.processContour(this.vertices,this.edges))}processContour(e,t){let n,r;if(Hm(e[0])&&"number"==typeof e[0][0])for(r=e.length,qm(e[0],e[r-1])&&(r-=1),n=0;n<r;n++)t.push(new zm(e[n],e[(n+1)%r]));else for(n=0,r=e.length;n<r;n++)t.push([]),this.processContour(e[n],t[t.length-1])}setArcSegments(e){return this.arcSegments=e,this}createArc(e,t,n,r,i,s,a){const o=2*Math.PI;let l=Math.atan2(r[1]-t[1],r[0]-t[0]),c=Math.atan2(i[1]-t[1],i[0]-t[0]);s%2==0&&(s-=1),l<0&&(l+=o),c<0&&(c+=o);let u=l>c?l-c:l+o-c;const h=(a?-u:o-u)/s;e.push(r);for(let r=1;r<s;++r)u=l+h*r,e.push([t[0]+Math.cos(u)*n,t[1]+Math.sin(u)*n]);return e.push(i),e}setDistance(e){return this.distance=e,this}ensureLastPoint(e){return qm(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e}offset(e){return this.setDistance(e),0===this.distance?this.vertices:this.distance>0?this.margin(this.distance):this.padding(-this.distance)}offsetSegment(e,t,n,r){const i=[n.offset(n.inNormal[0]*r,n.inNormal[1]*r),n.inverseOffset(n.outNormal[0]*r,n.outNormal[1]*r)],s=[];for(let n=0,a=2;n<a;n++){const o=i[n],l=i[(n+a-1)%a];this.createArc(s,0===n?e:t,r,l.next,o.current,this.arcSegments,!0)}return s}margin(e){if(this.setDistance(e),"number"==typeof this.vertices[0])return this.offsetPoint(this.distance);if(0===e)return this.vertices;let t=this.offsetLines(this.distance);return t=(0,Vm.union)(this.vertices,t),t}padding(e){if(this.setDistance(e),0===this.distance)return this.vertices;if(2===this.vertices.length&&"number"==typeof this.vertices[0])return this.vertices;const t=this.offsetLines(this.distance);return(0,Vm.difference)(this.vertices,t)}offsetLine(e){return 0===e?this.vertices:this.offsetLines(e)}offsetLines(e){if(e<0)throw new Error("Cannot apply negative margin to the line");this.setDistance(e);let t=[];if(Hm(this.vertices[0])&&"number"!=typeof this.vertices[0][0]){const e=[];for(let t=0,n=this.edges.length;t<n;t++){const n=this.offsetContour(this.vertices[t],this.edges[t]);n.length>0&&e.push(n)}e.length>0&&(t=1===e.length?e[0]:(0,Vm.union)(e[0],...M()(e).call(e,1)))}else t=1===this.vertices.length?this.offsetPoint(e):this.offsetContour(this.vertices,this.edges);return t}offsetContour(e,t){let n=[],r=0,i=0;if(Hm(e[0])&&"number"==typeof e[0][0]){for(r=0,i=e.length-1;r<i;r++){const i=[this.ensureLastPoint(this.offsetSegment(e[r],e[r+1],t[r],this.distance))];n.push(i)}n.length>0&&(n=1===n.length?[n[0]]:(0,Vm.union)(n[0],M()(n).call(n,1)))}else{const s=[];for(r=0,i=t.length;r<i;r++){const n=this.offsetContour(e[r],t[r]);n.length>0&&s.push(n)}s.length>0&&(n=1===s.length?s[0]:(0,Vm.union)(s[0],...M()(s).call(s,1)))}return n}offsetPoint(e){this.setDistance(e);let t=2*this.arcSegments;const n=[],r=this.vertices,i=this.distance;let s=0;t%2==0&&t++;for(let e=0;e<t;e++)s+=2*Math.PI/t,n.push([r[0]+i*Math.cos(s),r[1]+i*Math.sin(s)]);return[[this.ensureLastPoint(n)]]}}const $m=1e6,Km=new xu,Zm=new xu,Jm=new Xt,Qm=new Xt;class ef{static geometryEquals(e,t){if(e===t)return!0;return e.type===t.type&&e.name===t.name&&e.morphTargetsRelative===t.morphTargetsRelative&&this.equals(e.boundingBox,t.boundingBox)&&this.equals(e.boundingSphere,t.boundingSphere)&&this.attributesEqual(e.attributes,t.attributes)&&this.bufferAttributeEqual(e.index,t.index)}static equals(e,t){return e===t||(!e&&!t||!(!e||!t)&&e.equals(t))}static attributesEqual(e,t){var n,r;if(e===t)return!0;const i=re()(n=Q()(e)).call(n),s=re()(r=Q()(t)).call(r);if(i.length!==s.length)return!1;for(let n=0;n<i.length;++n){if(i[n]!==s[n])return!1;const r=e[i[n]],a=t[s[n]];if(!this.bufferAttributeEqual(r,a))return!1}return!0}static bufferAttributeEqual(e,t){if(e===t)return!0;if(!e||!t)return!1;if(!(e.name===t.name&&e.itemSize===t.itemSize&&e.count===t.count&&e.normalized===t.normalized))return!1;if(e.array&&t.array){if(e.array.length!==t.array.length)return!1;for(let n=0;n<e.array.length;++n)if(e.array[n]!==t.array[n])return!1}else if(e.array||t.array)return!1;const n=e.data,r=t.data;if(n&&r){if(n.length!==r.length)return!1;for(let e=0;e<n.length;++e)if(n[e]!==r[e])return!1}else if(n||r)return!1;return!0}static tryConvertInterleavedBufferAttributes(e){var t;e&&e.attributes&&ge()(t=Q()(e.attributes)).call(t,(t=>{const n=e.attributes[t];if(n instanceof _o){const r=n.clone();e.attributes[t]=r}}))}static isPointInPolygon(e,t,n=!1){const r=e.x,i=e.y;let s=!1;const a=t.length;for(let e=0,o=a-1;e<a;o=e++){const a=t[e].x,l=t[e].y,c=t[o].x,u=t[o].y;let h=l>i!=u>i;n&&(h=l>=i!=u>=i);h&&r<(c-a)*(i-l)/(u-l)+a&&(s=!s)}return s}static caculateGeometryCenter(e){if(!e.hasAttribute("position"))return null;const t=e.getAttribute("position");if(0===t.count)return null;const n=new xn,r=t.itemSize,i=t.array,s=[0,0,0];for(let e=0;e<t.count;e++)for(let t=0;t<r;t++)s[t]+=i[e*r+t];for(let e=0;e<r;e++)n.setComponent(e,s[e]/t.count);return n}static isConvex(e){const t=e.length;let n=0,r=0;const i=new Xt,s=new Xt;for(let a=0;a<t;++a){const o=e[a],l=e[(a+1)%t],c=e[(a+2)%t];if(i.subVectors(l,o),s.subVectors(c,l),r=i.cross(s),0!=r){if(r>0&&n<0||r<0&&n>0)return!1;n=r}}return!0}static areLineSegmentsIntersecting(e,t){const{start:n,end:r}=e,{start:i,end:s}=t,a=new xn(n.x,n.y,0),o=new xn(r.x,r.y,0),l=new xn(i.x,i.y,0),c=new xn(s.x,s.y,0),u=l.clone().sub(a),h=o.clone().sub(a),p=c.clone().sub(a),d=u.cross(h).dot(p.cross(h)),m=a.clone().sub(l),f=c.clone().sub(l),g=o.clone().sub(l),_=m.cross(f).dot(g.cross(f));return d<0&&_<0}static getLineSegmentsIntersectingPoint(e,t){if(!ef.areLineSegmentsIntersecting(e,t))return null;const{start:n,end:r}=e,{start:i,end:s}=t,a=n.x-r.x,o=i.x-s.x,l=n.y-r.y,c=i.y-s.y,u=a*c-l*o,h=n.x*r.y-n.y*r.x,p=i.x*s.y-i.y*s.x;return new Xt((h*o-a*p)/u,(h*c-l*p)/u)}static isPointOnLineSegment(e,t,n=.001){const{start:r,end:i}=t,s=Jm.subVectors(r,i).length(),a=Jm.subVectors(e,r).length(),o=Qm.subVectors(e,i).length();return Math.abs(s-(a+o))<=n}static isPointOnLineSegments(e,t,n=.001){let r=!1;for(let i=0;i<t.length-1;i+=2){const s=t[i],a=t[i+1];if(r=this.isPointOnLineSegment(e,{start:s,end:a},n),r)break}return r}static checkAndRebasePositionsOnRTC(e,t){if(0===e.length)return!1;const n=e[0]instanceof xn;ge()(e).call(e,(e=>{n?t.add(e):(t.x+=e.x,t.y+=e.y)})),t.divideScalar(e.length);let r=!1;if(ef.shouldRebasePositionOnRTC(t)){r=!0;for(let r=0;r<e.length;r++){const i=e[r].x-t.x,s=e[r].y-t.y;e[r]=n?new xn(i,s,e[r].z-t.z):new Xt(i,s)}}else t.setScalar(0);return r}static shouldRebasePositionOnRTC(e){return Math.abs(e.x)>$m||Math.abs(e.y)>$m}static convertGeometryWithIndexedToNonIndexed(e){if(!e.index)return e;const t=new Kr,n=e.index;for(const r in e.attributes)t.setAttribute(r,ef.createGeometryAttributeByIndex(e.attributes[r],n));return t}static createGeometryAttributeByIndex(e,t){const n=t.count,r=e.itemSize,i=new(0,e.array.constructor)(n*r);for(let s=0;s<n;s++){const n=t.getX(s)*r;for(let t=0;t<r;t++)i[s*r+t]=e.array[n+t]}return new Br(i,r,e.normalized)}static arePolygonsIntersect(e,t){if(0===e.length||0===t.length)return!1;if(Km.setFromPoints(e),Zm.setFromPoints(t),!Km.intersectsBox(Zm))return!1;for(let n=0;n<e.length;){if(this.isPointInPolygon(e[n],t,!0))return!0;n<e.length-1&&Gm.AreVector2sEqual(e[n+1],e[n])&&++n,++n}return!1}static getLineLineIntersectionPoint(e,t,n,r,i=.001){const s=t.clone().sub(e).normalize(),a=r.clone().sub(n).normalize();if(Math.abs(s.dot(a))>1-i)return;const o=t.y-e.y,l=e.x-t.x,c=o*e.x+l*e.y,u=r.y-n.y,h=n.x-r.x,p=u*n.x+h*n.y,d=o*h-u*l;if(Math.abs(d)<i)return;return new Xt((h*c-l*p)/d,(o*p-u*c)/d)}static getOffsetPoint(e,t,n){const r=t.x-e.x,i=t.y-e.y,s=n/Math.sqrt(r*r+i*i);return new Xt(-s*i,s*r)}static convertSimpleWidthLineToMeshGeometry(e,t){let n,r,i,s=!1,a=!1,o=[],l=[],c=new Xt,u=new Xt,h=new Xt,p=new Xt;const d=[],m=t/2;for(let t=0,f=e.length-1;t<f;t++)s=!t,a=t===e.length-2,n=this.getOffsetPoint(e[t],e[t+1],m),c=new Xt(e[t].x+n.x,e[t].y+n.y),u=new Xt(e[t+1].x+n.x,e[t+1].y+n.y),h=new Xt(e[t].x-n.x,e[t].y-n.y),p=new Xt(e[t+1].x-n.x,e[t+1].y-n.y),s||(r=this.getLineLineIntersectionPoint(o[0],o[1],c,u),void 0!==r?d.unshift(r):d.unshift(c),i=this.getLineLineIntersectionPoint(l[0],l[1],h,p),void 0!==i?d.push(i):d.push(h)),s&&(d.unshift(c),d.push(h)),a&&(d.unshift(u),d.push(p)),a||(o=[c,u],l=[h,p]);if(d.length<3)return;const f=Jl.triangulateShape(d,[]),g=[];for(let e=0;e<f.length;e++)g.push(...f[e]);const _=(new Kr).setFromPoints(d);return _.setIndex(g),_}static convertWidthLineToMeshGeometry(e,t){if(e.length<2)return;const n=[];let r;ge()(e).call(e,(e=>{n.push([e.x,e.y])}));try{r=new Xm(n).setArcSegments(2).offsetLine(t/2)}catch(e){return}if(!r||0===r.length)return;r=r[0];const i=[],s=[];for(let e=0;e<r.length;e++)if(0===e){var a;ge()(a=r[e]).call(a,(e=>{i.push(new Xt(e[0],e[1]))})),Jl.isClockWise(i)||Te()(i).call(i)}else{var o;const t=[];ge()(o=r[e]).call(o,(e=>{t.push(new Xt(e[0],e[1]))})),Jl.isClockWise(t)&&Te()(t).call(t),s.push(t)}const l=Jl.triangulateShape(i,s),c=[];for(let e=0;e<l.length;e++)c.push(...l[e]);ge()(s).call(s,(e=>i.push(...e)));const u=(new Kr).setFromPoints(i);return u.setIndex(c),u}static releaseGeometryManually(e){e.index=null,e.attributes={}}static getAdjacentNonRepeatPoints(e,t=1e-7){const n=[],r=e.length;for(let i=0;i<r-1;i++)Gm.AreVector3sEqual(e[i],e[i+1],t)||n.push(e[i]);return n.push(e[r-1]),n}static mergeBBoxes(e){const t=[...e];if(t.length<2)return t;const n=[],r=[];for(let e=0;e<t.length;e++){const i=t[e];if(!cp()(r).call(r,e)){for(let e=0;e<t.length;e++){const n=t[e];i.equals(n)||i.intersectsBox(n)&&(i.union(n),r.push(e))}n.push(i)}}return n}}class tf{static materialEquals(e,t){if(e===t)return!0;if(e.type!==t.type)return!1;if(e instanceof Lr&&t instanceof Lr){const n=e,r=t;return e.alphaTest===t.alphaTest&&e.opacity===t.opacity&&e.side===t.side&&e.visible===t.visible&&e.name===t.name&&e.transparent===t.transparent&&this.colorEquals(n.color,r.color)&&this.colorEquals(n.emissive,r.emissive)&&n.roughness===r.roughness&&n.metalness===r.metalness&&n.alphaMap===r.alphaMap&&n.uniforms===r.uniforms&&n.defines===r.defines&&n.vertexShader===r.vertexShader&&n.fragmentShader===r.fragmentShader&&n.clippingPlanes===r.clippingPlanes&&Z()(n)===Z()(r)&&n.clipIntersection===r.clipIntersection}return!1}static materialsEquals(e,t){if(e===t)return!0;if(x()(e)&&x()(t)&&e.length===t.length){for(let n=0;n<e.length;++n)if(!this.materialEquals(e[n],t[n]))return!1;return!0}return e instanceof Lr&&t instanceof Lr&&this.materialEquals(e,t)}static colorEquals(e,t){return e===t||e instanceof cn&&t instanceof cn&&e.equals(t)}static clonedHighlightMaterials(e,t={}){if(!e||!e.material)return;const n=e.material;if(x()(n)&&n.length>0){const e=[];return ge()(n).call(n,(n=>{e.push(this.clonedHighlightMaterial(n,t))})),e}if(n instanceof Lr)return this.clonedHighlightMaterial(n,t);console.warn(`[MaterialUtils] Invalid material: ${n}`)}static clonedHighlightMaterial(e,t={}){const{depthTest:n,highlightColor:r=new cn(583902),opacity:i=.7}=t,s=e.clone();if(s instanceof ac)s.emissive.set(r),s.color.set(r);else if(s instanceof lc)s.emissive.set(r),s.color.set(r);else if(s instanceof kr)s.color.set(r);else if(s instanceof uc)s.color.set(r);else if(s instanceof Fo)s.color.set(r);else if(s instanceof hc)s.color.set(r);else if(s instanceof bi){var a;null===(a=s.uniforms.u_color)||void 0===a||a.value.set(r)}else s instanceof vo?s.color.set(r):console.warn("[MaterialUtils] Unsupported Material:",s.type);return s.opacity=i,s.transparent=!0,void 0!==n&&(s.depthTest=!1,s.side=2),s}static cloneMaterial(e){if(!e)return e;if(x()(e)){const t=[];return ge()(e).call(e,(e=>{t.push(e.clone())})),t}return e.clone()}static getMaterialColor(e){let t=new cn(16777215);return e instanceof Xo||e instanceof Fo||e instanceof kr?t=e.color:e instanceof bi&&e.uniforms.u_color&&(t=e.uniforms.u_color.value),t}static setMaterialColor(e,t){e instanceof Xo||e instanceof Fo||e instanceof kr?e.color=t:e instanceof bi&&e.uniforms.u_color&&(e.uniforms.u_color.value=t)}static cloneMaterials(e){const t=new(ue());e.traverse((e=>{e.material&&(e.material=(e=>{let n;return x()(e)?(n=[],ge()(e).call(e,(e=>{if(t.has(e))n.push(t.get(e));else{const r=e.clone();t.set(e,r),n.push(r)}}))):e&&(t.has(e)?n=t.get(e):(n=e.clone(),t.set(e,n))),n})(e.material))}))}}class nf{constructor(e,t,n,r=nf.DEFAULT_SCALE){gh(this,"scene",void 0),gh(this,"objectId",void 0),gh(this,"position",void 0),gh(this,"scale",void 0),gh(this,"isExplodeUp",!1),this.scene=e,this.objectId=t,t||console.log(`[EXP] Invalid objectId: ${t}`),this.scale=r,r<=0&&console.log(`[EXP] Invalid scale: ${r}`),n?this.position=n:(this.position=new xn,this.getObjectCenter(this.position))}explode(){if(!this.objectId||!this.position||!this.scale)return void console.log(`[EXP] Invalid objectId: ${this.objectId}, or position: ${this.position}, or this.power: ${this.scale}`);const e=this.scene.getObjectById(this.objectId);e&&e.children?(console.log(`[EXP] Exploding ${e.name} at: ${this.position.x}, ${this.position.y}, ${this.position.z}`),this.explodeObject(e)):console.log("[EXP] No children to explode!")}explodeObject(e){if(e.geometry)this.explodeLeafObject(e);else if(e.children.length>0){var t;ge()(t=e.children).call(t,(e=>this.explodeObject(e)))}else this.explodeLeafObject(e)}explodeLeafObject(e){if(e.geometry){if(e.userData.originalPosition=e.position.clone(),e instanceof ko){const t=new Zn,n=new xn,r=new bn,i=new xn;for(let s=0;s<e.count;++s){if(e.getMatrixAt(s,t),t.decompose(n,r,i),this.isExplodeUp){const e=(n.z-this.position.z)*this.scale;n.setZ(n.z+e)}else{const e=n.clone().sub(this.position);n.addScaledVector(e,this.scale)}t.setPosition(n),e.setMatrixAt(s,t)}e.matrixWorldNeedsUpdate=!0,e.instanceMatrix.needsUpdate=!0}else{const t=e.position.clone();if(e instanceof mi&&e.geometry&&e.geometry.boundingBox?e.geometry.boundingBox.getCenter(t):console.warn(`[EXP] Failed to get center for ${e.type} '${e.name||e.id}', will use its position as center`),this.isExplodeUp){const n=(t.z-this.position.z)*this.scale;e.position.setZ(t.z+n)}else{const n=t.sub(this.position);e.position.addScaledVector(n,this.scale)}}e.updateMatrix()}}unexplode(){const e=this.scene.getObjectById(this.objectId);e&&e.children?(console.log(`[EXP] Unexploding ${e.name} at: ${this.position.x}, ${this.position.y}, ${this.position.z}`),this.unexplodeObject(e)):console.log("[EXP] No children to explode!")}unexplodeObject(e){if(e.geometry)this.unexplodeLeafObject(e);else if(e.children.length>0){var t;ge()(t=e.children).call(t,(e=>this.unexplodeObject(e)))}else this.unexplodeLeafObject(e)}unexplodeLeafObject(e){const t=e.userData.originalPosition;t&&(e.position.set(t.x,t.y,t.z),e.updateMatrix(),delete e.userData.originalPosition)}setOnlyExplodeUp(e){this.isExplodeUp=e}getObjectCenter(e){const t=new En;if(!this.objectId)return void console.log(`[EXP] Invalid objectId: ${this.objectId}`);const n=this.scene.getObjectById(this.objectId);n&&n.children?(n.traverse((e=>{t.expandByObject(e)})),t.getCenter(e)):console.log("[EXP] No children to explode!")}}gh(nf,"DEFAULT_SCALE",1);class rf{static getVisibleObjectBoundingBox(e){const t=new En;return e.traverseVisible((e=>{e instanceof mi&&!1!==e.userData.selectable&&t.expandByObject(e)})),t}static getObjectsBoundingBox(e,t,n){const r=new En;return ge()(t).call(t,(t=>{const i=e.getObjectById(t);if(i){const e=rf.getBoundingBox(i,n);e.isEmpty()||r.union(e)}})),r}static getBoundingBox(e,t=!0){const n=new En;if(e instanceof ko)return rf.getInstancedMeshBoundingBox(e);if(0===e.children.length)return n.expandByObject(e),n;const r=e.children.length;let i=1;r>20&&(i=3),r>100&&(i=5),r>200&&(i=10),r>1e3&&(i=100),e.updateMatrixWorld(!1);for(let s=0;s<r;++s){const r=e.children[s];if(!t||s%i==0)if(r.updateMatrix(),r instanceof ko){const e=rf.getInstancedMeshBoundingBox(r);e.isEmpty()||n.union(e)}else if(cm.isMatrixValid(r.matrixWorld)){const e=rf.getBoundingBox(r);e.isEmpty()||n.union(e)}else console.warn(`[SceneUtils] Found object(${r.type}) with invalid matrix: ${r.matrixWorld.elements}`)}return e.geometry&&n.expandByObject(e),n}static getInstancedMeshBoundingBox(e){const t=new En,n=new Zn;for(let r=0;r<e.count;++r){e.getMatrixAt(r,n);const i=e.geometry.clone();if(i.boundingBox){const e=i.boundingBox.applyMatrix4(n);!e.isEmpty()&&cm.isBoxValid(e)&&t.union(e)}}return t.applyMatrix4(e.matrixWorld),t}static explodeObject(e,t,n,r=!1){n[e.id]&&n[e.id].unexplode();const i=new xn;rf.getPositionCenter(e,i);const s=new nf(t,e.id,i);s.setOnlyExplodeUp(r),s.explode(),n[e.id]=s}static explodeObjects(e,t,n,r=!1){return e.traverse((i=>{Se()(n).call(n,(e=>e===i.id))&&(i.children&&1===i.children.length?rf.explodeObject(i.children[0],e,t,r):rf.explodeObject(i,e,t,r))})),t}static unexplodeObjects(e,t){e.traverse((e=>{const n=t[e.id];n&&(n.unexplode(),delete t[e.id])}))}static getPositionCenter(e,t){const n=rf.getBoundingBox(e);n.getCenter(t),t.y=n.min.y}}var sf=n(20477),af=n.n(sf);function of(){return af()("/******/ var __webpack_modules__ = ({\n\n/***/ 95299:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(27698);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 83450:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(83363);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 83865:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(41793);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 90093:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(28196);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 82772:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(8065);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 3688:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(11955);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 39641:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(61577);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 83838:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(46279);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 15684:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(19373);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 41147:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(73819);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 40682:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(11022);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 12548:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(61798);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 5501:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(36857);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 99826:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(28427);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 84234:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(82073);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 7328:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(62856);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 90900:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(2348);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 96279:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(76361);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 79401:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(62908);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 57679:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(8933);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 92182:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(15868);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 28436:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(21917);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 97498:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(60155);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 72319:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(55169);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 36629:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(14873);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 9965:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(38849);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 83592:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(42119);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 65362:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(63383);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 91254:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(57396);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 43536:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(41910);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 23427:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(35021);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 45012:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(23059);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 42679:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(66877);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 34116:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(74888);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 25626:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(27460);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 55057:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(27989);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 66082:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(5519);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 48439:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(88004);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 40031:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(46509);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 91718:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(72010);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 54493:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(77971);\n__webpack_require__(53242);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Array.from;\n\n\n/***/ }),\n\n/***/ 24034:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(92737);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Array.isArray;\n\n\n/***/ }),\n\n/***/ 87716:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(94481);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').at;\n\n\n/***/ }),\n\n/***/ 15367:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(85906);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').concat;\n\n\n/***/ }),\n\n/***/ 62383:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(21501);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').filter;\n\n\n/***/ }),\n\n/***/ 17671:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(80833);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').find;\n\n\n/***/ }),\n\n/***/ 99324:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(2437);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').forEach;\n\n\n/***/ }),\n\n/***/ 8700:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(99076);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').indexOf;\n\n\n/***/ }),\n\n/***/ 95909:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\n__webpack_require__(55967);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').keys;\n\n\n/***/ }),\n\n/***/ 6442:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(75915);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').lastIndexOf;\n\n\n/***/ }),\n\n/***/ 23866:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(68787);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').map;\n\n\n/***/ }),\n\n/***/ 91876:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(11490);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').reverse;\n\n\n/***/ }),\n\n/***/ 24900:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(60186);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').slice;\n\n\n/***/ }),\n\n/***/ 2948:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(4115);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').sort;\n\n\n/***/ }),\n\n/***/ 78209:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(98611);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').splice;\n\n\n/***/ }),\n\n/***/ 14423:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\n__webpack_require__(55967);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Array').values;\n\n\n/***/ }),\n\n/***/ 27700:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(73381);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('Function').bind;\n\n\n/***/ }),\n\n/***/ 16246:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(27700);\n\nvar FunctionPrototype = Function.prototype;\n\nmodule.exports = function (it) {\n var own = it.bind;\n return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 56043:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(15367);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.concat;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 2480:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(62383);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.filter;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 32236:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(17671);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.find;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 34570:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(8700);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.indexOf;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 57564:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(6442);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.lastIndexOf;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.lastIndexOf) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 88287:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(23866);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.map;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 59257:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(80454);\n\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.repeat;\n return typeof it == 'string' || it === StringPrototype\n || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.repeat) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 91060:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(91876);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.reverse;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.reverse) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 69601:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(24900);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.slice;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 69355:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(2948);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.sort;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.sort) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 18339:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(78209);\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.splice;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.splice) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 62774:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(13348);\n\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.trim;\n return typeof it == 'string' || it === StringPrototype\n || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.trim) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 84426:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(32619);\nvar path = __webpack_require__(54058);\nvar apply = __webpack_require__(79730);\n\n// eslint-disable-next-line es/no-json -- safe\nif (!path.JSON) path.JSON = { stringify: JSON.stringify };\n\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nmodule.exports = function stringify(it, replacer, space) {\n return apply(path.JSON.stringify, null, arguments);\n};\n\n\n/***/ }),\n\n/***/ 91018:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\n__webpack_require__(37501);\n__webpack_require__(55967);\n__webpack_require__(77971);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Map;\n\n\n/***/ }),\n\n/***/ 95213:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(53874);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Math.imul;\n\n\n/***/ }),\n\n/***/ 88908:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(88359);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Math.log2;\n\n\n/***/ }),\n\n/***/ 76837:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(25499);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Math.sign;\n\n\n/***/ }),\n\n/***/ 97849:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(54973);\n\nmodule.exports = Math.pow(2, -52);\n\n\n/***/ }),\n\n/***/ 3820:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(30800);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Number.isInteger;\n\n\n/***/ }),\n\n/***/ 4723:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(71967);\n\nmodule.exports = 0x1FFFFFFFFFFFFF;\n\n\n/***/ }),\n\n/***/ 45999:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(49221);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Object.assign;\n\n\n/***/ }),\n\n/***/ 7702:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(74979);\nvar path = __webpack_require__(54058);\n\nvar Object = path.Object;\n\nvar defineProperties = module.exports = function defineProperties(T, D) {\n return Object.defineProperties(T, D);\n};\n\nif (Object.defineProperties.sham) defineProperties.sham = true;\n\n\n/***/ }),\n\n/***/ 48171:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(86450);\nvar path = __webpack_require__(54058);\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n\n\n/***/ }),\n\n/***/ 73770:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(15711);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Object.freeze;\n\n\n/***/ }),\n\n/***/ 48494:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(21724);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Object.keys;\n\n\n/***/ }),\n\n/***/ 7579:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(49718);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.parseFloat;\n\n\n/***/ }),\n\n/***/ 98524:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(14038);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.parseInt;\n\n\n/***/ }),\n\n/***/ 52956:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(47627);\n__webpack_require__(66274);\n__webpack_require__(55967);\n__webpack_require__(98881);\n__webpack_require__(4560);\n__webpack_require__(91302);\n__webpack_require__(44349);\n__webpack_require__(77971);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Promise;\n\n\n/***/ }),\n\n/***/ 76998:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\n__webpack_require__(55967);\n__webpack_require__(69008);\n__webpack_require__(77971);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.Set;\n\n\n/***/ }),\n\n/***/ 12318:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(93588);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('String').at;\n\n\n/***/ }),\n\n/***/ 80454:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(60986);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('String').repeat;\n\n\n/***/ }),\n\n/***/ 13348:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(57398);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('String').trim;\n\n\n/***/ }),\n\n/***/ 24227:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\n__webpack_require__(55967);\n__webpack_require__(77971);\n__webpack_require__(1825);\nvar WrappedWellKnownSymbolModule = __webpack_require__(11477);\n\nmodule.exports = WrappedWellKnownSymbolModule.f('iterator');\n\n\n/***/ }),\n\n/***/ 32304:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\n__webpack_require__(55967);\n__webpack_require__(54334);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.WeakMap;\n\n\n/***/ }),\n\n/***/ 27385:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(64225);\n\n\n/***/ }),\n\n/***/ 81522:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(30382);\n\n\n/***/ }),\n\n/***/ 66449:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(74352);\n\n\n/***/ }),\n\n/***/ 14122:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(89097);\n\n\n/***/ }),\n\n/***/ 21086:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(90898);\n\n\n/***/ }),\n\n/***/ 44442:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(51675);\n\n\n/***/ }),\n\n/***/ 2636:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(82535);\n\n\n/***/ }),\n\n/***/ 57152:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(82507);\n\n\n/***/ }),\n\n/***/ 69447:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(628);\n\n\n/***/ }),\n\n/***/ 56211:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* unused reexport */ __webpack_require__(29834);\n\n\n/***/ }),\n\n/***/ 25376:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(48460);\n\n\n/***/ }),\n\n/***/ 86942:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(88698);\n\n\n/***/ }),\n\n/***/ 79595:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(48646);\n\n\n/***/ }),\n\n/***/ 17579:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(33294);\n\n\n/***/ }),\n\n/***/ 81493:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(97088);\n\n\n/***/ }),\n\n/***/ 72858:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(8391);\n\n\n/***/ }),\n\n/***/ 71777:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(62792);\n\n\n/***/ }),\n\n/***/ 75425:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(36384);\n\n\n/***/ }),\n\n/***/ 99465:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(63249);\n\n\n/***/ }),\n\n/***/ 52740:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(59821);\n\n\n/***/ }),\n\n/***/ 86672:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(44574);\n\n\n/***/ }),\n\n/***/ 2753:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(14919);\n\n\n/***/ }),\n\n/***/ 18260:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(77700);\n\n\n/***/ }),\n\n/***/ 93376:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(63145);\n\n\n/***/ }),\n\n/***/ 78421:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(89974);\n\n\n/***/ }),\n\n/***/ 82320:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* unused reexport */ __webpack_require__(51230);\n\n\n/***/ }),\n\n/***/ 75632:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(12237);\n\n\n/***/ }),\n\n/***/ 60269:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(76936);\n\n\n/***/ }),\n\n/***/ 70573:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(18180);\n\n\n/***/ }),\n\n/***/ 73685:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(80621);\n\n\n/***/ }),\n\n/***/ 23252:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(62793);\n\n\n/***/ }),\n\n/***/ 93799:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(92093);\n\n\n/***/ }),\n\n/***/ 91645:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(35796);\n\n\n/***/ }),\n\n/***/ 53103:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(36309);\n\n\n/***/ }),\n\n/***/ 29531:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(32050);\n\n\n/***/ }),\n\n/***/ 24803:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* unused reexport */ __webpack_require__(31051);\n\n\n/***/ }),\n\n/***/ 65743:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(65309);\n\n\n/***/ }),\n\n/***/ 9759:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(27398);\n\n\n/***/ }),\n\n/***/ 58714:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(93463);\n\n\n/***/ }),\n\n/***/ 64225:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(95299);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 30382:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(83450);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 26627:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(83865);\n\n// TODO: Remove from `core-js@4`\n__webpack_require__(54322);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 74352:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\nvar arrayMethod = __webpack_require__(26627);\nvar stringMethod = __webpack_require__(9499);\n\nvar ArrayPrototype = Array.prototype;\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.at;\n if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.at)) return arrayMethod;\n if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.at)) {\n return stringMethod;\n } return own;\n};\n\n\n/***/ }),\n\n/***/ 89097:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(90093);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 90898:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(82772);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 51675:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(3688);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 82535:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(39641);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 82507:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(83838);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 628:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(15684);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 29834:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(41147);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 48460:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(40682);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 88698:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(12548);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 48646:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(5501);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 33294:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(99826);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 97088:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(84234);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 8391:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(7328);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 62792:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(90900);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 36384:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(96279);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 63249:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(79401);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 59821:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(57679);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 44574:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(92182);\n__webpack_require__(52453);\n__webpack_require__(32523);\n__webpack_require__(66591);\n__webpack_require__(55121);\n__webpack_require__(14751);\n__webpack_require__(52407);\n__webpack_require__(48580);\n__webpack_require__(27281);\n__webpack_require__(36507);\n__webpack_require__(93647);\n__webpack_require__(47641);\n__webpack_require__(18552);\n__webpack_require__(27693);\n__webpack_require__(8);\n__webpack_require__(48514);\n__webpack_require__(8212);\n__webpack_require__(89642);\n__webpack_require__(78485);\n// TODO: remove from `core-js@4`\n__webpack_require__(42256);\n// TODO: remove from `core-js@4`\n__webpack_require__(68826);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 14919:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(28436);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 77700:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(97498);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 63145:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(72319);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 89974:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(36629);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 51230:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(9965);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 12237:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(83592);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 76936:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(65362);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 18180:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(91254);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 80621:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(43536);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 62793:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(23427);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 92093:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(45012);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 35796:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(42679);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 36309:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(34116);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 32050:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(25626);\n__webpack_require__(89731);\n// TODO: Remove from `core-js@4`\n__webpack_require__(55708);\n__webpack_require__(30014);\n__webpack_require__(88731);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 31051:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(55057);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 65309:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(66082);\n__webpack_require__(95800);\n__webpack_require__(73676);\n__webpack_require__(32645);\n__webpack_require__(32578);\n__webpack_require__(4573);\n__webpack_require__(17421);\n__webpack_require__(13787);\n__webpack_require__(40256);\n__webpack_require__(52032);\n__webpack_require__(21873);\n__webpack_require__(26566);\n__webpack_require__(50987);\n__webpack_require__(71892);\n__webpack_require__(3352);\n__webpack_require__(76988);\n__webpack_require__(16875);\n__webpack_require__(3859);\n__webpack_require__(56690);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 9499:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(48439);\n// TODO: Remove from `core-js@4`\n__webpack_require__(54975);\nvar entryVirtual = __webpack_require__(35703);\n\nmodule.exports = entryVirtual('String').at;\n\n\n/***/ }),\n\n/***/ 27398:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(40031);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 93463:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(91718);\n__webpack_require__(77971);\n__webpack_require__(86442);\n__webpack_require__(26207);\n__webpack_require__(13215);\n__webpack_require__(4629);\n// TODO: remove from `core-js@4`\n__webpack_require__(4055);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 24883:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isCallable = __webpack_require__(57475);\nvar tryToString = __webpack_require__(69826);\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n\n\n/***/ }),\n\n/***/ 174:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isConstructor = __webpack_require__(24284);\nvar tryToString = __webpack_require__(69826);\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a constructor');\n};\n\n\n/***/ }),\n\n/***/ 11851:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isCallable = __webpack_require__(57475);\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n\n\n/***/ }),\n\n/***/ 18479:\n/***/ (function(module) {\n\nmodule.exports = function () { /* empty */ };\n\n\n/***/ }),\n\n/***/ 5743:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isPrototypeOf = __webpack_require__(7046);\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw $TypeError('Incorrect invocation');\n};\n\n\n/***/ }),\n\n/***/ 96059:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10941);\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n\n\n/***/ }),\n\n/***/ 97135:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it\nvar fails = __webpack_require__(95981);\n\nmodule.exports = fails(function () {\n if (typeof ArrayBuffer == 'function') {\n var buffer = new ArrayBuffer(8);\n // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe\n if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });\n }\n});\n\n\n/***/ }),\n\n/***/ 56837:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $forEach = (__webpack_require__(3610).forEach);\nvar arrayMethodIsStrict = __webpack_require__(34194);\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n} : [].forEach;\n\n\n/***/ }),\n\n/***/ 11354:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar toObject = __webpack_require__(89678);\nvar callWithSafeIterationClosing = __webpack_require__(75196);\nvar isArrayIteratorMethod = __webpack_require__(6782);\nvar isConstructor = __webpack_require__(24284);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar createProperty = __webpack_require__(55449);\nvar getIterator = __webpack_require__(53476);\nvar getIteratorMethod = __webpack_require__(22902);\n\nvar $Array = Array;\n\n// `Array.from` method implementation\n// https://tc39.es/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var IS_CONSTRUCTOR = isConstructor(this);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = getIterator(O, iteratorMethod);\n next = iterator.next;\n result = IS_CONSTRUCTOR ? new this() : [];\n for (;!(step = call(next, iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = lengthOfArrayLike(O);\n result = IS_CONSTRUCTOR ? new this(length) : $Array(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n\n\n/***/ }),\n\n/***/ 31692:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toIndexedObject = __webpack_require__(74529);\nvar toAbsoluteIndex = __webpack_require__(59413);\nvar lengthOfArrayLike = __webpack_require__(10623);\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n\n\n/***/ }),\n\n/***/ 3610:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar bind = __webpack_require__(86843);\nvar uncurryThis = __webpack_require__(95329);\nvar IndexedObject = __webpack_require__(37026);\nvar toObject = __webpack_require__(89678);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar arraySpeciesCreate = __webpack_require__(64692);\n\nvar push = uncurryThis([].push);\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var IS_FILTER_REJECT = TYPE == 7;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that);\n var length = lengthOfArrayLike(self);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n};\n\n\n/***/ }),\n\n/***/ 67145:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\n/* eslint-disable es/no-array-prototype-lastindexof -- safe */\nvar apply = __webpack_require__(79730);\nvar toIndexedObject = __webpack_require__(74529);\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar arrayMethodIsStrict = __webpack_require__(34194);\n\nvar min = Math.min;\nvar $lastIndexOf = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');\nvar FORCED = NEGATIVE_ZERO || !STRICT_METHOD;\n\n// `Array.prototype.lastIndexOf` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.lastindexof\nmodule.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;\n var O = toIndexedObject(this);\n var length = lengthOfArrayLike(O);\n var index = length - 1;\n if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;\n return -1;\n} : $lastIndexOf;\n\n\n/***/ }),\n\n/***/ 50568:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar V8_VERSION = __webpack_require__(53385);\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n\n\n/***/ }),\n\n/***/ 34194:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar fails = __webpack_require__(95981);\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call -- required for testing\n method.call(null, argument || function () { return 1; }, 1);\n });\n};\n\n\n/***/ }),\n\n/***/ 89779:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar isArray = __webpack_require__(1052);\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Safari < 13 does not throw an error in this case\nvar SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {\n // makes no sense without proper strict mode support\n if (this !== undefined) return true;\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty([], 'length', { writable: false }).length = 1;\n } catch (error) {\n return error instanceof TypeError;\n }\n}();\n\nmodule.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {\n if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {\n throw $TypeError('Cannot set read only .length');\n } return O.length = length;\n} : function (O, length) {\n return O.length = length;\n};\n\n\n/***/ }),\n\n/***/ 15790:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toAbsoluteIndex = __webpack_require__(59413);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar createProperty = __webpack_require__(55449);\n\nvar $Array = Array;\nvar max = Math.max;\n\nmodule.exports = function (O, start, end) {\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = $Array(max(fin - k, 0));\n for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n};\n\n\n/***/ }),\n\n/***/ 93765:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\n\nmodule.exports = uncurryThis([].slice);\n\n\n/***/ }),\n\n/***/ 61388:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar arraySlice = __webpack_require__(15790);\n\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n array,\n mergeSort(arraySlice(array, 0, middle), comparefn),\n mergeSort(arraySlice(array, middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (array, left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n\n while (lindex < llength || rindex < rlength) {\n array[lindex + rindex] = (lindex < llength && rindex < rlength)\n ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]\n : lindex < llength ? left[lindex++] : right[rindex++];\n } return array;\n};\n\nmodule.exports = mergeSort;\n\n\n/***/ }),\n\n/***/ 5693:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isArray = __webpack_require__(1052);\nvar isConstructor = __webpack_require__(24284);\nvar isObject = __webpack_require__(10941);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? $Array : C;\n};\n\n\n/***/ }),\n\n/***/ 64692:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar arraySpeciesConstructor = __webpack_require__(5693);\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n\n\n/***/ }),\n\n/***/ 75196:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(96059);\nvar iteratorClose = __webpack_require__(7609);\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n};\n\n\n/***/ }),\n\n/***/ 21385:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n\n\n/***/ }),\n\n/***/ 82532:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n\n\n/***/ }),\n\n/***/ 9697:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar TO_STRING_TAG_SUPPORT = __webpack_require__(22885);\nvar isCallable = __webpack_require__(57475);\nvar classofRaw = __webpack_require__(82532);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n\n\n/***/ }),\n\n/***/ 7622:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\n\n// https://github.com/tc39/collection-methods\nmodule.exports = function addAll(/* ...elements */) {\n var set = anObject(this);\n var adder = aCallable(set.add);\n for (var k = 0, len = arguments.length; k < len; k++) {\n call(adder, set, arguments[k]);\n }\n return set;\n};\n\n\n/***/ }),\n\n/***/ 28984:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\n\n// https://github.com/tc39/collection-methods\nmodule.exports = function deleteAll(/* ...elements */) {\n var collection = anObject(this);\n var remover = aCallable(collection['delete']);\n var allDeleted = true;\n var wasDeleted;\n for (var k = 0, len = arguments.length; k < len; k++) {\n wasDeleted = call(remover, collection, arguments[k]);\n allDeleted = allDeleted && wasDeleted;\n }\n return !!allDeleted;\n};\n\n\n/***/ }),\n\n/***/ 83590:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\n// https://tc39.github.io/proposal-setmap-offrom/\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar aConstructor = __webpack_require__(174);\nvar isNullOrUndefined = __webpack_require__(82119);\nvar iterate = __webpack_require__(93091);\n\nvar push = [].push;\n\nmodule.exports = function from(source /* , mapFn, thisArg */) {\n var length = arguments.length;\n var mapFn = length > 1 ? arguments[1] : undefined;\n var mapping, array, n, boundFunction;\n aConstructor(this);\n mapping = mapFn !== undefined;\n if (mapping) aCallable(mapFn);\n if (isNullOrUndefined(source)) return new this();\n array = [];\n if (mapping) {\n n = 0;\n boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined);\n iterate(source, function (nextItem) {\n call(push, array, boundFunction(nextItem, n++));\n });\n } else {\n iterate(source, push, { that: array });\n }\n return new this(array);\n};\n\n\n/***/ }),\n\n/***/ 45226:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar arraySlice = __webpack_require__(93765);\n\n// https://tc39.github.io/proposal-setmap-offrom/\nmodule.exports = function of() {\n return new this(arraySlice(arguments));\n};\n\n\n/***/ }),\n\n/***/ 85616:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar defineProperty = (__webpack_require__(65988).f);\nvar create = __webpack_require__(29290);\nvar defineBuiltIns = __webpack_require__(94380);\nvar bind = __webpack_require__(86843);\nvar anInstance = __webpack_require__(5743);\nvar isNullOrUndefined = __webpack_require__(82119);\nvar iterate = __webpack_require__(93091);\nvar defineIterator = __webpack_require__(75105);\nvar createIterResultObject = __webpack_require__(23538);\nvar setSpecies = __webpack_require__(94431);\nvar DESCRIPTORS = __webpack_require__(55746);\nvar fastKey = (__webpack_require__(21647).fastKey);\nvar InternalStateModule = __webpack_require__(45402);\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key) return entry;\n }\n };\n\n defineBuiltIns(Prototype, {\n // `{ Map, Set }.prototype.clear()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.clear\n // https://tc39.es/ecma262/#sec-set.prototype.clear\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // `{ Map, Set }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.delete\n // https://tc39.es/ecma262/#sec-set.prototype.delete\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first == entry) state.first = next;\n if (state.last == entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.foreach\n // https://tc39.es/ecma262/#sec-set.prototype.foreach\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // `{ Map, Set}.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.has\n // https://tc39.es/ecma262/#sec-set.prototype.has\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n defineBuiltIns(Prototype, IS_MAP ? {\n // `Map.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-map.prototype.get\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // `Map.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-map.prototype.set\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // `Set.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-set.prototype.add\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineProperty(Prototype, 'size', {\n get: function () {\n return getInternalState(this).size;\n }\n });\n return Constructor;\n },\n setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.entries\n // https://tc39.es/ecma262/#sec-map.prototype.keys\n // https://tc39.es/ecma262/#sec-map.prototype.values\n // https://tc39.es/ecma262/#sec-map.prototype-@@iterator\n // https://tc39.es/ecma262/#sec-set.prototype.entries\n // https://tc39.es/ecma262/#sec-set.prototype.keys\n // https://tc39.es/ecma262/#sec-set.prototype.values\n // https://tc39.es/ecma262/#sec-set.prototype-@@iterator\n defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = undefined;\n return createIterResultObject(undefined, true);\n }\n // return step by kind\n if (kind == 'keys') return createIterResultObject(entry.key, false);\n if (kind == 'values') return createIterResultObject(entry.value, false);\n return createIterResultObject([entry.key, entry.value], false);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // `{ Map, Set }.prototype[@@species]` accessors\n // https://tc39.es/ecma262/#sec-get-map-@@species\n // https://tc39.es/ecma262/#sec-get-set-@@species\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n\n\n/***/ }),\n\n/***/ 8850:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar uncurryThis = __webpack_require__(95329);\nvar defineBuiltIns = __webpack_require__(94380);\nvar getWeakData = (__webpack_require__(21647).getWeakData);\nvar anInstance = __webpack_require__(5743);\nvar anObject = __webpack_require__(96059);\nvar isNullOrUndefined = __webpack_require__(82119);\nvar isObject = __webpack_require__(10941);\nvar iterate = __webpack_require__(93091);\nvar ArrayIterationModule = __webpack_require__(3610);\nvar hasOwn = __webpack_require__(90953);\nvar InternalStateModule = __webpack_require__(45402);\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\nvar find = ArrayIterationModule.find;\nvar findIndex = ArrayIterationModule.findIndex;\nvar splice = uncurryThis([].splice);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (store) {\n return store.frozen || (store.frozen = new UncaughtFrozenStore());\n};\n\nvar UncaughtFrozenStore = function () {\n this.entries = [];\n};\n\nvar findUncaughtFrozen = function (store, key) {\n return find(store.entries, function (it) {\n return it[0] === key;\n });\n};\n\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.entries.push([key, value]);\n },\n 'delete': function (key) {\n var index = findIndex(this.entries, function (it) {\n return it[0] === key;\n });\n if (~index) splice(this.entries, index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n id: id++,\n frozen: undefined\n });\n if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var data = getWeakData(anObject(key), true);\n if (data === true) uncaughtFrozenStore(state).set(key, value);\n else data[state.id] = value;\n return that;\n };\n\n defineBuiltIns(Prototype, {\n // `{ WeakMap, WeakSet }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-weakmap.prototype.delete\n // https://tc39.es/ecma262/#sec-weakset.prototype.delete\n 'delete': function (key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state)['delete'](key);\n return data && hasOwn(data, state.id) && delete data[state.id];\n },\n // `{ WeakMap, WeakSet }.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-weakmap.prototype.has\n // https://tc39.es/ecma262/#sec-weakset.prototype.has\n has: function has(key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).has(key);\n return data && hasOwn(data, state.id);\n }\n });\n\n defineBuiltIns(Prototype, IS_MAP ? {\n // `WeakMap.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-weakmap.prototype.get\n get: function get(key) {\n var state = getInternalState(this);\n if (isObject(key)) {\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).get(key);\n return data ? data[state.id] : undefined;\n }\n },\n // `WeakMap.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-weakmap.prototype.set\n set: function set(key, value) {\n return define(this, key, value);\n }\n } : {\n // `WeakSet.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-weakset.prototype.add\n add: function add(value) {\n return define(this, value, true);\n }\n });\n\n return Constructor;\n }\n};\n\n\n/***/ }),\n\n/***/ 24683:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar global = __webpack_require__(21899);\nvar InternalMetadataModule = __webpack_require__(21647);\nvar fails = __webpack_require__(95981);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar iterate = __webpack_require__(93091);\nvar anInstance = __webpack_require__(5743);\nvar isCallable = __webpack_require__(57475);\nvar isObject = __webpack_require__(10941);\nvar setToStringTag = __webpack_require__(90904);\nvar defineProperty = (__webpack_require__(65988).f);\nvar forEach = (__webpack_require__(3610).forEach);\nvar DESCRIPTORS = __webpack_require__(55746);\nvar InternalStateModule = __webpack_require__(45402);\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var exported = {};\n var Constructor;\n\n if (!DESCRIPTORS || !isCallable(NativeConstructor)\n || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))\n ) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.enable();\n } else {\n Constructor = wrapper(function (target, iterable) {\n setInternalState(anInstance(target, Prototype), {\n type: CONSTRUCTOR_NAME,\n collection: new NativeConstructor()\n });\n if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {\n createNonEnumerableProperty(Prototype, KEY, function (a, b) {\n var collection = getInternalState(this).collection;\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = collection[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n }\n });\n\n IS_WEAK || defineProperty(Prototype, 'size', {\n configurable: true,\n get: function () {\n return getInternalState(this).collection.size;\n }\n });\n }\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: true }, exported);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n\n\n/***/ }),\n\n/***/ 23489:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar hasOwn = __webpack_require__(90953);\nvar ownKeys = __webpack_require__(31136);\nvar getOwnPropertyDescriptorModule = __webpack_require__(49677);\nvar definePropertyModule = __webpack_require__(65988);\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n\n\n/***/ }),\n\n/***/ 64160:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n\n\n/***/ }),\n\n/***/ 23538:\n/***/ (function(module) {\n\n// `CreateIterResultObject` abstract operation\n// https://tc39.es/ecma262/#sec-createiterresultobject\nmodule.exports = function (value, done) {\n return { value: value, done: done };\n};\n\n\n/***/ }),\n\n/***/ 32029:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar definePropertyModule = __webpack_require__(65988);\nvar createPropertyDescriptor = __webpack_require__(31887);\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n/***/ }),\n\n/***/ 31887:\n/***/ (function(module) {\n\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n/***/ }),\n\n/***/ 55449:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar toPropertyKey = __webpack_require__(83894);\nvar definePropertyModule = __webpack_require__(65988);\nvar createPropertyDescriptor = __webpack_require__(31887);\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n\n\n/***/ }),\n\n/***/ 95929:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar createNonEnumerableProperty = __webpack_require__(32029);\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n return target;\n};\n\n\n/***/ }),\n\n/***/ 94380:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar defineBuiltIn = __webpack_require__(95929);\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else defineBuiltIn(target, key, src[key], options);\n } return target;\n};\n\n\n/***/ }),\n\n/***/ 75609:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n\n\n/***/ }),\n\n/***/ 15863:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar tryToString = __webpack_require__(69826);\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n\n\n/***/ }),\n\n/***/ 55746:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n\n\n/***/ }),\n\n/***/ 76616:\n/***/ (function(module) {\n\nvar documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n\n\n/***/ }),\n\n/***/ 61333:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar isObject = __webpack_require__(10941);\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n\n\n/***/ }),\n\n/***/ 66796:\n/***/ (function(module) {\n\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n\n\n/***/ }),\n\n/***/ 63281:\n/***/ (function(module) {\n\n// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n\n\n/***/ }),\n\n/***/ 34342:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar userAgent = __webpack_require__(2861);\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n\n\n/***/ }),\n\n/***/ 23321:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar IS_DENO = __webpack_require__(48501);\nvar IS_NODE = __webpack_require__(6049);\n\nmodule.exports = !IS_DENO && !IS_NODE\n && typeof window == 'object'\n && typeof document == 'object';\n\n\n/***/ }),\n\n/***/ 48501:\n/***/ (function(module) {\n\n/* global Deno -- Deno case */\nmodule.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';\n\n\n/***/ }),\n\n/***/ 81046:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar UA = __webpack_require__(2861);\n\nmodule.exports = /MSIE|Trident/.test(UA);\n\n\n/***/ }),\n\n/***/ 4470:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar userAgent = __webpack_require__(2861);\nvar global = __webpack_require__(21899);\n\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;\n\n\n/***/ }),\n\n/***/ 22749:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar userAgent = __webpack_require__(2861);\n\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n\n\n/***/ }),\n\n/***/ 6049:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar classof = __webpack_require__(82532);\nvar global = __webpack_require__(21899);\n\nmodule.exports = classof(global.process) == 'process';\n\n\n/***/ }),\n\n/***/ 58045:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar userAgent = __webpack_require__(2861);\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n\n\n/***/ }),\n\n/***/ 2861:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar getBuiltIn = __webpack_require__(626);\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n\n\n/***/ }),\n\n/***/ 53385:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar userAgent = __webpack_require__(2861);\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n\n\n/***/ }),\n\n/***/ 18938:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar userAgent = __webpack_require__(2861);\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n\n\n/***/ }),\n\n/***/ 35703:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar path = __webpack_require__(54058);\n\nmodule.exports = function (CONSTRUCTOR) {\n return path[CONSTRUCTOR + 'Prototype'];\n};\n\n\n/***/ }),\n\n/***/ 56759:\n/***/ (function(module) {\n\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n\n\n/***/ }),\n\n/***/ 53995:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n\n\n/***/ }),\n\n/***/ 18780:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\nvar createPropertyDescriptor = __webpack_require__(31887);\n\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n\n\n/***/ }),\n\n/***/ 76887:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar global = __webpack_require__(21899);\nvar apply = __webpack_require__(79730);\nvar uncurryThis = __webpack_require__(95329);\nvar isCallable = __webpack_require__(57475);\nvar getOwnPropertyDescriptor = (__webpack_require__(49677).f);\nvar isForced = __webpack_require__(37252);\nvar path = __webpack_require__(54058);\nvar bind = __webpack_require__(86843);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar hasOwn = __webpack_require__(90953);\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n\n\n/***/ }),\n\n/***/ 95981:\n/***/ (function(module) {\n\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n\n/***/ }),\n\n/***/ 45602:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing\n return Object.isExtensible(Object.preventExtensions({}));\n});\n\n\n/***/ }),\n\n/***/ 79730:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar NATIVE_BIND = __webpack_require__(18285);\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n/***/ }),\n\n/***/ 86843:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar aCallable = __webpack_require__(24883);\nvar NATIVE_BIND = __webpack_require__(18285);\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n/***/ }),\n\n/***/ 18285:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n\n\n/***/ }),\n\n/***/ 98308:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar uncurryThis = __webpack_require__(95329);\nvar aCallable = __webpack_require__(24883);\nvar isObject = __webpack_require__(10941);\nvar hasOwn = __webpack_require__(90953);\nvar arraySlice = __webpack_require__(93765);\nvar NATIVE_BIND = __webpack_require__(18285);\n\nvar $Function = Function;\nvar concat = uncurryThis([].concat);\nvar join = uncurryThis([].join);\nvar factories = {};\n\nvar construct = function (C, argsLength, args) {\n if (!hasOwn(factories, argsLength)) {\n for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';\n factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');\n } return factories[argsLength](C, args);\n};\n\n// `Function.prototype.bind` method implementation\n// https://tc39.es/ecma262/#sec-function.prototype.bind\nmodule.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {\n var F = aCallable(this);\n var Prototype = F.prototype;\n var partArgs = arraySlice(arguments, 1);\n var boundFunction = function bound(/* args... */) {\n var args = concat(partArgs, arraySlice(arguments));\n return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);\n };\n if (isObject(Prototype)) boundFunction.prototype = Prototype;\n return boundFunction;\n};\n\n\n/***/ }),\n\n/***/ 78834:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar NATIVE_BIND = __webpack_require__(18285);\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n\n\n/***/ }),\n\n/***/ 79417:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar hasOwn = __webpack_require__(90953);\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n\n\n/***/ }),\n\n/***/ 95329:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar NATIVE_BIND = __webpack_require__(18285);\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n\n\n/***/ }),\n\n/***/ 626:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar path = __webpack_require__(54058);\nvar global = __webpack_require__(21899);\nvar isCallable = __webpack_require__(57475);\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n\n\n/***/ }),\n\n/***/ 22902:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar classof = __webpack_require__(9697);\nvar getMethod = __webpack_require__(14229);\nvar isNullOrUndefined = __webpack_require__(82119);\nvar Iterators = __webpack_require__(12077);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || Iterators[classof(it)];\n};\n\n\n/***/ }),\n\n/***/ 53476:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar tryToString = __webpack_require__(69826);\nvar getIteratorMethod = __webpack_require__(22902);\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw $TypeError(tryToString(argument) + ' is not iterable');\n};\n\n\n/***/ }),\n\n/***/ 79993:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar getIterator = __webpack_require__(53476);\n\nmodule.exports = getIterator;\n\n\n/***/ }),\n\n/***/ 14229:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar aCallable = __webpack_require__(24883);\nvar isNullOrUndefined = __webpack_require__(82119);\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n\n\n/***/ }),\n\n/***/ 69571:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar getIterator = __webpack_require__(53476);\n\nmodule.exports = getIterator;\n\n\n/***/ }),\n\n/***/ 21899:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n\n\n/***/ }),\n\n/***/ 90953:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar toObject = __webpack_require__(89678);\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n\n\n/***/ }),\n\n/***/ 27748:\n/***/ (function(module) {\n\nmodule.exports = {};\n\n\n/***/ }),\n\n/***/ 34845:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length == 1 ? console.error(a) : console.error(a, b);\n }\n};\n\n\n/***/ }),\n\n/***/ 15463:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar getBuiltIn = __webpack_require__(626);\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n\n\n/***/ }),\n\n/***/ 2840:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar fails = __webpack_require__(95981);\nvar createElement = __webpack_require__(61333);\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n\n\n/***/ }),\n\n/***/ 37026:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar fails = __webpack_require__(95981);\nvar classof = __webpack_require__(82532);\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n\n\n/***/ }),\n\n/***/ 81302:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar isCallable = __webpack_require__(57475);\nvar store = __webpack_require__(63030);\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n\n\n/***/ }),\n\n/***/ 53794:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10941);\nvar createNonEnumerableProperty = __webpack_require__(32029);\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n\n\n/***/ }),\n\n/***/ 21647:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar uncurryThis = __webpack_require__(95329);\nvar hiddenKeys = __webpack_require__(27748);\nvar isObject = __webpack_require__(10941);\nvar hasOwn = __webpack_require__(90953);\nvar defineProperty = (__webpack_require__(65988).f);\nvar getOwnPropertyNamesModule = __webpack_require__(10946);\nvar getOwnPropertyNamesExternalModule = __webpack_require__(684);\nvar isExtensible = __webpack_require__(91584);\nvar uid = __webpack_require__(99418);\nvar FREEZING = __webpack_require__(45602);\n\nvar REQUIRED = false;\nvar METADATA = uid('meta');\nvar id = 0;\n\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, { value: {\n objectID: 'O' + id++, // object ID\n weakData: {} // weak collections IDs\n } });\n};\n\nvar fastKey = function (it, create) {\n // return a primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!hasOwn(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMetadata(it);\n // return object ID\n } return it[METADATA].objectID;\n};\n\nvar getWeakData = function (it, create) {\n if (!hasOwn(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMetadata(it);\n // return the store of weak collections IDs\n } return it[METADATA].weakData;\n};\n\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar enable = function () {\n meta.enable = function () { /* empty */ };\n REQUIRED = true;\n var getOwnPropertyNames = getOwnPropertyNamesModule.f;\n var splice = uncurryThis([].splice);\n var test = {};\n test[METADATA] = 1;\n\n // prevent exposing of metadata key\n if (getOwnPropertyNames(test).length) {\n getOwnPropertyNamesModule.f = function (it) {\n var result = getOwnPropertyNames(it);\n for (var i = 0, length = result.length; i < length; i++) {\n if (result[i] === METADATA) {\n splice(result, i, 1);\n break;\n }\n } return result;\n };\n\n $({ target: 'Object', stat: true, forced: true }, {\n getOwnPropertyNames: getOwnPropertyNamesExternalModule.f\n });\n }\n};\n\nvar meta = module.exports = {\n enable: enable,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\n\nhiddenKeys[METADATA] = true;\n\n\n/***/ }),\n\n/***/ 45402:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar NATIVE_WEAK_MAP = __webpack_require__(47093);\nvar global = __webpack_require__(21899);\nvar uncurryThis = __webpack_require__(95329);\nvar isObject = __webpack_require__(10941);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar hasOwn = __webpack_require__(90953);\nvar shared = __webpack_require__(63030);\nvar sharedKey = __webpack_require__(44262);\nvar hiddenKeys = __webpack_require__(27748);\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n\n\n/***/ }),\n\n/***/ 6782:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar wellKnownSymbol = __webpack_require__(99813);\nvar Iterators = __webpack_require__(12077);\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n\n\n/***/ }),\n\n/***/ 1052:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar classof = __webpack_require__(82532);\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n\n\n/***/ }),\n\n/***/ 57475:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar $documentAll = __webpack_require__(76616);\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n\n\n/***/ }),\n\n/***/ 24284:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar fails = __webpack_require__(95981);\nvar isCallable = __webpack_require__(57475);\nvar classof = __webpack_require__(9697);\nvar getBuiltIn = __webpack_require__(626);\nvar inspectSource = __webpack_require__(81302);\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n\n\n/***/ }),\n\n/***/ 37252:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\nvar isCallable = __webpack_require__(57475);\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n\n\n/***/ }),\n\n/***/ 54639:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10941);\n\nvar floor = Math.floor;\n\n// `IsIntegralNumber` abstract operation\n// https://tc39.es/ecma262/#sec-isintegralnumber\n// eslint-disable-next-line es/no-number-isinteger -- safe\nmodule.exports = Number.isInteger || function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n\n/***/ }),\n\n/***/ 82119:\n/***/ (function(module) {\n\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n\n\n/***/ }),\n\n/***/ 10941:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isCallable = __webpack_require__(57475);\nvar $documentAll = __webpack_require__(76616);\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n\n\n/***/ }),\n\n/***/ 82529:\n/***/ (function(module) {\n\nmodule.exports = true;\n\n\n/***/ }),\n\n/***/ 56664:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar getBuiltIn = __webpack_require__(626);\nvar isCallable = __webpack_require__(57475);\nvar isPrototypeOf = __webpack_require__(7046);\nvar USE_SYMBOL_AS_UID = __webpack_require__(32302);\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n\n\n/***/ }),\n\n/***/ 93091:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar anObject = __webpack_require__(96059);\nvar tryToString = __webpack_require__(69826);\nvar isArrayIteratorMethod = __webpack_require__(6782);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar isPrototypeOf = __webpack_require__(7046);\nvar getIterator = __webpack_require__(53476);\nvar getIteratorMethod = __webpack_require__(22902);\nvar iteratorClose = __webpack_require__(7609);\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n\n\n/***/ }),\n\n/***/ 7609:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar call = __webpack_require__(78834);\nvar anObject = __webpack_require__(96059);\nvar getMethod = __webpack_require__(14229);\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n\n\n/***/ }),\n\n/***/ 53847:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar IteratorPrototype = (__webpack_require__(35143).IteratorPrototype);\nvar create = __webpack_require__(29290);\nvar createPropertyDescriptor = __webpack_require__(31887);\nvar setToStringTag = __webpack_require__(90904);\nvar Iterators = __webpack_require__(12077);\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n\n\n/***/ }),\n\n/***/ 75105:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar IS_PURE = __webpack_require__(82529);\nvar FunctionName = __webpack_require__(79417);\nvar isCallable = __webpack_require__(57475);\nvar createIteratorConstructor = __webpack_require__(53847);\nvar getPrototypeOf = __webpack_require__(249);\nvar setPrototypeOf = __webpack_require__(88929);\nvar setToStringTag = __webpack_require__(90904);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar defineBuiltIn = __webpack_require__(95929);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar Iterators = __webpack_require__(12077);\nvar IteratorsCore = __webpack_require__(35143);\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return call(nativeIterator, this); };\n }\n }\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n defineBuiltIn(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n\n return methods;\n};\n\n\n/***/ }),\n\n/***/ 35143:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar fails = __webpack_require__(95981);\nvar isCallable = __webpack_require__(57475);\nvar isObject = __webpack_require__(10941);\nvar create = __webpack_require__(29290);\nvar getPrototypeOf = __webpack_require__(249);\nvar defineBuiltIn = __webpack_require__(95929);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar IS_PURE = __webpack_require__(82529);\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n\n\n/***/ }),\n\n/***/ 12077:\n/***/ (function(module) {\n\nmodule.exports = {};\n\n\n/***/ }),\n\n/***/ 10623:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toLength = __webpack_require__(43057);\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n\n\n/***/ }),\n\n/***/ 48721:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\n\n// `Map.prototype.emplace` method\n// https://github.com/thumbsupep/proposal-upsert\nmodule.exports = function emplace(key, handler) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var value, inserted;\n if (call(has, map, key)) {\n value = call(get, map, key);\n if ('update' in handler) {\n value = handler.update(value, key, map);\n call(set, map, key, value);\n } return value;\n }\n inserted = handler.insert(key, map);\n call(set, map, key, inserted);\n return inserted;\n};\n\n\n/***/ }),\n\n/***/ 20716:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar isCallable = __webpack_require__(57475);\nvar anObject = __webpack_require__(96059);\n\nvar $TypeError = TypeError;\n\n// `Map.prototype.upsert` method\n// https://github.com/thumbsupep/proposal-upsert\nmodule.exports = function upsert(key, updateFn /* , insertFn */) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var insertFn = arguments.length > 2 ? arguments[2] : undefined;\n var value;\n if (!isCallable(updateFn) && !isCallable(insertFn)) {\n throw $TypeError('At least one callback required');\n }\n if (call(has, map, key)) {\n value = call(get, map, key);\n if (isCallable(updateFn)) {\n value = updateFn(value);\n call(set, map, key, value);\n }\n } else if (isCallable(insertFn)) {\n value = insertFn();\n call(set, map, key, value);\n } return value;\n};\n\n\n/***/ }),\n\n/***/ 6383:\n/***/ (function(module) {\n\n// `Math.sign` method implementation\n// https://tc39.es/ecma262/#sec-math.sign\n// eslint-disable-next-line es/no-math-sign -- safe\nmodule.exports = Math.sign || function sign(x) {\n var n = +x;\n // eslint-disable-next-line no-self-compare -- NaN check\n return n == 0 || n != n ? n : n < 0 ? -1 : 1;\n};\n\n\n/***/ }),\n\n/***/ 35331:\n/***/ (function(module) {\n\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n\n\n/***/ }),\n\n/***/ 66132:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar bind = __webpack_require__(86843);\nvar getOwnPropertyDescriptor = (__webpack_require__(49677).f);\nvar macrotask = (__webpack_require__(42941).set);\nvar IS_IOS = __webpack_require__(22749);\nvar IS_IOS_PEBBLE = __webpack_require__(4470);\nvar IS_WEBOS_WEBKIT = __webpack_require__(58045);\nvar IS_NODE = __webpack_require__(6049);\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // strange IE + webpack dev server bug - use .bind(global)\n macrotask = bind(macrotask, global);\n notify = function () {\n macrotask(flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n\n\n/***/ }),\n\n/***/ 69520:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar aCallable = __webpack_require__(24883);\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n\n\n/***/ }),\n\n/***/ 14649:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toString = __webpack_require__(85803);\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n\n\n/***/ }),\n\n/***/ 81942:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar fails = __webpack_require__(95981);\nvar uncurryThis = __webpack_require__(95329);\nvar toString = __webpack_require__(85803);\nvar trim = (__webpack_require__(74853).trim);\nvar whitespaces = __webpack_require__(73483);\n\nvar charAt = uncurryThis(''.charAt);\nvar $parseFloat = global.parseFloat;\nvar Symbol = global.Symbol;\nvar ITERATOR = Symbol && Symbol.iterator;\nvar FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity\n // MS Edge 18- broken with boxed symbols\n || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(toString(string));\n var result = $parseFloat(trimmedString);\n return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;\n} : $parseFloat;\n\n\n/***/ }),\n\n/***/ 29806:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar fails = __webpack_require__(95981);\nvar uncurryThis = __webpack_require__(95329);\nvar toString = __webpack_require__(85803);\nvar trim = (__webpack_require__(74853).trim);\nvar whitespaces = __webpack_require__(73483);\n\nvar $parseInt = global.parseInt;\nvar Symbol = global.Symbol;\nvar ITERATOR = Symbol && Symbol.iterator;\nvar hex = /^[+-]?0x/i;\nvar exec = uncurryThis(hex.exec);\nvar FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22\n // MS Edge 18- broken with boxed symbols\n || (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));\n\n// `parseInt` method\n// https://tc39.es/ecma262/#sec-parseint-string-radix\nmodule.exports = FORCED ? function parseInt(string, radix) {\n var S = trim(toString(string));\n return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));\n} : $parseInt;\n\n\n/***/ }),\n\n/***/ 24420:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar uncurryThis = __webpack_require__(95329);\nvar call = __webpack_require__(78834);\nvar fails = __webpack_require__(95981);\nvar objectKeys = __webpack_require__(14771);\nvar getOwnPropertySymbolsModule = __webpack_require__(87857);\nvar propertyIsEnumerableModule = __webpack_require__(36760);\nvar toObject = __webpack_require__(89678);\nvar IndexedObject = __webpack_require__(37026);\n\n// eslint-disable-next-line es/no-object-assign -- safe\nvar $assign = Object.assign;\n// eslint-disable-next-line es/no-object-defineproperty -- required for testing\nvar defineProperty = Object.defineProperty;\nvar concat = uncurryThis([].concat);\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line es/no-symbol -- safe\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n\n\n/***/ }),\n\n/***/ 29290:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* global ActiveXObject -- old IE, WSH */\nvar anObject = __webpack_require__(96059);\nvar definePropertiesModule = __webpack_require__(59938);\nvar enumBugKeys = __webpack_require__(56759);\nvar hiddenKeys = __webpack_require__(27748);\nvar html = __webpack_require__(15463);\nvar documentCreateElement = __webpack_require__(61333);\nvar sharedKey = __webpack_require__(44262);\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n\n\n/***/ }),\n\n/***/ 59938:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(83937);\nvar definePropertyModule = __webpack_require__(65988);\nvar anObject = __webpack_require__(96059);\nvar toIndexedObject = __webpack_require__(74529);\nvar objectKeys = __webpack_require__(14771);\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n\n\n/***/ }),\n\n/***/ 65988:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar IE8_DOM_DEFINE = __webpack_require__(2840);\nvar V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(83937);\nvar anObject = __webpack_require__(96059);\nvar toPropertyKey = __webpack_require__(83894);\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n/***/ }),\n\n/***/ 49677:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar call = __webpack_require__(78834);\nvar propertyIsEnumerableModule = __webpack_require__(36760);\nvar createPropertyDescriptor = __webpack_require__(31887);\nvar toIndexedObject = __webpack_require__(74529);\nvar toPropertyKey = __webpack_require__(83894);\nvar hasOwn = __webpack_require__(90953);\nvar IE8_DOM_DEFINE = __webpack_require__(2840);\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n\n\n/***/ }),\n\n/***/ 684:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* eslint-disable es/no-object-getownpropertynames -- safe */\nvar classof = __webpack_require__(82532);\nvar toIndexedObject = __webpack_require__(74529);\nvar $getOwnPropertyNames = (__webpack_require__(10946).f);\nvar arraySlice = __webpack_require__(15790);\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return $getOwnPropertyNames(it);\n } catch (error) {\n return arraySlice(windowNames);\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && classof(it) == 'Window'\n ? getWindowNames(it)\n : $getOwnPropertyNames(toIndexedObject(it));\n};\n\n\n/***/ }),\n\n/***/ 10946:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\nvar internalObjectKeys = __webpack_require__(55629);\nvar enumBugKeys = __webpack_require__(56759);\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n\n\n/***/ }),\n\n/***/ 87857:\n/***/ (function(__unused_webpack_module, exports) {\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n\n\n/***/ }),\n\n/***/ 249:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar hasOwn = __webpack_require__(90953);\nvar isCallable = __webpack_require__(57475);\nvar toObject = __webpack_require__(89678);\nvar sharedKey = __webpack_require__(44262);\nvar CORRECT_PROTOTYPE_GETTER = __webpack_require__(64160);\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar $Object = Object;\nvar ObjectPrototype = $Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n } return object instanceof $Object ? ObjectPrototype : null;\n};\n\n\n/***/ }),\n\n/***/ 91584:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar fails = __webpack_require__(95981);\nvar isObject = __webpack_require__(10941);\nvar classof = __webpack_require__(82532);\nvar ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(97135);\n\n// eslint-disable-next-line es/no-object-isextensible -- safe\nvar $isExtensible = Object.isExtensible;\nvar FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });\n\n// `Object.isExtensible` method\n// https://tc39.es/ecma262/#sec-object.isextensible\nmodule.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {\n if (!isObject(it)) return false;\n if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;\n return $isExtensible ? $isExtensible(it) : true;\n} : $isExtensible;\n\n\n/***/ }),\n\n/***/ 7046:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n\n\n/***/ }),\n\n/***/ 55629:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar hasOwn = __webpack_require__(90953);\nvar toIndexedObject = __webpack_require__(74529);\nvar indexOf = (__webpack_require__(31692).indexOf);\nvar hiddenKeys = __webpack_require__(27748);\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n\n\n/***/ }),\n\n/***/ 14771:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar internalObjectKeys = __webpack_require__(55629);\nvar enumBugKeys = __webpack_require__(56759);\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n\n\n/***/ }),\n\n/***/ 36760:\n/***/ (function(__unused_webpack_module, exports) {\n\n\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n\n\n/***/ }),\n\n/***/ 88929:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* eslint-disable no-proto -- safe */\nvar uncurryThis = __webpack_require__(95329);\nvar anObject = __webpack_require__(96059);\nvar aPossiblePrototype = __webpack_require__(11851);\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n\n\n/***/ }),\n\n/***/ 95623:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar TO_STRING_TAG_SUPPORT = __webpack_require__(22885);\nvar classof = __webpack_require__(9697);\n\n// `Object.prototype.toString` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n\n\n/***/ }),\n\n/***/ 39811:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar call = __webpack_require__(78834);\nvar isCallable = __webpack_require__(57475);\nvar isObject = __webpack_require__(10941);\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n\n\n/***/ }),\n\n/***/ 31136:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar getBuiltIn = __webpack_require__(626);\nvar uncurryThis = __webpack_require__(95329);\nvar getOwnPropertyNamesModule = __webpack_require__(10946);\nvar getOwnPropertySymbolsModule = __webpack_require__(87857);\nvar anObject = __webpack_require__(96059);\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n\n\n/***/ }),\n\n/***/ 54058:\n/***/ (function(module) {\n\nmodule.exports = {};\n\n\n/***/ }),\n\n/***/ 40002:\n/***/ (function(module) {\n\nmodule.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n\n\n/***/ }),\n\n/***/ 67742:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar NativePromiseConstructor = __webpack_require__(6991);\nvar isCallable = __webpack_require__(57475);\nvar isForced = __webpack_require__(37252);\nvar inspectSource = __webpack_require__(81302);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar IS_BROWSER = __webpack_require__(23321);\nvar IS_DENO = __webpack_require__(48501);\nvar IS_PURE = __webpack_require__(82529);\nvar V8_VERSION = __webpack_require__(53385);\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar SPECIES = wellKnownSymbol('species');\nvar SUBCLASSING = false;\nvar NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);\n\nvar FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution\n if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {\n // Detect correctness of subclassing with @@species support\n var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;\n});\n\nmodule.exports = {\n CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,\n REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,\n SUBCLASSING: SUBCLASSING\n};\n\n\n/***/ }),\n\n/***/ 6991:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\n\nmodule.exports = global.Promise;\n\n\n/***/ }),\n\n/***/ 56584:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(96059);\nvar isObject = __webpack_require__(10941);\nvar newPromiseCapability = __webpack_require__(69520);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n\n\n/***/ }),\n\n/***/ 31542:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar NativePromiseConstructor = __webpack_require__(6991);\nvar checkCorrectnessOfIteration = __webpack_require__(21385);\nvar FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(67742).CONSTRUCTOR);\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n\n\n/***/ }),\n\n/***/ 18397:\n/***/ (function(module) {\n\nvar Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n if (this.head) this.tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n this.head = entry.next;\n if (this.tail === entry) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n\n\n/***/ }),\n\n/***/ 48219:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar isNullOrUndefined = __webpack_require__(82119);\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n/***/ }),\n\n/***/ 57309:\n/***/ (function(module) {\n\n// `SameValueZero` abstract operation\n// https://tc39.es/ecma262/#sec-samevaluezero\nmodule.exports = function (x, y) {\n // eslint-disable-next-line no-self-compare -- NaN check\n return x === y || x != x && y != y;\n};\n\n\n/***/ }),\n\n/***/ 37620:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar apply = __webpack_require__(79730);\nvar isCallable = __webpack_require__(57475);\nvar userAgent = __webpack_require__(2861);\nvar arraySlice = __webpack_require__(93765);\nvar validateArgumentsLength = __webpack_require__(18348);\n\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar Function = global.Function;\n\nvar wrap = function (scheduler) {\n return MSIE ? function (handler, timeout /* , ...arguments */) {\n var boundArgs = validateArgumentsLength(arguments.length, 1) > 2;\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = boundArgs ? arraySlice(arguments, 2) : undefined;\n return scheduler(boundArgs ? function () {\n apply(fn, this, args);\n } : fn, timeout);\n } : scheduler;\n};\n\n// ie9- setTimeout & setInterval additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers\nmodule.exports = {\n // `setTimeout` method\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\n setTimeout: wrap(global.setTimeout),\n // `setInterval` method\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\n setInterval: wrap(global.setInterval)\n};\n\n\n/***/ }),\n\n/***/ 94431:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar getBuiltIn = __webpack_require__(626);\nvar definePropertyModule = __webpack_require__(65988);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar DESCRIPTORS = __webpack_require__(55746);\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n\n\n/***/ }),\n\n/***/ 90904:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar TO_STRING_TAG_SUPPORT = __webpack_require__(22885);\nvar defineProperty = (__webpack_require__(65988).f);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar hasOwn = __webpack_require__(90953);\nvar toString = __webpack_require__(95623);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n\n\n/***/ }),\n\n/***/ 44262:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar shared = __webpack_require__(68726);\nvar uid = __webpack_require__(99418);\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n\n\n/***/ }),\n\n/***/ 63030:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar defineGlobalProperty = __webpack_require__(75609);\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n\n\n/***/ }),\n\n/***/ 68726:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar IS_PURE = __webpack_require__(82529);\nvar store = __webpack_require__(63030);\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.25.3',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n\n\n/***/ }),\n\n/***/ 70487:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(96059);\nvar aConstructor = __webpack_require__(174);\nvar isNullOrUndefined = __webpack_require__(82119);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);\n};\n\n\n/***/ }),\n\n/***/ 64620:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar toString = __webpack_require__(85803);\nvar requireObjectCoercible = __webpack_require__(48219);\n\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\n\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING\n ? charAt(S, position)\n : first\n : CONVERT_TO_STRING\n ? stringSlice(S, position, position + 2)\n : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n\n\n/***/ }),\n\n/***/ 16178:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar toString = __webpack_require__(85803);\nvar requireObjectCoercible = __webpack_require__(48219);\n\nvar $RangeError = RangeError;\n\n// `String.prototype.repeat` method implementation\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\nmodule.exports = function repeat(count) {\n var str = toString(requireObjectCoercible(this));\n var result = '';\n var n = toIntegerOrInfinity(count);\n if (n < 0 || n == Infinity) throw $RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n\n\n/***/ }),\n\n/***/ 93093:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar PROPER_FUNCTION_NAME = (__webpack_require__(79417).PROPER);\nvar fails = __webpack_require__(95981);\nvar whitespaces = __webpack_require__(73483);\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n\n\n/***/ }),\n\n/***/ 74853:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\nvar requireObjectCoercible = __webpack_require__(48219);\nvar toString = __webpack_require__(85803);\nvar whitespaces = __webpack_require__(73483);\n\nvar replace = uncurryThis(''.replace);\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = replace(string, ltrim, '');\n if (TYPE & 2) string = replace(string, rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n\n\n/***/ }),\n\n/***/ 63405:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = __webpack_require__(53385);\nvar fails = __webpack_require__(95981);\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n\n\n/***/ }),\n\n/***/ 42941:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar apply = __webpack_require__(79730);\nvar bind = __webpack_require__(86843);\nvar isCallable = __webpack_require__(57475);\nvar hasOwn = __webpack_require__(90953);\nvar fails = __webpack_require__(95981);\nvar html = __webpack_require__(15463);\nvar arraySlice = __webpack_require__(93765);\nvar createElement = __webpack_require__(61333);\nvar validateArgumentsLength = __webpack_require__(18348);\nvar IS_IOS = __webpack_require__(22749);\nvar IS_NODE = __webpack_require__(6049);\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar Dispatch = global.Dispatch;\nvar Function = global.Function;\nvar MessageChannel = global.MessageChannel;\nvar String = global.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar $location, defer, channel, port;\n\ntry {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n $location = global.location;\n} catch (error) { /* empty */ }\n\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), $location.protocol + '//' + $location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n isCallable(global.postMessage) &&\n !global.importScripts &&\n $location && $location.protocol !== 'file:' &&\n !fails(post)\n ) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n\n\n/***/ }),\n\n/***/ 59413:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toIntegerOrInfinity = __webpack_require__(62435);\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n\n\n/***/ }),\n\n/***/ 74529:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = __webpack_require__(37026);\nvar requireObjectCoercible = __webpack_require__(48219);\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n\n/***/ }),\n\n/***/ 62435:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar trunc = __webpack_require__(35331);\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n\n\n/***/ }),\n\n/***/ 43057:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toIntegerOrInfinity = __webpack_require__(62435);\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n\n\n/***/ }),\n\n/***/ 89678:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar requireObjectCoercible = __webpack_require__(48219);\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n\n\n/***/ }),\n\n/***/ 46935:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar call = __webpack_require__(78834);\nvar isObject = __webpack_require__(10941);\nvar isSymbol = __webpack_require__(56664);\nvar getMethod = __webpack_require__(14229);\nvar ordinaryToPrimitive = __webpack_require__(39811);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n\n\n/***/ }),\n\n/***/ 83894:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar toPrimitive = __webpack_require__(46935);\nvar isSymbol = __webpack_require__(56664);\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n\n\n/***/ }),\n\n/***/ 22885:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n\n\n/***/ }),\n\n/***/ 85803:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar classof = __webpack_require__(9697);\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n\n\n/***/ }),\n\n/***/ 69826:\n/***/ (function(module) {\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n\n\n/***/ }),\n\n/***/ 99418:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar uncurryThis = __webpack_require__(95329);\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n\n\n/***/ }),\n\n/***/ 32302:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = __webpack_require__(63405);\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n\n\n/***/ }),\n\n/***/ 83937:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(55746);\nvar fails = __webpack_require__(95981);\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n\n\n/***/ }),\n\n/***/ 18348:\n/***/ (function(module) {\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw $TypeError('Not enough arguments');\n return passed;\n};\n\n\n/***/ }),\n\n/***/ 47093:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar isCallable = __webpack_require__(57475);\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n\n\n/***/ }),\n\n/***/ 73464:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar path = __webpack_require__(54058);\nvar hasOwn = __webpack_require__(90953);\nvar wrappedWellKnownSymbolModule = __webpack_require__(11477);\nvar defineProperty = (__webpack_require__(65988).f);\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n\n\n/***/ }),\n\n/***/ 11477:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\nvar wellKnownSymbol = __webpack_require__(99813);\n\nexports.f = wellKnownSymbol;\n\n\n/***/ }),\n\n/***/ 99813:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar global = __webpack_require__(21899);\nvar shared = __webpack_require__(68726);\nvar hasOwn = __webpack_require__(90953);\nvar uid = __webpack_require__(99418);\nvar NATIVE_SYMBOL = __webpack_require__(63405);\nvar USE_SYMBOL_AS_UID = __webpack_require__(32302);\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n\n\n/***/ }),\n\n/***/ 73483:\n/***/ (function(module) {\n\n// a string of all valid unicode whitespaces\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002' +\n '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n\n\n/***/ }),\n\n/***/ 49812:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar isPrototypeOf = __webpack_require__(7046);\nvar getPrototypeOf = __webpack_require__(249);\nvar setPrototypeOf = __webpack_require__(88929);\nvar copyConstructorProperties = __webpack_require__(23489);\nvar create = __webpack_require__(29290);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar createPropertyDescriptor = __webpack_require__(31887);\nvar clearErrorStack = __webpack_require__(53995);\nvar installErrorCause = __webpack_require__(53794);\nvar iterate = __webpack_require__(93091);\nvar normalizeStringArgument = __webpack_require__(14649);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar ERROR_STACK_INSTALLABLE = __webpack_require__(18780);\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Error = Error;\nvar push = [].push;\n\nvar $AggregateError = function AggregateError(errors, message /* , options */) {\n var options = arguments.length > 2 ? arguments[2] : undefined;\n var isInstance = isPrototypeOf(AggregateErrorPrototype, this);\n var that;\n if (setPrototypeOf) {\n that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);\n } else {\n that = isInstance ? this : create(AggregateErrorPrototype);\n createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');\n }\n if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));\n if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));\n installErrorCause(that, options);\n var errorsArray = [];\n iterate(errors, push, { that: errorsArray });\n createNonEnumerableProperty(that, 'errors', errorsArray);\n return that;\n};\n\nif (setPrototypeOf) setPrototypeOf($AggregateError, $Error);\nelse copyConstructorProperties($AggregateError, $Error, { name: true });\n\nvar AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {\n constructor: createPropertyDescriptor(1, $AggregateError),\n message: createPropertyDescriptor(1, ''),\n name: createPropertyDescriptor(1, 'AggregateError')\n});\n\n// `AggregateError` constructor\n// https://tc39.es/ecma262/#sec-aggregate-error-constructor\n$({ global: true, constructor: true, arity: 2 }, {\n AggregateError: $AggregateError\n});\n\n\n/***/ }),\n\n/***/ 47627:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove this module from `core-js@4` since it's replaced to module below\n__webpack_require__(49812);\n\n\n/***/ }),\n\n/***/ 94481:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar toObject = __webpack_require__(89678);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar addToUnscopables = __webpack_require__(18479);\n\n// `Array.prototype.at` method\n// https://github.com/tc39/proposal-relative-indexing-method\n$({ target: 'Array', proto: true }, {\n at: function at(index) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var relativeIndex = toIntegerOrInfinity(index);\n var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;\n return (k < 0 || k >= len) ? undefined : O[k];\n }\n});\n\naddToUnscopables('at');\n\n\n/***/ }),\n\n/***/ 85906:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar fails = __webpack_require__(95981);\nvar isArray = __webpack_require__(1052);\nvar isObject = __webpack_require__(10941);\nvar toObject = __webpack_require__(89678);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar doesNotExceedSafeInteger = __webpack_require__(66796);\nvar createProperty = __webpack_require__(55449);\nvar arraySpeciesCreate = __webpack_require__(64692);\nvar arrayMethodHasSpeciesSupport = __webpack_require__(50568);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar V8_VERSION = __webpack_require__(53385);\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n doesNotExceedSafeInteger(n + len);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n doesNotExceedSafeInteger(n + 1);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n\n\n/***/ }),\n\n/***/ 21501:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar $filter = (__webpack_require__(3610).filter);\nvar arrayMethodHasSpeciesSupport = __webpack_require__(50568);\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.es/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n\n/***/ }),\n\n/***/ 80833:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar $find = (__webpack_require__(3610).find);\nvar addToUnscopables = __webpack_require__(18479);\n\nvar FIND = 'find';\nvar SKIPS_HOLES = true;\n\n// Shouldn't skip holes\nif (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.find` method\n// https://tc39.es/ecma262/#sec-array.prototype.find\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND);\n\n\n/***/ }),\n\n/***/ 2437:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar forEach = __webpack_require__(56837);\n\n// `Array.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n$({ target: 'Array', proto: true, forced: [].forEach != forEach }, {\n forEach: forEach\n});\n\n\n/***/ }),\n\n/***/ 53242:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar from = __webpack_require__(11354);\nvar checkCorrectnessOfIteration = __webpack_require__(21385);\n\nvar INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {\n // eslint-disable-next-line es/no-array-from -- required for testing\n Array.from(iterable);\n});\n\n// `Array.from` method\n// https://tc39.es/ecma262/#sec-array.from\n$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {\n from: from\n});\n\n\n/***/ }),\n\n/***/ 99076:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n/* eslint-disable es/no-array-prototype-indexof -- required for testing */\nvar $ = __webpack_require__(76887);\nvar uncurryThis = __webpack_require__(95329);\nvar $indexOf = (__webpack_require__(31692).indexOf);\nvar arrayMethodIsStrict = __webpack_require__(34194);\n\nvar nativeIndexOf = uncurryThis([].indexOf);\n\nvar NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('indexOf');\n\n// `Array.prototype.indexOf` method\n// https://tc39.es/ecma262/#sec-array.prototype.indexof\n$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n var fromIndex = arguments.length > 1 ? arguments[1] : undefined;\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? nativeIndexOf(this, searchElement, fromIndex) || 0\n : $indexOf(this, searchElement, fromIndex);\n }\n});\n\n\n/***/ }),\n\n/***/ 92737:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar isArray = __webpack_require__(1052);\n\n// `Array.isArray` method\n// https://tc39.es/ecma262/#sec-array.isarray\n$({ target: 'Array', stat: true }, {\n isArray: isArray\n});\n\n\n/***/ }),\n\n/***/ 66274:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar toIndexedObject = __webpack_require__(74529);\nvar addToUnscopables = __webpack_require__(18479);\nvar Iterators = __webpack_require__(12077);\nvar InternalStateModule = __webpack_require__(45402);\nvar defineProperty = (__webpack_require__(65988).f);\nvar defineIterator = __webpack_require__(75105);\nvar createIterResultObject = __webpack_require__(23538);\nvar IS_PURE = __webpack_require__(82529);\nvar DESCRIPTORS = __webpack_require__(55746);\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return createIterResultObject(undefined, true);\n }\n if (kind == 'keys') return createIterResultObject(index, false);\n if (kind == 'values') return createIterResultObject(target[index], false);\n return createIterResultObject([index, target[index]], false);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nvar values = Iterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n// V8 ~ Chrome 45- bug\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {\n defineProperty(values, 'name', { value: 'values' });\n} catch (error) { /* empty */ }\n\n\n/***/ }),\n\n/***/ 75915:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar lastIndexOf = __webpack_require__(67145);\n\n// `Array.prototype.lastIndexOf` method\n// https://tc39.es/ecma262/#sec-array.prototype.lastindexof\n// eslint-disable-next-line es/no-array-prototype-lastindexof -- required for testing\n$({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {\n lastIndexOf: lastIndexOf\n});\n\n\n/***/ }),\n\n/***/ 68787:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar $map = (__webpack_require__(3610).map);\nvar arrayMethodHasSpeciesSupport = __webpack_require__(50568);\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');\n\n// `Array.prototype.map` method\n// https://tc39.es/ecma262/#sec-array.prototype.map\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n\n/***/ }),\n\n/***/ 11490:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar uncurryThis = __webpack_require__(95329);\nvar isArray = __webpack_require__(1052);\n\nvar nativeReverse = uncurryThis([].reverse);\nvar test = [1, 2];\n\n// `Array.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-array.prototype.reverse\n// fix for Safari 12.0 bug\n// https://bugs.webkit.org/show_bug.cgi?id=188794\n$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {\n reverse: function reverse() {\n // eslint-disable-next-line no-self-assign -- dirty hack\n if (isArray(this)) this.length = this.length;\n return nativeReverse(this);\n }\n});\n\n\n/***/ }),\n\n/***/ 60186:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar isArray = __webpack_require__(1052);\nvar isConstructor = __webpack_require__(24284);\nvar isObject = __webpack_require__(10941);\nvar toAbsoluteIndex = __webpack_require__(59413);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar toIndexedObject = __webpack_require__(74529);\nvar createProperty = __webpack_require__(55449);\nvar wellKnownSymbol = __webpack_require__(99813);\nvar arrayMethodHasSpeciesSupport = __webpack_require__(50568);\nvar nativeSlice = __webpack_require__(93765);\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === $Array || Constructor === undefined) {\n return nativeSlice(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n\n\n/***/ }),\n\n/***/ 4115:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar uncurryThis = __webpack_require__(95329);\nvar aCallable = __webpack_require__(24883);\nvar toObject = __webpack_require__(89678);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar deletePropertyOrThrow = __webpack_require__(15863);\nvar toString = __webpack_require__(85803);\nvar fails = __webpack_require__(95981);\nvar internalSort = __webpack_require__(61388);\nvar arrayMethodIsStrict = __webpack_require__(34194);\nvar FF = __webpack_require__(34342);\nvar IE_OR_EDGE = __webpack_require__(81046);\nvar V8 = __webpack_require__(53385);\nvar WEBKIT = __webpack_require__(18938);\n\nvar test = [];\nvar nativeSort = uncurryThis(test.sort);\nvar push = uncurryThis(test.push);\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);\n\n var items = [];\n var arrayLength = lengthOfArrayLike(array);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) push(items, array[index]);\n }\n\n internalSort(items, getSortCompare(comparefn));\n\n itemsLength = lengthOfArrayLike(items);\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) deletePropertyOrThrow(array, index++);\n\n return array;\n }\n});\n\n\n/***/ }),\n\n/***/ 98611:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar toObject = __webpack_require__(89678);\nvar toAbsoluteIndex = __webpack_require__(59413);\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar lengthOfArrayLike = __webpack_require__(10623);\nvar setArrayLength = __webpack_require__(89779);\nvar doesNotExceedSafeInteger = __webpack_require__(66796);\nvar arraySpeciesCreate = __webpack_require__(64692);\nvar createProperty = __webpack_require__(55449);\nvar deletePropertyOrThrow = __webpack_require__(15863);\nvar arrayMethodHasSpeciesSupport = __webpack_require__(50568);\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// `Array.prototype.splice` method\n// https://tc39.es/ecma262/#sec-array.prototype.splice\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n splice: function splice(start, deleteCount /* , ...items */) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var actualStart = toAbsoluteIndex(start, len);\n var argumentsLength = arguments.length;\n var insertCount, actualDeleteCount, A, k, from, to;\n if (argumentsLength === 0) {\n insertCount = actualDeleteCount = 0;\n } else if (argumentsLength === 1) {\n insertCount = 0;\n actualDeleteCount = len - actualStart;\n } else {\n insertCount = argumentsLength - 2;\n actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);\n }\n doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);\n A = arraySpeciesCreate(O, actualDeleteCount);\n for (k = 0; k < actualDeleteCount; k++) {\n from = actualStart + k;\n if (from in O) createProperty(A, k, O[from]);\n }\n A.length = actualDeleteCount;\n if (insertCount < actualDeleteCount) {\n for (k = actualStart; k < len - actualDeleteCount; k++) {\n from = k + actualDeleteCount;\n to = k + insertCount;\n if (from in O) O[to] = O[from];\n else deletePropertyOrThrow(O, to);\n }\n for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);\n } else if (insertCount > actualDeleteCount) {\n for (k = len - actualDeleteCount; k > actualStart; k--) {\n from = k + actualDeleteCount - 1;\n to = k + insertCount - 1;\n if (from in O) O[to] = O[from];\n else deletePropertyOrThrow(O, to);\n }\n }\n for (k = 0; k < insertCount; k++) {\n O[k + actualStart] = arguments[k + 2];\n }\n setArrayLength(O, len - actualDeleteCount + insertCount);\n return A;\n }\n});\n\n\n/***/ }),\n\n/***/ 73381:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove from `core-js@4`\nvar $ = __webpack_require__(76887);\nvar bind = __webpack_require__(98308);\n\n// `Function.prototype.bind` method\n// https://tc39.es/ecma262/#sec-function.prototype.bind\n$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {\n bind: bind\n});\n\n\n/***/ }),\n\n/***/ 32619:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar apply = __webpack_require__(79730);\nvar call = __webpack_require__(78834);\nvar uncurryThis = __webpack_require__(95329);\nvar fails = __webpack_require__(95981);\nvar isArray = __webpack_require__(1052);\nvar isCallable = __webpack_require__(57475);\nvar isObject = __webpack_require__(10941);\nvar isSymbol = __webpack_require__(56664);\nvar arraySlice = __webpack_require__(93765);\nvar NATIVE_SYMBOL = __webpack_require__(63405);\n\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = replacer;\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (isCallable($replacer)) value = call($replacer, this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n\n\n/***/ }),\n\n/***/ 23112:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar collection = __webpack_require__(24683);\nvar collectionStrong = __webpack_require__(85616);\n\n// `Map` constructor\n// https://tc39.es/ecma262/#sec-map-objects\ncollection('Map', function (init) {\n return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n\n\n/***/ }),\n\n/***/ 37501:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove this module from `core-js@4` since it's replaced to module below\n__webpack_require__(23112);\n\n\n/***/ }),\n\n/***/ 53874:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar fails = __webpack_require__(95981);\n\n// eslint-disable-next-line es/no-math-imul -- required for testing\nvar $imul = Math.imul;\n\nvar FORCED = fails(function () {\n return $imul(0xFFFFFFFF, 5) != -5 || $imul.length != 2;\n});\n\n// `Math.imul` method\n// https://tc39.es/ecma262/#sec-math.imul\n// some WebKit versions fails with big numbers, some has wrong arity\n$({ target: 'Math', stat: true, forced: FORCED }, {\n imul: function imul(x, y) {\n var UINT16 = 0xFFFF;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n\n\n/***/ }),\n\n/***/ 88359:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\n\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\n// `Math.log2` method\n// https://tc39.es/ecma262/#sec-math.log2\n$({ target: 'Math', stat: true }, {\n log2: function log2(x) {\n return log(x) / LN2;\n }\n});\n\n\n/***/ }),\n\n/***/ 25499:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar sign = __webpack_require__(6383);\n\n// `Math.sign` method\n// https://tc39.es/ecma262/#sec-math.sign\n$({ target: 'Math', stat: true }, {\n sign: sign\n});\n\n\n/***/ }),\n\n/***/ 54973:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\n\n// `Number.EPSILON` constant\n// https://tc39.es/ecma262/#sec-number.epsilon\n$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, {\n EPSILON: Math.pow(2, -52)\n});\n\n\n/***/ }),\n\n/***/ 30800:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar isIntegralNumber = __webpack_require__(54639);\n\n// `Number.isInteger` method\n// https://tc39.es/ecma262/#sec-number.isinteger\n$({ target: 'Number', stat: true }, {\n isInteger: isIntegralNumber\n});\n\n\n/***/ }),\n\n/***/ 71967:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\n\n// `Number.MAX_SAFE_INTEGER` constant\n// https://tc39.es/ecma262/#sec-number.max_safe_integer\n$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, {\n MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF\n});\n\n\n/***/ }),\n\n/***/ 49221:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar assign = __webpack_require__(24420);\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\n// eslint-disable-next-line es/no-object-assign -- required for testing\n$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {\n assign: assign\n});\n\n\n/***/ }),\n\n/***/ 74979:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar DESCRIPTORS = __webpack_require__(55746);\nvar defineProperties = (__webpack_require__(59938).f);\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, {\n defineProperties: defineProperties\n});\n\n\n/***/ }),\n\n/***/ 86450:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar DESCRIPTORS = __webpack_require__(55746);\nvar defineProperty = (__webpack_require__(65988).f);\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n\n\n/***/ }),\n\n/***/ 15711:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar FREEZING = __webpack_require__(45602);\nvar fails = __webpack_require__(95981);\nvar isObject = __webpack_require__(10941);\nvar onFreeze = (__webpack_require__(21647).onFreeze);\n\n// eslint-disable-next-line es/no-object-freeze -- safe\nvar $freeze = Object.freeze;\nvar FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });\n\n// `Object.freeze` method\n// https://tc39.es/ecma262/#sec-object.freeze\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {\n freeze: function freeze(it) {\n return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;\n }\n});\n\n\n/***/ }),\n\n/***/ 21724:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar toObject = __webpack_require__(89678);\nvar nativeKeys = __webpack_require__(14771);\nvar fails = __webpack_require__(95981);\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n\n\n/***/ }),\n\n/***/ 55967:\n/***/ (function() {\n\n// empty\n\n\n/***/ }),\n\n/***/ 49718:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar $parseFloat = __webpack_require__(81942);\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != $parseFloat }, {\n parseFloat: $parseFloat\n});\n\n\n/***/ }),\n\n/***/ 14038:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar $parseInt = __webpack_require__(29806);\n\n// `parseInt` method\n// https://tc39.es/ecma262/#sec-parseint-string-radix\n$({ global: true, forced: parseInt != $parseInt }, {\n parseInt: $parseInt\n});\n\n\n/***/ }),\n\n/***/ 4560:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\nvar perform = __webpack_require__(40002);\nvar iterate = __webpack_require__(93091);\n\n// `Promise.allSettled` method\n// https://tc39.es/ecma262/#sec-promise.allsettled\n$({ target: 'Promise', stat: true }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (error) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: error };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n\n\n/***/ }),\n\n/***/ 16890:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\nvar perform = __webpack_require__(40002);\nvar iterate = __webpack_require__(93091);\nvar PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(31542);\n\n// `Promise.all` method\n// https://tc39.es/ecma262/#sec-promise.all\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n\n\n/***/ }),\n\n/***/ 91302:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar getBuiltIn = __webpack_require__(626);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\nvar perform = __webpack_require__(40002);\nvar iterate = __webpack_require__(93091);\n\nvar PROMISE_ANY_ERROR = 'No one promise resolved';\n\n// `Promise.any` method\n// https://tc39.es/ecma262/#sec-promise.any\n$({ target: 'Promise', stat: true }, {\n any: function any(iterable) {\n var C = this;\n var AggregateError = getBuiltIn('AggregateError');\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var errors = [];\n var counter = 0;\n var remaining = 1;\n var alreadyResolved = false;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyRejected = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyResolved = true;\n resolve(value);\n }, function (error) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyRejected = true;\n errors[index] = error;\n --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));\n });\n });\n --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n\n\n/***/ }),\n\n/***/ 83376:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar IS_PURE = __webpack_require__(82529);\nvar FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(67742).CONSTRUCTOR);\nvar NativePromiseConstructor = __webpack_require__(6991);\nvar getBuiltIn = __webpack_require__(626);\nvar isCallable = __webpack_require__(57475);\nvar defineBuiltIn = __webpack_require__(95929);\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// `Promise.prototype.catch` method\n// https://tc39.es/ecma262/#sec-promise.prototype.catch\n$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n});\n\n// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['catch'];\n if (NativePromisePrototype['catch'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });\n }\n}\n\n\n/***/ }),\n\n/***/ 26934:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar IS_PURE = __webpack_require__(82529);\nvar IS_NODE = __webpack_require__(6049);\nvar global = __webpack_require__(21899);\nvar call = __webpack_require__(78834);\nvar defineBuiltIn = __webpack_require__(95929);\nvar setPrototypeOf = __webpack_require__(88929);\nvar setToStringTag = __webpack_require__(90904);\nvar setSpecies = __webpack_require__(94431);\nvar aCallable = __webpack_require__(24883);\nvar isCallable = __webpack_require__(57475);\nvar isObject = __webpack_require__(10941);\nvar anInstance = __webpack_require__(5743);\nvar speciesConstructor = __webpack_require__(70487);\nvar task = (__webpack_require__(42941).set);\nvar microtask = __webpack_require__(66132);\nvar hostReportErrors = __webpack_require__(34845);\nvar perform = __webpack_require__(40002);\nvar Queue = __webpack_require__(18397);\nvar InternalStateModule = __webpack_require__(45402);\nvar NativePromiseConstructor = __webpack_require__(6991);\nvar PromiseConstructorDetection = __webpack_require__(67742);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\n\nvar PROMISE = 'Promise';\nvar FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;\nvar NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;\nvar NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar PromiseConstructor = NativePromiseConstructor;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\n\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\n\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\n\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED_PROMISE_CONSTRUCTOR) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalPromiseState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n\n PromisePrototype = PromiseConstructor.prototype;\n\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state == PENDING) state.reactions.add(reaction);\n else microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n });\n\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalPromiseState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!NATIVE_PROMISE_SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\n\n/***/ }),\n\n/***/ 44349:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar IS_PURE = __webpack_require__(82529);\nvar NativePromiseConstructor = __webpack_require__(6991);\nvar fails = __webpack_require__(95981);\nvar getBuiltIn = __webpack_require__(626);\nvar isCallable = __webpack_require__(57475);\nvar speciesConstructor = __webpack_require__(70487);\nvar promiseResolve = __webpack_require__(56584);\nvar defineBuiltIn = __webpack_require__(95929);\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromiseConstructor && fails(function () {\n // eslint-disable-next-line unicorn/no-thenable -- required for testing\n NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.es/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = isCallable(onFinally);\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['finally'];\n if (NativePromisePrototype['finally'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });\n }\n}\n\n\n/***/ }),\n\n/***/ 98881:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\n__webpack_require__(26934);\n__webpack_require__(16890);\n__webpack_require__(83376);\n__webpack_require__(55921);\n__webpack_require__(64069);\n__webpack_require__(14482);\n\n\n/***/ }),\n\n/***/ 55921:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\nvar perform = __webpack_require__(40002);\nvar iterate = __webpack_require__(93091);\nvar PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(31542);\n\n// `Promise.race` method\n// https://tc39.es/ecma262/#sec-promise.race\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n\n\n/***/ }),\n\n/***/ 64069:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\nvar FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(67742).CONSTRUCTOR);\n\n// `Promise.reject` method\n// https://tc39.es/ecma262/#sec-promise.reject\n$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n reject: function reject(r) {\n var capability = newPromiseCapabilityModule.f(this);\n call(capability.reject, undefined, r);\n return capability.promise;\n }\n});\n\n\n/***/ }),\n\n/***/ 14482:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar IS_PURE = __webpack_require__(82529);\nvar NativePromiseConstructor = __webpack_require__(6991);\nvar FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(67742).CONSTRUCTOR);\nvar promiseResolve = __webpack_require__(56584);\n\nvar PromiseConstructorWrapper = getBuiltIn('Promise');\nvar CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;\n\n// `Promise.resolve` method\n// https://tc39.es/ecma262/#sec-promise.resolve\n$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {\n resolve: function resolve(x) {\n return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);\n }\n});\n\n\n/***/ }),\n\n/***/ 82266:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar collection = __webpack_require__(24683);\nvar collectionStrong = __webpack_require__(85616);\n\n// `Set` constructor\n// https://tc39.es/ecma262/#sec-set-objects\ncollection('Set', function (init) {\n return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n\n\n/***/ }),\n\n/***/ 69008:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove this module from `core-js@4` since it's replaced to module below\n__webpack_require__(82266);\n\n\n/***/ }),\n\n/***/ 93588:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar uncurryThis = __webpack_require__(95329);\nvar requireObjectCoercible = __webpack_require__(48219);\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar toString = __webpack_require__(85803);\nvar fails = __webpack_require__(95981);\n\nvar charAt = uncurryThis(''.charAt);\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-array-string-prototype-at -- safe\n return '𠮷'.at(-2) !== '\\uD842';\n});\n\n// `String.prototype.at` method\n// https://github.com/tc39/proposal-relative-indexing-method\n$({ target: 'String', proto: true, forced: FORCED }, {\n at: function at(index) {\n var S = toString(requireObjectCoercible(this));\n var len = S.length;\n var relativeIndex = toIntegerOrInfinity(index);\n var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;\n return (k < 0 || k >= len) ? undefined : charAt(S, k);\n }\n});\n\n\n/***/ }),\n\n/***/ 77971:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar charAt = (__webpack_require__(64620).charAt);\nvar toString = __webpack_require__(85803);\nvar InternalStateModule = __webpack_require__(45402);\nvar defineIterator = __webpack_require__(75105);\nvar createIterResultObject = __webpack_require__(23538);\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return createIterResultObject(undefined, true);\n point = charAt(string, index);\n state.index += point.length;\n return createIterResultObject(point, false);\n});\n\n\n/***/ }),\n\n/***/ 60986:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar repeat = __webpack_require__(16178);\n\n// `String.prototype.repeat` method\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\n$({ target: 'String', proto: true }, {\n repeat: repeat\n});\n\n\n/***/ }),\n\n/***/ 57398:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar $trim = (__webpack_require__(74853).trim);\nvar forcedStringTrimMethod = __webpack_require__(93093);\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n\n\n/***/ }),\n\n/***/ 1825:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar defineWellKnownSymbol = __webpack_require__(73464);\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n\n\n/***/ }),\n\n/***/ 94776:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar global = __webpack_require__(21899);\nvar uncurryThis = __webpack_require__(95329);\nvar defineBuiltIns = __webpack_require__(94380);\nvar InternalMetadataModule = __webpack_require__(21647);\nvar collection = __webpack_require__(24683);\nvar collectionWeak = __webpack_require__(8850);\nvar isObject = __webpack_require__(10941);\nvar isExtensible = __webpack_require__(91584);\nvar enforceInternalState = (__webpack_require__(45402).enforce);\nvar NATIVE_WEAK_MAP = __webpack_require__(47093);\n\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar InternalWeakMap;\n\nvar wrapper = function (init) {\n return function WeakMap() {\n return init(this, arguments.length ? arguments[0] : undefined);\n };\n};\n\n// `WeakMap` constructor\n// https://tc39.es/ecma262/#sec-weakmap-constructor\nvar $WeakMap = collection('WeakMap', wrapper, collectionWeak);\n\n// IE11 WeakMap frozen keys fix\n// We can't use feature detection because it crash some old IE builds\n// https://github.com/zloirock/core-js/issues/485\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);\n InternalMetadataModule.enable();\n var WeakMapPrototype = $WeakMap.prototype;\n var nativeDelete = uncurryThis(WeakMapPrototype['delete']);\n var nativeHas = uncurryThis(WeakMapPrototype.has);\n var nativeGet = uncurryThis(WeakMapPrototype.get);\n var nativeSet = uncurryThis(WeakMapPrototype.set);\n defineBuiltIns(WeakMapPrototype, {\n 'delete': function (key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceInternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeDelete(this, key) || state.frozen['delete'](key);\n } return nativeDelete(this, key);\n },\n has: function has(key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceInternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeHas(this, key) || state.frozen.has(key);\n } return nativeHas(this, key);\n },\n get: function get(key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceInternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);\n } return nativeGet(this, key);\n },\n set: function set(key, value) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceInternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);\n } else nativeSet(this, key, value);\n return this;\n }\n });\n}\n\n\n/***/ }),\n\n/***/ 54334:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove this module from `core-js@4` since it's replaced to module below\n__webpack_require__(94776);\n\n\n/***/ }),\n\n/***/ 89731:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove from `core-js@4`\n__webpack_require__(47627);\n\n\n/***/ }),\n\n/***/ 54322:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove from `core-js@4`\n__webpack_require__(94481);\n\n\n/***/ }),\n\n/***/ 66591:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar deleteAll = __webpack_require__(28984);\n\n// `Map.prototype.deleteAll` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n deleteAll: deleteAll\n});\n\n\n/***/ }),\n\n/***/ 55121:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar emplace = __webpack_require__(48721);\n\n// `Map.prototype.emplace` method\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n emplace: emplace\n});\n\n\n/***/ }),\n\n/***/ 14751:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.every` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n every: function every(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return !iterate(iterator, function (key, value, stop) {\n if (!boundFunction(value, key, map)) return stop();\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 52407:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.filter` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n filter: function filter(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();\n var setter = aCallable(newMap.set);\n iterate(iterator, function (key, value) {\n if (boundFunction(value, key, map)) call(setter, newMap, key, value);\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n return newMap;\n }\n});\n\n\n/***/ }),\n\n/***/ 27281:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.findKey` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n findKey: function findKey(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (key, value, stop) {\n if (boundFunction(value, key, map)) return stop(key);\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n\n\n/***/ }),\n\n/***/ 48580:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.find` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n find: function find(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (key, value, stop) {\n if (boundFunction(value, key, map)) return stop(value);\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n\n\n/***/ }),\n\n/***/ 52453:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar from = __webpack_require__(83590);\n\n// `Map.from` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\n$({ target: 'Map', stat: true, forced: true }, {\n from: from\n});\n\n\n/***/ }),\n\n/***/ 36507:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar uncurryThis = __webpack_require__(95329);\nvar aCallable = __webpack_require__(24883);\nvar getIterator = __webpack_require__(53476);\nvar iterate = __webpack_require__(93091);\n\nvar push = uncurryThis([].push);\n\n// `Map.groupBy` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', stat: true, forced: true }, {\n groupBy: function groupBy(iterable, keyDerivative) {\n aCallable(keyDerivative);\n var iterator = getIterator(iterable);\n var newMap = new this();\n var has = aCallable(newMap.has);\n var get = aCallable(newMap.get);\n var set = aCallable(newMap.set);\n iterate(iterator, function (element) {\n var derivedKey = keyDerivative(element);\n if (!call(has, newMap, derivedKey)) call(set, newMap, derivedKey, [element]);\n else push(call(get, newMap, derivedKey), element);\n }, { IS_ITERATOR: true });\n return newMap;\n }\n});\n\n\n/***/ }),\n\n/***/ 93647:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar getMapIterator = __webpack_require__(79993);\nvar sameValueZero = __webpack_require__(57309);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.includes` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n includes: function includes(searchElement) {\n return iterate(getMapIterator(anObject(this)), function (key, value, stop) {\n if (sameValueZero(value, searchElement)) return stop();\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 47641:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar iterate = __webpack_require__(93091);\nvar aCallable = __webpack_require__(24883);\n\n// `Map.keyBy` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', stat: true, forced: true }, {\n keyBy: function keyBy(iterable, keyDerivative) {\n var newMap = new this();\n aCallable(keyDerivative);\n var setter = aCallable(newMap.set);\n iterate(iterable, function (element) {\n call(setter, newMap, keyDerivative(element), element);\n });\n return newMap;\n }\n});\n\n\n/***/ }),\n\n/***/ 18552:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.keyOf` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n keyOf: function keyOf(searchElement) {\n return iterate(getMapIterator(anObject(this)), function (key, value, stop) {\n if (value === searchElement) return stop(key);\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n\n\n/***/ }),\n\n/***/ 27693:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.mapKeys` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n mapKeys: function mapKeys(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();\n var setter = aCallable(newMap.set);\n iterate(iterator, function (key, value) {\n call(setter, newMap, boundFunction(value, key, map), value);\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n return newMap;\n }\n});\n\n\n/***/ }),\n\n/***/ 8:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.mapValues` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n mapValues: function mapValues(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();\n var setter = aCallable(newMap.set);\n iterate(iterator, function (key, value) {\n call(setter, newMap, key, boundFunction(value, key, map));\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n return newMap;\n }\n});\n\n\n/***/ }),\n\n/***/ 48514:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar iterate = __webpack_require__(93091);\n\n// `Map.prototype.merge` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n merge: function merge(iterable /* ...iterables */) {\n var map = anObject(this);\n var setter = aCallable(map.set);\n var argumentsLength = arguments.length;\n var i = 0;\n while (i < argumentsLength) {\n iterate(arguments[i++], setter, { that: map, AS_ENTRIES: true });\n }\n return map;\n }\n});\n\n\n/***/ }),\n\n/***/ 32523:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar of = __webpack_require__(45226);\n\n// `Map.of` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\n$({ target: 'Map', stat: true, forced: true }, {\n of: of\n});\n\n\n/***/ }),\n\n/***/ 8212:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar aCallable = __webpack_require__(24883);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\nvar $TypeError = TypeError;\n\n// `Map.prototype.reduce` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var noInitial = arguments.length < 2;\n var accumulator = noInitial ? undefined : arguments[1];\n aCallable(callbackfn);\n iterate(iterator, function (key, value) {\n if (noInitial) {\n noInitial = false;\n accumulator = value;\n } else {\n accumulator = callbackfn(accumulator, value, key, map);\n }\n }, { AS_ENTRIES: true, IS_ITERATOR: true });\n if (noInitial) throw $TypeError('Reduce of empty map with no initial value');\n return accumulator;\n }\n});\n\n\n/***/ }),\n\n/***/ 89642:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getMapIterator = __webpack_require__(79993);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.some` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n some: function some(callbackfn /* , thisArg */) {\n var map = anObject(this);\n var iterator = getMapIterator(map);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (key, value, stop) {\n if (boundFunction(value, key, map)) return stop();\n }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 68826:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n// TODO: remove from `core-js@4`\nvar $ = __webpack_require__(76887);\nvar upsert = __webpack_require__(20716);\n\n// `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`)\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, {\n updateOrInsert: upsert\n});\n\n\n/***/ }),\n\n/***/ 78485:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar anObject = __webpack_require__(96059);\nvar aCallable = __webpack_require__(24883);\n\nvar $TypeError = TypeError;\n\n// `Set.prototype.update` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n update: function update(key, callback /* , thunk */) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var length = arguments.length;\n aCallable(callback);\n var isPresentInMap = call(has, map, key);\n if (!isPresentInMap && length < 3) {\n throw $TypeError('Updating absent value');\n }\n var value = isPresentInMap ? call(get, map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map);\n call(set, map, key, callback(value, key, map));\n return map;\n }\n});\n\n\n/***/ }),\n\n/***/ 42256:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n// TODO: remove from `core-js@4`\nvar $ = __webpack_require__(76887);\nvar upsert = __webpack_require__(20716);\n\n// `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`)\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n upsert: upsert\n});\n\n\n/***/ }),\n\n/***/ 55708:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove from `core-js@4`\n__webpack_require__(4560);\n\n\n/***/ }),\n\n/***/ 88731:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove from `core-js@4`\n__webpack_require__(91302);\n\n\n/***/ }),\n\n/***/ 30014:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n// TODO: Remove from `core-js@4`\nvar $ = __webpack_require__(76887);\nvar newPromiseCapabilityModule = __webpack_require__(69520);\nvar perform = __webpack_require__(40002);\n\n// `Promise.try` method\n// https://github.com/tc39/proposal-promise-try\n$({ target: 'Promise', stat: true, forced: true }, {\n 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapabilityModule.f(this);\n var result = perform(callbackfn);\n (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);\n return promiseCapability.promise;\n }\n});\n\n\n/***/ }),\n\n/***/ 32645:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar addAll = __webpack_require__(7622);\n\n// `Set.prototype.addAll` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n addAll: addAll\n});\n\n\n/***/ }),\n\n/***/ 32578:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar deleteAll = __webpack_require__(28984);\n\n// `Set.prototype.deleteAll` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n deleteAll: deleteAll\n});\n\n\n/***/ }),\n\n/***/ 17421:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.difference` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n difference: function difference(iterable) {\n var set = anObject(this);\n var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set);\n var remover = aCallable(newSet['delete']);\n iterate(iterable, function (value) {\n call(remover, newSet, value);\n });\n return newSet;\n }\n});\n\n\n/***/ }),\n\n/***/ 4573:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.every` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n every: function every(callbackfn /* , thisArg */) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return !iterate(iterator, function (value, stop) {\n if (!boundFunction(value, value, set)) return stop();\n }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 13787:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar speciesConstructor = __webpack_require__(70487);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.filter` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n filter: function filter(callbackfn /* , thisArg */) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newSet = new (speciesConstructor(set, getBuiltIn('Set')))();\n var adder = aCallable(newSet.add);\n iterate(iterator, function (value) {\n if (boundFunction(value, value, set)) call(adder, newSet, value);\n }, { IS_ITERATOR: true });\n return newSet;\n }\n});\n\n\n/***/ }),\n\n/***/ 40256:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.find` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n find: function find(callbackfn /* , thisArg */) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (value, stop) {\n if (boundFunction(value, value, set)) return stop(value);\n }, { IS_ITERATOR: true, INTERRUPTED: true }).result;\n }\n});\n\n\n/***/ }),\n\n/***/ 95800:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar from = __webpack_require__(83590);\n\n// `Set.from` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\n$({ target: 'Set', stat: true, forced: true }, {\n from: from\n});\n\n\n/***/ }),\n\n/***/ 52032:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.intersection` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n intersection: function intersection(iterable) {\n var set = anObject(this);\n var newSet = new (speciesConstructor(set, getBuiltIn('Set')))();\n var hasCheck = aCallable(set.has);\n var adder = aCallable(newSet.add);\n iterate(iterable, function (value) {\n if (call(hasCheck, set, value)) call(adder, newSet, value);\n });\n return newSet;\n }\n});\n\n\n/***/ }),\n\n/***/ 21873:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.isDisjointFrom` method\n// https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n isDisjointFrom: function isDisjointFrom(iterable) {\n var set = anObject(this);\n var hasCheck = aCallable(set.has);\n return !iterate(iterable, function (value, stop) {\n if (call(hasCheck, set, value) === true) return stop();\n }, { INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 26566:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar isCallable = __webpack_require__(57475);\nvar anObject = __webpack_require__(96059);\nvar getIterator = __webpack_require__(53476);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.isSubsetOf` method\n// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n isSubsetOf: function isSubsetOf(iterable) {\n var iterator = getIterator(this);\n var otherSet = anObject(iterable);\n var hasCheck = otherSet.has;\n if (!isCallable(hasCheck)) {\n otherSet = new (getBuiltIn('Set'))(iterable);\n hasCheck = aCallable(otherSet.has);\n }\n return !iterate(iterator, function (value, stop) {\n if (call(hasCheck, otherSet, value) === false) return stop();\n }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 50987:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.isSupersetOf` method\n// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n isSupersetOf: function isSupersetOf(iterable) {\n var set = anObject(this);\n var hasCheck = aCallable(set.has);\n return !iterate(iterable, function (value, stop) {\n if (call(hasCheck, set, value) === false) return stop();\n }, { INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 71892:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar uncurryThis = __webpack_require__(95329);\nvar anObject = __webpack_require__(96059);\nvar toString = __webpack_require__(85803);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\nvar arrayJoin = uncurryThis([].join);\nvar push = [].push;\n\n// `Set.prototype.join` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n join: function join(separator) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var sep = separator === undefined ? ',' : toString(separator);\n var result = [];\n iterate(iterator, push, { that: result, IS_ITERATOR: true });\n return arrayJoin(result, sep);\n }\n});\n\n\n/***/ }),\n\n/***/ 3352:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar bind = __webpack_require__(86843);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.map` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n map: function map(callbackfn /* , thisArg */) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newSet = new (speciesConstructor(set, getBuiltIn('Set')))();\n var adder = aCallable(newSet.add);\n iterate(iterator, function (value) {\n call(adder, newSet, boundFunction(value, value, set));\n }, { IS_ITERATOR: true });\n return newSet;\n }\n});\n\n\n/***/ }),\n\n/***/ 73676:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar of = __webpack_require__(45226);\n\n// `Set.of` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\n$({ target: 'Set', stat: true, forced: true }, {\n of: of\n});\n\n\n/***/ }),\n\n/***/ 76988:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\nvar $TypeError = TypeError;\n\n// `Set.prototype.reduce` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var noInitial = arguments.length < 2;\n var accumulator = noInitial ? undefined : arguments[1];\n aCallable(callbackfn);\n iterate(iterator, function (value) {\n if (noInitial) {\n noInitial = false;\n accumulator = value;\n } else {\n accumulator = callbackfn(accumulator, value, value, set);\n }\n }, { IS_ITERATOR: true });\n if (noInitial) throw $TypeError('Reduce of empty set with no initial value');\n return accumulator;\n }\n});\n\n\n/***/ }),\n\n/***/ 16875:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar anObject = __webpack_require__(96059);\nvar bind = __webpack_require__(86843);\nvar getSetIterator = __webpack_require__(69571);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.some` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n some: function some(callbackfn /* , thisArg */) {\n var set = anObject(this);\n var iterator = getSetIterator(set);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(iterator, function (value, stop) {\n if (boundFunction(value, value, set)) return stop();\n }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped;\n }\n});\n\n\n/***/ }),\n\n/***/ 3859:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar call = __webpack_require__(78834);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.symmetricDifference` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n symmetricDifference: function symmetricDifference(iterable) {\n var set = anObject(this);\n var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set);\n var remover = aCallable(newSet['delete']);\n var adder = aCallable(newSet.add);\n iterate(iterable, function (value) {\n call(remover, newSet, value) || call(adder, newSet, value);\n });\n return newSet;\n }\n});\n\n\n/***/ }),\n\n/***/ 56690:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar getBuiltIn = __webpack_require__(626);\nvar aCallable = __webpack_require__(24883);\nvar anObject = __webpack_require__(96059);\nvar speciesConstructor = __webpack_require__(70487);\nvar iterate = __webpack_require__(93091);\n\n// `Set.prototype.union` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: true }, {\n union: function union(iterable) {\n var set = anObject(this);\n var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set);\n iterate(iterable, aCallable(newSet.add), { that: newSet });\n return newSet;\n }\n});\n\n\n/***/ }),\n\n/***/ 54975:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n// TODO: Remove from `core-js@4`\nvar $ = __webpack_require__(76887);\nvar charAt = (__webpack_require__(64620).charAt);\nvar requireObjectCoercible = __webpack_require__(48219);\nvar toIntegerOrInfinity = __webpack_require__(62435);\nvar toString = __webpack_require__(85803);\n\n// `String.prototype.at` method\n// https://github.com/mathiasbynens/String.prototype.at\n$({ target: 'String', proto: true, forced: true }, {\n at: function at(index) {\n var S = toString(requireObjectCoercible(this));\n var len = S.length;\n var relativeIndex = toIntegerOrInfinity(index);\n var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;\n return (k < 0 || k >= len) ? undefined : charAt(S, k);\n }\n});\n\n\n/***/ }),\n\n/***/ 4629:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar deleteAll = __webpack_require__(28984);\n\n// `WeakMap.prototype.deleteAll` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'WeakMap', proto: true, real: true, forced: true }, {\n deleteAll: deleteAll\n});\n\n\n/***/ }),\n\n/***/ 86442:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\nvar $ = __webpack_require__(76887);\nvar emplace = __webpack_require__(48721);\n\n// `WeakMap.prototype.emplace` method\n// https://github.com/tc39/proposal-upsert\n$({ target: 'WeakMap', proto: true, real: true, forced: true }, {\n emplace: emplace\n});\n\n\n/***/ }),\n\n/***/ 26207:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar from = __webpack_require__(83590);\n\n// `WeakMap.from` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\n$({ target: 'WeakMap', stat: true, forced: true }, {\n from: from\n});\n\n\n/***/ }),\n\n/***/ 13215:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar of = __webpack_require__(45226);\n\n// `WeakMap.of` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\n$({ target: 'WeakMap', stat: true, forced: true }, {\n of: of\n});\n\n\n/***/ }),\n\n/***/ 4055:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n// TODO: remove from `core-js@4`\nvar $ = __webpack_require__(76887);\nvar upsert = __webpack_require__(20716);\n\n// `WeakMap.prototype.upsert` method (replaced by `WeakMap.prototype.emplace`)\n// https://github.com/tc39/proposal-upsert\n$({ target: 'WeakMap', proto: true, real: true, forced: true }, {\n upsert: upsert\n});\n\n\n/***/ }),\n\n/***/ 7634:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(66274);\nvar DOMIterables = __webpack_require__(63281);\nvar global = __webpack_require__(21899);\nvar classof = __webpack_require__(9697);\nvar createNonEnumerableProperty = __webpack_require__(32029);\nvar Iterators = __webpack_require__(12077);\nvar wellKnownSymbol = __webpack_require__(99813);\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n\n\n/***/ }),\n\n/***/ 79229:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar global = __webpack_require__(21899);\nvar setInterval = __webpack_require__(37620);\n\n// ie9- setInterval additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\n$({ global: true, bind: true, forced: global.setInterval !== setInterval }, {\n setInterval: setInterval\n});\n\n\n/***/ }),\n\n/***/ 17749:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\nvar $ = __webpack_require__(76887);\nvar global = __webpack_require__(21899);\nvar setTimeout = __webpack_require__(37620);\n\n// ie9- setTimeout additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\n$({ global: true, bind: true, forced: global.setTimeout !== setTimeout }, {\n setTimeout: setTimeout\n});\n\n\n/***/ }),\n\n/***/ 71249:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\n__webpack_require__(79229);\n__webpack_require__(17749);\n\n\n/***/ }),\n\n/***/ 27698:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(54493);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 83363:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(24034);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 41793:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(87716);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 49216:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(99324);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 56668:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(95909);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 74719:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(14423);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 28196:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(16246);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 8065:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(56043);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 11955:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(2480);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 61577:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(32236);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 46279:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(7634);\nvar classof = __webpack_require__(9697);\nvar hasOwn = __webpack_require__(90953);\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(49216);\n\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.forEach;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.forEach)\n || hasOwn(DOMIterables, classof(it)) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 19373:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(34570);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 73819:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(7634);\nvar classof = __webpack_require__(9697);\nvar hasOwn = __webpack_require__(90953);\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(56668);\n\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.keys;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)\n || hasOwn(DOMIterables, classof(it)) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 11022:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(57564);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 61798:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(88287);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 36857:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(59257);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 28427:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(91060);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 82073:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(69601);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 62856:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(69355);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 2348:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(18339);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 76361:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(62774);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 62908:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(7634);\nvar classof = __webpack_require__(9697);\nvar hasOwn = __webpack_require__(90953);\nvar isPrototypeOf = __webpack_require__(7046);\nvar method = __webpack_require__(74719);\n\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.values;\n return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.values)\n || hasOwn(DOMIterables, classof(it)) ? method : own;\n};\n\n\n/***/ }),\n\n/***/ 8933:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(84426);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 15868:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(91018);\n__webpack_require__(7634);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 21917:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(95213);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 60155:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(88908);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 55169:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(76837);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 14873:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(97849);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 38849:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(3820);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 42119:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(4723);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 63383:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(45999);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 57396:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(7702);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 41910:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(48171);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 35021:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(73770);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 23059:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(48494);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 66877:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(7579);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 74888:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(98524);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 27460:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(52956);\n__webpack_require__(7634);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 27989:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n__webpack_require__(71249);\nvar path = __webpack_require__(54058);\n\nmodule.exports = path.setTimeout;\n\n\n/***/ }),\n\n/***/ 5519:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(76998);\n__webpack_require__(7634);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 88004:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(12318);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 46509:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(24227);\n__webpack_require__(7634);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 72010:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar parent = __webpack_require__(32304);\n__webpack_require__(7634);\n\nmodule.exports = parent;\n\n\n/***/ }),\n\n/***/ 10349:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(27385);\n\n/***/ }),\n\n/***/ 98235:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(81522);\n\n/***/ }),\n\n/***/ 90646:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(66449);\n\n/***/ }),\n\n/***/ 48216:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(14122);\n\n/***/ }),\n\n/***/ 8571:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(21086);\n\n/***/ }),\n\n/***/ 73324:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(44442);\n\n/***/ }),\n\n/***/ 86981:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(2636);\n\n/***/ }),\n\n/***/ 99595:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(57152);\n\n/***/ }),\n\n/***/ 51791:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(69447);\n\n/***/ }),\n\n/***/ 29898:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* unused reexport */ __webpack_require__(56211);\n\n/***/ }),\n\n/***/ 19178:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(25376);\n\n/***/ }),\n\n/***/ 88946:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(86942);\n\n/***/ }),\n\n/***/ 13004:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(79595);\n\n/***/ }),\n\n/***/ 86526:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(17579);\n\n/***/ }),\n\n/***/ 35704:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(81493);\n\n/***/ }),\n\n/***/ 76555:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(72858);\n\n/***/ }),\n\n/***/ 90143:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(71777);\n\n/***/ }),\n\n/***/ 84705:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(75425);\n\n/***/ }),\n\n/***/ 89221:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(99465);\n\n/***/ }),\n\n/***/ 58218:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(52740);\n\n/***/ }),\n\n/***/ 54847:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(86672);\n\n/***/ }),\n\n/***/ 77726:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(2753);\n\n/***/ }),\n\n/***/ 37265:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(18260);\n\n/***/ }),\n\n/***/ 14051:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(93376);\n\n/***/ }),\n\n/***/ 55243:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(78421);\n\n/***/ }),\n\n/***/ 60312:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* unused reexport */ __webpack_require__(82320);\n\n/***/ }),\n\n/***/ 73672:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(75632);\n\n/***/ }),\n\n/***/ 67552:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(60269);\n\n/***/ }),\n\n/***/ 2201:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(70573);\n\n/***/ }),\n\n/***/ 57445:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(73685);\n\n/***/ }),\n\n/***/ 54877:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(23252);\n\n/***/ }),\n\n/***/ 62079:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(93799);\n\n/***/ }),\n\n/***/ 10899:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(91645);\n\n/***/ }),\n\n/***/ 34300:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(53103);\n\n/***/ }),\n\n/***/ 35820:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(29531);\n\n/***/ }),\n\n/***/ 9938:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\n/* unused reexport */ __webpack_require__(24803);\n\n/***/ }),\n\n/***/ 23513:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(65743);\n\n/***/ }),\n\n/***/ 48994:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(9759);\n\n/***/ }),\n\n/***/ 98186:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(58714);\n\n/***/ })\n\n/******/ });\n/************************************************************************/\n/******/ // The module cache\n/******/ var __webpack_module_cache__ = {};\n/******/ \n/******/ // The require function\n/******/ function __webpack_require__(moduleId) {\n/******/ \t// Check if module is in cache\n/******/ \tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \tif (cachedModule !== undefined) {\n/******/ \t\treturn cachedModule.exports;\n/******/ \t}\n/******/ \t// Create a new module (and put it into the cache)\n/******/ \tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t// no module.id needed\n/******/ \t\t// no module.loaded needed\n/******/ \t\texports: {}\n/******/ \t};\n/******/ \n/******/ \t// Execute the module function\n/******/ \t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \n/******/ \t// Return the exports of the module\n/******/ \treturn module.exports;\n/******/ }\n/******/ \n/************************************************************************/\n/******/ /* webpack/runtime/compat get default export */\n/******/ !function() {\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction() { return module['default']; } :\n/******/ \t\t\tfunction() { return module; };\n/******/ \t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\treturn getter;\n/******/ \t};\n/******/ }();\n/******/ \n/******/ /* webpack/runtime/define property getters */\n/******/ !function() {\n/******/ \t// define getter functions for harmony exports\n/******/ \t__webpack_require__.d = function(exports, definition) {\n/******/ \t\tfor(var key in definition) {\n/******/ \t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t};\n/******/ }();\n/******/ \n/******/ /* webpack/runtime/global */\n/******/ !function() {\n/******/ \t__webpack_require__.g = (function() {\n/******/ \t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\ttry {\n/******/ \t\t\treturn this || new Function('return this')();\n/******/ \t\t} catch (e) {\n/******/ \t\t\tif (typeof window === 'object') return window;\n/******/ \t\t}\n/******/ \t})();\n/******/ }();\n/******/ \n/******/ /* webpack/runtime/hasOwnProperty shorthand */\n/******/ !function() {\n/******/ \t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ }();\n/******/ \n/************************************************************************/\nvar __webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.\n!function() {\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/promise.js\nvar promise = __webpack_require__(35820);\nvar promise_default = /*#__PURE__*/__webpack_require__.n(promise);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/math/imul.js\nvar imul = __webpack_require__(77726);\n;// CONCATENATED MODULE: ./node_modules/three/src/math/MathUtils.js\nconst _lut=(/* unused pure expression or super */ null && (['00','01','02','03','04','05','06','07','08','09','0a','0b','0c','0d','0e','0f','10','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','70','71','72','73','74','75','76','77','78','79','7a','7b','7c','7d','7e','7f','80','81','82','83','84','85','86','87','88','89','8a','8b','8c','8d','8e','8f','90','91','92','93','94','95','96','97','98','99','9a','9b','9c','9d','9e','9f','a0','a1','a2','a3','a4','a5','a6','a7','a8','a9','aa','ab','ac','ad','ae','af','b0','b1','b2','b3','b4','b5','b6','b7','b8','b9','ba','bb','bc','bd','be','bf','c0','c1','c2','c3','c4','c5','c6','c7','c8','c9','ca','cb','cc','cd','ce','cf','d0','d1','d2','d3','d4','d5','d6','d7','d8','d9','da','db','dc','dd','de','df','e0','e1','e2','e3','e4','e5','e6','e7','e8','e9','ea','eb','ec','ed','ee','ef','f0','f1','f2','f3','f4','f5','f6','f7','f8','f9','fa','fb','fc','fd','fe','ff']));let _seed=1234567;const DEG2RAD=Math.PI/180;const RAD2DEG=180/Math.PI;// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\nfunction generateUUID(){const d0=Math.random()*0xffffffff|0;const d1=Math.random()*0xffffffff|0;const d2=Math.random()*0xffffffff|0;const d3=Math.random()*0xffffffff|0;const uuid=_lut[d0&0xff]+_lut[d0>>8&0xff]+_lut[d0>>16&0xff]+_lut[d0>>24&0xff]+'-'+_lut[d1&0xff]+_lut[d1>>8&0xff]+'-'+_lut[d1>>16&0x0f|0x40]+_lut[d1>>24&0xff]+'-'+_lut[d2&0x3f|0x80]+_lut[d2>>8&0xff]+'-'+_lut[d2>>16&0xff]+_lut[d2>>24&0xff]+_lut[d3&0xff]+_lut[d3>>8&0xff]+_lut[d3>>16&0xff]+_lut[d3>>24&0xff];// .toLowerCase() here flattens concatenated strings to save heap memory space.\nreturn uuid.toLowerCase();}function clamp(value,min,max){return Math.max(min,Math.min(max,value));}// compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\nfunction euclideanModulo(n,m){return(n%m+m)%m;}// Linear mapping from range <a1, a2> to range <b1, b2>\nfunction mapLinear(x,a1,a2,b1,b2){return b1+(x-a1)*(b2-b1)/(a2-a1);}// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\nfunction inverseLerp(x,y,value){if(x!==y){return(value-x)/(y-x);}else{return 0;}}// https://en.wikipedia.org/wiki/Linear_interpolation\nfunction lerp(x,y,t){return(1-t)*x+t*y;}// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\nfunction damp(x,y,lambda,dt){return lerp(x,y,1-Math.exp(-lambda*dt));}// https://www.desmos.com/calculator/vcsjnyz7x4\nfunction pingpong(x,length=1){return length-Math.abs(euclideanModulo(x,length*2)-length);}// http://en.wikipedia.org/wiki/Smoothstep\nfunction smoothstep(x,min,max){if(x<=min)return 0;if(x>=max)return 1;x=(x-min)/(max-min);return x*x*(3-2*x);}function smootherstep(x,min,max){if(x<=min)return 0;if(x>=max)return 1;x=(x-min)/(max-min);return x*x*x*(x*(x*6-15)+10);}// Random integer from <low, high> interval\nfunction randInt(low,high){return low+Math.floor(Math.random()*(high-low+1));}// Random float from <low, high> interval\nfunction randFloat(low,high){return low+Math.random()*(high-low);}// Random float from <-range/2, range/2> interval\nfunction randFloatSpread(range){return range*(0.5-Math.random());}// Deterministic pseudo-random float in the interval [ 0, 1 ]\nfunction seededRandom(s){if(s!==undefined)_seed=s;// Mulberry32 generator\nlet t=_seed+=0x6D2B79F5;t=_Math$imul(t^t>>>15,t|1);t^=t+_Math$imul(t^t>>>7,t|61);return((t^t>>>14)>>>0)/4294967296;}function degToRad(degrees){return degrees*DEG2RAD;}function radToDeg(radians){return radians*RAD2DEG;}function isPowerOfTwo(value){return(value&value-1)===0&&value!==0;}function ceilPowerOfTwo(value){return Math.pow(2,Math.ceil(Math.log(value)/Math.LN2));}function floorPowerOfTwo(value){return Math.pow(2,Math.floor(Math.log(value)/Math.LN2));}function setQuaternionFromProperEuler(q,a,b,c,order){// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n// rotations are applied to the axes in the order specified by 'order'\n// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n// angles are in radians\nconst cos=Math.cos;const sin=Math.sin;const c2=cos(b/2);const s2=sin(b/2);const c13=cos((a+c)/2);const s13=sin((a+c)/2);const c1_3=cos((a-c)/2);const s1_3=sin((a-c)/2);const c3_1=cos((c-a)/2);const s3_1=sin((c-a)/2);switch(order){case'XYX':q.set(c2*s13,s2*c1_3,s2*s1_3,c2*c13);break;case'YZY':q.set(s2*s1_3,c2*s13,s2*c1_3,c2*c13);break;case'ZXZ':q.set(s2*c1_3,s2*s1_3,c2*s13,c2*c13);break;case'XZX':q.set(c2*s13,s2*s3_1,s2*c3_1,c2*c13);break;case'YXY':q.set(s2*c3_1,c2*s13,s2*s3_1,c2*c13);break;case'ZYZ':q.set(s2*s3_1,s2*c3_1,c2*s13,c2*c13);break;default:console.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: '+order);}}function denormalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint16Array:return value/65535.0;case Uint8Array:return value/255.0;case Int16Array:return Math.max(value/32767.0,-1.0);case Int8Array:return Math.max(value/127.0,-1.0);default:throw new Error('Invalid component type.');}}function normalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint16Array:return Math.round(value*65535.0);case Uint8Array:return Math.round(value*255.0);case Int16Array:return Math.round(value*32767.0);case Int8Array:return Math.round(value*127.0);default:throw new Error('Invalid component type.');}}\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/symbol/iterator.js\nvar iterator = __webpack_require__(48994);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/number/epsilon.js\nvar epsilon = __webpack_require__(55243);\n;// CONCATENATED MODULE: ./node_modules/three/src/math/Quaternion.js\nclass Quaternion{constructor(x=0,y=0,z=0,w=1){this.isQuaternion=true;this._x=x;this._y=y;this._z=z;this._w=w;}static slerpFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1,t){// fuzz-free, array-based Quaternion SLERP operation\nlet x0=src0[srcOffset0+0],y0=src0[srcOffset0+1],z0=src0[srcOffset0+2],w0=src0[srcOffset0+3];const x1=src1[srcOffset1+0],y1=src1[srcOffset1+1],z1=src1[srcOffset1+2],w1=src1[srcOffset1+3];if(t===0){dst[dstOffset+0]=x0;dst[dstOffset+1]=y0;dst[dstOffset+2]=z0;dst[dstOffset+3]=w0;return;}if(t===1){dst[dstOffset+0]=x1;dst[dstOffset+1]=y1;dst[dstOffset+2]=z1;dst[dstOffset+3]=w1;return;}if(w0!==w1||x0!==x1||y0!==y1||z0!==z1){let s=1-t;const cos=x0*x1+y0*y1+z0*z1+w0*w1,dir=cos>=0?1:-1,sqrSin=1-cos*cos;// Skip the Slerp for tiny steps to avoid numeric problems:\nif(sqrSin>epsilon){const sin=Math.sqrt(sqrSin),len=Math.atan2(sin,cos*dir);s=Math.sin(s*len)/sin;t=Math.sin(t*len)/sin;}const tDir=t*dir;x0=x0*s+x1*tDir;y0=y0*s+y1*tDir;z0=z0*s+z1*tDir;w0=w0*s+w1*tDir;// Normalize in case we just did a lerp:\nif(s===1-t){const f=1/Math.sqrt(x0*x0+y0*y0+z0*z0+w0*w0);x0*=f;y0*=f;z0*=f;w0*=f;}}dst[dstOffset]=x0;dst[dstOffset+1]=y0;dst[dstOffset+2]=z0;dst[dstOffset+3]=w0;}static multiplyQuaternionsFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1){const x0=src0[srcOffset0];const y0=src0[srcOffset0+1];const z0=src0[srcOffset0+2];const w0=src0[srcOffset0+3];const x1=src1[srcOffset1];const y1=src1[srcOffset1+1];const z1=src1[srcOffset1+2];const w1=src1[srcOffset1+3];dst[dstOffset]=x0*w1+w0*x1+y0*z1-z0*y1;dst[dstOffset+1]=y0*w1+w0*y1+z0*x1-x0*z1;dst[dstOffset+2]=z0*w1+w0*z1+x0*y1-y0*x1;dst[dstOffset+3]=w0*w1-x0*x1-y0*y1-z0*z1;return dst;}get x(){return this._x;}set x(value){this._x=value;this._onChangeCallback();}get y(){return this._y;}set y(value){this._y=value;this._onChangeCallback();}get z(){return this._z;}set z(value){this._z=value;this._onChangeCallback();}get w(){return this._w;}set w(value){this._w=value;this._onChangeCallback();}set(x,y,z,w){this._x=x;this._y=y;this._z=z;this._w=w;this._onChangeCallback();return this;}clone(){return new this.constructor(this._x,this._y,this._z,this._w);}copy(quaternion){this._x=quaternion.x;this._y=quaternion.y;this._z=quaternion.z;this._w=quaternion.w;this._onChangeCallback();return this;}setFromEuler(euler,update){const x=euler._x,y=euler._y,z=euler._z,order=euler._order;// http://www.mathworks.com/matlabcentral/fileexchange/\n// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n//\tcontent/SpinCalc.m\nconst cos=Math.cos;const sin=Math.sin;const c1=cos(x/2);const c2=cos(y/2);const c3=cos(z/2);const s1=sin(x/2);const s2=sin(y/2);const s3=sin(z/2);switch(order){case'XYZ':this._x=s1*c2*c3+c1*s2*s3;this._y=c1*s2*c3-s1*c2*s3;this._z=c1*c2*s3+s1*s2*c3;this._w=c1*c2*c3-s1*s2*s3;break;case'YXZ':this._x=s1*c2*c3+c1*s2*s3;this._y=c1*s2*c3-s1*c2*s3;this._z=c1*c2*s3-s1*s2*c3;this._w=c1*c2*c3+s1*s2*s3;break;case'ZXY':this._x=s1*c2*c3-c1*s2*s3;this._y=c1*s2*c3+s1*c2*s3;this._z=c1*c2*s3+s1*s2*c3;this._w=c1*c2*c3-s1*s2*s3;break;case'ZYX':this._x=s1*c2*c3-c1*s2*s3;this._y=c1*s2*c3+s1*c2*s3;this._z=c1*c2*s3-s1*s2*c3;this._w=c1*c2*c3+s1*s2*s3;break;case'YZX':this._x=s1*c2*c3+c1*s2*s3;this._y=c1*s2*c3+s1*c2*s3;this._z=c1*c2*s3-s1*s2*c3;this._w=c1*c2*c3-s1*s2*s3;break;case'XZY':this._x=s1*c2*c3-c1*s2*s3;this._y=c1*s2*c3-s1*c2*s3;this._z=c1*c2*s3+s1*s2*c3;this._w=c1*c2*c3+s1*s2*s3;break;default:console.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: '+order);}if(update!==false)this._onChangeCallback();return this;}setFromAxisAngle(axis,angle){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n// assumes axis is normalized\nconst halfAngle=angle/2,s=Math.sin(halfAngle);this._x=axis.x*s;this._y=axis.y*s;this._z=axis.z*s;this._w=Math.cos(halfAngle);this._onChangeCallback();return this;}setFromRotationMatrix(m){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\nconst te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10],trace=m11+m22+m33;if(trace>0){const s=0.5/Math.sqrt(trace+1.0);this._w=0.25/s;this._x=(m32-m23)*s;this._y=(m13-m31)*s;this._z=(m21-m12)*s;}else if(m11>m22&&m11>m33){const s=2.0*Math.sqrt(1.0+m11-m22-m33);this._w=(m32-m23)/s;this._x=0.25*s;this._y=(m12+m21)/s;this._z=(m13+m31)/s;}else if(m22>m33){const s=2.0*Math.sqrt(1.0+m22-m11-m33);this._w=(m13-m31)/s;this._x=(m12+m21)/s;this._y=0.25*s;this._z=(m23+m32)/s;}else{const s=2.0*Math.sqrt(1.0+m33-m11-m22);this._w=(m21-m12)/s;this._x=(m13+m31)/s;this._y=(m23+m32)/s;this._z=0.25*s;}this._onChangeCallback();return this;}setFromUnitVectors(vFrom,vTo){// assumes direction vectors vFrom and vTo are normalized\nlet r=vFrom.dot(vTo)+1;if(r<epsilon){// vFrom and vTo point in opposite directions\nr=0;if(Math.abs(vFrom.x)>Math.abs(vFrom.z)){this._x=-vFrom.y;this._y=vFrom.x;this._z=0;this._w=r;}else{this._x=0;this._y=-vFrom.z;this._z=vFrom.y;this._w=r;}}else{// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\nthis._x=vFrom.y*vTo.z-vFrom.z*vTo.y;this._y=vFrom.z*vTo.x-vFrom.x*vTo.z;this._z=vFrom.x*vTo.y-vFrom.y*vTo.x;this._w=r;}return this.normalize();}angleTo(q){return 2*Math.acos(Math.abs(clamp(this.dot(q),-1,1)));}rotateTowards(q,step){const angle=this.angleTo(q);if(angle===0)return this;const t=Math.min(1,step/angle);this.slerp(q,t);return this;}identity(){return this.set(0,0,0,1);}invert(){// quaternion is assumed to have unit length\nreturn this.conjugate();}conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this;}dot(v){return this._x*v._x+this._y*v._y+this._z*v._z+this._w*v._w;}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w;}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);}normalize(){let l=this.length();if(l===0){this._x=0;this._y=0;this._z=0;this._w=1;}else{l=1/l;this._x=this._x*l;this._y=this._y*l;this._z=this._z*l;this._w=this._w*l;}this._onChangeCallback();return this;}multiply(q){return this.multiplyQuaternions(this,q);}premultiply(q){return this.multiplyQuaternions(q,this);}multiplyQuaternions(a,b){// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\nconst qax=a._x,qay=a._y,qaz=a._z,qaw=a._w;const qbx=b._x,qby=b._y,qbz=b._z,qbw=b._w;this._x=qax*qbw+qaw*qbx+qay*qbz-qaz*qby;this._y=qay*qbw+qaw*qby+qaz*qbx-qax*qbz;this._z=qaz*qbw+qaw*qbz+qax*qby-qay*qbx;this._w=qaw*qbw-qax*qbx-qay*qby-qaz*qbz;this._onChangeCallback();return this;}slerp(qb,t){if(t===0)return this;if(t===1)return this.copy(qb);const x=this._x,y=this._y,z=this._z,w=this._w;// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\nlet cosHalfTheta=w*qb._w+x*qb._x+y*qb._y+z*qb._z;if(cosHalfTheta<0){this._w=-qb._w;this._x=-qb._x;this._y=-qb._y;this._z=-qb._z;cosHalfTheta=-cosHalfTheta;}else{this.copy(qb);}if(cosHalfTheta>=1.0){this._w=w;this._x=x;this._y=y;this._z=z;return this;}const sqrSinHalfTheta=1.0-cosHalfTheta*cosHalfTheta;if(sqrSinHalfTheta<=epsilon){const s=1-t;this._w=s*w+t*this._w;this._x=s*x+t*this._x;this._y=s*y+t*this._y;this._z=s*z+t*this._z;this.normalize();this._onChangeCallback();return this;}const sinHalfTheta=Math.sqrt(sqrSinHalfTheta);const halfTheta=Math.atan2(sinHalfTheta,cosHalfTheta);const ratioA=Math.sin((1-t)*halfTheta)/sinHalfTheta,ratioB=Math.sin(t*halfTheta)/sinHalfTheta;this._w=w*ratioA+this._w*ratioB;this._x=x*ratioA+this._x*ratioB;this._y=y*ratioA+this._y*ratioB;this._z=z*ratioA+this._z*ratioB;this._onChangeCallback();return this;}slerpQuaternions(qa,qb,t){return this.copy(qa).slerp(qb,t);}random(){// Derived from http://planning.cs.uiuc.edu/node198.html\n// Note, this source uses w, x, y, z ordering,\n// so we swap the order below.\nconst u1=Math.random();const sqrt1u1=Math.sqrt(1-u1);const sqrtu1=Math.sqrt(u1);const u2=2*Math.PI*Math.random();const u3=2*Math.PI*Math.random();return this.set(sqrt1u1*Math.cos(u2),sqrtu1*Math.sin(u3),sqrtu1*Math.cos(u3),sqrt1u1*Math.sin(u2));}equals(quaternion){return quaternion._x===this._x&&quaternion._y===this._y&&quaternion._z===this._z&&quaternion._w===this._w;}fromArray(array,offset=0){this._x=array[offset];this._y=array[offset+1];this._z=array[offset+2];this._w=array[offset+3];this._onChangeCallback();return this;}toArray(array=[],offset=0){array[offset]=this._x;array[offset+1]=this._y;array[offset+2]=this._z;array[offset+3]=this._w;return array;}fromBufferAttribute(attribute,index){this._x=attribute.getX(index);this._y=attribute.getY(index);this._z=attribute.getZ(index);this._w=attribute.getW(index);return this;}_onChange(callback){this._onChangeCallback=callback;return this;}_onChangeCallback(){}*[iterator](){yield this._x;yield this._y;yield this._z;yield this._w;}}\n;// CONCATENATED MODULE: ./node_modules/three/src/math/Vector3.js\nclass Vector3{constructor(x=0,y=0,z=0){Vector3.prototype.isVector3=true;this.x=x;this.y=y;this.z=z;}set(x,y,z){if(z===undefined)z=this.z;// sprite.scale.set(x,y)\nthis.x=x;this.y=y;this.z=z;return this;}setScalar(scalar){this.x=scalar;this.y=scalar;this.z=scalar;return this;}setX(x){this.x=x;return this;}setY(y){this.y=y;return this;}setZ(z){this.z=z;return this;}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;default:throw new Error('index is out of range: '+index);}return this;}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error('index is out of range: '+index);}}clone(){return new this.constructor(this.x,this.y,this.z);}copy(v){this.x=v.x;this.y=v.y;this.z=v.z;return this;}add(v){this.x+=v.x;this.y+=v.y;this.z+=v.z;return this;}addScalar(s){this.x+=s;this.y+=s;this.z+=s;return this;}addVectors(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this;}addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;this.z+=v.z*s;return this;}sub(v){this.x-=v.x;this.y-=v.y;this.z-=v.z;return this;}subScalar(s){this.x-=s;this.y-=s;this.z-=s;return this;}subVectors(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this;}multiply(v){this.x*=v.x;this.y*=v.y;this.z*=v.z;return this;}multiplyScalar(scalar){this.x*=scalar;this.y*=scalar;this.z*=scalar;return this;}multiplyVectors(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this;}applyEuler(euler){return this.applyQuaternion(_quaternion.setFromEuler(euler));}applyAxisAngle(axis,angle){return this.applyQuaternion(_quaternion.setFromAxisAngle(axis,angle));}applyMatrix3(m){const x=this.x,y=this.y,z=this.z;const e=m.elements;this.x=e[0]*x+e[3]*y+e[6]*z;this.y=e[1]*x+e[4]*y+e[7]*z;this.z=e[2]*x+e[5]*y+e[8]*z;return this;}applyNormalMatrix(m){return this.applyMatrix3(m).normalize();}applyMatrix4(m){const x=this.x,y=this.y,z=this.z;const e=m.elements;const w=1/(e[3]*x+e[7]*y+e[11]*z+e[15]);this.x=(e[0]*x+e[4]*y+e[8]*z+e[12])*w;this.y=(e[1]*x+e[5]*y+e[9]*z+e[13])*w;this.z=(e[2]*x+e[6]*y+e[10]*z+e[14])*w;return this;}applyQuaternion(q){const x=this.x,y=this.y,z=this.z;const qx=q.x,qy=q.y,qz=q.z,qw=q.w;// calculate quat * vector\nconst ix=qw*x+qy*z-qz*y;const iy=qw*y+qz*x-qx*z;const iz=qw*z+qx*y-qy*x;const iw=-qx*x-qy*y-qz*z;// calculate result * inverse quat\nthis.x=ix*qw+iw*-qx+iy*-qz-iz*-qy;this.y=iy*qw+iw*-qy+iz*-qx-ix*-qz;this.z=iz*qw+iw*-qz+ix*-qy-iy*-qx;return this;}project(camera){return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);}unproject(camera){return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);}transformDirection(m){// input: THREE.Matrix4 affine matrix\n// vector interpreted as a direction\nconst x=this.x,y=this.y,z=this.z;const e=m.elements;this.x=e[0]*x+e[4]*y+e[8]*z;this.y=e[1]*x+e[5]*y+e[9]*z;this.z=e[2]*x+e[6]*y+e[10]*z;return this.normalize();}divide(v){this.x/=v.x;this.y/=v.y;this.z/=v.z;return this;}divideScalar(scalar){return this.multiplyScalar(1/scalar);}min(v){this.x=Math.min(this.x,v.x);this.y=Math.min(this.y,v.y);this.z=Math.min(this.z,v.z);return this;}max(v){this.x=Math.max(this.x,v.x);this.y=Math.max(this.y,v.y);this.z=Math.max(this.z,v.z);return this;}clamp(min,max){// assumes min < max, componentwise\nthis.x=Math.max(min.x,Math.min(max.x,this.x));this.y=Math.max(min.y,Math.min(max.y,this.y));this.z=Math.max(min.z,Math.min(max.z,this.z));return this;}clampScalar(minVal,maxVal){this.x=Math.max(minVal,Math.min(maxVal,this.x));this.y=Math.max(minVal,Math.min(maxVal,this.y));this.z=Math.max(minVal,Math.min(maxVal,this.z));return this;}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)));}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this;}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this;}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this;}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this;}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this;}dot(v){return this.x*v.x+this.y*v.y+this.z*v.z;}// TODO lengthSquared?\nlengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z;}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z);}normalize(){return this.divideScalar(this.length()||1);}setLength(length){return this.normalize().multiplyScalar(length);}lerp(v,alpha){this.x+=(v.x-this.x)*alpha;this.y+=(v.y-this.y)*alpha;this.z+=(v.z-this.z)*alpha;return this;}lerpVectors(v1,v2,alpha){this.x=v1.x+(v2.x-v1.x)*alpha;this.y=v1.y+(v2.y-v1.y)*alpha;this.z=v1.z+(v2.z-v1.z)*alpha;return this;}cross(v){return this.crossVectors(this,v);}crossVectors(a,b){const ax=a.x,ay=a.y,az=a.z;const bx=b.x,by=b.y,bz=b.z;this.x=ay*bz-az*by;this.y=az*bx-ax*bz;this.z=ax*by-ay*bx;return this;}projectOnVector(v){const denominator=v.lengthSq();if(denominator===0)return this.set(0,0,0);const scalar=v.dot(this)/denominator;return this.copy(v).multiplyScalar(scalar);}projectOnPlane(planeNormal){_vector.copy(this).projectOnVector(planeNormal);return this.sub(_vector);}reflect(normal){// reflect incident vector off plane orthogonal to normal\n// normal is assumed to have unit length\nreturn this.sub(_vector.copy(normal).multiplyScalar(2*this.dot(normal)));}angleTo(v){const denominator=Math.sqrt(this.lengthSq()*v.lengthSq());if(denominator===0)return Math.PI/2;const theta=this.dot(v)/denominator;// clamp, to handle numerical problems\nreturn Math.acos(clamp(theta,-1,1));}distanceTo(v){return Math.sqrt(this.distanceToSquared(v));}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y,dz=this.z-v.z;return dx*dx+dy*dy+dz*dz;}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)+Math.abs(this.z-v.z);}setFromSpherical(s){return this.setFromSphericalCoords(s.radius,s.phi,s.theta);}setFromSphericalCoords(radius,phi,theta){const sinPhiRadius=Math.sin(phi)*radius;this.x=sinPhiRadius*Math.sin(theta);this.y=Math.cos(phi)*radius;this.z=sinPhiRadius*Math.cos(theta);return this;}setFromCylindrical(c){return this.setFromCylindricalCoords(c.radius,c.theta,c.y);}setFromCylindricalCoords(radius,theta,y){this.x=radius*Math.sin(theta);this.y=y;this.z=radius*Math.cos(theta);return this;}setFromMatrixPosition(m){const e=m.elements;this.x=e[12];this.y=e[13];this.z=e[14];return this;}setFromMatrixScale(m){const sx=this.setFromMatrixColumn(m,0).length();const sy=this.setFromMatrixColumn(m,1).length();const sz=this.setFromMatrixColumn(m,2).length();this.x=sx;this.y=sy;this.z=sz;return this;}setFromMatrixColumn(m,index){return this.fromArray(m.elements,index*4);}setFromMatrix3Column(m,index){return this.fromArray(m.elements,index*3);}setFromEuler(e){this.x=e._x;this.y=e._y;this.z=e._z;return this;}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z;}fromArray(array,offset=0){this.x=array[offset];this.y=array[offset+1];this.z=array[offset+2];return this;}toArray(array=[],offset=0){array[offset]=this.x;array[offset+1]=this.y;array[offset+2]=this.z;return array;}fromBufferAttribute(attribute,index){this.x=attribute.getX(index);this.y=attribute.getY(index);this.z=attribute.getZ(index);return this;}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this;}randomDirection(){// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\nconst u=(Math.random()-0.5)*2;const t=Math.random()*Math.PI*2;const f=Math.sqrt(1-u**2);this.x=f*Math.cos(t);this.y=f*Math.sin(t);this.z=u;return this;}*[iterator](){yield this.x;yield this.y;yield this.z;}}const _vector=/*@__PURE__*/new Vector3();const _quaternion=/*@__PURE__*/new Quaternion();\n;// CONCATENATED MODULE: ./node_modules/three/src/math/Triangle.js\nconst _v0=/*@__PURE__*/new Vector3();const _v1=/*@__PURE__*/new Vector3();const _v2=/*@__PURE__*/new Vector3();const _v3=/*@__PURE__*/new Vector3();const _vab=/*@__PURE__*/new Vector3();const _vac=/*@__PURE__*/new Vector3();const _vbc=/*@__PURE__*/new Vector3();const _vap=/*@__PURE__*/new Vector3();const _vbp=/*@__PURE__*/new Vector3();const _vcp=/*@__PURE__*/new Vector3();class Triangle{constructor(a=new Vector3(),b=new Vector3(),c=new Vector3()){this.a=a;this.b=b;this.c=c;}static getNormal(a,b,c,target){target.subVectors(c,b);_v0.subVectors(a,b);target.cross(_v0);const targetLengthSq=target.lengthSq();if(targetLengthSq>0){return target.multiplyScalar(1/Math.sqrt(targetLengthSq));}return target.set(0,0,0);}// static/instance method to calculate barycentric coordinates\n// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\nstatic getBarycoord(point,a,b,c,target){_v0.subVectors(c,a);_v1.subVectors(b,a);_v2.subVectors(point,a);const dot00=_v0.dot(_v0);const dot01=_v0.dot(_v1);const dot02=_v0.dot(_v2);const dot11=_v1.dot(_v1);const dot12=_v1.dot(_v2);const denom=dot00*dot11-dot01*dot01;// collinear or singular triangle\nif(denom===0){// arbitrary location outside of triangle?\n// not sure if this is the best idea, maybe should be returning undefined\nreturn target.set(-2,-1,-1);}const invDenom=1/denom;const u=(dot11*dot02-dot01*dot12)*invDenom;const v=(dot00*dot12-dot01*dot02)*invDenom;// barycentric coordinates must always sum to 1\nreturn target.set(1-u-v,v,u);}static containsPoint(point,a,b,c){this.getBarycoord(point,a,b,c,_v3);return _v3.x>=0&&_v3.y>=0&&_v3.x+_v3.y<=1;}static getUV(point,p1,p2,p3,uv1,uv2,uv3,target){this.getBarycoord(point,p1,p2,p3,_v3);target.set(0,0);target.addScaledVector(uv1,_v3.x);target.addScaledVector(uv2,_v3.y);target.addScaledVector(uv3,_v3.z);return target;}static isFrontFacing(a,b,c,direction){_v0.subVectors(c,b);_v1.subVectors(a,b);// strictly front facing\nreturn _v0.cross(_v1).dot(direction)<0?true:false;}set(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this;}setFromPointsAndIndices(points,i0,i1,i2){this.a.copy(points[i0]);this.b.copy(points[i1]);this.c.copy(points[i2]);return this;}setFromAttributeAndIndices(attribute,i0,i1,i2){this.a.fromBufferAttribute(attribute,i0);this.b.fromBufferAttribute(attribute,i1);this.c.fromBufferAttribute(attribute,i2);return this;}clone(){return new this.constructor().copy(this);}copy(triangle){this.a.copy(triangle.a);this.b.copy(triangle.b);this.c.copy(triangle.c);return this;}getArea(){_v0.subVectors(this.c,this.b);_v1.subVectors(this.a,this.b);return _v0.cross(_v1).length()*0.5;}getMidpoint(target){return target.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3);}getNormal(target){return Triangle.getNormal(this.a,this.b,this.c,target);}getPlane(target){return target.setFromCoplanarPoints(this.a,this.b,this.c);}getBarycoord(point,target){return Triangle.getBarycoord(point,this.a,this.b,this.c,target);}getUV(point,uv1,uv2,uv3,target){return Triangle.getUV(point,this.a,this.b,this.c,uv1,uv2,uv3,target);}containsPoint(point){return Triangle.containsPoint(point,this.a,this.b,this.c);}isFrontFacing(direction){return Triangle.isFrontFacing(this.a,this.b,this.c,direction);}intersectsBox(box){return box.intersectsTriangle(this);}closestPointToPoint(p,target){const a=this.a,b=this.b,c=this.c;let v,w;// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n// basically, we're distinguishing which of the voronoi regions of the triangle\n// the point lies in with the minimum amount of redundant computation.\n_vab.subVectors(b,a);_vac.subVectors(c,a);_vap.subVectors(p,a);const d1=_vab.dot(_vap);const d2=_vac.dot(_vap);if(d1<=0&&d2<=0){// vertex region of A; barycentric coords (1, 0, 0)\nreturn target.copy(a);}_vbp.subVectors(p,b);const d3=_vab.dot(_vbp);const d4=_vac.dot(_vbp);if(d3>=0&&d4<=d3){// vertex region of B; barycentric coords (0, 1, 0)\nreturn target.copy(b);}const vc=d1*d4-d3*d2;if(vc<=0&&d1>=0&&d3<=0){v=d1/(d1-d3);// edge region of AB; barycentric coords (1-v, v, 0)\nreturn target.copy(a).addScaledVector(_vab,v);}_vcp.subVectors(p,c);const d5=_vab.dot(_vcp);const d6=_vac.dot(_vcp);if(d6>=0&&d5<=d6){// vertex region of C; barycentric coords (0, 0, 1)\nreturn target.copy(c);}const vb=d5*d2-d1*d6;if(vb<=0&&d2>=0&&d6<=0){w=d2/(d2-d6);// edge region of AC; barycentric coords (1-w, 0, w)\nreturn target.copy(a).addScaledVector(_vac,w);}const va=d3*d6-d5*d4;if(va<=0&&d4-d3>=0&&d5-d6>=0){_vbc.subVectors(c,b);w=(d4-d3)/(d4-d3+(d5-d6));// edge region of BC; barycentric coords (0, 1-w, w)\nreturn target.copy(b).addScaledVector(_vbc,w);// edge region of BC\n}// face region\nconst denom=1/(va+vb+vc);// u = va * denom\nv=vb*denom;w=vc*denom;return target.copy(a).addScaledVector(_vab,v).addScaledVector(_vac,w);}equals(triangle){return triangle.a.equals(this.a)&&triangle.b.equals(this.b)&&triangle.c.equals(this.c);}}\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/index-of.js\nvar index_of = __webpack_require__(51791);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/splice.js\nvar splice = __webpack_require__(90143);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/slice.js\nvar slice = __webpack_require__(35704);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/freeze.js\nvar freeze = __webpack_require__(54877);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/parse-float.js\nvar parse_float = __webpack_require__(10899);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/parse-int.js\nvar parse_int = __webpack_require__(34300);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/array/is-array.js\nvar is_array = __webpack_require__(98235);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/array/from.js\nvar from = __webpack_require__(10349);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/define-property.js\nvar define_property = __webpack_require__(57445);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/repeat.js\nvar repeat = __webpack_require__(13004);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/json/stringify.js\nvar stringify = __webpack_require__(58218);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/assign.js\nvar object_assign = __webpack_require__(67552);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/at.js\nvar at = __webpack_require__(90646);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/define-properties.js\nvar define_properties = __webpack_require__(2201);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/map.js\nvar instance_map = __webpack_require__(88946);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/keys.js\nvar object_keys = __webpack_require__(62079);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/weak-map.js\nvar weak_map = __webpack_require__(98186);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/math/log2.js\nvar log2 = __webpack_require__(37265);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/sort.js\nvar instance_sort = __webpack_require__(76555);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/number/max-safe-integer.js\nvar max_safe_integer = __webpack_require__(73672);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/trim.js\nvar trim = __webpack_require__(84705);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/filter.js\nvar filter = __webpack_require__(73324);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/map.js\nvar map = __webpack_require__(54847);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/set.js\nvar core_js_set = __webpack_require__(23513);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/values.js\nvar instance_values = __webpack_require__(89221);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/for-each.js\nvar for_each = __webpack_require__(99595);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/bind.js\nvar bind = __webpack_require__(48216);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/concat.js\nvar concat = __webpack_require__(8571);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/reverse.js\nvar instance_reverse = __webpack_require__(86526);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/math/sign.js\nvar sign = __webpack_require__(14051);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/find.js\nvar find = __webpack_require__(86981);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/keys.js\nvar keys = __webpack_require__(29898);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/set-timeout.js\nvar set_timeout = __webpack_require__(9938);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/last-index-of.js\nvar last_index_of = __webpack_require__(19178);\n// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/number/is-integer.js\nvar is_integer = __webpack_require__(60312);\n;// CONCATENATED MODULE: ./node_modules/three/build/three.module.js\nfunction _settle(pact,state,value){if(!pact.s){if(value instanceof _Pact){if(value.s){if(state&1){state=value.s;}value=value.v;}else{value.o=_bindInstanceProperty(_settle).call(_settle,null,pact,state);return;}}if(value&&value.then){value.then(_bindInstanceProperty(_settle).call(_settle,null,pact,state),_bindInstanceProperty(_settle).call(_settle,null,pact,2));return;}pact.s=state;pact.v=value;const observer=pact.o;if(observer){observer(pact);}}}/**\n * @license\n * Copyright 2010-2022 Three.js Authors\n * SPDX-License-Identifier: MIT\n */const REVISION='146';const _Pact=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){function _Pact(){}_Pact.prototype.then=function(onFulfilled,onRejected){const result=new _Pact();const state=this.s;if(state){const callback=state&1?onFulfilled:onRejected;if(callback){try{_settle(result,1,callback(this.v));}catch(e){_settle(result,2,e);}return result;}else{return this;}}this.o=function(_this){try{const value=_this.v;if(_this.s&1){_settle(result,1,onFulfilled?onFulfilled(value):value);}else if(onRejected){_settle(result,1,onRejected(value));}else{_settle(result,2,value);}}catch(e){_settle(result,2,e);}};return result;};return _Pact;}()));function _isSettledPact(thenable){return thenable instanceof _Pact&&thenable.s&1;}function _for(test,update,body){var stage;for(;;){var shouldContinue=test();if(_isSettledPact(shouldContinue)){shouldContinue=shouldContinue.v;}if(!shouldContinue){return result;}if(shouldContinue.then){stage=0;break;}var result=body();if(result&&result.then){if(_isSettledPact(result)){result=result.s;}else{stage=1;break;}}if(update){var updateValue=update();if(updateValue&&updateValue.then&&!_isSettledPact(updateValue)){stage=2;break;}}}var pact=new _Pact();var reject=_bindInstanceProperty(_settle).call(_settle,null,pact,2);(stage===0?shouldContinue.then(_resumeAfterTest):stage===1?result.then(_resumeAfterBody):updateValue.then(_resumeAfterUpdate)).then(void 0,reject);return pact;function _resumeAfterBody(value){result=value;do{if(update){updateValue=update();if(updateValue&&updateValue.then&&!_isSettledPact(updateValue)){updateValue.then(_resumeAfterUpdate).then(void 0,reject);return;}}shouldContinue=test();if(!shouldContinue||_isSettledPact(shouldContinue)&&!shouldContinue.v){_settle(pact,1,result);return;}if(shouldContinue.then){shouldContinue.then(_resumeAfterTest).then(void 0,reject);return;}result=body();if(_isSettledPact(result)){result=result.v;}}while(!result||!result.then);result.then(_resumeAfterBody).then(void 0,reject);}function _resumeAfterTest(shouldContinue){if(shouldContinue){result=body();if(result&&result.then){result.then(_resumeAfterBody).then(void 0,reject);}else{_resumeAfterBody(result);}}else{_settle(pact,1,result);}}function _resumeAfterUpdate(){if(shouldContinue=test()){if(shouldContinue.then){shouldContinue.then(_resumeAfterTest).then(void 0,reject);}else{_resumeAfterTest(shouldContinue);}}else{_settle(pact,1,result);}}}const MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};const TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};const CullFaceNone=0;const CullFaceBack=1;const CullFaceFront=2;const CullFaceFrontBack=3;const BasicShadowMap=0;const PCFShadowMap=1;const PCFSoftShadowMap=2;const VSMShadowMap=3;const FrontSide=0;const BackSide=1;const DoubleSide=2;const NoBlending=0;const NormalBlending=1;const AdditiveBlending=2;const SubtractiveBlending=3;const MultiplyBlending=4;const CustomBlending=5;const AddEquation=100;const SubtractEquation=101;const ReverseSubtractEquation=102;const MinEquation=103;const MaxEquation=104;const ZeroFactor=200;const OneFactor=201;const SrcColorFactor=202;const OneMinusSrcColorFactor=203;const SrcAlphaFactor=204;const OneMinusSrcAlphaFactor=205;const DstAlphaFactor=206;const OneMinusDstAlphaFactor=207;const DstColorFactor=208;const OneMinusDstColorFactor=209;const SrcAlphaSaturateFactor=210;const NeverDepth=0;const AlwaysDepth=1;const LessDepth=2;const LessEqualDepth=3;const EqualDepth=4;const GreaterEqualDepth=5;const GreaterDepth=6;const NotEqualDepth=7;const MultiplyOperation=0;const MixOperation=1;const AddOperation=2;const NoToneMapping=0;const LinearToneMapping=1;const ReinhardToneMapping=2;const CineonToneMapping=3;const ACESFilmicToneMapping=4;const CustomToneMapping=5;const UVMapping=300;const CubeReflectionMapping=301;const CubeRefractionMapping=302;const EquirectangularReflectionMapping=303;const EquirectangularRefractionMapping=304;const CubeUVReflectionMapping=306;const RepeatWrapping=1000;const ClampToEdgeWrapping=1001;const MirroredRepeatWrapping=1002;const NearestFilter=1003;const NearestMipmapNearestFilter=1004;const NearestMipMapNearestFilter=1004;const NearestMipmapLinearFilter=1005;const NearestMipMapLinearFilter=1005;const LinearFilter=1006;const LinearMipmapNearestFilter=1007;const LinearMipMapNearestFilter=1007;const LinearMipmapLinearFilter=1008;const LinearMipMapLinearFilter=1008;const UnsignedByteType=1009;const ByteType=1010;const ShortType=1011;const UnsignedShortType=1012;const IntType=1013;const UnsignedIntType=1014;const FloatType=1015;const HalfFloatType=1016;const UnsignedShort4444Type=1017;const UnsignedShort5551Type=1018;const UnsignedInt248Type=1020;const AlphaFormat=1021;const RGBFormat=1022;// @deprecated since r137\nconst RGBAFormat=1023;const LuminanceFormat=1024;const LuminanceAlphaFormat=1025;const DepthFormat=1026;const DepthStencilFormat=1027;const RedFormat=1028;const RedIntegerFormat=1029;const RGFormat=1030;const RGIntegerFormat=1031;const RGBAIntegerFormat=1033;const RGB_S3TC_DXT1_Format=33776;const RGBA_S3TC_DXT1_Format=33777;const RGBA_S3TC_DXT3_Format=33778;const RGBA_S3TC_DXT5_Format=33779;const RGB_PVRTC_4BPPV1_Format=35840;const RGB_PVRTC_2BPPV1_Format=35841;const RGBA_PVRTC_4BPPV1_Format=35842;const RGBA_PVRTC_2BPPV1_Format=35843;const RGB_ETC1_Format=36196;const RGB_ETC2_Format=37492;const RGBA_ETC2_EAC_Format=37496;const RGBA_ASTC_4x4_Format=37808;const RGBA_ASTC_5x4_Format=37809;const RGBA_ASTC_5x5_Format=37810;const RGBA_ASTC_6x5_Format=37811;const RGBA_ASTC_6x6_Format=37812;const RGBA_ASTC_8x5_Format=37813;const RGBA_ASTC_8x6_Format=37814;const RGBA_ASTC_8x8_Format=37815;const RGBA_ASTC_10x5_Format=37816;const RGBA_ASTC_10x6_Format=37817;const RGBA_ASTC_10x8_Format=37818;const RGBA_ASTC_10x10_Format=37819;const RGBA_ASTC_12x10_Format=37820;const RGBA_ASTC_12x12_Format=37821;const RGBA_BPTC_Format=36492;const LoopOnce=2200;const LoopRepeat=2201;const LoopPingPong=2202;const InterpolateDiscrete=2300;const InterpolateLinear=2301;const InterpolateSmooth=2302;const ZeroCurvatureEnding=2400;const ZeroSlopeEnding=2401;const WrapAroundEnding=2402;const NormalAnimationBlendMode=2500;const AdditiveAnimationBlendMode=2501;const TrianglesDrawMode=0;const TriangleStripDrawMode=1;const TriangleFanDrawMode=2;const LinearEncoding=3000;const sRGBEncoding=3001;const BasicDepthPacking=3200;const RGBADepthPacking=3201;const TangentSpaceNormalMap=0;const ObjectSpaceNormalMap=1;// Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\nconst NoColorSpace='';const SRGBColorSpace='srgb';const LinearSRGBColorSpace='srgb-linear';const ZeroStencilOp=0;const KeepStencilOp=7680;const ReplaceStencilOp=7681;const IncrementStencilOp=7682;const DecrementStencilOp=7683;const IncrementWrapStencilOp=34055;const DecrementWrapStencilOp=34056;const InvertStencilOp=5386;const NeverStencilFunc=512;const LessStencilFunc=513;const EqualStencilFunc=514;const LessEqualStencilFunc=515;const GreaterStencilFunc=516;const NotEqualStencilFunc=517;const GreaterEqualStencilFunc=518;const AlwaysStencilFunc=519;const StaticDrawUsage=35044;const DynamicDrawUsage=35048;const StreamDrawUsage=35040;const StaticReadUsage=35045;const DynamicReadUsage=35049;const StreamReadUsage=35041;const StaticCopyUsage=35046;const DynamicCopyUsage=35050;const StreamCopyUsage=35042;const GLSL1='100';const GLSL3='300 es';const _SRGBAFormat=1035;// fallback for WebGL 1\n/**\n * https://github.com/mrdoob/eventdispatcher.js/\n */class EventDispatcher{addEventListener(type,listener){var _context2;if(this._listeners===undefined)this._listeners={};const listeners=this._listeners;if(listeners[type]===undefined){listeners[type]=[];}if(index_of(_context2=listeners[type]).call(_context2,listener)===-1){listeners[type].push(listener);}}hasEventListener(type,listener){var _context3;if(this._listeners===undefined)return false;const listeners=this._listeners;return listeners[type]!==undefined&&index_of(_context3=listeners[type]).call(_context3,listener)!==-1;}removeEventListener(type,listener){if(this._listeners===undefined)return;const listeners=this._listeners;const listenerArray=listeners[type];if(listenerArray!==undefined){const index=index_of(listenerArray).call(listenerArray,listener);if(index!==-1){splice(listenerArray).call(listenerArray,index,1);}}}dispatchEvent(event){if(this._listeners===undefined)return;const listeners=this._listeners;const listenerArray=listeners[event.type];if(listenerArray!==undefined){event.target=this;// Make a copy, in case listeners are removed while iterating.\nconst array=slice(listenerArray).call(listenerArray,0);for(let i=0,l=array.length;i<l;i++){array[i].call(this,event);}event.target=null;}}}const three_module_lut=['00','01','02','03','04','05','06','07','08','09','0a','0b','0c','0d','0e','0f','10','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','70','71','72','73','74','75','76','77','78','79','7a','7b','7c','7d','7e','7f','80','81','82','83','84','85','86','87','88','89','8a','8b','8c','8d','8e','8f','90','91','92','93','94','95','96','97','98','99','9a','9b','9c','9d','9e','9f','a0','a1','a2','a3','a4','a5','a6','a7','a8','a9','aa','ab','ac','ad','ae','af','b0','b1','b2','b3','b4','b5','b6','b7','b8','b9','ba','bb','bc','bd','be','bf','c0','c1','c2','c3','c4','c5','c6','c7','c8','c9','ca','cb','cc','cd','ce','cf','d0','d1','d2','d3','d4','d5','d6','d7','d8','d9','da','db','dc','dd','de','df','e0','e1','e2','e3','e4','e5','e6','e7','e8','e9','ea','eb','ec','ed','ee','ef','f0','f1','f2','f3','f4','f5','f6','f7','f8','f9','fa','fb','fc','fd','fe','ff'];let three_module_seed=1234567;const three_module_DEG2RAD=Math.PI/180;const three_module_RAD2DEG=180/Math.PI;// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\nfunction three_module_generateUUID(){const d0=Math.random()*0xffffffff|0;const d1=Math.random()*0xffffffff|0;const d2=Math.random()*0xffffffff|0;const d3=Math.random()*0xffffffff|0;const uuid=three_module_lut[d0&0xff]+three_module_lut[d0>>8&0xff]+three_module_lut[d0>>16&0xff]+three_module_lut[d0>>24&0xff]+'-'+three_module_lut[d1&0xff]+three_module_lut[d1>>8&0xff]+'-'+three_module_lut[d1>>16&0x0f|0x40]+three_module_lut[d1>>24&0xff]+'-'+three_module_lut[d2&0x3f|0x80]+three_module_lut[d2>>8&0xff]+'-'+three_module_lut[d2>>16&0xff]+three_module_lut[d2>>24&0xff]+three_module_lut[d3&0xff]+three_module_lut[d3>>8&0xff]+three_module_lut[d3>>16&0xff]+three_module_lut[d3>>24&0xff];// .toLowerCase() here flattens concatenated strings to save heap memory space.\nreturn uuid.toLowerCase();}function three_module_clamp(value,min,max){return Math.max(min,Math.min(max,value));}// compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\nfunction three_module_euclideanModulo(n,m){return(n%m+m)%m;}// Linear mapping from range <a1, a2> to range <b1, b2>\nfunction three_module_mapLinear(x,a1,a2,b1,b2){return b1+(x-a1)*(b2-b1)/(a2-a1);}// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\nfunction three_module_inverseLerp(x,y,value){if(x!==y){return(value-x)/(y-x);}else{return 0;}}// https://en.wikipedia.org/wiki/Linear_interpolation\nfunction three_module_lerp(x,y,t){return(1-t)*x+t*y;}// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\nfunction three_module_damp(x,y,lambda,dt){return three_module_lerp(x,y,1-Math.exp(-lambda*dt));}// https://www.desmos.com/calculator/vcsjnyz7x4\nfunction three_module_pingpong(x,length=1){return length-Math.abs(three_module_euclideanModulo(x,length*2)-length);}// http://en.wikipedia.org/wiki/Smoothstep\nfunction three_module_smoothstep(x,min,max){if(x<=min)return 0;if(x>=max)return 1;x=(x-min)/(max-min);return x*x*(3-2*x);}function three_module_smootherstep(x,min,max){if(x<=min)return 0;if(x>=max)return 1;x=(x-min)/(max-min);return x*x*x*(x*(x*6-15)+10);}// Random integer from <low, high> interval\nfunction three_module_randInt(low,high){return low+Math.floor(Math.random()*(high-low+1));}// Random float from <low, high> interval\nfunction three_module_randFloat(low,high){return low+Math.random()*(high-low);}// Random float from <-range/2, range/2> interval\nfunction three_module_randFloatSpread(range){return range*(0.5-Math.random());}// Deterministic pseudo-random float in the interval [ 0, 1 ]\nfunction three_module_seededRandom(s){if(s!==undefined)three_module_seed=s;// Mulberry32 generator\nlet t=three_module_seed+=0x6D2B79F5;t=imul(t^t>>>15,t|1);t^=t+imul(t^t>>>7,t|61);return((t^t>>>14)>>>0)/4294967296;}function three_module_degToRad(degrees){return degrees*three_module_DEG2RAD;}function three_module_radToDeg(radians){return radians*three_module_RAD2DEG;}function three_module_isPowerOfTwo(value){return(value&value-1)===0&&value!==0;}function three_module_ceilPowerOfTwo(value){return Math.pow(2,Math.ceil(Math.log(value)/Math.LN2));}function three_module_floorPowerOfTwo(value){return Math.pow(2,Math.floor(Math.log(value)/Math.LN2));}function three_module_setQuaternionFromProperEuler(q,a,b,c,order){// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n// rotations are applied to the axes in the order specified by 'order'\n// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n// angles are in radians\nconst cos=Math.cos;const sin=Math.sin;const c2=cos(b/2);const s2=sin(b/2);const c13=cos((a+c)/2);const s13=sin((a+c)/2);const c1_3=cos((a-c)/2);const s1_3=sin((a-c)/2);const c3_1=cos((c-a)/2);const s3_1=sin((c-a)/2);switch(order){case'XYX':q.set(c2*s13,s2*c1_3,s2*s1_3,c2*c13);break;case'YZY':q.set(s2*s1_3,c2*s13,s2*c1_3,c2*c13);break;case'ZXZ':q.set(s2*c1_3,s2*s1_3,c2*s13,c2*c13);break;case'XZX':q.set(c2*s13,s2*s3_1,s2*c3_1,c2*c13);break;case'YXY':q.set(s2*c3_1,c2*s13,s2*s3_1,c2*c13);break;case'ZYZ':q.set(s2*s3_1,s2*c3_1,c2*s13,c2*c13);break;default:console.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: '+order);}}function three_module_denormalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint16Array:return value/65535.0;case Uint8Array:return value/255.0;case Int16Array:return Math.max(value/32767.0,-1.0);case Int8Array:return Math.max(value/127.0,-1.0);default:throw new Error('Invalid component type.');}}function three_module_normalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint16Array:return Math.round(value*65535.0);case Uint8Array:return Math.round(value*255.0);case Int16Array:return Math.round(value*32767.0);case Int8Array:return Math.round(value*127.0);default:throw new Error('Invalid component type.');}}var MathUtils=/*#__PURE__*/freeze({__proto__:null,DEG2RAD:three_module_DEG2RAD,RAD2DEG:three_module_RAD2DEG,generateUUID:three_module_generateUUID,clamp:three_module_clamp,euclideanModulo:three_module_euclideanModulo,mapLinear:three_module_mapLinear,inverseLerp:three_module_inverseLerp,lerp:three_module_lerp,damp:three_module_damp,pingpong:three_module_pingpong,smoothstep:three_module_smoothstep,smootherstep:three_module_smootherstep,randInt:three_module_randInt,randFloat:three_module_randFloat,randFloatSpread:three_module_randFloatSpread,seededRandom:three_module_seededRandom,degToRad:three_module_degToRad,radToDeg:three_module_radToDeg,isPowerOfTwo:three_module_isPowerOfTwo,ceilPowerOfTwo:three_module_ceilPowerOfTwo,floorPowerOfTwo:three_module_floorPowerOfTwo,setQuaternionFromProperEuler:three_module_setQuaternionFromProperEuler,normalize:three_module_normalize,denormalize:three_module_denormalize});class Vector2{constructor(x=0,y=0){Vector2.prototype.isVector2=true;this.x=x;this.y=y;}get width(){return this.x;}set width(value){this.x=value;}get height(){return this.y;}set height(value){this.y=value;}set(x,y){this.x=x;this.y=y;return this;}setScalar(scalar){this.x=scalar;this.y=scalar;return this;}setX(x){this.x=x;return this;}setY(y){this.y=y;return this;}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;default:throw new Error('index is out of range: '+index);}return this;}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;default:throw new Error('index is out of range: '+index);}}clone(){return new this.constructor(this.x,this.y);}copy(v){this.x=v.x;this.y=v.y;return this;}add(v){this.x+=v.x;this.y+=v.y;return this;}addScalar(s){this.x+=s;this.y+=s;return this;}addVectors(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this;}addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;return this;}sub(v){this.x-=v.x;this.y-=v.y;return this;}subScalar(s){this.x-=s;this.y-=s;return this;}subVectors(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this;}multiply(v){this.x*=v.x;this.y*=v.y;return this;}multiplyScalar(scalar){this.x*=scalar;this.y*=scalar;return this;}divide(v){this.x/=v.x;this.y/=v.y;return this;}divideScalar(scalar){return this.multiplyScalar(1/scalar);}applyMatrix3(m){const x=this.x,y=this.y;const e=m.elements;this.x=e[0]*x+e[3]*y+e[6];this.y=e[1]*x+e[4]*y+e[7];return this;}min(v){this.x=Math.min(this.x,v.x);this.y=Math.min(this.y,v.y);return this;}max(v){this.x=Math.max(this.x,v.x);this.y=Math.max(this.y,v.y);return this;}clamp(min,max){// assumes min < max, componentwise\nthis.x=Math.max(min.x,Math.min(max.x,this.x));this.y=Math.max(min.y,Math.min(max.y,this.y));return this;}clampScalar(minVal,maxVal){this.x=Math.max(minVal,Math.min(maxVal,this.x));this.y=Math.max(minVal,Math.min(maxVal,this.y));return this;}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)));}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this;}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this;}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this;}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);return this;}negate(){this.x=-this.x;this.y=-this.y;return this;}dot(v){return this.x*v.x+this.y*v.y;}cross(v){return this.x*v.y-this.y*v.x;}lengthSq(){return this.x*this.x+this.y*this.y;}length(){return Math.sqrt(this.x*this.x+this.y*this.y);}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y);}normalize(){return this.divideScalar(this.length()||1);}angle(){// computes the angle in radians with respect to the positive x-axis\nconst angle=Math.atan2(-this.y,-this.x)+Math.PI;return angle;}distanceTo(v){return Math.sqrt(this.distanceToSquared(v));}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y;return dx*dx+dy*dy;}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y);}setLength(length){return this.normalize().multiplyScalar(length);}lerp(v,alpha){this.x+=(v.x-this.x)*alpha;this.y+=(v.y-this.y)*alpha;return this;}lerpVectors(v1,v2,alpha){this.x=v1.x+(v2.x-v1.x)*alpha;this.y=v1.y+(v2.y-v1.y)*alpha;return this;}equals(v){return v.x===this.x&&v.y===this.y;}fromArray(array,offset=0){this.x=array[offset];this.y=array[offset+1];return this;}toArray(array=[],offset=0){array[offset]=this.x;array[offset+1]=this.y;return array;}fromBufferAttribute(attribute,index){this.x=attribute.getX(index);this.y=attribute.getY(index);return this;}rotateAround(center,angle){const c=Math.cos(angle),s=Math.sin(angle);const x=this.x-center.x;const y=this.y-center.y;this.x=x*c-y*s+center.x;this.y=x*s+y*c+center.y;return this;}random(){this.x=Math.random();this.y=Math.random();return this;}*[iterator](){yield this.x;yield this.y;}}class Matrix3{constructor(){Matrix3.prototype.isMatrix3=true;this.elements=[1,0,0,0,1,0,0,0,1];}set(n11,n12,n13,n21,n22,n23,n31,n32,n33){const te=this.elements;te[0]=n11;te[1]=n21;te[2]=n31;te[3]=n12;te[4]=n22;te[5]=n32;te[6]=n13;te[7]=n23;te[8]=n33;return this;}identity(){this.set(1,0,0,0,1,0,0,0,1);return this;}copy(m){const te=this.elements;const me=m.elements;te[0]=me[0];te[1]=me[1];te[2]=me[2];te[3]=me[3];te[4]=me[4];te[5]=me[5];te[6]=me[6];te[7]=me[7];te[8]=me[8];return this;}extractBasis(xAxis,yAxis,zAxis){xAxis.setFromMatrix3Column(this,0);yAxis.setFromMatrix3Column(this,1);zAxis.setFromMatrix3Column(this,2);return this;}setFromMatrix4(m){const me=m.elements;this.set(me[0],me[4],me[8],me[1],me[5],me[9],me[2],me[6],me[10]);return this;}multiply(m){return this.multiplyMatrices(this,m);}premultiply(m){return this.multiplyMatrices(m,this);}multiplyMatrices(a,b){const ae=a.elements;const be=b.elements;const te=this.elements;const a11=ae[0],a12=ae[3],a13=ae[6];const a21=ae[1],a22=ae[4],a23=ae[7];const a31=ae[2],a32=ae[5],a33=ae[8];const b11=be[0],b12=be[3],b13=be[6];const b21=be[1],b22=be[4],b23=be[7];const b31=be[2],b32=be[5],b33=be[8];te[0]=a11*b11+a12*b21+a13*b31;te[3]=a11*b12+a12*b22+a13*b32;te[6]=a11*b13+a12*b23+a13*b33;te[1]=a21*b11+a22*b21+a23*b31;te[4]=a21*b12+a22*b22+a23*b32;te[7]=a21*b13+a22*b23+a23*b33;te[2]=a31*b11+a32*b21+a33*b31;te[5]=a31*b12+a32*b22+a33*b32;te[8]=a31*b13+a32*b23+a33*b33;return this;}multiplyScalar(s){const te=this.elements;te[0]*=s;te[3]*=s;te[6]*=s;te[1]*=s;te[4]*=s;te[7]*=s;te[2]*=s;te[5]*=s;te[8]*=s;return this;}determinant(){const te=this.elements;const a=te[0],b=te[1],c=te[2],d=te[3],e=te[4],f=te[5],g=te[6],h=te[7],i=te[8];return a*e*i-a*f*h-b*d*i+b*f*g+c*d*h-c*e*g;}invert(){const te=this.elements,n11=te[0],n21=te[1],n31=te[2],n12=te[3],n22=te[4],n32=te[5],n13=te[6],n23=te[7],n33=te[8],t11=n33*n22-n32*n23,t12=n32*n13-n33*n12,t13=n23*n12-n22*n13,det=n11*t11+n21*t12+n31*t13;if(det===0)return this.set(0,0,0,0,0,0,0,0,0);const detInv=1/det;te[0]=t11*detInv;te[1]=(n31*n23-n33*n21)*detInv;te[2]=(n32*n21-n31*n22)*detInv;te[3]=t12*detInv;te[4]=(n33*n11-n31*n13)*detInv;te[5]=(n31*n12-n32*n11)*detInv;te[6]=t13*detInv;te[7]=(n21*n13-n23*n11)*detInv;te[8]=(n22*n11-n21*n12)*detInv;return this;}transpose(){let tmp;const m=this.elements;tmp=m[1];m[1]=m[3];m[3]=tmp;tmp=m[2];m[2]=m[6];m[6]=tmp;tmp=m[5];m[5]=m[7];m[7]=tmp;return this;}getNormalMatrix(matrix4){return this.setFromMatrix4(matrix4).invert().transpose();}transposeIntoArray(r){const m=this.elements;r[0]=m[0];r[1]=m[3];r[2]=m[6];r[3]=m[1];r[4]=m[4];r[5]=m[7];r[6]=m[2];r[7]=m[5];r[8]=m[8];return this;}setUvTransform(tx,ty,sx,sy,rotation,cx,cy){const c=Math.cos(rotation);const s=Math.sin(rotation);this.set(sx*c,sx*s,-sx*(c*cx+s*cy)+cx+tx,-sy*s,sy*c,-sy*(-s*cx+c*cy)+cy+ty,0,0,1);return this;}scale(sx,sy){const te=this.elements;te[0]*=sx;te[3]*=sx;te[6]*=sx;te[1]*=sy;te[4]*=sy;te[7]*=sy;return this;}rotate(theta){const c=Math.cos(theta);const s=Math.sin(theta);const te=this.elements;const a11=te[0],a12=te[3],a13=te[6];const a21=te[1],a22=te[4],a23=te[7];te[0]=c*a11+s*a21;te[3]=c*a12+s*a22;te[6]=c*a13+s*a23;te[1]=-s*a11+c*a21;te[4]=-s*a12+c*a22;te[7]=-s*a13+c*a23;return this;}translate(tx,ty){const te=this.elements;te[0]+=tx*te[2];te[3]+=tx*te[5];te[6]+=tx*te[8];te[1]+=ty*te[2];te[4]+=ty*te[5];te[7]+=ty*te[8];return this;}equals(matrix){const te=this.elements;const me=matrix.elements;for(let i=0;i<9;i++){if(te[i]!==me[i])return false;}return true;}fromArray(array,offset=0){for(let i=0;i<9;i++){this.elements[i]=array[i+offset];}return this;}toArray(array=[],offset=0){const te=this.elements;array[offset]=te[0];array[offset+1]=te[1];array[offset+2]=te[2];array[offset+3]=te[3];array[offset+4]=te[4];array[offset+5]=te[5];array[offset+6]=te[6];array[offset+7]=te[7];array[offset+8]=te[8];return array;}clone(){return new this.constructor().fromArray(this.elements);}}function arrayNeedsUint32(array){// assumes larger values usually on last\nfor(let i=array.length-1;i>=0;--i){if(array[i]>=65535)return true;// account for PRIMITIVE_RESTART_FIXED_INDEX, #24565\n}return false;}const TYPED_ARRAYS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function getTypedArray(type,buffer){return new TYPED_ARRAYS[type](buffer);}function createElementNS(name){return document.createElementNS('http://www.w3.org/1999/xhtml',name);}function SRGBToLinear(c){return c<0.04045?c*0.0773993808:Math.pow(c*0.9478672986+0.0521327014,2.4);}function LinearToSRGB(c){return c<0.0031308?c*12.92:1.055*Math.pow(c,0.41666)-0.055;}// JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\nconst FN={[SRGBColorSpace]:{[LinearSRGBColorSpace]:SRGBToLinear},[LinearSRGBColorSpace]:{[SRGBColorSpace]:LinearToSRGB}};const ColorManagement={legacyMode:true,get workingColorSpace(){return LinearSRGBColorSpace;},set workingColorSpace(colorSpace){console.warn('THREE.ColorManagement: .workingColorSpace is readonly.');},convert:function(color,sourceColorSpace,targetColorSpace){if(this.legacyMode||sourceColorSpace===targetColorSpace||!sourceColorSpace||!targetColorSpace){return color;}if(FN[sourceColorSpace]&&FN[sourceColorSpace][targetColorSpace]!==undefined){const fn=FN[sourceColorSpace][targetColorSpace];color.r=fn(color.r);color.g=fn(color.g);color.b=fn(color.b);return color;}throw new Error('Unsupported color space conversion.');},fromWorkingColorSpace:function(color,targetColorSpace){return this.convert(color,this.workingColorSpace,targetColorSpace);},toWorkingColorSpace:function(color,sourceColorSpace){return this.convert(color,sourceColorSpace,this.workingColorSpace);}};const _colorKeywords={'aliceblue':0xF0F8FF,'antiquewhite':0xFAEBD7,'aqua':0x00FFFF,'aquamarine':0x7FFFD4,'azure':0xF0FFFF,'beige':0xF5F5DC,'bisque':0xFFE4C4,'black':0x000000,'blanchedalmond':0xFFEBCD,'blue':0x0000FF,'blueviolet':0x8A2BE2,'brown':0xA52A2A,'burlywood':0xDEB887,'cadetblue':0x5F9EA0,'chartreuse':0x7FFF00,'chocolate':0xD2691E,'coral':0xFF7F50,'cornflowerblue':0x6495ED,'cornsilk':0xFFF8DC,'crimson':0xDC143C,'cyan':0x00FFFF,'darkblue':0x00008B,'darkcyan':0x008B8B,'darkgoldenrod':0xB8860B,'darkgray':0xA9A9A9,'darkgreen':0x006400,'darkgrey':0xA9A9A9,'darkkhaki':0xBDB76B,'darkmagenta':0x8B008B,'darkolivegreen':0x556B2F,'darkorange':0xFF8C00,'darkorchid':0x9932CC,'darkred':0x8B0000,'darksalmon':0xE9967A,'darkseagreen':0x8FBC8F,'darkslateblue':0x483D8B,'darkslategray':0x2F4F4F,'darkslategrey':0x2F4F4F,'darkturquoise':0x00CED1,'darkviolet':0x9400D3,'deeppink':0xFF1493,'deepskyblue':0x00BFFF,'dimgray':0x696969,'dimgrey':0x696969,'dodgerblue':0x1E90FF,'firebrick':0xB22222,'floralwhite':0xFFFAF0,'forestgreen':0x228B22,'fuchsia':0xFF00FF,'gainsboro':0xDCDCDC,'ghostwhite':0xF8F8FF,'gold':0xFFD700,'goldenrod':0xDAA520,'gray':0x808080,'green':0x008000,'greenyellow':0xADFF2F,'grey':0x808080,'honeydew':0xF0FFF0,'hotpink':0xFF69B4,'indianred':0xCD5C5C,'indigo':0x4B0082,'ivory':0xFFFFF0,'khaki':0xF0E68C,'lavender':0xE6E6FA,'lavenderblush':0xFFF0F5,'lawngreen':0x7CFC00,'lemonchiffon':0xFFFACD,'lightblue':0xADD8E6,'lightcoral':0xF08080,'lightcyan':0xE0FFFF,'lightgoldenrodyellow':0xFAFAD2,'lightgray':0xD3D3D3,'lightgreen':0x90EE90,'lightgrey':0xD3D3D3,'lightpink':0xFFB6C1,'lightsalmon':0xFFA07A,'lightseagreen':0x20B2AA,'lightskyblue':0x87CEFA,'lightslategray':0x778899,'lightslategrey':0x778899,'lightsteelblue':0xB0C4DE,'lightyellow':0xFFFFE0,'lime':0x00FF00,'limegreen':0x32CD32,'linen':0xFAF0E6,'magenta':0xFF00FF,'maroon':0x800000,'mediumaquamarine':0x66CDAA,'mediumblue':0x0000CD,'mediumorchid':0xBA55D3,'mediumpurple':0x9370DB,'mediumseagreen':0x3CB371,'mediumslateblue':0x7B68EE,'mediumspringgreen':0x00FA9A,'mediumturquoise':0x48D1CC,'mediumvioletred':0xC71585,'midnightblue':0x191970,'mintcream':0xF5FFFA,'mistyrose':0xFFE4E1,'moccasin':0xFFE4B5,'navajowhite':0xFFDEAD,'navy':0x000080,'oldlace':0xFDF5E6,'olive':0x808000,'olivedrab':0x6B8E23,'orange':0xFFA500,'orangered':0xFF4500,'orchid':0xDA70D6,'palegoldenrod':0xEEE8AA,'palegreen':0x98FB98,'paleturquoise':0xAFEEEE,'palevioletred':0xDB7093,'papayawhip':0xFFEFD5,'peachpuff':0xFFDAB9,'peru':0xCD853F,'pink':0xFFC0CB,'plum':0xDDA0DD,'powderblue':0xB0E0E6,'purple':0x800080,'rebeccapurple':0x663399,'red':0xFF0000,'rosybrown':0xBC8F8F,'royalblue':0x4169E1,'saddlebrown':0x8B4513,'salmon':0xFA8072,'sandybrown':0xF4A460,'seagreen':0x2E8B57,'seashell':0xFFF5EE,'sienna':0xA0522D,'silver':0xC0C0C0,'skyblue':0x87CEEB,'slateblue':0x6A5ACD,'slategray':0x708090,'slategrey':0x708090,'snow':0xFFFAFA,'springgreen':0x00FF7F,'steelblue':0x4682B4,'tan':0xD2B48C,'teal':0x008080,'thistle':0xD8BFD8,'tomato':0xFF6347,'turquoise':0x40E0D0,'violet':0xEE82EE,'wheat':0xF5DEB3,'white':0xFFFFFF,'whitesmoke':0xF5F5F5,'yellow':0xFFFF00,'yellowgreen':0x9ACD32};const _rgb={r:0,g:0,b:0};const _hslA={h:0,s:0,l:0};const _hslB={h:0,s:0,l:0};function hue2rgb(p,q,t){if(t<0)t+=1;if(t>1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*6*(2/3-t);return p;}function toComponents(source,target){target.r=source.r;target.g=source.g;target.b=source.b;return target;}class Color{constructor(r,g,b){this.isColor=true;this.r=1;this.g=1;this.b=1;if(g===undefined&&b===undefined){// r is THREE.Color, hex or string\nreturn this.set(r);}return this.setRGB(r,g,b);}set(value){if(value&&value.isColor){this.copy(value);}else if(typeof value==='number'){this.setHex(value);}else if(typeof value==='string'){this.setStyle(value);}return this;}setScalar(scalar){this.r=scalar;this.g=scalar;this.b=scalar;return this;}setHex(hex,colorSpace=SRGBColorSpace){hex=Math.floor(hex);this.r=(hex>>16&255)/255;this.g=(hex>>8&255)/255;this.b=(hex&255)/255;ColorManagement.toWorkingColorSpace(this,colorSpace);return this;}setRGB(r,g,b,colorSpace=LinearSRGBColorSpace){this.r=r;this.g=g;this.b=b;ColorManagement.toWorkingColorSpace(this,colorSpace);return this;}setHSL(h,s,l,colorSpace=LinearSRGBColorSpace){// h,s,l ranges are in 0.0 - 1.0\nh=three_module_euclideanModulo(h,1);s=three_module_clamp(s,0,1);l=three_module_clamp(l,0,1);if(s===0){this.r=this.g=this.b=l;}else{const p=l<=0.5?l*(1+s):l+s-l*s;const q=2*l-p;this.r=hue2rgb(q,p,h+1/3);this.g=hue2rgb(q,p,h);this.b=hue2rgb(q,p,h-1/3);}ColorManagement.toWorkingColorSpace(this,colorSpace);return this;}setStyle(style,colorSpace=SRGBColorSpace){function handleAlpha(string){if(string===undefined)return;if(parse_float(string)<1){console.warn('THREE.Color: Alpha component of '+style+' will be ignored.');}}let m;if(m=/^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)){// rgb / hsl\nlet color;const name=m[1];const components=m[2];switch(name){case'rgb':case'rgba':if(color=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)){// rgb(255,0,0) rgba(255,0,0,0.5)\nthis.r=Math.min(255,parse_int(color[1],10))/255;this.g=Math.min(255,parse_int(color[2],10))/255;this.b=Math.min(255,parse_int(color[3],10))/255;ColorManagement.toWorkingColorSpace(this,colorSpace);handleAlpha(color[4]);return this;}if(color=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)){// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\nthis.r=Math.min(100,parse_int(color[1],10))/100;this.g=Math.min(100,parse_int(color[2],10))/100;this.b=Math.min(100,parse_int(color[3],10))/100;ColorManagement.toWorkingColorSpace(this,colorSpace);handleAlpha(color[4]);return this;}break;case'hsl':case'hsla':if(color=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)){// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\nconst h=parse_float(color[1])/360;const s=parse_float(color[2])/100;const l=parse_float(color[3])/100;handleAlpha(color[4]);return this.setHSL(h,s,l,colorSpace);}break;}}else if(m=/^\\#([A-Fa-f\\d]+)$/.exec(style)){// hex color\nconst hex=m[1];const size=hex.length;if(size===3){// #ff0\nthis.r=parse_int(hex.charAt(0)+hex.charAt(0),16)/255;this.g=parse_int(hex.charAt(1)+hex.charAt(1),16)/255;this.b=parse_int(hex.charAt(2)+hex.charAt(2),16)/255;ColorManagement.toWorkingColorSpace(this,colorSpace);return this;}else if(size===6){// #ff0000\nthis.r=parse_int(hex.charAt(0)+hex.charAt(1),16)/255;this.g=parse_int(hex.charAt(2)+hex.charAt(3),16)/255;this.b=parse_int(hex.charAt(4)+hex.charAt(5),16)/255;ColorManagement.toWorkingColorSpace(this,colorSpace);return this;}}if(style&&style.length>0){return this.setColorName(style,colorSpace);}return this;}setColorName(style,colorSpace=SRGBColorSpace){// color keywords\nconst hex=_colorKeywords[style.toLowerCase()];if(hex!==undefined){// red\nthis.setHex(hex,colorSpace);}else{// unknown color\nconsole.warn('THREE.Color: Unknown color '+style);}return this;}clone(){return new this.constructor(this.r,this.g,this.b);}copy(color){this.r=color.r;this.g=color.g;this.b=color.b;return this;}copySRGBToLinear(color){this.r=SRGBToLinear(color.r);this.g=SRGBToLinear(color.g);this.b=SRGBToLinear(color.b);return this;}copyLinearToSRGB(color){this.r=LinearToSRGB(color.r);this.g=LinearToSRGB(color.g);this.b=LinearToSRGB(color.b);return this;}convertSRGBToLinear(){this.copySRGBToLinear(this);return this;}convertLinearToSRGB(){this.copyLinearToSRGB(this);return this;}getHex(colorSpace=SRGBColorSpace){ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),colorSpace);return three_module_clamp(_rgb.r*255,0,255)<<16^three_module_clamp(_rgb.g*255,0,255)<<8^three_module_clamp(_rgb.b*255,0,255)<<0;}getHexString(colorSpace=SRGBColorSpace){var _context4;return slice(_context4='000000'+this.getHex(colorSpace).toString(16)).call(_context4,-6);}getHSL(target,colorSpace=LinearSRGBColorSpace){// h,s,l ranges are in 0.0 - 1.0\nColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),colorSpace);const r=_rgb.r,g=_rgb.g,b=_rgb.b;const max=Math.max(r,g,b);const min=Math.min(r,g,b);let hue,saturation;const lightness=(min+max)/2.0;if(min===max){hue=0;saturation=0;}else{const delta=max-min;saturation=lightness<=0.5?delta/(max+min):delta/(2-max-min);switch(max){case r:hue=(g-b)/delta+(g<b?6:0);break;case g:hue=(b-r)/delta+2;break;case b:hue=(r-g)/delta+4;break;}hue/=6;}target.h=hue;target.s=saturation;target.l=lightness;return target;}getRGB(target,colorSpace=LinearSRGBColorSpace){ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),colorSpace);target.r=_rgb.r;target.g=_rgb.g;target.b=_rgb.b;return target;}getStyle(colorSpace=SRGBColorSpace){ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),colorSpace);if(colorSpace!==SRGBColorSpace){// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\nreturn`color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;}return`rgb(${_rgb.r*255|0},${_rgb.g*255|0},${_rgb.b*255|0})`;}offsetHSL(h,s,l){this.getHSL(_hslA);_hslA.h+=h;_hslA.s+=s;_hslA.l+=l;this.setHSL(_hslA.h,_hslA.s,_hslA.l);return this;}add(color){this.r+=color.r;this.g+=color.g;this.b+=color.b;return this;}addColors(color1,color2){this.r=color1.r+color2.r;this.g=color1.g+color2.g;this.b=color1.b+color2.b;return this;}addScalar(s){this.r+=s;this.g+=s;this.b+=s;return this;}sub(color){this.r=Math.max(0,this.r-color.r);this.g=Math.max(0,this.g-color.g);this.b=Math.max(0,this.b-color.b);return this;}multiply(color){this.r*=color.r;this.g*=color.g;this.b*=color.b;return this;}multiplyScalar(s){this.r*=s;this.g*=s;this.b*=s;return this;}lerp(color,alpha){this.r+=(color.r-this.r)*alpha;this.g+=(color.g-this.g)*alpha;this.b+=(color.b-this.b)*alpha;return this;}lerpColors(color1,color2,alpha){this.r=color1.r+(color2.r-color1.r)*alpha;this.g=color1.g+(color2.g-color1.g)*alpha;this.b=color1.b+(color2.b-color1.b)*alpha;return this;}lerpHSL(color,alpha){this.getHSL(_hslA);color.getHSL(_hslB);const h=three_module_lerp(_hslA.h,_hslB.h,alpha);const s=three_module_lerp(_hslA.s,_hslB.s,alpha);const l=three_module_lerp(_hslA.l,_hslB.l,alpha);this.setHSL(h,s,l);return this;}equals(c){return c.r===this.r&&c.g===this.g&&c.b===this.b;}fromArray(array,offset=0){this.r=array[offset];this.g=array[offset+1];this.b=array[offset+2];return this;}toArray(array=[],offset=0){array[offset]=this.r;array[offset+1]=this.g;array[offset+2]=this.b;return array;}fromBufferAttribute(attribute,index){this.r=attribute.getX(index);this.g=attribute.getY(index);this.b=attribute.getZ(index);return this;}toJSON(){return this.getHex();}*[iterator](){yield this.r;yield this.g;yield this.b;}}Color.NAMES=_colorKeywords;let _canvas;class ImageUtils{static getDataURL(image){if(/^data:/i.test(image.src)){return image.src;}if(typeof HTMLCanvasElement=='undefined'){return image.src;}let canvas;if(image instanceof HTMLCanvasElement){canvas=image;}else{if(_canvas===undefined)_canvas=createElementNS('canvas');_canvas.width=image.width;_canvas.height=image.height;const context=_canvas.getContext('2d');if(image instanceof ImageData){context.putImageData(image,0,0);}else{context.drawImage(image,0,0,image.width,image.height);}canvas=_canvas;}if(canvas.width>2048||canvas.height>2048){console.warn('THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons',image);return canvas.toDataURL('image/jpeg',0.6);}else{return canvas.toDataURL('image/png');}}static sRGBToLinear(image){if(typeof HTMLImageElement!=='undefined'&&image instanceof HTMLImageElement||typeof HTMLCanvasElement!=='undefined'&&image instanceof HTMLCanvasElement||typeof ImageBitmap!=='undefined'&&image instanceof ImageBitmap){const canvas=createElementNS('canvas');canvas.width=image.width;canvas.height=image.height;const context=canvas.getContext('2d');context.drawImage(image,0,0,image.width,image.height);const imageData=context.getImageData(0,0,image.width,image.height);const data=imageData.data;for(let i=0;i<data.length;i++){data[i]=SRGBToLinear(data[i]/255)*255;}context.putImageData(imageData,0,0);return canvas;}else if(image.data){var _context5;const data=slice(_context5=image.data).call(_context5,0);for(let i=0;i<data.length;i++){if(data instanceof Uint8Array||data instanceof Uint8ClampedArray){data[i]=Math.floor(SRGBToLinear(data[i]/255)*255);}else{// assuming float\ndata[i]=SRGBToLinear(data[i]);}}return{data:data,width:image.width,height:image.height};}else{console.warn('THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.');return image;}}}class Source{constructor(data=null){this.isSource=true;this.uuid=three_module_generateUUID();this.data=data;this.version=0;}set needsUpdate(value){if(value===true)this.version++;}toJSON(meta){const isRootObject=meta===undefined||typeof meta==='string';if(!isRootObject&&meta.images[this.uuid]!==undefined){return meta.images[this.uuid];}const output={uuid:this.uuid,url:''};const data=this.data;if(data!==null){let url;if(is_array(data)){// cube texture\nurl=[];for(let i=0,l=data.length;i<l;i++){if(data[i].isDataTexture){url.push(serializeImage(data[i].image));}else{url.push(serializeImage(data[i]));}}}else{// texture\nurl=serializeImage(data);}output.url=url;}if(!isRootObject){meta.images[this.uuid]=output;}return output;}}function serializeImage(image){if(typeof HTMLImageElement!=='undefined'&&image instanceof HTMLImageElement||typeof HTMLCanvasElement!=='undefined'&&image instanceof HTMLCanvasElement||typeof ImageBitmap!=='undefined'&&image instanceof ImageBitmap){// default images\nreturn ImageUtils.getDataURL(image);}else{if(image.data){// images of DataTexture\nreturn{data:from(image.data),width:image.width,height:image.height,type:image.data.constructor.name};}else{console.warn('THREE.Texture: Unable to serialize Texture.');return{};}}}let textureId=0;class Texture extends EventDispatcher{constructor(image=Texture.DEFAULT_IMAGE,mapping=Texture.DEFAULT_MAPPING,wrapS=ClampToEdgeWrapping,wrapT=ClampToEdgeWrapping,magFilter=LinearFilter,minFilter=LinearMipmapLinearFilter,format=RGBAFormat,type=UnsignedByteType,anisotropy=1,encoding=LinearEncoding){super();this.isTexture=true;define_property(this,'id',{value:textureId++});this.uuid=three_module_generateUUID();this.name='';this.source=new Source(image);this.mipmaps=[];this.mapping=mapping;this.wrapS=wrapS;this.wrapT=wrapT;this.magFilter=magFilter;this.minFilter=minFilter;this.anisotropy=anisotropy;this.format=format;this.internalFormat=null;this.type=type;this.offset=new Vector2(0,0);this.repeat=new Vector2(1,1);this.center=new Vector2(0,0);this.rotation=0;this.matrixAutoUpdate=true;this.matrix=new Matrix3();this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.unpackAlignment=4;// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.\n//\n// Also changing the encoding after already used by a Material will not automatically make the Material\n// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.\nthis.encoding=encoding;this.userData={};this.version=0;this.onUpdate=null;this.isRenderTargetTexture=false;// indicates whether a texture belongs to a render target or not\nthis.needsPMREMUpdate=false;// indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target textures)\n}get image(){return this.source.data;}set image(value){this.source.data=value;}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,repeat(this).x,repeat(this).y,this.rotation,this.center.x,this.center.y);}clone(){return new this.constructor().copy(this);}copy(source){var _context6;this.name=source.name;this.source=source.source;this.mipmaps=slice(_context6=source.mipmaps).call(_context6,0);this.mapping=source.mapping;this.wrapS=source.wrapS;this.wrapT=source.wrapT;this.magFilter=source.magFilter;this.minFilter=source.minFilter;this.anisotropy=source.anisotropy;this.format=source.format;this.internalFormat=source.internalFormat;this.type=source.type;this.offset.copy(source.offset);repeat(this).copy(repeat(source));this.center.copy(source.center);this.rotation=source.rotation;this.matrixAutoUpdate=source.matrixAutoUpdate;this.matrix.copy(source.matrix);this.generateMipmaps=source.generateMipmaps;this.premultiplyAlpha=source.premultiplyAlpha;this.flipY=source.flipY;this.unpackAlignment=source.unpackAlignment;this.encoding=source.encoding;this.userData=JSON.parse(stringify(source.userData));this.needsUpdate=true;return this;}toJSON(meta){const isRootObject=meta===undefined||typeof meta==='string';if(!isRootObject&&meta.textures[this.uuid]!==undefined){return meta.textures[this.uuid];}const output={metadata:{version:4.5,type:'Texture',generator:'Texture.toJSON'},uuid:this.uuid,name:this.name,image:this.source.toJSON(meta).uuid,mapping:this.mapping,repeat:[repeat(this).x,repeat(this).y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(stringify(this.userData)!=='{}')output.userData=this.userData;if(!isRootObject){meta.textures[this.uuid]=output;}return output;}dispose(){this.dispatchEvent({type:'dispose'});}transformUv(uv){if(this.mapping!==UVMapping)return uv;uv.applyMatrix3(this.matrix);if(uv.x<0||uv.x>1){switch(this.wrapS){case RepeatWrapping:uv.x=uv.x-Math.floor(uv.x);break;case ClampToEdgeWrapping:uv.x=uv.x<0?0:1;break;case MirroredRepeatWrapping:if(Math.abs(Math.floor(uv.x)%2)===1){uv.x=Math.ceil(uv.x)-uv.x;}else{uv.x=uv.x-Math.floor(uv.x);}break;}}if(uv.y<0||uv.y>1){switch(this.wrapT){case RepeatWrapping:uv.y=uv.y-Math.floor(uv.y);break;case ClampToEdgeWrapping:uv.y=uv.y<0?0:1;break;case MirroredRepeatWrapping:if(Math.abs(Math.floor(uv.y)%2)===1){uv.y=Math.ceil(uv.y)-uv.y;}else{uv.y=uv.y-Math.floor(uv.y);}break;}}if(this.flipY){uv.y=1-uv.y;}return uv;}set needsUpdate(value){if(value===true){this.version++;this.source.needsUpdate=true;}}}Texture.DEFAULT_IMAGE=null;Texture.DEFAULT_MAPPING=UVMapping;class Vector4{constructor(x=0,y=0,z=0,w=1){Vector4.prototype.isVector4=true;this.x=x;this.y=y;this.z=z;this.w=w;}get width(){return this.z;}set width(value){this.z=value;}get height(){return this.w;}set height(value){this.w=value;}set(x,y,z,w){this.x=x;this.y=y;this.z=z;this.w=w;return this;}setScalar(scalar){this.x=scalar;this.y=scalar;this.z=scalar;this.w=scalar;return this;}setX(x){this.x=x;return this;}setY(y){this.y=y;return this;}setZ(z){this.z=z;return this;}setW(w){this.w=w;return this;}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;case 3:this.w=value;break;default:throw new Error('index is out of range: '+index);}return this;}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error('index is out of range: '+index);}}clone(){return new this.constructor(this.x,this.y,this.z,this.w);}copy(v){this.x=v.x;this.y=v.y;this.z=v.z;this.w=v.w!==undefined?v.w:1;return this;}add(v){this.x+=v.x;this.y+=v.y;this.z+=v.z;this.w+=v.w;return this;}addScalar(s){this.x+=s;this.y+=s;this.z+=s;this.w+=s;return this;}addVectors(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this;}addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;this.z+=v.z*s;this.w+=v.w*s;return this;}sub(v){this.x-=v.x;this.y-=v.y;this.z-=v.z;this.w-=v.w;return this;}subScalar(s){this.x-=s;this.y-=s;this.z-=s;this.w-=s;return this;}subVectors(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this;}multiply(v){this.x*=v.x;this.y*=v.y;this.z*=v.z;this.w*=v.w;return this;}multiplyScalar(scalar){this.x*=scalar;this.y*=scalar;this.z*=scalar;this.w*=scalar;return this;}applyMatrix4(m){const x=this.x,y=this.y,z=this.z,w=this.w;const e=m.elements;this.x=e[0]*x+e[4]*y+e[8]*z+e[12]*w;this.y=e[1]*x+e[5]*y+e[9]*z+e[13]*w;this.z=e[2]*x+e[6]*y+e[10]*z+e[14]*w;this.w=e[3]*x+e[7]*y+e[11]*z+e[15]*w;return this;}divideScalar(scalar){return this.multiplyScalar(1/scalar);}setAxisAngleFromQuaternion(q){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n// q is assumed to be normalized\nthis.w=2*Math.acos(q.w);const s=Math.sqrt(1-q.w*q.w);if(s<0.0001){this.x=1;this.y=0;this.z=0;}else{this.x=q.x/s;this.y=q.y/s;this.z=q.z/s;}return this;}setAxisAngleFromRotationMatrix(m){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\nlet angle,x,y,z;// variables for result\nconst epsilon=0.01,// margin to allow for rounding errors\nepsilon2=0.1,// margin to distinguish between 0 and 180 degrees\nte=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10];if(Math.abs(m12-m21)<epsilon&&Math.abs(m13-m31)<epsilon&&Math.abs(m23-m32)<epsilon){// singularity found\n// first check for identity matrix which must have +1 for all terms\n// in leading diagonal and zero in other terms\nif(Math.abs(m12+m21)<epsilon2&&Math.abs(m13+m31)<epsilon2&&Math.abs(m23+m32)<epsilon2&&Math.abs(m11+m22+m33-3)<epsilon2){// this singularity is identity matrix so angle = 0\nthis.set(1,0,0,0);return this;// zero angle, arbitrary axis\n}// otherwise this singularity is angle = 180\nangle=Math.PI;const xx=(m11+1)/2;const yy=(m22+1)/2;const zz=(m33+1)/2;const xy=(m12+m21)/4;const xz=(m13+m31)/4;const yz=(m23+m32)/4;if(xx>yy&&xx>zz){// m11 is the largest diagonal term\nif(xx<epsilon){x=0;y=0.707106781;z=0.707106781;}else{x=Math.sqrt(xx);y=xy/x;z=xz/x;}}else if(yy>zz){// m22 is the largest diagonal term\nif(yy<epsilon){x=0.707106781;y=0;z=0.707106781;}else{y=Math.sqrt(yy);x=xy/y;z=yz/y;}}else{// m33 is the largest diagonal term so base result on this\nif(zz<epsilon){x=0.707106781;y=0.707106781;z=0;}else{z=Math.sqrt(zz);x=xz/z;y=yz/z;}}this.set(x,y,z,angle);return this;// return 180 deg rotation\n}// as we have reached here there are no singularities so we can handle normally\nlet s=Math.sqrt((m32-m23)*(m32-m23)+(m13-m31)*(m13-m31)+(m21-m12)*(m21-m12));// used to normalize\nif(Math.abs(s)<0.001)s=1;// prevent divide by zero, should not happen if matrix is orthogonal and should be\n// caught by singularity test above, but I've left it in just in case\nthis.x=(m32-m23)/s;this.y=(m13-m31)/s;this.z=(m21-m12)/s;this.w=Math.acos((m11+m22+m33-1)/2);return this;}min(v){this.x=Math.min(this.x,v.x);this.y=Math.min(this.y,v.y);this.z=Math.min(this.z,v.z);this.w=Math.min(this.w,v.w);return this;}max(v){this.x=Math.max(this.x,v.x);this.y=Math.max(this.y,v.y);this.z=Math.max(this.z,v.z);this.w=Math.max(this.w,v.w);return this;}clamp(min,max){// assumes min < max, componentwise\nthis.x=Math.max(min.x,Math.min(max.x,this.x));this.y=Math.max(min.y,Math.min(max.y,this.y));this.z=Math.max(min.z,Math.min(max.z,this.z));this.w=Math.max(min.w,Math.min(max.w,this.w));return this;}clampScalar(minVal,maxVal){this.x=Math.max(minVal,Math.min(maxVal,this.x));this.y=Math.max(minVal,Math.min(maxVal,this.y));this.z=Math.max(minVal,Math.min(maxVal,this.z));this.w=Math.max(minVal,Math.min(maxVal,this.w));return this;}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)));}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this;}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this;}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this;}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w);return this;}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this;}dot(v){return this.x*v.x+this.y*v.y+this.z*v.z+this.w*v.w;}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w;}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w);}normalize(){return this.divideScalar(this.length()||1);}setLength(length){return this.normalize().multiplyScalar(length);}lerp(v,alpha){this.x+=(v.x-this.x)*alpha;this.y+=(v.y-this.y)*alpha;this.z+=(v.z-this.z)*alpha;this.w+=(v.w-this.w)*alpha;return this;}lerpVectors(v1,v2,alpha){this.x=v1.x+(v2.x-v1.x)*alpha;this.y=v1.y+(v2.y-v1.y)*alpha;this.z=v1.z+(v2.z-v1.z)*alpha;this.w=v1.w+(v2.w-v1.w)*alpha;return this;}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z&&v.w===this.w;}fromArray(array,offset=0){this.x=array[offset];this.y=array[offset+1];this.z=array[offset+2];this.w=array[offset+3];return this;}toArray(array=[],offset=0){array[offset]=this.x;array[offset+1]=this.y;array[offset+2]=this.z;array[offset+3]=this.w;return array;}fromBufferAttribute(attribute,index){this.x=attribute.getX(index);this.y=attribute.getY(index);this.z=attribute.getZ(index);this.w=attribute.getW(index);return this;}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();this.w=Math.random();return this;}*[iterator](){yield this.x;yield this.y;yield this.z;yield this.w;}}/*\n In options, we can specify:\n * Texture parameters for an auto-generated target texture\n * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n*/class WebGLRenderTarget extends EventDispatcher{constructor(width=1,height=1,options={}){super();this.isWebGLRenderTarget=true;this.width=width;this.height=height;this.depth=1;this.scissor=new Vector4(0,0,width,height);this.scissorTest=false;this.viewport=new Vector4(0,0,width,height);const image={width:width,height:height,depth:1};this.texture=new Texture(image,options.mapping,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.encoding);this.texture.isRenderTargetTexture=true;this.texture.flipY=false;this.texture.generateMipmaps=options.generateMipmaps!==undefined?options.generateMipmaps:false;this.texture.internalFormat=options.internalFormat!==undefined?options.internalFormat:null;this.texture.minFilter=options.minFilter!==undefined?options.minFilter:LinearFilter;this.depthBuffer=options.depthBuffer!==undefined?options.depthBuffer:true;this.stencilBuffer=options.stencilBuffer!==undefined?options.stencilBuffer:false;this.depthTexture=options.depthTexture!==undefined?options.depthTexture:null;this.samples=options.samples!==undefined?options.samples:0;}setSize(width,height,depth=1){if(this.width!==width||this.height!==height||this.depth!==depth){this.width=width;this.height=height;this.depth=depth;this.texture.image.width=width;this.texture.image.height=height;this.texture.image.depth=depth;this.dispose();}this.viewport.set(0,0,width,height);this.scissor.set(0,0,width,height);}clone(){return new this.constructor().copy(this);}copy(source){this.width=source.width;this.height=source.height;this.depth=source.depth;this.viewport.copy(source.viewport);this.texture=source.texture.clone();this.texture.isRenderTargetTexture=true;// ensure image object is not shared, see #20328\nconst image=object_assign({},source.texture.image);this.texture.source=new Source(image);this.depthBuffer=source.depthBuffer;this.stencilBuffer=source.stencilBuffer;if(source.depthTexture!==null)this.depthTexture=source.depthTexture.clone();this.samples=source.samples;return this;}dispose(){this.dispatchEvent({type:'dispose'});}}class DataArrayTexture extends Texture{constructor(data=null,width=1,height=1,depth=1){super(null);this.isDataArrayTexture=true;this.image={data,width,height,depth};this.magFilter=NearestFilter;this.minFilter=NearestFilter;this.wrapR=ClampToEdgeWrapping;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1;}}class WebGLArrayRenderTarget extends (/* unused pure expression or super */ null && (WebGLRenderTarget)){constructor(width=1,height=1,depth=1){super(width,height);this.isWebGLArrayRenderTarget=true;this.depth=depth;this.texture=new DataArrayTexture(null,width,height,depth);this.texture.isRenderTargetTexture=true;}}class Data3DTexture extends Texture{constructor(data=null,width=1,height=1,depth=1){// We're going to add .setXXX() methods for setting properties later.\n// Users can still set in DataTexture3D directly.\n//\n//\tconst texture = new THREE.DataTexture3D( data, width, height, depth );\n// \ttexture.anisotropy = 16;\n//\n// See #14839\nsuper(null);this.isData3DTexture=true;this.image={data,width,height,depth};this.magFilter=NearestFilter;this.minFilter=NearestFilter;this.wrapR=ClampToEdgeWrapping;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1;}}class WebGL3DRenderTarget extends (/* unused pure expression or super */ null && (WebGLRenderTarget)){constructor(width=1,height=1,depth=1){super(width,height);this.isWebGL3DRenderTarget=true;this.depth=depth;this.texture=new Data3DTexture(null,width,height,depth);this.texture.isRenderTargetTexture=true;}}class WebGLMultipleRenderTargets extends (/* unused pure expression or super */ null && (WebGLRenderTarget)){constructor(width=1,height=1,count=1,options={}){super(width,height,options);this.isWebGLMultipleRenderTargets=true;const texture=this.texture;this.texture=[];for(let i=0;i<count;i++){this.texture[i]=texture.clone();this.texture[i].isRenderTargetTexture=true;}}setSize(width,height,depth=1){if(this.width!==width||this.height!==height||this.depth!==depth){this.width=width;this.height=height;this.depth=depth;for(let i=0,il=this.texture.length;i<il;i++){this.texture[i].image.width=width;this.texture[i].image.height=height;this.texture[i].image.depth=depth;}this.dispose();}this.viewport.set(0,0,width,height);this.scissor.set(0,0,width,height);return this;}copy(source){this.dispose();this.width=source.width;this.height=source.height;this.depth=source.depth;this.viewport.set(0,0,this.width,this.height);this.scissor.set(0,0,this.width,this.height);this.depthBuffer=source.depthBuffer;this.stencilBuffer=source.stencilBuffer;if(source.depthTexture!==null)this.depthTexture=source.depthTexture.clone();this.texture.length=0;for(let i=0,il=source.texture.length;i<il;i++){this.texture[i]=source.texture[i].clone();this.texture[i].isRenderTargetTexture=true;}return this;}}class three_module_Quaternion{constructor(x=0,y=0,z=0,w=1){this.isQuaternion=true;this._x=x;this._y=y;this._z=z;this._w=w;}static slerpFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1,t){// fuzz-free, array-based Quaternion SLERP operation\nlet x0=src0[srcOffset0+0],y0=src0[srcOffset0+1],z0=src0[srcOffset0+2],w0=src0[srcOffset0+3];const x1=src1[srcOffset1+0],y1=src1[srcOffset1+1],z1=src1[srcOffset1+2],w1=src1[srcOffset1+3];if(t===0){dst[dstOffset+0]=x0;dst[dstOffset+1]=y0;dst[dstOffset+2]=z0;dst[dstOffset+3]=w0;return;}if(t===1){dst[dstOffset+0]=x1;dst[dstOffset+1]=y1;dst[dstOffset+2]=z1;dst[dstOffset+3]=w1;return;}if(w0!==w1||x0!==x1||y0!==y1||z0!==z1){let s=1-t;const cos=x0*x1+y0*y1+z0*z1+w0*w1,dir=cos>=0?1:-1,sqrSin=1-cos*cos;// Skip the Slerp for tiny steps to avoid numeric problems:\nif(sqrSin>epsilon){const sin=Math.sqrt(sqrSin),len=Math.atan2(sin,cos*dir);s=Math.sin(s*len)/sin;t=Math.sin(t*len)/sin;}const tDir=t*dir;x0=x0*s+x1*tDir;y0=y0*s+y1*tDir;z0=z0*s+z1*tDir;w0=w0*s+w1*tDir;// Normalize in case we just did a lerp:\nif(s===1-t){const f=1/Math.sqrt(x0*x0+y0*y0+z0*z0+w0*w0);x0*=f;y0*=f;z0*=f;w0*=f;}}dst[dstOffset]=x0;dst[dstOffset+1]=y0;dst[dstOffset+2]=z0;dst[dstOffset+3]=w0;}static multiplyQuaternionsFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1){const x0=src0[srcOffset0];const y0=src0[srcOffset0+1];const z0=src0[srcOffset0+2];const w0=src0[srcOffset0+3];const x1=src1[srcOffset1];const y1=src1[srcOffset1+1];const z1=src1[srcOffset1+2];const w1=src1[srcOffset1+3];dst[dstOffset]=x0*w1+w0*x1+y0*z1-z0*y1;dst[dstOffset+1]=y0*w1+w0*y1+z0*x1-x0*z1;dst[dstOffset+2]=z0*w1+w0*z1+x0*y1-y0*x1;dst[dstOffset+3]=w0*w1-x0*x1-y0*y1-z0*z1;return dst;}get x(){return this._x;}set x(value){this._x=value;this._onChangeCallback();}get y(){return this._y;}set y(value){this._y=value;this._onChangeCallback();}get z(){return this._z;}set z(value){this._z=value;this._onChangeCallback();}get w(){return this._w;}set w(value){this._w=value;this._onChangeCallback();}set(x,y,z,w){this._x=x;this._y=y;this._z=z;this._w=w;this._onChangeCallback();return this;}clone(){return new this.constructor(this._x,this._y,this._z,this._w);}copy(quaternion){this._x=quaternion.x;this._y=quaternion.y;this._z=quaternion.z;this._w=quaternion.w;this._onChangeCallback();return this;}setFromEuler(euler,update){const x=euler._x,y=euler._y,z=euler._z,order=euler._order;// http://www.mathworks.com/matlabcentral/fileexchange/\n// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n//\tcontent/SpinCalc.m\nconst cos=Math.cos;const sin=Math.sin;const c1=cos(x/2);const c2=cos(y/2);const c3=cos(z/2);const s1=sin(x/2);const s2=sin(y/2);const s3=sin(z/2);switch(order){case'XYZ':this._x=s1*c2*c3+c1*s2*s3;this._y=c1*s2*c3-s1*c2*s3;this._z=c1*c2*s3+s1*s2*c3;this._w=c1*c2*c3-s1*s2*s3;break;case'YXZ':this._x=s1*c2*c3+c1*s2*s3;this._y=c1*s2*c3-s1*c2*s3;this._z=c1*c2*s3-s1*s2*c3;this._w=c1*c2*c3+s1*s2*s3;break;case'ZXY':this._x=s1*c2*c3-c1*s2*s3;this._y=c1*s2*c3+s1*c2*s3;this._z=c1*c2*s3+s1*s2*c3;this._w=c1*c2*c3-s1*s2*s3;break;case'ZYX':this._x=s1*c2*c3-c1*s2*s3;this._y=c1*s2*c3+s1*c2*s3;this._z=c1*c2*s3-s1*s2*c3;this._w=c1*c2*c3+s1*s2*s3;break;case'YZX':this._x=s1*c2*c3+c1*s2*s3;this._y=c1*s2*c3+s1*c2*s3;this._z=c1*c2*s3-s1*s2*c3;this._w=c1*c2*c3-s1*s2*s3;break;case'XZY':this._x=s1*c2*c3-c1*s2*s3;this._y=c1*s2*c3-s1*c2*s3;this._z=c1*c2*s3+s1*s2*c3;this._w=c1*c2*c3+s1*s2*s3;break;default:console.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: '+order);}if(update!==false)this._onChangeCallback();return this;}setFromAxisAngle(axis,angle){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n// assumes axis is normalized\nconst halfAngle=angle/2,s=Math.sin(halfAngle);this._x=axis.x*s;this._y=axis.y*s;this._z=axis.z*s;this._w=Math.cos(halfAngle);this._onChangeCallback();return this;}setFromRotationMatrix(m){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\nconst te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10],trace=m11+m22+m33;if(trace>0){const s=0.5/Math.sqrt(trace+1.0);this._w=0.25/s;this._x=(m32-m23)*s;this._y=(m13-m31)*s;this._z=(m21-m12)*s;}else if(m11>m22&&m11>m33){const s=2.0*Math.sqrt(1.0+m11-m22-m33);this._w=(m32-m23)/s;this._x=0.25*s;this._y=(m12+m21)/s;this._z=(m13+m31)/s;}else if(m22>m33){const s=2.0*Math.sqrt(1.0+m22-m11-m33);this._w=(m13-m31)/s;this._x=(m12+m21)/s;this._y=0.25*s;this._z=(m23+m32)/s;}else{const s=2.0*Math.sqrt(1.0+m33-m11-m22);this._w=(m21-m12)/s;this._x=(m13+m31)/s;this._y=(m23+m32)/s;this._z=0.25*s;}this._onChangeCallback();return this;}setFromUnitVectors(vFrom,vTo){// assumes direction vectors vFrom and vTo are normalized\nlet r=vFrom.dot(vTo)+1;if(r<epsilon){// vFrom and vTo point in opposite directions\nr=0;if(Math.abs(vFrom.x)>Math.abs(vFrom.z)){this._x=-vFrom.y;this._y=vFrom.x;this._z=0;this._w=r;}else{this._x=0;this._y=-vFrom.z;this._z=vFrom.y;this._w=r;}}else{// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\nthis._x=vFrom.y*vTo.z-vFrom.z*vTo.y;this._y=vFrom.z*vTo.x-vFrom.x*vTo.z;this._z=vFrom.x*vTo.y-vFrom.y*vTo.x;this._w=r;}return this.normalize();}angleTo(q){return 2*Math.acos(Math.abs(three_module_clamp(this.dot(q),-1,1)));}rotateTowards(q,step){const angle=this.angleTo(q);if(angle===0)return this;const t=Math.min(1,step/angle);this.slerp(q,t);return this;}identity(){return this.set(0,0,0,1);}invert(){// quaternion is assumed to have unit length\nreturn this.conjugate();}conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this;}dot(v){return this._x*v._x+this._y*v._y+this._z*v._z+this._w*v._w;}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w;}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);}normalize(){let l=this.length();if(l===0){this._x=0;this._y=0;this._z=0;this._w=1;}else{l=1/l;this._x=this._x*l;this._y=this._y*l;this._z=this._z*l;this._w=this._w*l;}this._onChangeCallback();return this;}multiply(q){return this.multiplyQuaternions(this,q);}premultiply(q){return this.multiplyQuaternions(q,this);}multiplyQuaternions(a,b){// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\nconst qax=a._x,qay=a._y,qaz=a._z,qaw=a._w;const qbx=b._x,qby=b._y,qbz=b._z,qbw=b._w;this._x=qax*qbw+qaw*qbx+qay*qbz-qaz*qby;this._y=qay*qbw+qaw*qby+qaz*qbx-qax*qbz;this._z=qaz*qbw+qaw*qbz+qax*qby-qay*qbx;this._w=qaw*qbw-qax*qbx-qay*qby-qaz*qbz;this._onChangeCallback();return this;}slerp(qb,t){if(t===0)return this;if(t===1)return this.copy(qb);const x=this._x,y=this._y,z=this._z,w=this._w;// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\nlet cosHalfTheta=w*qb._w+x*qb._x+y*qb._y+z*qb._z;if(cosHalfTheta<0){this._w=-qb._w;this._x=-qb._x;this._y=-qb._y;this._z=-qb._z;cosHalfTheta=-cosHalfTheta;}else{this.copy(qb);}if(cosHalfTheta>=1.0){this._w=w;this._x=x;this._y=y;this._z=z;return this;}const sqrSinHalfTheta=1.0-cosHalfTheta*cosHalfTheta;if(sqrSinHalfTheta<=epsilon){const s=1-t;this._w=s*w+t*this._w;this._x=s*x+t*this._x;this._y=s*y+t*this._y;this._z=s*z+t*this._z;this.normalize();this._onChangeCallback();return this;}const sinHalfTheta=Math.sqrt(sqrSinHalfTheta);const halfTheta=Math.atan2(sinHalfTheta,cosHalfTheta);const ratioA=Math.sin((1-t)*halfTheta)/sinHalfTheta,ratioB=Math.sin(t*halfTheta)/sinHalfTheta;this._w=w*ratioA+this._w*ratioB;this._x=x*ratioA+this._x*ratioB;this._y=y*ratioA+this._y*ratioB;this._z=z*ratioA+this._z*ratioB;this._onChangeCallback();return this;}slerpQuaternions(qa,qb,t){return this.copy(qa).slerp(qb,t);}random(){// Derived from http://planning.cs.uiuc.edu/node198.html\n// Note, this source uses w, x, y, z ordering,\n// so we swap the order below.\nconst u1=Math.random();const sqrt1u1=Math.sqrt(1-u1);const sqrtu1=Math.sqrt(u1);const u2=2*Math.PI*Math.random();const u3=2*Math.PI*Math.random();return this.set(sqrt1u1*Math.cos(u2),sqrtu1*Math.sin(u3),sqrtu1*Math.cos(u3),sqrt1u1*Math.sin(u2));}equals(quaternion){return quaternion._x===this._x&&quaternion._y===this._y&&quaternion._z===this._z&&quaternion._w===this._w;}fromArray(array,offset=0){this._x=array[offset];this._y=array[offset+1];this._z=array[offset+2];this._w=array[offset+3];this._onChangeCallback();return this;}toArray(array=[],offset=0){array[offset]=this._x;array[offset+1]=this._y;array[offset+2]=this._z;array[offset+3]=this._w;return array;}fromBufferAttribute(attribute,index){this._x=attribute.getX(index);this._y=attribute.getY(index);this._z=attribute.getZ(index);this._w=attribute.getW(index);return this;}_onChange(callback){this._onChangeCallback=callback;return this;}_onChangeCallback(){}*[iterator](){yield this._x;yield this._y;yield this._z;yield this._w;}}class three_module_Vector3{constructor(x=0,y=0,z=0){three_module_Vector3.prototype.isVector3=true;this.x=x;this.y=y;this.z=z;}set(x,y,z){if(z===undefined)z=this.z;// sprite.scale.set(x,y)\nthis.x=x;this.y=y;this.z=z;return this;}setScalar(scalar){this.x=scalar;this.y=scalar;this.z=scalar;return this;}setX(x){this.x=x;return this;}setY(y){this.y=y;return this;}setZ(z){this.z=z;return this;}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;default:throw new Error('index is out of range: '+index);}return this;}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error('index is out of range: '+index);}}clone(){return new this.constructor(this.x,this.y,this.z);}copy(v){this.x=v.x;this.y=v.y;this.z=v.z;return this;}add(v){this.x+=v.x;this.y+=v.y;this.z+=v.z;return this;}addScalar(s){this.x+=s;this.y+=s;this.z+=s;return this;}addVectors(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this;}addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;this.z+=v.z*s;return this;}sub(v){this.x-=v.x;this.y-=v.y;this.z-=v.z;return this;}subScalar(s){this.x-=s;this.y-=s;this.z-=s;return this;}subVectors(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this;}multiply(v){this.x*=v.x;this.y*=v.y;this.z*=v.z;return this;}multiplyScalar(scalar){this.x*=scalar;this.y*=scalar;this.z*=scalar;return this;}multiplyVectors(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this;}applyEuler(euler){return this.applyQuaternion(_quaternion$4.setFromEuler(euler));}applyAxisAngle(axis,angle){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis,angle));}applyMatrix3(m){const x=this.x,y=this.y,z=this.z;const e=m.elements;this.x=e[0]*x+e[3]*y+e[6]*z;this.y=e[1]*x+e[4]*y+e[7]*z;this.z=e[2]*x+e[5]*y+e[8]*z;return this;}applyNormalMatrix(m){return this.applyMatrix3(m).normalize();}applyMatrix4(m){const x=this.x,y=this.y,z=this.z;const e=m.elements;const w=1/(e[3]*x+e[7]*y+e[11]*z+e[15]);this.x=(e[0]*x+e[4]*y+e[8]*z+e[12])*w;this.y=(e[1]*x+e[5]*y+e[9]*z+e[13])*w;this.z=(e[2]*x+e[6]*y+e[10]*z+e[14])*w;return this;}applyQuaternion(q){const x=this.x,y=this.y,z=this.z;const qx=q.x,qy=q.y,qz=q.z,qw=q.w;// calculate quat * vector\nconst ix=qw*x+qy*z-qz*y;const iy=qw*y+qz*x-qx*z;const iz=qw*z+qx*y-qy*x;const iw=-qx*x-qy*y-qz*z;// calculate result * inverse quat\nthis.x=ix*qw+iw*-qx+iy*-qz-iz*-qy;this.y=iy*qw+iw*-qy+iz*-qx-ix*-qz;this.z=iz*qw+iw*-qz+ix*-qy-iy*-qx;return this;}project(camera){return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);}unproject(camera){return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);}transformDirection(m){// input: THREE.Matrix4 affine matrix\n// vector interpreted as a direction\nconst x=this.x,y=this.y,z=this.z;const e=m.elements;this.x=e[0]*x+e[4]*y+e[8]*z;this.y=e[1]*x+e[5]*y+e[9]*z;this.z=e[2]*x+e[6]*y+e[10]*z;return this.normalize();}divide(v){this.x/=v.x;this.y/=v.y;this.z/=v.z;return this;}divideScalar(scalar){return this.multiplyScalar(1/scalar);}min(v){this.x=Math.min(this.x,v.x);this.y=Math.min(this.y,v.y);this.z=Math.min(this.z,v.z);return this;}max(v){this.x=Math.max(this.x,v.x);this.y=Math.max(this.y,v.y);this.z=Math.max(this.z,v.z);return this;}clamp(min,max){// assumes min < max, componentwise\nthis.x=Math.max(min.x,Math.min(max.x,this.x));this.y=Math.max(min.y,Math.min(max.y,this.y));this.z=Math.max(min.z,Math.min(max.z,this.z));return this;}clampScalar(minVal,maxVal){this.x=Math.max(minVal,Math.min(maxVal,this.x));this.y=Math.max(minVal,Math.min(maxVal,this.y));this.z=Math.max(minVal,Math.min(maxVal,this.z));return this;}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)));}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this;}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this;}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this;}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this;}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this;}dot(v){return this.x*v.x+this.y*v.y+this.z*v.z;}// TODO lengthSquared?\nlengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z;}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z);}normalize(){return this.divideScalar(this.length()||1);}setLength(length){return this.normalize().multiplyScalar(length);}lerp(v,alpha){this.x+=(v.x-this.x)*alpha;this.y+=(v.y-this.y)*alpha;this.z+=(v.z-this.z)*alpha;return this;}lerpVectors(v1,v2,alpha){this.x=v1.x+(v2.x-v1.x)*alpha;this.y=v1.y+(v2.y-v1.y)*alpha;this.z=v1.z+(v2.z-v1.z)*alpha;return this;}cross(v){return this.crossVectors(this,v);}crossVectors(a,b){const ax=a.x,ay=a.y,az=a.z;const bx=b.x,by=b.y,bz=b.z;this.x=ay*bz-az*by;this.y=az*bx-ax*bz;this.z=ax*by-ay*bx;return this;}projectOnVector(v){const denominator=v.lengthSq();if(denominator===0)return this.set(0,0,0);const scalar=v.dot(this)/denominator;return this.copy(v).multiplyScalar(scalar);}projectOnPlane(planeNormal){_vector$c.copy(this).projectOnVector(planeNormal);return this.sub(_vector$c);}reflect(normal){// reflect incident vector off plane orthogonal to normal\n// normal is assumed to have unit length\nreturn this.sub(_vector$c.copy(normal).multiplyScalar(2*this.dot(normal)));}angleTo(v){const denominator=Math.sqrt(this.lengthSq()*v.lengthSq());if(denominator===0)return Math.PI/2;const theta=this.dot(v)/denominator;// clamp, to handle numerical problems\nreturn Math.acos(three_module_clamp(theta,-1,1));}distanceTo(v){return Math.sqrt(this.distanceToSquared(v));}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y,dz=this.z-v.z;return dx*dx+dy*dy+dz*dz;}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)+Math.abs(this.z-v.z);}setFromSpherical(s){return this.setFromSphericalCoords(s.radius,s.phi,s.theta);}setFromSphericalCoords(radius,phi,theta){const sinPhiRadius=Math.sin(phi)*radius;this.x=sinPhiRadius*Math.sin(theta);this.y=Math.cos(phi)*radius;this.z=sinPhiRadius*Math.cos(theta);return this;}setFromCylindrical(c){return this.setFromCylindricalCoords(c.radius,c.theta,c.y);}setFromCylindricalCoords(radius,theta,y){this.x=radius*Math.sin(theta);this.y=y;this.z=radius*Math.cos(theta);return this;}setFromMatrixPosition(m){const e=m.elements;this.x=e[12];this.y=e[13];this.z=e[14];return this;}setFromMatrixScale(m){const sx=this.setFromMatrixColumn(m,0).length();const sy=this.setFromMatrixColumn(m,1).length();const sz=this.setFromMatrixColumn(m,2).length();this.x=sx;this.y=sy;this.z=sz;return this;}setFromMatrixColumn(m,index){return this.fromArray(m.elements,index*4);}setFromMatrix3Column(m,index){return this.fromArray(m.elements,index*3);}setFromEuler(e){this.x=e._x;this.y=e._y;this.z=e._z;return this;}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z;}fromArray(array,offset=0){this.x=array[offset];this.y=array[offset+1];this.z=array[offset+2];return this;}toArray(array=[],offset=0){array[offset]=this.x;array[offset+1]=this.y;array[offset+2]=this.z;return array;}fromBufferAttribute(attribute,index){this.x=attribute.getX(index);this.y=attribute.getY(index);this.z=attribute.getZ(index);return this;}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this;}randomDirection(){// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\nconst u=(Math.random()-0.5)*2;const t=Math.random()*Math.PI*2;const f=Math.sqrt(1-u**2);this.x=f*Math.cos(t);this.y=f*Math.sin(t);this.z=u;return this;}*[iterator](){yield this.x;yield this.y;yield this.z;}}const _vector$c=/*@__PURE__*/new three_module_Vector3();const _quaternion$4=/*@__PURE__*/new three_module_Quaternion();class Box3{constructor(min=new three_module_Vector3(+Infinity,+Infinity,+Infinity),max=new three_module_Vector3(-Infinity,-Infinity,-Infinity)){this.isBox3=true;this.min=min;this.max=max;}set(min,max){this.min.copy(min);this.max.copy(max);return this;}setFromArray(array){let minX=+Infinity;let minY=+Infinity;let minZ=+Infinity;let maxX=-Infinity;let maxY=-Infinity;let maxZ=-Infinity;for(let i=0,l=array.length;i<l;i+=3){const x=array[i];const y=array[i+1];const z=array[i+2];if(x<minX)minX=x;if(y<minY)minY=y;if(z<minZ)minZ=z;if(x>maxX)maxX=x;if(y>maxY)maxY=y;if(z>maxZ)maxZ=z;}this.min.set(minX,minY,minZ);this.max.set(maxX,maxY,maxZ);return this;}setFromBufferAttribute(attribute){let minX=+Infinity;let minY=+Infinity;let minZ=+Infinity;let maxX=-Infinity;let maxY=-Infinity;let maxZ=-Infinity;for(let i=0,l=attribute.count;i<l;i++){const x=attribute.getX(i);const y=attribute.getY(i);const z=attribute.getZ(i);if(x<minX)minX=x;if(y<minY)minY=y;if(z<minZ)minZ=z;if(x>maxX)maxX=x;if(y>maxY)maxY=y;if(z>maxZ)maxZ=z;}this.min.set(minX,minY,minZ);this.max.set(maxX,maxY,maxZ);return this;}setFromPoints(points){this.makeEmpty();for(let i=0,il=points.length;i<il;i++){this.expandByPoint(points[i]);}return this;}setFromCenterAndSize(center,size){const halfSize=_vector$b.copy(size).multiplyScalar(0.5);this.min.copy(center).sub(halfSize);this.max.copy(center).add(halfSize);return this;}setFromObject(object,precise=false){this.makeEmpty();return this.expandByObject(object,precise);}clone(){return new this.constructor().copy(this);}copy(box){this.min.copy(box.min);this.max.copy(box.max);return this;}makeEmpty(){this.min.x=this.min.y=this.min.z=+Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this;}isEmpty(){// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\nreturn this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z;}getCenter(target){return this.isEmpty()?target.set(0,0,0):target.addVectors(this.min,this.max).multiplyScalar(0.5);}getSize(target){return this.isEmpty()?target.set(0,0,0):target.subVectors(this.max,this.min);}expandByPoint(point){this.min.min(point);this.max.max(point);return this;}expandByVector(vector){this.min.sub(vector);this.max.add(vector);return this;}expandByScalar(scalar){this.min.addScalar(-scalar);this.max.addScalar(scalar);return this;}expandByObject(object,precise=false){// Computes the world-axis-aligned bounding box of an object (including its children),\n// accounting for both the object's, and children's, world transforms\nobject.updateWorldMatrix(false,false);const geometry=object.geometry;if(geometry!==undefined){if(precise&&geometry.attributes!=undefined&&geometry.attributes.position!==undefined){const position=geometry.attributes.position;for(let i=0,l=position.count;i<l;i++){_vector$b.fromBufferAttribute(position,i).applyMatrix4(object.matrixWorld);this.expandByPoint(_vector$b);}}else{if(geometry.boundingBox===null){geometry.computeBoundingBox();}_box$3.copy(geometry.boundingBox);_box$3.applyMatrix4(object.matrixWorld);this.union(_box$3);}}const children=object.children;for(let i=0,l=children.length;i<l;i++){this.expandByObject(children[i],precise);}return this;}containsPoint(point){return point.x<this.min.x||point.x>this.max.x||point.y<this.min.y||point.y>this.max.y||point.z<this.min.z||point.z>this.max.z?false:true;}containsBox(box){return this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y&&this.min.z<=box.min.z&&box.max.z<=this.max.z;}getParameter(point,target){// This can potentially have a divide by zero if the box\n// has a size dimension of 0.\nreturn target.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y),(point.z-this.min.z)/(this.max.z-this.min.z));}intersectsBox(box){// using 6 splitting planes to rule out intersections.\nreturn box.max.x<this.min.x||box.min.x>this.max.x||box.max.y<this.min.y||box.min.y>this.max.y||box.max.z<this.min.z||box.min.z>this.max.z?false:true;}intersectsSphere(sphere){// Find the point on the AABB closest to the sphere center.\nthis.clampPoint(sphere.center,_vector$b);// If that point is inside the sphere, the AABB and sphere intersect.\nreturn _vector$b.distanceToSquared(sphere.center)<=sphere.radius*sphere.radius;}intersectsPlane(plane){// We compute the minimum and maximum dot product values. If those values\n// are on the same side (back or front) of the plane, then there is no intersection.\nlet min,max;if(plane.normal.x>0){min=plane.normal.x*this.min.x;max=plane.normal.x*this.max.x;}else{min=plane.normal.x*this.max.x;max=plane.normal.x*this.min.x;}if(plane.normal.y>0){min+=plane.normal.y*this.min.y;max+=plane.normal.y*this.max.y;}else{min+=plane.normal.y*this.max.y;max+=plane.normal.y*this.min.y;}if(plane.normal.z>0){min+=plane.normal.z*this.min.z;max+=plane.normal.z*this.max.z;}else{min+=plane.normal.z*this.max.z;max+=plane.normal.z*this.min.z;}return min<=-plane.constant&&max>=-plane.constant;}intersectsTriangle(triangle){if(this.isEmpty()){return false;}// compute box center and extents\nthis.getCenter(_center);_extents.subVectors(this.max,_center);// translate triangle to aabb origin\n_v0$2.subVectors(triangle.a,_center);_v1$7.subVectors(triangle.b,_center);_v2$4.subVectors(triangle.c,_center);// compute edge vectors for triangle\n_f0.subVectors(_v1$7,_v0$2);_f1.subVectors(_v2$4,_v1$7);_f2.subVectors(_v0$2,_v2$4);// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\nlet axes=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];if(!satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)){return false;}// test 3 face normals from the aabb\naxes=[1,0,0,0,1,0,0,0,1];if(!satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)){return false;}// finally testing the face normal of the triangle\n// use already existing triangle edge vectors here\n_triangleNormal.crossVectors(_f0,_f1);axes=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z];return satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents);}clampPoint(point,target){return target.copy(point).clamp(this.min,this.max);}distanceToPoint(point){const clampedPoint=_vector$b.copy(point).clamp(this.min,this.max);return clampedPoint.sub(point).length();}getBoundingSphere(target){this.getCenter(target.center);target.radius=this.getSize(_vector$b).length()*0.5;return target;}intersect(box){this.min.max(box.min);this.max.min(box.max);// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\nif(this.isEmpty())this.makeEmpty();return this;}union(box){this.min.min(box.min);this.max.max(box.max);return this;}applyMatrix4(matrix){// transform of empty box is an empty box.\nif(this.isEmpty())return this;// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(matrix);// 000\n_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(matrix);// 001\n_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(matrix);// 010\n_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(matrix);// 011\n_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(matrix);// 100\n_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(matrix);// 101\n_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(matrix);// 110\n_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(matrix);// 111\nthis.setFromPoints(_points);return this;}translate(offset){this.min.add(offset);this.max.add(offset);return this;}equals(box){return box.min.equals(this.min)&&box.max.equals(this.max);}}const _points=[/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3(),/*@__PURE__*/new three_module_Vector3()];const _vector$b=/*@__PURE__*/new three_module_Vector3();const _box$3=/*@__PURE__*/new Box3();// triangle centered vertices\nconst _v0$2=/*@__PURE__*/new three_module_Vector3();const _v1$7=/*@__PURE__*/new three_module_Vector3();const _v2$4=/*@__PURE__*/new three_module_Vector3();// triangle edge vectors\nconst _f0=/*@__PURE__*/new three_module_Vector3();const _f1=/*@__PURE__*/new three_module_Vector3();const _f2=/*@__PURE__*/new three_module_Vector3();const _center=/*@__PURE__*/new three_module_Vector3();const _extents=/*@__PURE__*/new three_module_Vector3();const _triangleNormal=/*@__PURE__*/new three_module_Vector3();const _testAxis=/*@__PURE__*/new three_module_Vector3();function satForAxes(axes,v0,v1,v2,extents){for(let i=0,j=axes.length-3;i<=j;i+=3){_testAxis.fromArray(axes,i);// project the aabb onto the separating axis\nconst r=extents.x*Math.abs(_testAxis.x)+extents.y*Math.abs(_testAxis.y)+extents.z*Math.abs(_testAxis.z);// project all 3 vertices of the triangle onto the separating axis\nconst p0=v0.dot(_testAxis);const p1=v1.dot(_testAxis);const p2=v2.dot(_testAxis);// actual test, basically see if either of the most extreme of the triangle points intersects r\nif(Math.max(-Math.max(p0,p1,p2),Math.min(p0,p1,p2))>r){// points of the projected triangle are outside the projected half-length of the aabb\n// the axis is separating and we can exit\nreturn false;}}return true;}const _box$2=/*@__PURE__*/new Box3();const _v1$6=/*@__PURE__*/new three_module_Vector3();const _v2$3=/*@__PURE__*/new three_module_Vector3();class Sphere{constructor(center=new three_module_Vector3(),radius=-1){this.center=center;this.radius=radius;}set(center,radius){this.center.copy(center);this.radius=radius;return this;}setFromPoints(points,optionalCenter){const center=this.center;if(optionalCenter!==undefined){center.copy(optionalCenter);}else{_box$2.setFromPoints(points).getCenter(center);}let maxRadiusSq=0;for(let i=0,il=points.length;i<il;i++){maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(points[i]));}this.radius=Math.sqrt(maxRadiusSq);return this;}copy(sphere){this.center.copy(sphere.center);this.radius=sphere.radius;return this;}isEmpty(){return this.radius<0;}makeEmpty(){this.center.set(0,0,0);this.radius=-1;return this;}containsPoint(point){return point.distanceToSquared(this.center)<=this.radius*this.radius;}distanceToPoint(point){return point.distanceTo(this.center)-this.radius;}intersectsSphere(sphere){const radiusSum=this.radius+sphere.radius;return sphere.center.distanceToSquared(this.center)<=radiusSum*radiusSum;}intersectsBox(box){return box.intersectsSphere(this);}intersectsPlane(plane){return Math.abs(plane.distanceToPoint(this.center))<=this.radius;}clampPoint(point,target){const deltaLengthSq=this.center.distanceToSquared(point);target.copy(point);if(deltaLengthSq>this.radius*this.radius){target.sub(this.center).normalize();target.multiplyScalar(this.radius).add(this.center);}return target;}getBoundingBox(target){if(this.isEmpty()){// Empty sphere produces empty bounding box\ntarget.makeEmpty();return target;}target.set(this.center,this.center);target.expandByScalar(this.radius);return target;}applyMatrix4(matrix){this.center.applyMatrix4(matrix);this.radius=this.radius*matrix.getMaxScaleOnAxis();return this;}translate(offset){this.center.add(offset);return this;}expandByPoint(point){if(this.isEmpty()){this.center.copy(point);this.radius=0;return this;}_v1$6.subVectors(point,this.center);const lengthSq=_v1$6.lengthSq();if(lengthSq>this.radius*this.radius){// calculate the minimal sphere\nconst length=Math.sqrt(lengthSq);const delta=(length-this.radius)*0.5;this.center.addScaledVector(_v1$6,delta/length);this.radius+=delta;}return this;}union(sphere){if(sphere.isEmpty()){return this;}if(this.isEmpty()){this.copy(sphere);return this;}if(this.center.equals(sphere.center)===true){this.radius=Math.max(this.radius,sphere.radius);}else{_v2$3.subVectors(sphere.center,this.center).setLength(sphere.radius);this.expandByPoint(_v1$6.copy(sphere.center).add(_v2$3));this.expandByPoint(_v1$6.copy(sphere.center).sub(_v2$3));}return this;}equals(sphere){return sphere.center.equals(this.center)&&sphere.radius===this.radius;}clone(){return new this.constructor().copy(this);}}const _vector$a=/*@__PURE__*/new three_module_Vector3();const _segCenter=/*@__PURE__*/new three_module_Vector3();const _segDir=/*@__PURE__*/new three_module_Vector3();const _diff=/*@__PURE__*/new three_module_Vector3();const _edge1=/*@__PURE__*/new three_module_Vector3();const _edge2=/*@__PURE__*/new three_module_Vector3();const _normal$1=/*@__PURE__*/new three_module_Vector3();class Ray{constructor(origin=new three_module_Vector3(),direction=new three_module_Vector3(0,0,-1)){this.origin=origin;this.direction=direction;}set(origin,direction){this.origin.copy(origin);this.direction.copy(direction);return this;}copy(ray){this.origin.copy(ray.origin);this.direction.copy(ray.direction);return this;}at(t,target){return target.copy(this.direction).multiplyScalar(t).add(this.origin);}lookAt(v){this.direction.copy(v).sub(this.origin).normalize();return this;}recast(t){var _context7;this.origin.copy(at(_context7=this).call(_context7,t,_vector$a));return this;}closestPointToPoint(point,target){target.subVectors(point,this.origin);const directionDistance=target.dot(this.direction);if(directionDistance<0){return target.copy(this.origin);}return target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);}distanceToPoint(point){return Math.sqrt(this.distanceSqToPoint(point));}distanceSqToPoint(point){const directionDistance=_vector$a.subVectors(point,this.origin).dot(this.direction);// point behind the ray\nif(directionDistance<0){return this.origin.distanceToSquared(point);}_vector$a.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);return _vector$a.distanceToSquared(point);}distanceSqToSegment(v0,v1,optionalPointOnRay,optionalPointOnSegment){// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n// It returns the min distance between the ray and the segment\n// defined by v0 and v1\n// It can also set two optional targets :\n// - The closest point on the ray\n// - The closest point on the segment\n_segCenter.copy(v0).add(v1).multiplyScalar(0.5);_segDir.copy(v1).sub(v0).normalize();_diff.copy(this.origin).sub(_segCenter);const segExtent=v0.distanceTo(v1)*0.5;const a01=-this.direction.dot(_segDir);const b0=_diff.dot(this.direction);const b1=-_diff.dot(_segDir);const c=_diff.lengthSq();const det=Math.abs(1-a01*a01);let s0,s1,sqrDist,extDet;if(det>0){// The ray and segment are not parallel.\ns0=a01*b1-b0;s1=a01*b0-b1;extDet=segExtent*det;if(s0>=0){if(s1>=-extDet){if(s1<=extDet){// region 0\n// Minimum at interior points of ray and segment.\nconst invDet=1/det;s0*=invDet;s1*=invDet;sqrDist=s0*(s0+a01*s1+2*b0)+s1*(a01*s0+s1+2*b1)+c;}else{// region 1\ns1=segExtent;s0=Math.max(0,-(a01*s1+b0));sqrDist=-s0*s0+s1*(s1+2*b1)+c;}}else{// region 5\ns1=-segExtent;s0=Math.max(0,-(a01*s1+b0));sqrDist=-s0*s0+s1*(s1+2*b1)+c;}}else{if(s1<=-extDet){// region 4\ns0=Math.max(0,-(-a01*segExtent+b0));s1=s0>0?-segExtent:Math.min(Math.max(-segExtent,-b1),segExtent);sqrDist=-s0*s0+s1*(s1+2*b1)+c;}else if(s1<=extDet){// region 3\ns0=0;s1=Math.min(Math.max(-segExtent,-b1),segExtent);sqrDist=s1*(s1+2*b1)+c;}else{// region 2\ns0=Math.max(0,-(a01*segExtent+b0));s1=s0>0?segExtent:Math.min(Math.max(-segExtent,-b1),segExtent);sqrDist=-s0*s0+s1*(s1+2*b1)+c;}}}else{// Ray and segment are parallel.\ns1=a01>0?-segExtent:segExtent;s0=Math.max(0,-(a01*s1+b0));sqrDist=-s0*s0+s1*(s1+2*b1)+c;}if(optionalPointOnRay){optionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);}if(optionalPointOnSegment){optionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);}return sqrDist;}intersectSphere(sphere,target){var _context8,_context9;_vector$a.subVectors(sphere.center,this.origin);const tca=_vector$a.dot(this.direction);const d2=_vector$a.dot(_vector$a)-tca*tca;const radius2=sphere.radius*sphere.radius;if(d2>radius2)return null;const thc=Math.sqrt(radius2-d2);// t0 = first intersect point - entrance on front of sphere\nconst t0=tca-thc;// t1 = second intersect point - exit point on back of sphere\nconst t1=tca+thc;// test to see if both t0 and t1 are behind the ray - if so, return null\nif(t0<0&&t1<0)return null;// test to see if t0 is behind the ray:\n// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n// in order to always return an intersect point that is in front of the ray.\nif(t0<0)return at(_context8=this).call(_context8,t1,target);// else t0 is in front of the ray, so return the first collision point scaled by t0\nreturn at(_context9=this).call(_context9,t0,target);}intersectsSphere(sphere){return this.distanceSqToPoint(sphere.center)<=sphere.radius*sphere.radius;}distanceToPlane(plane){const denominator=plane.normal.dot(this.direction);if(denominator===0){// line is coplanar, return origin\nif(plane.distanceToPoint(this.origin)===0){return 0;}// Null is preferable to undefined since undefined means.... it is undefined\nreturn null;}const t=-(this.origin.dot(plane.normal)+plane.constant)/denominator;// Return if the ray never intersects the plane\nreturn t>=0?t:null;}intersectPlane(plane,target){var _context10;const t=this.distanceToPlane(plane);if(t===null){return null;}return at(_context10=this).call(_context10,t,target);}intersectsPlane(plane){// check if the ray lies on the plane first\nconst distToPoint=plane.distanceToPoint(this.origin);if(distToPoint===0){return true;}const denominator=plane.normal.dot(this.direction);if(denominator*distToPoint<0){return true;}// ray origin is behind the plane (and is pointing behind it)\nreturn false;}intersectBox(box,target){var _context11;let tmin,tmax,tymin,tymax,tzmin,tzmax;const invdirx=1/this.direction.x,invdiry=1/this.direction.y,invdirz=1/this.direction.z;const origin=this.origin;if(invdirx>=0){tmin=(box.min.x-origin.x)*invdirx;tmax=(box.max.x-origin.x)*invdirx;}else{tmin=(box.max.x-origin.x)*invdirx;tmax=(box.min.x-origin.x)*invdirx;}if(invdiry>=0){tymin=(box.min.y-origin.y)*invdiry;tymax=(box.max.y-origin.y)*invdiry;}else{tymin=(box.max.y-origin.y)*invdiry;tymax=(box.min.y-origin.y)*invdiry;}if(tmin>tymax||tymin>tmax)return null;if(tymin>tmin||isNaN(tmin))tmin=tymin;if(tymax<tmax||isNaN(tmax))tmax=tymax;if(invdirz>=0){tzmin=(box.min.z-origin.z)*invdirz;tzmax=(box.max.z-origin.z)*invdirz;}else{tzmin=(box.max.z-origin.z)*invdirz;tzmax=(box.min.z-origin.z)*invdirz;}if(tmin>tzmax||tzmin>tmax)return null;if(tzmin>tmin||tmin!==tmin)tmin=tzmin;if(tzmax<tmax||tmax!==tmax)tmax=tzmax;//return point closest to the ray (positive side)\nif(tmax<0)return null;return at(_context11=this).call(_context11,tmin>=0?tmin:tmax,target);}intersectsBox(box){return this.intersectBox(box,_vector$a)!==null;}intersectTriangle(a,b,c,backfaceCulling,target){var _context12;// Compute the offset origin, edges, and normal.\n// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n_edge1.subVectors(b,a);_edge2.subVectors(c,a);_normal$1.crossVectors(_edge1,_edge2);// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\nlet DdN=this.direction.dot(_normal$1);let sign;if(DdN>0){if(backfaceCulling)return null;sign=1;}else if(DdN<0){sign=-1;DdN=-DdN;}else{return null;}_diff.subVectors(this.origin,a);const DdQxE2=sign*this.direction.dot(_edge2.crossVectors(_diff,_edge2));// b1 < 0, no intersection\nif(DdQxE2<0){return null;}const DdE1xQ=sign*this.direction.dot(_edge1.cross(_diff));// b2 < 0, no intersection\nif(DdE1xQ<0){return null;}// b1+b2 > 1, no intersection\nif(DdQxE2+DdE1xQ>DdN){return null;}// Line intersects triangle, check if ray does.\nconst QdN=-sign*_diff.dot(_normal$1);// t < 0, no intersection\nif(QdN<0){return null;}// Ray intersects triangle.\nreturn at(_context12=this).call(_context12,QdN/DdN,target);}applyMatrix4(matrix4){this.origin.applyMatrix4(matrix4);this.direction.transformDirection(matrix4);return this;}equals(ray){return ray.origin.equals(this.origin)&&ray.direction.equals(this.direction);}clone(){return new this.constructor().copy(this);}}class Matrix4{constructor(){Matrix4.prototype.isMatrix4=true;this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];}set(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44){const te=this.elements;te[0]=n11;te[4]=n12;te[8]=n13;te[12]=n14;te[1]=n21;te[5]=n22;te[9]=n23;te[13]=n24;te[2]=n31;te[6]=n32;te[10]=n33;te[14]=n34;te[3]=n41;te[7]=n42;te[11]=n43;te[15]=n44;return this;}identity(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this;}clone(){return new Matrix4().fromArray(this.elements);}copy(m){const te=this.elements;const me=m.elements;te[0]=me[0];te[1]=me[1];te[2]=me[2];te[3]=me[3];te[4]=me[4];te[5]=me[5];te[6]=me[6];te[7]=me[7];te[8]=me[8];te[9]=me[9];te[10]=me[10];te[11]=me[11];te[12]=me[12];te[13]=me[13];te[14]=me[14];te[15]=me[15];return this;}copyPosition(m){const te=this.elements,me=m.elements;te[12]=me[12];te[13]=me[13];te[14]=me[14];return this;}setFromMatrix3(m){const me=m.elements;this.set(me[0],me[3],me[6],0,me[1],me[4],me[7],0,me[2],me[5],me[8],0,0,0,0,1);return this;}extractBasis(xAxis,yAxis,zAxis){xAxis.setFromMatrixColumn(this,0);yAxis.setFromMatrixColumn(this,1);zAxis.setFromMatrixColumn(this,2);return this;}makeBasis(xAxis,yAxis,zAxis){this.set(xAxis.x,yAxis.x,zAxis.x,0,xAxis.y,yAxis.y,zAxis.y,0,xAxis.z,yAxis.z,zAxis.z,0,0,0,0,1);return this;}extractRotation(m){// this method does not support reflection matrices\nconst te=this.elements;const me=m.elements;const scaleX=1/_v1$5.setFromMatrixColumn(m,0).length();const scaleY=1/_v1$5.setFromMatrixColumn(m,1).length();const scaleZ=1/_v1$5.setFromMatrixColumn(m,2).length();te[0]=me[0]*scaleX;te[1]=me[1]*scaleX;te[2]=me[2]*scaleX;te[3]=0;te[4]=me[4]*scaleY;te[5]=me[5]*scaleY;te[6]=me[6]*scaleY;te[7]=0;te[8]=me[8]*scaleZ;te[9]=me[9]*scaleZ;te[10]=me[10]*scaleZ;te[11]=0;te[12]=0;te[13]=0;te[14]=0;te[15]=1;return this;}makeRotationFromEuler(euler){const te=this.elements;const x=euler.x,y=euler.y,z=euler.z;const a=Math.cos(x),b=Math.sin(x);const c=Math.cos(y),d=Math.sin(y);const e=Math.cos(z),f=Math.sin(z);if(euler.order==='XYZ'){const ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e;te[4]=-c*f;te[8]=d;te[1]=af+be*d;te[5]=ae-bf*d;te[9]=-b*c;te[2]=bf-ae*d;te[6]=be+af*d;te[10]=a*c;}else if(euler.order==='YXZ'){const ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce+df*b;te[4]=de*b-cf;te[8]=a*d;te[1]=a*f;te[5]=a*e;te[9]=-b;te[2]=cf*b-de;te[6]=df+ce*b;te[10]=a*c;}else if(euler.order==='ZXY'){const ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce-df*b;te[4]=-a*f;te[8]=de+cf*b;te[1]=cf+de*b;te[5]=a*e;te[9]=df-ce*b;te[2]=-a*d;te[6]=b;te[10]=a*c;}else if(euler.order==='ZYX'){const ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e;te[4]=be*d-af;te[8]=ae*d+bf;te[1]=c*f;te[5]=bf*d+ae;te[9]=af*d-be;te[2]=-d;te[6]=b*c;te[10]=a*c;}else if(euler.order==='YZX'){const ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e;te[4]=bd-ac*f;te[8]=bc*f+ad;te[1]=f;te[5]=a*e;te[9]=-b*e;te[2]=-d*e;te[6]=ad*f+bc;te[10]=ac-bd*f;}else if(euler.order==='XZY'){const ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e;te[4]=-f;te[8]=d*e;te[1]=ac*f+bd;te[5]=a*e;te[9]=ad*f-bc;te[2]=bc*f-ad;te[6]=b*e;te[10]=bd*f+ac;}// bottom row\nte[3]=0;te[7]=0;te[11]=0;// last column\nte[12]=0;te[13]=0;te[14]=0;te[15]=1;return this;}makeRotationFromQuaternion(q){return this.compose(_zero,q,_one);}lookAt(eye,target,up){const te=this.elements;_z.subVectors(eye,target);if(_z.lengthSq()===0){// eye and target are in the same position\n_z.z=1;}_z.normalize();_x.crossVectors(up,_z);if(_x.lengthSq()===0){// up and z are parallel\nif(Math.abs(up.z)===1){_z.x+=0.0001;}else{_z.z+=0.0001;}_z.normalize();_x.crossVectors(up,_z);}_x.normalize();_y.crossVectors(_z,_x);te[0]=_x.x;te[4]=_y.x;te[8]=_z.x;te[1]=_x.y;te[5]=_y.y;te[9]=_z.y;te[2]=_x.z;te[6]=_y.z;te[10]=_z.z;return this;}multiply(m){return this.multiplyMatrices(this,m);}premultiply(m){return this.multiplyMatrices(m,this);}multiplyMatrices(a,b){const ae=a.elements;const be=b.elements;const te=this.elements;const a11=ae[0],a12=ae[4],a13=ae[8],a14=ae[12];const a21=ae[1],a22=ae[5],a23=ae[9],a24=ae[13];const a31=ae[2],a32=ae[6],a33=ae[10],a34=ae[14];const a41=ae[3],a42=ae[7],a43=ae[11],a44=ae[15];const b11=be[0],b12=be[4],b13=be[8],b14=be[12];const b21=be[1],b22=be[5],b23=be[9],b24=be[13];const b31=be[2],b32=be[6],b33=be[10],b34=be[14];const b41=be[3],b42=be[7],b43=be[11],b44=be[15];te[0]=a11*b11+a12*b21+a13*b31+a14*b41;te[4]=a11*b12+a12*b22+a13*b32+a14*b42;te[8]=a11*b13+a12*b23+a13*b33+a14*b43;te[12]=a11*b14+a12*b24+a13*b34+a14*b44;te[1]=a21*b11+a22*b21+a23*b31+a24*b41;te[5]=a21*b12+a22*b22+a23*b32+a24*b42;te[9]=a21*b13+a22*b23+a23*b33+a24*b43;te[13]=a21*b14+a22*b24+a23*b34+a24*b44;te[2]=a31*b11+a32*b21+a33*b31+a34*b41;te[6]=a31*b12+a32*b22+a33*b32+a34*b42;te[10]=a31*b13+a32*b23+a33*b33+a34*b43;te[14]=a31*b14+a32*b24+a33*b34+a34*b44;te[3]=a41*b11+a42*b21+a43*b31+a44*b41;te[7]=a41*b12+a42*b22+a43*b32+a44*b42;te[11]=a41*b13+a42*b23+a43*b33+a44*b43;te[15]=a41*b14+a42*b24+a43*b34+a44*b44;return this;}multiplyScalar(s){const te=this.elements;te[0]*=s;te[4]*=s;te[8]*=s;te[12]*=s;te[1]*=s;te[5]*=s;te[9]*=s;te[13]*=s;te[2]*=s;te[6]*=s;te[10]*=s;te[14]*=s;te[3]*=s;te[7]*=s;te[11]*=s;te[15]*=s;return this;}determinant(){const te=this.elements;const n11=te[0],n12=te[4],n13=te[8],n14=te[12];const n21=te[1],n22=te[5],n23=te[9],n24=te[13];const n31=te[2],n32=te[6],n33=te[10],n34=te[14];const n41=te[3],n42=te[7],n43=te[11],n44=te[15];//TODO: make this more efficient\n//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\nreturn n41*(+n14*n23*n32-n13*n24*n32-n14*n22*n33+n12*n24*n33+n13*n22*n34-n12*n23*n34)+n42*(+n11*n23*n34-n11*n24*n33+n14*n21*n33-n13*n21*n34+n13*n24*n31-n14*n23*n31)+n43*(+n11*n24*n32-n11*n22*n34-n14*n21*n32+n12*n21*n34+n14*n22*n31-n12*n24*n31)+n44*(-n13*n22*n31-n11*n23*n32+n11*n22*n33+n13*n21*n32-n12*n21*n33+n12*n23*n31);}transpose(){const te=this.elements;let tmp;tmp=te[1];te[1]=te[4];te[4]=tmp;tmp=te[2];te[2]=te[8];te[8]=tmp;tmp=te[6];te[6]=te[9];te[9]=tmp;tmp=te[3];te[3]=te[12];te[12]=tmp;tmp=te[7];te[7]=te[13];te[13]=tmp;tmp=te[11];te[11]=te[14];te[14]=tmp;return this;}setPosition(x,y,z){const te=this.elements;if(x.isVector3){te[12]=x.x;te[13]=x.y;te[14]=x.z;}else{te[12]=x;te[13]=y;te[14]=z;}return this;}invert(){// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\nconst te=this.elements,n11=te[0],n21=te[1],n31=te[2],n41=te[3],n12=te[4],n22=te[5],n32=te[6],n42=te[7],n13=te[8],n23=te[9],n33=te[10],n43=te[11],n14=te[12],n24=te[13],n34=te[14],n44=te[15],t11=n23*n34*n42-n24*n33*n42+n24*n32*n43-n22*n34*n43-n23*n32*n44+n22*n33*n44,t12=n14*n33*n42-n13*n34*n42-n14*n32*n43+n12*n34*n43+n13*n32*n44-n12*n33*n44,t13=n13*n24*n42-n14*n23*n42+n14*n22*n43-n12*n24*n43-n13*n22*n44+n12*n23*n44,t14=n14*n23*n32-n13*n24*n32-n14*n22*n33+n12*n24*n33+n13*n22*n34-n12*n23*n34;const det=n11*t11+n21*t12+n31*t13+n41*t14;if(det===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const detInv=1/det;te[0]=t11*detInv;te[1]=(n24*n33*n41-n23*n34*n41-n24*n31*n43+n21*n34*n43+n23*n31*n44-n21*n33*n44)*detInv;te[2]=(n22*n34*n41-n24*n32*n41+n24*n31*n42-n21*n34*n42-n22*n31*n44+n21*n32*n44)*detInv;te[3]=(n23*n32*n41-n22*n33*n41-n23*n31*n42+n21*n33*n42+n22*n31*n43-n21*n32*n43)*detInv;te[4]=t12*detInv;te[5]=(n13*n34*n41-n14*n33*n41+n14*n31*n43-n11*n34*n43-n13*n31*n44+n11*n33*n44)*detInv;te[6]=(n14*n32*n41-n12*n34*n41-n14*n31*n42+n11*n34*n42+n12*n31*n44-n11*n32*n44)*detInv;te[7]=(n12*n33*n41-n13*n32*n41+n13*n31*n42-n11*n33*n42-n12*n31*n43+n11*n32*n43)*detInv;te[8]=t13*detInv;te[9]=(n14*n23*n41-n13*n24*n41-n14*n21*n43+n11*n24*n43+n13*n21*n44-n11*n23*n44)*detInv;te[10]=(n12*n24*n41-n14*n22*n41+n14*n21*n42-n11*n24*n42-n12*n21*n44+n11*n22*n44)*detInv;te[11]=(n13*n22*n41-n12*n23*n41-n13*n21*n42+n11*n23*n42+n12*n21*n43-n11*n22*n43)*detInv;te[12]=t14*detInv;te[13]=(n13*n24*n31-n14*n23*n31+n14*n21*n33-n11*n24*n33-n13*n21*n34+n11*n23*n34)*detInv;te[14]=(n14*n22*n31-n12*n24*n31-n14*n21*n32+n11*n24*n32+n12*n21*n34-n11*n22*n34)*detInv;te[15]=(n12*n23*n31-n13*n22*n31+n13*n21*n32-n11*n23*n32-n12*n21*n33+n11*n22*n33)*detInv;return this;}scale(v){const te=this.elements;const x=v.x,y=v.y,z=v.z;te[0]*=x;te[4]*=y;te[8]*=z;te[1]*=x;te[5]*=y;te[9]*=z;te[2]*=x;te[6]*=y;te[10]*=z;te[3]*=x;te[7]*=y;te[11]*=z;return this;}getMaxScaleOnAxis(){const te=this.elements;const scaleXSq=te[0]*te[0]+te[1]*te[1]+te[2]*te[2];const scaleYSq=te[4]*te[4]+te[5]*te[5]+te[6]*te[6];const scaleZSq=te[8]*te[8]+te[9]*te[9]+te[10]*te[10];return Math.sqrt(Math.max(scaleXSq,scaleYSq,scaleZSq));}makeTranslation(x,y,z){this.set(1,0,0,x,0,1,0,y,0,0,1,z,0,0,0,1);return this;}makeRotationX(theta){const c=Math.cos(theta),s=Math.sin(theta);this.set(1,0,0,0,0,c,-s,0,0,s,c,0,0,0,0,1);return this;}makeRotationY(theta){const c=Math.cos(theta),s=Math.sin(theta);this.set(c,0,s,0,0,1,0,0,-s,0,c,0,0,0,0,1);return this;}makeRotationZ(theta){const c=Math.cos(theta),s=Math.sin(theta);this.set(c,-s,0,0,s,c,0,0,0,0,1,0,0,0,0,1);return this;}makeRotationAxis(axis,angle){// Based on http://www.gamedev.net/reference/articles/article1199.asp\nconst c=Math.cos(angle);const s=Math.sin(angle);const t=1-c;const x=axis.x,y=axis.y,z=axis.z;const tx=t*x,ty=t*y;this.set(tx*x+c,tx*y-s*z,tx*z+s*y,0,tx*y+s*z,ty*y+c,ty*z-s*x,0,tx*z-s*y,ty*z+s*x,t*z*z+c,0,0,0,0,1);return this;}makeScale(x,y,z){this.set(x,0,0,0,0,y,0,0,0,0,z,0,0,0,0,1);return this;}makeShear(xy,xz,yx,yz,zx,zy){this.set(1,yx,zx,0,xy,1,zy,0,xz,yz,1,0,0,0,0,1);return this;}compose(position,quaternion,scale){const te=this.elements;const x=quaternion._x,y=quaternion._y,z=quaternion._z,w=quaternion._w;const x2=x+x,y2=y+y,z2=z+z;const xx=x*x2,xy=x*y2,xz=x*z2;const yy=y*y2,yz=y*z2,zz=z*z2;const wx=w*x2,wy=w*y2,wz=w*z2;const sx=scale.x,sy=scale.y,sz=scale.z;te[0]=(1-(yy+zz))*sx;te[1]=(xy+wz)*sx;te[2]=(xz-wy)*sx;te[3]=0;te[4]=(xy-wz)*sy;te[5]=(1-(xx+zz))*sy;te[6]=(yz+wx)*sy;te[7]=0;te[8]=(xz+wy)*sz;te[9]=(yz-wx)*sz;te[10]=(1-(xx+yy))*sz;te[11]=0;te[12]=position.x;te[13]=position.y;te[14]=position.z;te[15]=1;return this;}decompose(position,quaternion,scale){const te=this.elements;let sx=_v1$5.set(te[0],te[1],te[2]).length();const sy=_v1$5.set(te[4],te[5],te[6]).length();const sz=_v1$5.set(te[8],te[9],te[10]).length();// if determine is negative, we need to invert one scale\nconst det=this.determinant();if(det<0)sx=-sx;position.x=te[12];position.y=te[13];position.z=te[14];// scale the rotation part\n_m1$2.copy(this);const invSX=1/sx;const invSY=1/sy;const invSZ=1/sz;_m1$2.elements[0]*=invSX;_m1$2.elements[1]*=invSX;_m1$2.elements[2]*=invSX;_m1$2.elements[4]*=invSY;_m1$2.elements[5]*=invSY;_m1$2.elements[6]*=invSY;_m1$2.elements[8]*=invSZ;_m1$2.elements[9]*=invSZ;_m1$2.elements[10]*=invSZ;quaternion.setFromRotationMatrix(_m1$2);scale.x=sx;scale.y=sy;scale.z=sz;return this;}makePerspective(left,right,top,bottom,near,far){const te=this.elements;const x=2*near/(right-left);const y=2*near/(top-bottom);const a=(right+left)/(right-left);const b=(top+bottom)/(top-bottom);const c=-(far+near)/(far-near);const d=-2*far*near/(far-near);te[0]=x;te[4]=0;te[8]=a;te[12]=0;te[1]=0;te[5]=y;te[9]=b;te[13]=0;te[2]=0;te[6]=0;te[10]=c;te[14]=d;te[3]=0;te[7]=0;te[11]=-1;te[15]=0;return this;}makeOrthographic(left,right,top,bottom,near,far){const te=this.elements;const w=1.0/(right-left);const h=1.0/(top-bottom);const p=1.0/(far-near);const x=(right+left)*w;const y=(top+bottom)*h;const z=(far+near)*p;te[0]=2*w;te[4]=0;te[8]=0;te[12]=-x;te[1]=0;te[5]=2*h;te[9]=0;te[13]=-y;te[2]=0;te[6]=0;te[10]=-2*p;te[14]=-z;te[3]=0;te[7]=0;te[11]=0;te[15]=1;return this;}equals(matrix){const te=this.elements;const me=matrix.elements;for(let i=0;i<16;i++){if(te[i]!==me[i])return false;}return true;}fromArray(array,offset=0){for(let i=0;i<16;i++){this.elements[i]=array[i+offset];}return this;}toArray(array=[],offset=0){const te=this.elements;array[offset]=te[0];array[offset+1]=te[1];array[offset+2]=te[2];array[offset+3]=te[3];array[offset+4]=te[4];array[offset+5]=te[5];array[offset+6]=te[6];array[offset+7]=te[7];array[offset+8]=te[8];array[offset+9]=te[9];array[offset+10]=te[10];array[offset+11]=te[11];array[offset+12]=te[12];array[offset+13]=te[13];array[offset+14]=te[14];array[offset+15]=te[15];return array;}}const _v1$5=/*@__PURE__*/new three_module_Vector3();const _m1$2=/*@__PURE__*/new Matrix4();const _zero=/*@__PURE__*/new three_module_Vector3(0,0,0);const _one=/*@__PURE__*/new three_module_Vector3(1,1,1);const _x=/*@__PURE__*/new three_module_Vector3();const _y=/*@__PURE__*/new three_module_Vector3();const _z=/*@__PURE__*/new three_module_Vector3();const _matrix$1=/*@__PURE__*/new Matrix4();const _quaternion$3=/*@__PURE__*/new three_module_Quaternion();class Euler{constructor(x=0,y=0,z=0,order=Euler.DefaultOrder){this.isEuler=true;this._x=x;this._y=y;this._z=z;this._order=order;}get x(){return this._x;}set x(value){this._x=value;this._onChangeCallback();}get y(){return this._y;}set y(value){this._y=value;this._onChangeCallback();}get z(){return this._z;}set z(value){this._z=value;this._onChangeCallback();}get order(){return this._order;}set order(value){this._order=value;this._onChangeCallback();}set(x,y,z,order=this._order){this._x=x;this._y=y;this._z=z;this._order=order;this._onChangeCallback();return this;}clone(){return new this.constructor(this._x,this._y,this._z,this._order);}copy(euler){this._x=euler._x;this._y=euler._y;this._z=euler._z;this._order=euler._order;this._onChangeCallback();return this;}setFromRotationMatrix(m,order=this._order,update=true){// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\nconst te=m.elements;const m11=te[0],m12=te[4],m13=te[8];const m21=te[1],m22=te[5],m23=te[9];const m31=te[2],m32=te[6],m33=te[10];switch(order){case'XYZ':this._y=Math.asin(three_module_clamp(m13,-1,1));if(Math.abs(m13)<0.9999999){this._x=Math.atan2(-m23,m33);this._z=Math.atan2(-m12,m11);}else{this._x=Math.atan2(m32,m22);this._z=0;}break;case'YXZ':this._x=Math.asin(-three_module_clamp(m23,-1,1));if(Math.abs(m23)<0.9999999){this._y=Math.atan2(m13,m33);this._z=Math.atan2(m21,m22);}else{this._y=Math.atan2(-m31,m11);this._z=0;}break;case'ZXY':this._x=Math.asin(three_module_clamp(m32,-1,1));if(Math.abs(m32)<0.9999999){this._y=Math.atan2(-m31,m33);this._z=Math.atan2(-m12,m22);}else{this._y=0;this._z=Math.atan2(m21,m11);}break;case'ZYX':this._y=Math.asin(-three_module_clamp(m31,-1,1));if(Math.abs(m31)<0.9999999){this._x=Math.atan2(m32,m33);this._z=Math.atan2(m21,m11);}else{this._x=0;this._z=Math.atan2(-m12,m22);}break;case'YZX':this._z=Math.asin(three_module_clamp(m21,-1,1));if(Math.abs(m21)<0.9999999){this._x=Math.atan2(-m23,m22);this._y=Math.atan2(-m31,m11);}else{this._x=0;this._y=Math.atan2(m13,m33);}break;case'XZY':this._z=Math.asin(-three_module_clamp(m12,-1,1));if(Math.abs(m12)<0.9999999){this._x=Math.atan2(m32,m22);this._y=Math.atan2(m13,m11);}else{this._x=Math.atan2(-m23,m33);this._y=0;}break;default:console.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: '+order);}this._order=order;if(update===true)this._onChangeCallback();return this;}setFromQuaternion(q,order,update){_matrix$1.makeRotationFromQuaternion(q);return this.setFromRotationMatrix(_matrix$1,order,update);}setFromVector3(v,order=this._order){return this.set(v.x,v.y,v.z,order);}reorder(newOrder){// WARNING: this discards revolution information -bhouston\n_quaternion$3.setFromEuler(this);return this.setFromQuaternion(_quaternion$3,newOrder);}equals(euler){return euler._x===this._x&&euler._y===this._y&&euler._z===this._z&&euler._order===this._order;}fromArray(array){this._x=array[0];this._y=array[1];this._z=array[2];if(array[3]!==undefined)this._order=array[3];this._onChangeCallback();return this;}toArray(array=[],offset=0){array[offset]=this._x;array[offset+1]=this._y;array[offset+2]=this._z;array[offset+3]=this._order;return array;}_onChange(callback){this._onChangeCallback=callback;return this;}_onChangeCallback(){}*[iterator](){yield this._x;yield this._y;yield this._z;yield this._order;}// @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\ntoVector3(){console.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');}}Euler.DefaultOrder='XYZ';Euler.RotationOrders=['XYZ','YZX','ZXY','XZY','YXZ','ZYX'];class Layers{constructor(){this.mask=1|0;}set(channel){this.mask=(1<<channel|0)>>>0;}enable(channel){this.mask|=1<<channel|0;}enableAll(){this.mask=0xffffffff|0;}toggle(channel){this.mask^=1<<channel|0;}disable(channel){this.mask&=~(1<<channel|0);}disableAll(){this.mask=0;}test(layers){return(this.mask&layers.mask)!==0;}isEnabled(channel){return(this.mask&(1<<channel|0))!==0;}}let _object3DId=0;const _v1$4=/*@__PURE__*/new three_module_Vector3();const _q1=/*@__PURE__*/new three_module_Quaternion();const _m1$1=/*@__PURE__*/new Matrix4();const _target=/*@__PURE__*/new three_module_Vector3();const _position$3=/*@__PURE__*/new three_module_Vector3();const _scale$2=/*@__PURE__*/new three_module_Vector3();const _quaternion$2=/*@__PURE__*/new three_module_Quaternion();const _xAxis=/*@__PURE__*/new three_module_Vector3(1,0,0);const _yAxis=/*@__PURE__*/new three_module_Vector3(0,1,0);const _zAxis=/*@__PURE__*/new three_module_Vector3(0,0,1);const _addedEvent={type:'added'};const _removedEvent={type:'removed'};class Object3D extends EventDispatcher{constructor(){super();this.isObject3D=true;define_property(this,'id',{value:_object3DId++});this.uuid=three_module_generateUUID();this.name='';this.type='Object3D';this.parent=null;this.children=[];this.up=Object3D.DefaultUp.clone();const position=new three_module_Vector3();const rotation=new Euler();const quaternion=new three_module_Quaternion();const scale=new three_module_Vector3(1,1,1);function onRotationChange(){quaternion.setFromEuler(rotation,false);}function onQuaternionChange(){rotation.setFromQuaternion(quaternion,undefined,false);}rotation._onChange(onRotationChange);quaternion._onChange(onQuaternionChange);define_properties(this,{position:{configurable:true,enumerable:true,value:position},rotation:{configurable:true,enumerable:true,value:rotation},quaternion:{configurable:true,enumerable:true,value:quaternion},scale:{configurable:true,enumerable:true,value:scale},modelViewMatrix:{value:new Matrix4()},normalMatrix:{value:new Matrix3()}});this.matrix=new Matrix4();this.matrixWorld=new Matrix4();this.matrixAutoUpdate=Object3D.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=false;this.matrixWorldAutoUpdate=Object3D.DefaultMatrixWorldAutoUpdate;// checked by the renderer\nthis.layers=new Layers();this.visible=true;this.castShadow=false;this.receiveShadow=false;this.frustumCulled=true;this.renderOrder=0;this.animations=[];this.userData={};}onBeforeRender(){}onAfterRender(){}applyMatrix4(matrix){if(this.matrixAutoUpdate)this.updateMatrix();this.matrix.premultiply(matrix);this.matrix.decompose(this.position,this.quaternion,this.scale);}applyQuaternion(q){this.quaternion.premultiply(q);return this;}setRotationFromAxisAngle(axis,angle){// assumes axis is normalized\nthis.quaternion.setFromAxisAngle(axis,angle);}setRotationFromEuler(euler){this.quaternion.setFromEuler(euler,true);}setRotationFromMatrix(m){// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\nthis.quaternion.setFromRotationMatrix(m);}setRotationFromQuaternion(q){// assumes q is normalized\nthis.quaternion.copy(q);}rotateOnAxis(axis,angle){// rotate object on axis in object space\n// axis is assumed to be normalized\n_q1.setFromAxisAngle(axis,angle);this.quaternion.multiply(_q1);return this;}rotateOnWorldAxis(axis,angle){// rotate object on axis in world space\n// axis is assumed to be normalized\n// method assumes no rotated parent\n_q1.setFromAxisAngle(axis,angle);this.quaternion.premultiply(_q1);return this;}rotateX(angle){return this.rotateOnAxis(_xAxis,angle);}rotateY(angle){return this.rotateOnAxis(_yAxis,angle);}rotateZ(angle){return this.rotateOnAxis(_zAxis,angle);}translateOnAxis(axis,distance){// translate object by distance along axis in object space\n// axis is assumed to be normalized\n_v1$4.copy(axis).applyQuaternion(this.quaternion);this.position.add(_v1$4.multiplyScalar(distance));return this;}translateX(distance){return this.translateOnAxis(_xAxis,distance);}translateY(distance){return this.translateOnAxis(_yAxis,distance);}translateZ(distance){return this.translateOnAxis(_zAxis,distance);}localToWorld(vector){return vector.applyMatrix4(this.matrixWorld);}worldToLocal(vector){return vector.applyMatrix4(_m1$1.copy(this.matrixWorld).invert());}lookAt(x,y,z){// This method does not support objects having non-uniformly-scaled parent(s)\nif(x.isVector3){_target.copy(x);}else{_target.set(x,y,z);}const parent=this.parent;this.updateWorldMatrix(true,false);_position$3.setFromMatrixPosition(this.matrixWorld);if(this.isCamera||this.isLight){_m1$1.lookAt(_position$3,_target,this.up);}else{_m1$1.lookAt(_target,_position$3,this.up);}this.quaternion.setFromRotationMatrix(_m1$1);if(parent){_m1$1.extractRotation(parent.matrixWorld);_q1.setFromRotationMatrix(_m1$1);this.quaternion.premultiply(_q1.invert());}}add(object){if(arguments.length>1){for(let i=0;i<arguments.length;i++){this.add(arguments[i]);}return this;}if(object===this){console.error('THREE.Object3D.add: object can\\'t be added as a child of itself.',object);return this;}if(object&&object.isObject3D){if(object.parent!==null){object.parent.remove(object);}object.parent=this;this.children.push(object);object.dispatchEvent(_addedEvent);}else{console.error('THREE.Object3D.add: object not an instance of THREE.Object3D.',object);}return this;}remove(object){var _context13;if(arguments.length>1){for(let i=0;i<arguments.length;i++){this.remove(arguments[i]);}return this;}const index=index_of(_context13=this.children).call(_context13,object);if(index!==-1){var _context14;object.parent=null;splice(_context14=this.children).call(_context14,index,1);object.dispatchEvent(_removedEvent);}return this;}removeFromParent(){const parent=this.parent;if(parent!==null){parent.remove(this);}return this;}clear(){for(let i=0;i<this.children.length;i++){const object=this.children[i];object.parent=null;object.dispatchEvent(_removedEvent);}this.children.length=0;return this;}attach(object){// adds object as a child of this, while maintaining the object's world transform\n// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)\nthis.updateWorldMatrix(true,false);_m1$1.copy(this.matrixWorld).invert();if(object.parent!==null){object.parent.updateWorldMatrix(true,false);_m1$1.multiply(object.parent.matrixWorld);}object.applyMatrix4(_m1$1);this.add(object);object.updateWorldMatrix(false,true);return this;}getObjectById(id){return this.getObjectByProperty('id',id);}getObjectByName(name){return this.getObjectByProperty('name',name);}getObjectByProperty(name,value){if(this[name]===value)return this;for(let i=0,l=this.children.length;i<l;i++){const child=this.children[i];const object=child.getObjectByProperty(name,value);if(object!==undefined){return object;}}return undefined;}getWorldPosition(target){this.updateWorldMatrix(true,false);return target.setFromMatrixPosition(this.matrixWorld);}getWorldQuaternion(target){this.updateWorldMatrix(true,false);this.matrixWorld.decompose(_position$3,target,_scale$2);return target;}getWorldScale(target){this.updateWorldMatrix(true,false);this.matrixWorld.decompose(_position$3,_quaternion$2,target);return target;}getWorldDirection(target){this.updateWorldMatrix(true,false);const e=this.matrixWorld.elements;return target.set(e[8],e[9],e[10]).normalize();}raycast(){}traverse(callback){callback(this);const children=this.children;for(let i=0,l=children.length;i<l;i++){children[i].traverse(callback);}}traverseVisible(callback){if(this.visible===false)return;callback(this);const children=this.children;for(let i=0,l=children.length;i<l;i++){children[i].traverseVisible(callback);}}traverseAncestors(callback){const parent=this.parent;if(parent!==null){callback(parent);parent.traverseAncestors(callback);}}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=true;}updateMatrixWorld(force){if(this.matrixAutoUpdate)this.updateMatrix();if(this.matrixWorldNeedsUpdate||force){if(this.parent===null){this.matrixWorld.copy(this.matrix);}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);}this.matrixWorldNeedsUpdate=false;force=true;}// update children\nconst children=this.children;for(let i=0,l=children.length;i<l;i++){const child=children[i];if(child.matrixWorldAutoUpdate===true||force===true){child.updateMatrixWorld(force);}}}updateWorldMatrix(updateParents,updateChildren){const parent=this.parent;if(updateParents===true&&parent!==null&&parent.matrixWorldAutoUpdate===true){parent.updateWorldMatrix(true,false);}if(this.matrixAutoUpdate)this.updateMatrix();if(this.parent===null){this.matrixWorld.copy(this.matrix);}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);}// update children\nif(updateChildren===true){const children=this.children;for(let i=0,l=children.length;i<l;i++){const child=children[i];if(child.matrixWorldAutoUpdate===true){child.updateWorldMatrix(false,true);}}}}toJSON(meta){// meta is a string when called from JSON.stringify\nconst isRootObject=meta===undefined||typeof meta==='string';const output={};// meta is a hash used to collect geometries, materials.\n// not providing it implies that this is the root object\n// being serialized.\nif(isRootObject){// initialize meta obj\nmeta={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}};output.metadata={version:4.5,type:'Object',generator:'Object3D.toJSON'};}// standard Object3D serialization\nconst object={};object.uuid=this.uuid;object.type=this.type;if(this.name!=='')object.name=this.name;if(this.castShadow===true)object.castShadow=true;if(this.receiveShadow===true)object.receiveShadow=true;if(this.visible===false)object.visible=false;if(this.frustumCulled===false)object.frustumCulled=false;if(this.renderOrder!==0)object.renderOrder=this.renderOrder;if(stringify(this.userData)!=='{}')object.userData=this.userData;object.layers=this.layers.mask;object.matrix=this.matrix.toArray();if(this.matrixAutoUpdate===false)object.matrixAutoUpdate=false;// object specific properties\nif(this.isInstancedMesh){object.type='InstancedMesh';object.count=this.count;object.instanceMatrix=this.instanceMatrix.toJSON();if(this.instanceColor!==null)object.instanceColor=this.instanceColor.toJSON();}//\nfunction serialize(library,element){if(library[element.uuid]===undefined){library[element.uuid]=element.toJSON(meta);}return element.uuid;}if(this.isScene){if(this.background){if(this.background.isColor){object.background=this.background.toJSON();}else if(this.background.isTexture){object.background=this.background.toJSON(meta).uuid;}}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==true){object.environment=this.environment.toJSON(meta).uuid;}}else if(this.isMesh||this.isLine||this.isPoints){object.geometry=serialize(meta.geometries,this.geometry);const parameters=this.geometry.parameters;if(parameters!==undefined&&parameters.shapes!==undefined){const shapes=parameters.shapes;if(is_array(shapes)){for(let i=0,l=shapes.length;i<l;i++){const shape=shapes[i];serialize(meta.shapes,shape);}}else{serialize(meta.shapes,shapes);}}}if(this.isSkinnedMesh){object.bindMode=this.bindMode;object.bindMatrix=this.bindMatrix.toArray();if(this.skeleton!==undefined){serialize(meta.skeletons,this.skeleton);object.skeleton=this.skeleton.uuid;}}if(this.material!==undefined){if(is_array(this.material)){const uuids=[];for(let i=0,l=this.material.length;i<l;i++){uuids.push(serialize(meta.materials,this.material[i]));}object.material=uuids;}else{object.material=serialize(meta.materials,this.material);}}//\nif(this.children.length>0){object.children=[];for(let i=0;i<this.children.length;i++){object.children.push(this.children[i].toJSON(meta).object);}}//\nif(this.animations.length>0){object.animations=[];for(let i=0;i<this.animations.length;i++){const animation=this.animations[i];object.animations.push(serialize(meta.animations,animation));}}if(isRootObject){const geometries=extractFromCache(meta.geometries);const materials=extractFromCache(meta.materials);const textures=extractFromCache(meta.textures);const images=extractFromCache(meta.images);const shapes=extractFromCache(meta.shapes);const skeletons=extractFromCache(meta.skeletons);const animations=extractFromCache(meta.animations);const nodes=extractFromCache(meta.nodes);if(geometries.length>0)output.geometries=geometries;if(materials.length>0)output.materials=materials;if(textures.length>0)output.textures=textures;if(images.length>0)output.images=images;if(shapes.length>0)output.shapes=shapes;if(skeletons.length>0)output.skeletons=skeletons;if(animations.length>0)output.animations=animations;if(nodes.length>0)output.nodes=nodes;}output.object=object;return output;// extract data from the cache hash\n// remove metadata on each item\n// and return as array\nfunction extractFromCache(cache){const values=[];for(const key in cache){const data=cache[key];delete data.metadata;values.push(data);}return values;}}clone(recursive){return new this.constructor().copy(this,recursive);}copy(source,recursive=true){this.name=source.name;this.up.copy(source.up);this.position.copy(source.position);this.rotation.order=source.rotation.order;this.quaternion.copy(source.quaternion);this.scale.copy(source.scale);this.matrix.copy(source.matrix);this.matrixWorld.copy(source.matrixWorld);this.matrixAutoUpdate=source.matrixAutoUpdate;this.matrixWorldNeedsUpdate=source.matrixWorldNeedsUpdate;this.matrixWorldAutoUpdate=source.matrixWorldAutoUpdate;this.layers.mask=source.layers.mask;this.visible=source.visible;this.castShadow=source.castShadow;this.receiveShadow=source.receiveShadow;this.frustumCulled=source.frustumCulled;this.renderOrder=source.renderOrder;this.userData=JSON.parse(stringify(source.userData));if(recursive===true){for(let i=0;i<source.children.length;i++){const child=source.children[i];this.add(child.clone());}}return this;}}Object3D.DefaultUp=/*@__PURE__*/new three_module_Vector3(0,1,0);Object3D.DefaultMatrixAutoUpdate=true;Object3D.DefaultMatrixWorldAutoUpdate=true;const _v0$1=/*@__PURE__*/new three_module_Vector3();const _v1$3=/*@__PURE__*/new three_module_Vector3();const _v2$2=/*@__PURE__*/new three_module_Vector3();const _v3$1=/*@__PURE__*/new three_module_Vector3();const three_module_vab=/*@__PURE__*/new three_module_Vector3();const three_module_vac=/*@__PURE__*/new three_module_Vector3();const three_module_vbc=/*@__PURE__*/new three_module_Vector3();const three_module_vap=/*@__PURE__*/new three_module_Vector3();const three_module_vbp=/*@__PURE__*/new three_module_Vector3();const three_module_vcp=/*@__PURE__*/new three_module_Vector3();class three_module_Triangle{constructor(a=new three_module_Vector3(),b=new three_module_Vector3(),c=new three_module_Vector3()){this.a=a;this.b=b;this.c=c;}static getNormal(a,b,c,target){target.subVectors(c,b);_v0$1.subVectors(a,b);target.cross(_v0$1);const targetLengthSq=target.lengthSq();if(targetLengthSq>0){return target.multiplyScalar(1/Math.sqrt(targetLengthSq));}return target.set(0,0,0);}// static/instance method to calculate barycentric coordinates\n// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\nstatic getBarycoord(point,a,b,c,target){_v0$1.subVectors(c,a);_v1$3.subVectors(b,a);_v2$2.subVectors(point,a);const dot00=_v0$1.dot(_v0$1);const dot01=_v0$1.dot(_v1$3);const dot02=_v0$1.dot(_v2$2);const dot11=_v1$3.dot(_v1$3);const dot12=_v1$3.dot(_v2$2);const denom=dot00*dot11-dot01*dot01;// collinear or singular triangle\nif(denom===0){// arbitrary location outside of triangle?\n// not sure if this is the best idea, maybe should be returning undefined\nreturn target.set(-2,-1,-1);}const invDenom=1/denom;const u=(dot11*dot02-dot01*dot12)*invDenom;const v=(dot00*dot12-dot01*dot02)*invDenom;// barycentric coordinates must always sum to 1\nreturn target.set(1-u-v,v,u);}static containsPoint(point,a,b,c){this.getBarycoord(point,a,b,c,_v3$1);return _v3$1.x>=0&&_v3$1.y>=0&&_v3$1.x+_v3$1.y<=1;}static getUV(point,p1,p2,p3,uv1,uv2,uv3,target){this.getBarycoord(point,p1,p2,p3,_v3$1);target.set(0,0);target.addScaledVector(uv1,_v3$1.x);target.addScaledVector(uv2,_v3$1.y);target.addScaledVector(uv3,_v3$1.z);return target;}static isFrontFacing(a,b,c,direction){_v0$1.subVectors(c,b);_v1$3.subVectors(a,b);// strictly front facing\nreturn _v0$1.cross(_v1$3).dot(direction)<0?true:false;}set(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this;}setFromPointsAndIndices(points,i0,i1,i2){this.a.copy(points[i0]);this.b.copy(points[i1]);this.c.copy(points[i2]);return this;}setFromAttributeAndIndices(attribute,i0,i1,i2){this.a.fromBufferAttribute(attribute,i0);this.b.fromBufferAttribute(attribute,i1);this.c.fromBufferAttribute(attribute,i2);return this;}clone(){return new this.constructor().copy(this);}copy(triangle){this.a.copy(triangle.a);this.b.copy(triangle.b);this.c.copy(triangle.c);return this;}getArea(){_v0$1.subVectors(this.c,this.b);_v1$3.subVectors(this.a,this.b);return _v0$1.cross(_v1$3).length()*0.5;}getMidpoint(target){return target.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3);}getNormal(target){return three_module_Triangle.getNormal(this.a,this.b,this.c,target);}getPlane(target){return target.setFromCoplanarPoints(this.a,this.b,this.c);}getBarycoord(point,target){return three_module_Triangle.getBarycoord(point,this.a,this.b,this.c,target);}getUV(point,uv1,uv2,uv3,target){return three_module_Triangle.getUV(point,this.a,this.b,this.c,uv1,uv2,uv3,target);}containsPoint(point){return three_module_Triangle.containsPoint(point,this.a,this.b,this.c);}isFrontFacing(direction){return three_module_Triangle.isFrontFacing(this.a,this.b,this.c,direction);}intersectsBox(box){return box.intersectsTriangle(this);}closestPointToPoint(p,target){const a=this.a,b=this.b,c=this.c;let v,w;// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n// basically, we're distinguishing which of the voronoi regions of the triangle\n// the point lies in with the minimum amount of redundant computation.\nthree_module_vab.subVectors(b,a);three_module_vac.subVectors(c,a);three_module_vap.subVectors(p,a);const d1=three_module_vab.dot(three_module_vap);const d2=three_module_vac.dot(three_module_vap);if(d1<=0&&d2<=0){// vertex region of A; barycentric coords (1, 0, 0)\nreturn target.copy(a);}three_module_vbp.subVectors(p,b);const d3=three_module_vab.dot(three_module_vbp);const d4=three_module_vac.dot(three_module_vbp);if(d3>=0&&d4<=d3){// vertex region of B; barycentric coords (0, 1, 0)\nreturn target.copy(b);}const vc=d1*d4-d3*d2;if(vc<=0&&d1>=0&&d3<=0){v=d1/(d1-d3);// edge region of AB; barycentric coords (1-v, v, 0)\nreturn target.copy(a).addScaledVector(three_module_vab,v);}three_module_vcp.subVectors(p,c);const d5=three_module_vab.dot(three_module_vcp);const d6=three_module_vac.dot(three_module_vcp);if(d6>=0&&d5<=d6){// vertex region of C; barycentric coords (0, 0, 1)\nreturn target.copy(c);}const vb=d5*d2-d1*d6;if(vb<=0&&d2>=0&&d6<=0){w=d2/(d2-d6);// edge region of AC; barycentric coords (1-w, 0, w)\nreturn target.copy(a).addScaledVector(three_module_vac,w);}const va=d3*d6-d5*d4;if(va<=0&&d4-d3>=0&&d5-d6>=0){three_module_vbc.subVectors(c,b);w=(d4-d3)/(d4-d3+(d5-d6));// edge region of BC; barycentric coords (0, 1-w, w)\nreturn target.copy(b).addScaledVector(three_module_vbc,w);// edge region of BC\n}// face region\nconst denom=1/(va+vb+vc);// u = va * denom\nv=vb*denom;w=vc*denom;return target.copy(a).addScaledVector(three_module_vab,v).addScaledVector(three_module_vac,w);}equals(triangle){return triangle.a.equals(this.a)&&triangle.b.equals(this.b)&&triangle.c.equals(this.c);}}let materialId=0;class Material extends EventDispatcher{constructor(){super();this.isMaterial=true;define_property(this,'id',{value:materialId++});this.uuid=three_module_generateUUID();this.name='';this.type='Material';this.blending=NormalBlending;this.side=FrontSide;this.vertexColors=false;this.opacity=1;this.transparent=false;this.blendSrc=SrcAlphaFactor;this.blendDst=OneMinusSrcAlphaFactor;this.blendEquation=AddEquation;this.blendSrcAlpha=null;this.blendDstAlpha=null;this.blendEquationAlpha=null;this.depthFunc=LessEqualDepth;this.depthTest=true;this.depthWrite=true;this.stencilWriteMask=0xff;this.stencilFunc=AlwaysStencilFunc;this.stencilRef=0;this.stencilFuncMask=0xff;this.stencilFail=KeepStencilOp;this.stencilZFail=KeepStencilOp;this.stencilZPass=KeepStencilOp;this.stencilWrite=false;this.clippingPlanes=null;this.clipIntersection=false;this.clipShadows=false;this.shadowSide=null;this.colorWrite=true;this.precision=null;// override the renderer's default precision for this material\nthis.polygonOffset=false;this.polygonOffsetFactor=0;this.polygonOffsetUnits=0;this.dithering=false;this.alphaToCoverage=false;this.premultipliedAlpha=false;this.visible=true;this.toneMapped=true;this.userData={};this.version=0;this._alphaTest=0;}get alphaTest(){return this._alphaTest;}set alphaTest(value){if(this._alphaTest>0!==value>0){this.version++;}this._alphaTest=value;}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString();}setValues(values){if(values===undefined)return;for(const key in values){const newValue=values[key];if(newValue===undefined){console.warn('THREE.Material: \\''+key+'\\' parameter is undefined.');continue;}const currentValue=this[key];if(currentValue===undefined){console.warn('THREE.'+this.type+': \\''+key+'\\' is not a property of this material.');continue;}if(currentValue&&currentValue.isColor){currentValue.set(newValue);}else if(currentValue&&currentValue.isVector3&&newValue&&newValue.isVector3){currentValue.copy(newValue);}else{this[key]=newValue;}}}toJSON(meta){const isRootObject=meta===undefined||typeof meta==='string';if(isRootObject){meta={textures:{},images:{}};}const data={metadata:{version:4.5,type:'Material',generator:'Material.toJSON'}};// standard Material serialization\ndata.uuid=this.uuid;data.type=this.type;if(this.name!=='')data.name=this.name;if(this.color&&this.color.isColor)data.color=this.color.getHex();if(this.roughness!==undefined)data.roughness=this.roughness;if(this.metalness!==undefined)data.metalness=this.metalness;if(this.sheen!==undefined)data.sheen=this.sheen;if(this.sheenColor&&this.sheenColor.isColor)data.sheenColor=this.sheenColor.getHex();if(this.sheenRoughness!==undefined)data.sheenRoughness=this.sheenRoughness;if(this.emissive&&this.emissive.isColor)data.emissive=this.emissive.getHex();if(this.emissiveIntensity&&this.emissiveIntensity!==1)data.emissiveIntensity=this.emissiveIntensity;if(this.specular&&this.specular.isColor)data.specular=this.specular.getHex();if(this.specularIntensity!==undefined)data.specularIntensity=this.specularIntensity;if(this.specularColor&&this.specularColor.isColor)data.specularColor=this.specularColor.getHex();if(this.shininess!==undefined)data.shininess=this.shininess;if(this.clearcoat!==undefined)data.clearcoat=this.clearcoat;if(this.clearcoatRoughness!==undefined)data.clearcoatRoughness=this.clearcoatRoughness;if(this.clearcoatMap&&this.clearcoatMap.isTexture){data.clearcoatMap=this.clearcoatMap.toJSON(meta).uuid;}if(this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture){data.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(meta).uuid;}if(this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture){data.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(meta).uuid;data.clearcoatNormalScale=this.clearcoatNormalScale.toArray();}if(this.iridescence!==undefined)data.iridescence=this.iridescence;if(this.iridescenceIOR!==undefined)data.iridescenceIOR=this.iridescenceIOR;if(this.iridescenceThicknessRange!==undefined)data.iridescenceThicknessRange=this.iridescenceThicknessRange;if(this.iridescenceMap&&this.iridescenceMap.isTexture){data.iridescenceMap=this.iridescenceMap.toJSON(meta).uuid;}if(this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture){data.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(meta).uuid;}if(instance_map(this)&&instance_map(this).isTexture)data.map=instance_map(this).toJSON(meta).uuid;if(this.matcap&&this.matcap.isTexture)data.matcap=this.matcap.toJSON(meta).uuid;if(this.alphaMap&&this.alphaMap.isTexture)data.alphaMap=this.alphaMap.toJSON(meta).uuid;if(this.lightMap&&this.lightMap.isTexture){data.lightMap=this.lightMap.toJSON(meta).uuid;data.lightMapIntensity=this.lightMapIntensity;}if(this.aoMap&&this.aoMap.isTexture){data.aoMap=this.aoMap.toJSON(meta).uuid;data.aoMapIntensity=this.aoMapIntensity;}if(this.bumpMap&&this.bumpMap.isTexture){data.bumpMap=this.bumpMap.toJSON(meta).uuid;data.bumpScale=this.bumpScale;}if(this.normalMap&&this.normalMap.isTexture){data.normalMap=this.normalMap.toJSON(meta).uuid;data.normalMapType=this.normalMapType;data.normalScale=this.normalScale.toArray();}if(this.displacementMap&&this.displacementMap.isTexture){data.displacementMap=this.displacementMap.toJSON(meta).uuid;data.displacementScale=this.displacementScale;data.displacementBias=this.displacementBias;}if(this.roughnessMap&&this.roughnessMap.isTexture)data.roughnessMap=this.roughnessMap.toJSON(meta).uuid;if(this.metalnessMap&&this.metalnessMap.isTexture)data.metalnessMap=this.metalnessMap.toJSON(meta).uuid;if(this.emissiveMap&&this.emissiveMap.isTexture)data.emissiveMap=this.emissiveMap.toJSON(meta).uuid;if(this.specularMap&&this.specularMap.isTexture)data.specularMap=this.specularMap.toJSON(meta).uuid;if(this.specularIntensityMap&&this.specularIntensityMap.isTexture)data.specularIntensityMap=this.specularIntensityMap.toJSON(meta).uuid;if(this.specularColorMap&&this.specularColorMap.isTexture)data.specularColorMap=this.specularColorMap.toJSON(meta).uuid;if(this.envMap&&this.envMap.isTexture){data.envMap=this.envMap.toJSON(meta).uuid;if(this.combine!==undefined)data.combine=this.combine;}if(this.envMapIntensity!==undefined)data.envMapIntensity=this.envMapIntensity;if(this.reflectivity!==undefined)data.reflectivity=this.reflectivity;if(this.refractionRatio!==undefined)data.refractionRatio=this.refractionRatio;if(this.gradientMap&&this.gradientMap.isTexture){data.gradientMap=this.gradientMap.toJSON(meta).uuid;}if(this.transmission!==undefined)data.transmission=this.transmission;if(this.transmissionMap&&this.transmissionMap.isTexture)data.transmissionMap=this.transmissionMap.toJSON(meta).uuid;if(this.thickness!==undefined)data.thickness=this.thickness;if(this.thicknessMap&&this.thicknessMap.isTexture)data.thicknessMap=this.thicknessMap.toJSON(meta).uuid;if(this.attenuationDistance!==undefined&&this.attenuationDistance!==Infinity)data.attenuationDistance=this.attenuationDistance;if(this.attenuationColor!==undefined)data.attenuationColor=this.attenuationColor.getHex();if(this.size!==undefined)data.size=this.size;if(this.shadowSide!==null)data.shadowSide=this.shadowSide;if(this.sizeAttenuation!==undefined)data.sizeAttenuation=this.sizeAttenuation;if(this.blending!==NormalBlending)data.blending=this.blending;if(this.side!==FrontSide)data.side=this.side;if(this.vertexColors)data.vertexColors=true;if(this.opacity<1)data.opacity=this.opacity;if(this.transparent===true)data.transparent=this.transparent;data.depthFunc=this.depthFunc;data.depthTest=this.depthTest;data.depthWrite=this.depthWrite;data.colorWrite=this.colorWrite;data.stencilWrite=this.stencilWrite;data.stencilWriteMask=this.stencilWriteMask;data.stencilFunc=this.stencilFunc;data.stencilRef=this.stencilRef;data.stencilFuncMask=this.stencilFuncMask;data.stencilFail=this.stencilFail;data.stencilZFail=this.stencilZFail;data.stencilZPass=this.stencilZPass;// rotation (SpriteMaterial)\nif(this.rotation!==undefined&&this.rotation!==0)data.rotation=this.rotation;if(this.polygonOffset===true)data.polygonOffset=true;if(this.polygonOffsetFactor!==0)data.polygonOffsetFactor=this.polygonOffsetFactor;if(this.polygonOffsetUnits!==0)data.polygonOffsetUnits=this.polygonOffsetUnits;if(this.linewidth!==undefined&&this.linewidth!==1)data.linewidth=this.linewidth;if(this.dashSize!==undefined)data.dashSize=this.dashSize;if(this.gapSize!==undefined)data.gapSize=this.gapSize;if(this.scale!==undefined)data.scale=this.scale;if(this.dithering===true)data.dithering=true;if(this.alphaTest>0)data.alphaTest=this.alphaTest;if(this.alphaToCoverage===true)data.alphaToCoverage=this.alphaToCoverage;if(this.premultipliedAlpha===true)data.premultipliedAlpha=this.premultipliedAlpha;if(this.wireframe===true)data.wireframe=this.wireframe;if(this.wireframeLinewidth>1)data.wireframeLinewidth=this.wireframeLinewidth;if(this.wireframeLinecap!=='round')data.wireframeLinecap=this.wireframeLinecap;if(this.wireframeLinejoin!=='round')data.wireframeLinejoin=this.wireframeLinejoin;if(this.flatShading===true)data.flatShading=this.flatShading;if(this.visible===false)data.visible=false;if(this.toneMapped===false)data.toneMapped=false;if(this.fog===false)data.fog=false;if(stringify(this.userData)!=='{}')data.userData=this.userData;// TODO: Copied from Object3D.toJSON\nfunction extractFromCache(cache){const values=[];for(const key in cache){const data=cache[key];delete data.metadata;values.push(data);}return values;}if(isRootObject){const textures=extractFromCache(meta.textures);const images=extractFromCache(meta.images);if(textures.length>0)data.textures=textures;if(images.length>0)data.images=images;}return data;}clone(){return new this.constructor().copy(this);}copy(source){this.name=source.name;this.blending=source.blending;this.side=source.side;this.vertexColors=source.vertexColors;this.opacity=source.opacity;this.transparent=source.transparent;this.blendSrc=source.blendSrc;this.blendDst=source.blendDst;this.blendEquation=source.blendEquation;this.blendSrcAlpha=source.blendSrcAlpha;this.blendDstAlpha=source.blendDstAlpha;this.blendEquationAlpha=source.blendEquationAlpha;this.depthFunc=source.depthFunc;this.depthTest=source.depthTest;this.depthWrite=source.depthWrite;this.stencilWriteMask=source.stencilWriteMask;this.stencilFunc=source.stencilFunc;this.stencilRef=source.stencilRef;this.stencilFuncMask=source.stencilFuncMask;this.stencilFail=source.stencilFail;this.stencilZFail=source.stencilZFail;this.stencilZPass=source.stencilZPass;this.stencilWrite=source.stencilWrite;const srcPlanes=source.clippingPlanes;let dstPlanes=null;if(srcPlanes!==null){const n=srcPlanes.length;dstPlanes=new Array(n);for(let i=0;i!==n;++i){dstPlanes[i]=srcPlanes[i].clone();}}this.clippingPlanes=dstPlanes;this.clipIntersection=source.clipIntersection;this.clipShadows=source.clipShadows;this.shadowSide=source.shadowSide;this.colorWrite=source.colorWrite;this.precision=source.precision;this.polygonOffset=source.polygonOffset;this.polygonOffsetFactor=source.polygonOffsetFactor;this.polygonOffsetUnits=source.polygonOffsetUnits;this.dithering=source.dithering;this.alphaTest=source.alphaTest;this.alphaToCoverage=source.alphaToCoverage;this.premultipliedAlpha=source.premultipliedAlpha;this.visible=source.visible;this.toneMapped=source.toneMapped;this.userData=JSON.parse(stringify(source.userData));return this;}dispose(){this.dispatchEvent({type:'dispose'});}set needsUpdate(value){if(value===true)this.version++;}}class MeshBasicMaterial extends Material{constructor(parameters){super();this.isMeshBasicMaterial=true;this.type='MeshBasicMaterial';this.color=new Color(0xffffff);// emissive\nthis.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.map=instance_map(source);this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.specularMap=source.specularMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.combine=source.combine;this.reflectivity=source.reflectivity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.fog=source.fog;return this;}}const _vector$9=/*@__PURE__*/new three_module_Vector3();const _vector2$1=/*@__PURE__*/new Vector2();class BufferAttribute{constructor(array,itemSize,normalized){if(is_array(array)){throw new TypeError('THREE.BufferAttribute: array should be a Typed Array.');}this.isBufferAttribute=true;this.name='';this.array=array;this.itemSize=itemSize;this.count=array!==undefined?array.length/itemSize:0;this.normalized=normalized===true;this.usage=StaticDrawUsage;this.updateRange={offset:0,count:-1};this.version=0;}onUploadCallback(){}set needsUpdate(value){if(value===true)this.version++;}setUsage(value){this.usage=value;return this;}copy(source){this.name=source.name;this.array=new source.array.constructor(source.array);this.itemSize=source.itemSize;this.count=source.count;this.normalized=source.normalized;this.usage=source.usage;return this;}copyAt(index1,attribute,index2){index1*=this.itemSize;index2*=attribute.itemSize;for(let i=0,l=this.itemSize;i<l;i++){this.array[index1+i]=attribute.array[index2+i];}return this;}copyArray(array){this.array.set(array);return this;}applyMatrix3(m){if(this.itemSize===2){for(let i=0,l=this.count;i<l;i++){_vector2$1.fromBufferAttribute(this,i);_vector2$1.applyMatrix3(m);this.setXY(i,_vector2$1.x,_vector2$1.y);}}else if(this.itemSize===3){for(let i=0,l=this.count;i<l;i++){_vector$9.fromBufferAttribute(this,i);_vector$9.applyMatrix3(m);this.setXYZ(i,_vector$9.x,_vector$9.y,_vector$9.z);}}return this;}applyMatrix4(m){for(let i=0,l=this.count;i<l;i++){_vector$9.fromBufferAttribute(this,i);_vector$9.applyMatrix4(m);this.setXYZ(i,_vector$9.x,_vector$9.y,_vector$9.z);}return this;}applyNormalMatrix(m){for(let i=0,l=this.count;i<l;i++){_vector$9.fromBufferAttribute(this,i);_vector$9.applyNormalMatrix(m);this.setXYZ(i,_vector$9.x,_vector$9.y,_vector$9.z);}return this;}transformDirection(m){for(let i=0,l=this.count;i<l;i++){_vector$9.fromBufferAttribute(this,i);_vector$9.transformDirection(m);this.setXYZ(i,_vector$9.x,_vector$9.y,_vector$9.z);}return this;}set(value,offset=0){// Matching BufferAttribute constructor, do not normalize the array.\nthis.array.set(value,offset);return this;}getX(index){let x=this.array[index*this.itemSize];if(this.normalized)x=three_module_denormalize(x,this.array);return x;}setX(index,x){if(this.normalized)x=three_module_normalize(x,this.array);this.array[index*this.itemSize]=x;return this;}getY(index){let y=this.array[index*this.itemSize+1];if(this.normalized)y=three_module_denormalize(y,this.array);return y;}setY(index,y){if(this.normalized)y=three_module_normalize(y,this.array);this.array[index*this.itemSize+1]=y;return this;}getZ(index){let z=this.array[index*this.itemSize+2];if(this.normalized)z=three_module_denormalize(z,this.array);return z;}setZ(index,z){if(this.normalized)z=three_module_normalize(z,this.array);this.array[index*this.itemSize+2]=z;return this;}getW(index){let w=this.array[index*this.itemSize+3];if(this.normalized)w=three_module_denormalize(w,this.array);return w;}setW(index,w){if(this.normalized)w=three_module_normalize(w,this.array);this.array[index*this.itemSize+3]=w;return this;}setXY(index,x,y){index*=this.itemSize;if(this.normalized){x=three_module_normalize(x,this.array);y=three_module_normalize(y,this.array);}this.array[index+0]=x;this.array[index+1]=y;return this;}setXYZ(index,x,y,z){index*=this.itemSize;if(this.normalized){x=three_module_normalize(x,this.array);y=three_module_normalize(y,this.array);z=three_module_normalize(z,this.array);}this.array[index+0]=x;this.array[index+1]=y;this.array[index+2]=z;return this;}setXYZW(index,x,y,z,w){index*=this.itemSize;if(this.normalized){x=three_module_normalize(x,this.array);y=three_module_normalize(y,this.array);z=three_module_normalize(z,this.array);w=three_module_normalize(w,this.array);}this.array[index+0]=x;this.array[index+1]=y;this.array[index+2]=z;this.array[index+3]=w;return this;}onUpload(callback){this.onUploadCallback=callback;return this;}clone(){return new this.constructor(this.array,this.itemSize).copy(this);}toJSON(){const data={itemSize:this.itemSize,type:this.array.constructor.name,array:from(this.array),normalized:this.normalized};if(this.name!=='')data.name=this.name;if(this.usage!==StaticDrawUsage)data.usage=this.usage;if(this.updateRange.offset!==0||this.updateRange.count!==-1)data.updateRange=this.updateRange;return data;}// @deprecated\ncopyColorsArray(){console.error('THREE.BufferAttribute: copyColorsArray() was removed in r144.');}copyVector2sArray(){console.error('THREE.BufferAttribute: copyVector2sArray() was removed in r144.');}copyVector3sArray(){console.error('THREE.BufferAttribute: copyVector3sArray() was removed in r144.');}copyVector4sArray(){console.error('THREE.BufferAttribute: copyVector4sArray() was removed in r144.');}}//\nclass Int8BufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Int8Array(array),itemSize,normalized);}}class Uint8BufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Uint8Array(array),itemSize,normalized);}}class Uint8ClampedBufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Uint8ClampedArray(array),itemSize,normalized);}}class Int16BufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Int16Array(array),itemSize,normalized);}}class Uint16BufferAttribute extends BufferAttribute{constructor(array,itemSize,normalized){super(new Uint16Array(array),itemSize,normalized);}}class Int32BufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Int32Array(array),itemSize,normalized);}}class Uint32BufferAttribute extends BufferAttribute{constructor(array,itemSize,normalized){super(new Uint32Array(array),itemSize,normalized);}}class Float16BufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Uint16Array(array),itemSize,normalized);this.isFloat16BufferAttribute=true;}}class Float32BufferAttribute extends BufferAttribute{constructor(array,itemSize,normalized){super(new Float32Array(array),itemSize,normalized);}}class Float64BufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized){super(new Float64Array(array),itemSize,normalized);}}let _id$1=0;const _m1=/*@__PURE__*/new Matrix4();const _obj=/*@__PURE__*/new Object3D();const _offset=/*@__PURE__*/new three_module_Vector3();const _box$1=/*@__PURE__*/new Box3();const _boxMorphTargets=/*@__PURE__*/new Box3();const _vector$8=/*@__PURE__*/new three_module_Vector3();class BufferGeometry extends EventDispatcher{constructor(){super();this.isBufferGeometry=true;define_property(this,'id',{value:_id$1++});this.uuid=three_module_generateUUID();this.name='';this.type='BufferGeometry';this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=false;this.groups=[];this.boundingBox=null;this.boundingSphere=null;this.drawRange={start:0,count:Infinity};this.userData={};}getIndex(){return this.index;}setIndex(index){if(is_array(index)){this.index=new(arrayNeedsUint32(index)?Uint32BufferAttribute:Uint16BufferAttribute)(index,1);}else{this.index=index;}return this;}getAttribute(name){return this.attributes[name];}setAttribute(name,attribute){this.attributes[name]=attribute;return this;}deleteAttribute(name){delete this.attributes[name];return this;}hasAttribute(name){return this.attributes[name]!==undefined;}addGroup(start,count,materialIndex=0){this.groups.push({start:start,count:count,materialIndex:materialIndex});}clearGroups(){this.groups=[];}setDrawRange(start,count){this.drawRange.start=start;this.drawRange.count=count;}applyMatrix4(matrix){const position=this.attributes.position;if(position!==undefined){position.applyMatrix4(matrix);position.needsUpdate=true;}const normal=this.attributes.normal;if(normal!==undefined){const normalMatrix=new Matrix3().getNormalMatrix(matrix);normal.applyNormalMatrix(normalMatrix);normal.needsUpdate=true;}const tangent=this.attributes.tangent;if(tangent!==undefined){tangent.transformDirection(matrix);tangent.needsUpdate=true;}if(this.boundingBox!==null){this.computeBoundingBox();}if(this.boundingSphere!==null){this.computeBoundingSphere();}return this;}applyQuaternion(q){_m1.makeRotationFromQuaternion(q);this.applyMatrix4(_m1);return this;}rotateX(angle){// rotate geometry around world x-axis\n_m1.makeRotationX(angle);this.applyMatrix4(_m1);return this;}rotateY(angle){// rotate geometry around world y-axis\n_m1.makeRotationY(angle);this.applyMatrix4(_m1);return this;}rotateZ(angle){// rotate geometry around world z-axis\n_m1.makeRotationZ(angle);this.applyMatrix4(_m1);return this;}translate(x,y,z){// translate geometry\n_m1.makeTranslation(x,y,z);this.applyMatrix4(_m1);return this;}scale(x,y,z){// scale geometry\n_m1.makeScale(x,y,z);this.applyMatrix4(_m1);return this;}lookAt(vector){_obj.lookAt(vector);_obj.updateMatrix();this.applyMatrix4(_obj.matrix);return this;}center(){this.computeBoundingBox();this.boundingBox.getCenter(_offset).negate();this.translate(_offset.x,_offset.y,_offset.z);return this;}setFromPoints(points){const position=[];for(let i=0,l=points.length;i<l;i++){const point=points[i];position.push(point.x,point.y,point.z||0);}this.setAttribute('position',new Float32BufferAttribute(position,3));return this;}computeBoundingBox(){if(this.boundingBox===null){this.boundingBox=new Box3();}const position=this.attributes.position;const morphAttributesPosition=this.morphAttributes.position;if(position&&position.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set \"mesh.frustumCulled\" to \"false\".',this);this.boundingBox.set(new three_module_Vector3(-Infinity,-Infinity,-Infinity),new three_module_Vector3(+Infinity,+Infinity,+Infinity));return;}if(position!==undefined){this.boundingBox.setFromBufferAttribute(position);// process morph attributes if present\nif(morphAttributesPosition){for(let i=0,il=morphAttributesPosition.length;i<il;i++){const morphAttribute=morphAttributesPosition[i];_box$1.setFromBufferAttribute(morphAttribute);if(this.morphTargetsRelative){_vector$8.addVectors(this.boundingBox.min,_box$1.min);this.boundingBox.expandByPoint(_vector$8);_vector$8.addVectors(this.boundingBox.max,_box$1.max);this.boundingBox.expandByPoint(_vector$8);}else{this.boundingBox.expandByPoint(_box$1.min);this.boundingBox.expandByPoint(_box$1.max);}}}}else{this.boundingBox.makeEmpty();}if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)){console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.',this);}}computeBoundingSphere(){if(this.boundingSphere===null){this.boundingSphere=new Sphere();}const position=this.attributes.position;const morphAttributesPosition=this.morphAttributes.position;if(position&&position.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set \"mesh.frustumCulled\" to \"false\".',this);this.boundingSphere.set(new three_module_Vector3(),Infinity);return;}if(position){// first, find the center of the bounding sphere\nconst center=this.boundingSphere.center;_box$1.setFromBufferAttribute(position);// process morph attributes if present\nif(morphAttributesPosition){for(let i=0,il=morphAttributesPosition.length;i<il;i++){const morphAttribute=morphAttributesPosition[i];_boxMorphTargets.setFromBufferAttribute(morphAttribute);if(this.morphTargetsRelative){_vector$8.addVectors(_box$1.min,_boxMorphTargets.min);_box$1.expandByPoint(_vector$8);_vector$8.addVectors(_box$1.max,_boxMorphTargets.max);_box$1.expandByPoint(_vector$8);}else{_box$1.expandByPoint(_boxMorphTargets.min);_box$1.expandByPoint(_boxMorphTargets.max);}}}_box$1.getCenter(center);// second, try to find a boundingSphere with a radius smaller than the\n// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\nlet maxRadiusSq=0;for(let i=0,il=position.count;i<il;i++){_vector$8.fromBufferAttribute(position,i);maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(_vector$8));}// process morph attributes if present\nif(morphAttributesPosition){for(let i=0,il=morphAttributesPosition.length;i<il;i++){const morphAttribute=morphAttributesPosition[i];const morphTargetsRelative=this.morphTargetsRelative;for(let j=0,jl=morphAttribute.count;j<jl;j++){_vector$8.fromBufferAttribute(morphAttribute,j);if(morphTargetsRelative){_offset.fromBufferAttribute(position,j);_vector$8.add(_offset);}maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(_vector$8));}}}this.boundingSphere.radius=Math.sqrt(maxRadiusSq);if(isNaN(this.boundingSphere.radius)){console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.',this);}}}computeTangents(){const index=this.index;const attributes=this.attributes;// based on http://www.terathon.com/code/tangent.html\n// (per vertex tangents)\nif(index===null||attributes.position===undefined||attributes.normal===undefined||attributes.uv===undefined){console.error('THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)');return;}const indices=index.array;const positions=attributes.position.array;const normals=attributes.normal.array;const uvs=attributes.uv.array;const nVertices=positions.length/3;if(this.hasAttribute('tangent')===false){this.setAttribute('tangent',new BufferAttribute(new Float32Array(4*nVertices),4));}const tangents=this.getAttribute('tangent').array;const tan1=[],tan2=[];for(let i=0;i<nVertices;i++){tan1[i]=new three_module_Vector3();tan2[i]=new three_module_Vector3();}const vA=new three_module_Vector3(),vB=new three_module_Vector3(),vC=new three_module_Vector3(),uvA=new Vector2(),uvB=new Vector2(),uvC=new Vector2(),sdir=new three_module_Vector3(),tdir=new three_module_Vector3();function handleTriangle(a,b,c){vA.fromArray(positions,a*3);vB.fromArray(positions,b*3);vC.fromArray(positions,c*3);uvA.fromArray(uvs,a*2);uvB.fromArray(uvs,b*2);uvC.fromArray(uvs,c*2);vB.sub(vA);vC.sub(vA);uvB.sub(uvA);uvC.sub(uvA);const r=1.0/(uvB.x*uvC.y-uvC.x*uvB.y);// silently ignore degenerate uv triangles having coincident or colinear vertices\nif(!isFinite(r))return;sdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC,-uvB.y).multiplyScalar(r);tdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB,-uvC.x).multiplyScalar(r);tan1[a].add(sdir);tan1[b].add(sdir);tan1[c].add(sdir);tan2[a].add(tdir);tan2[b].add(tdir);tan2[c].add(tdir);}let groups=this.groups;if(groups.length===0){groups=[{start:0,count:indices.length}];}for(let i=0,il=groups.length;i<il;++i){const group=groups[i];const start=group.start;const count=group.count;for(let j=start,jl=start+count;j<jl;j+=3){handleTriangle(indices[j+0],indices[j+1],indices[j+2]);}}const tmp=new three_module_Vector3(),tmp2=new three_module_Vector3();const n=new three_module_Vector3(),n2=new three_module_Vector3();function handleVertex(v){n.fromArray(normals,v*3);n2.copy(n);const t=tan1[v];// Gram-Schmidt orthogonalize\ntmp.copy(t);tmp.sub(n.multiplyScalar(n.dot(t))).normalize();// Calculate handedness\ntmp2.crossVectors(n2,t);const test=tmp2.dot(tan2[v]);const w=test<0.0?-1.0:1.0;tangents[v*4]=tmp.x;tangents[v*4+1]=tmp.y;tangents[v*4+2]=tmp.z;tangents[v*4+3]=w;}for(let i=0,il=groups.length;i<il;++i){const group=groups[i];const start=group.start;const count=group.count;for(let j=start,jl=start+count;j<jl;j+=3){handleVertex(indices[j+0]);handleVertex(indices[j+1]);handleVertex(indices[j+2]);}}}computeVertexNormals(){const index=this.index;const positionAttribute=this.getAttribute('position');if(positionAttribute!==undefined){let normalAttribute=this.getAttribute('normal');if(normalAttribute===undefined){normalAttribute=new BufferAttribute(new Float32Array(positionAttribute.count*3),3);this.setAttribute('normal',normalAttribute);}else{// reset existing normals to zero\nfor(let i=0,il=normalAttribute.count;i<il;i++){normalAttribute.setXYZ(i,0,0,0);}}const pA=new three_module_Vector3(),pB=new three_module_Vector3(),pC=new three_module_Vector3();const nA=new three_module_Vector3(),nB=new three_module_Vector3(),nC=new three_module_Vector3();const cb=new three_module_Vector3(),ab=new three_module_Vector3();// indexed elements\nif(index){for(let i=0,il=index.count;i<il;i+=3){const vA=index.getX(i+0);const vB=index.getX(i+1);const vC=index.getX(i+2);pA.fromBufferAttribute(positionAttribute,vA);pB.fromBufferAttribute(positionAttribute,vB);pC.fromBufferAttribute(positionAttribute,vC);cb.subVectors(pC,pB);ab.subVectors(pA,pB);cb.cross(ab);nA.fromBufferAttribute(normalAttribute,vA);nB.fromBufferAttribute(normalAttribute,vB);nC.fromBufferAttribute(normalAttribute,vC);nA.add(cb);nB.add(cb);nC.add(cb);normalAttribute.setXYZ(vA,nA.x,nA.y,nA.z);normalAttribute.setXYZ(vB,nB.x,nB.y,nB.z);normalAttribute.setXYZ(vC,nC.x,nC.y,nC.z);}}else{// non-indexed elements (unconnected triangle soup)\nfor(let i=0,il=positionAttribute.count;i<il;i+=3){pA.fromBufferAttribute(positionAttribute,i+0);pB.fromBufferAttribute(positionAttribute,i+1);pC.fromBufferAttribute(positionAttribute,i+2);cb.subVectors(pC,pB);ab.subVectors(pA,pB);cb.cross(ab);normalAttribute.setXYZ(i+0,cb.x,cb.y,cb.z);normalAttribute.setXYZ(i+1,cb.x,cb.y,cb.z);normalAttribute.setXYZ(i+2,cb.x,cb.y,cb.z);}}this.normalizeNormals();normalAttribute.needsUpdate=true;}}// @deprecated since r144\nmerge(){console.error('THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead.');return this;}normalizeNormals(){const normals=this.attributes.normal;for(let i=0,il=normals.count;i<il;i++){_vector$8.fromBufferAttribute(normals,i);_vector$8.normalize();normals.setXYZ(i,_vector$8.x,_vector$8.y,_vector$8.z);}}toNonIndexed(){function convertBufferAttribute(attribute,indices){const array=attribute.array;const itemSize=attribute.itemSize;const normalized=attribute.normalized;const array2=new array.constructor(indices.length*itemSize);let index=0,index2=0;for(let i=0,l=indices.length;i<l;i++){if(attribute.isInterleavedBufferAttribute){index=indices[i]*attribute.data.stride+attribute.offset;}else{index=indices[i]*itemSize;}for(let j=0;j<itemSize;j++){array2[index2++]=array[index++];}}return new BufferAttribute(array2,itemSize,normalized);}//\nif(this.index===null){console.warn('THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.');return this;}const geometry2=new BufferGeometry();const indices=this.index.array;const attributes=this.attributes;// attributes\nfor(const name in attributes){const attribute=attributes[name];const newAttribute=convertBufferAttribute(attribute,indices);geometry2.setAttribute(name,newAttribute);}// morph attributes\nconst morphAttributes=this.morphAttributes;for(const name in morphAttributes){const morphArray=[];const morphAttribute=morphAttributes[name];// morphAttribute: array of Float32BufferAttributes\nfor(let i=0,il=morphAttribute.length;i<il;i++){const attribute=morphAttribute[i];const newAttribute=convertBufferAttribute(attribute,indices);morphArray.push(newAttribute);}geometry2.morphAttributes[name]=morphArray;}geometry2.morphTargetsRelative=this.morphTargetsRelative;// groups\nconst groups=this.groups;for(let i=0,l=groups.length;i<l;i++){const group=groups[i];geometry2.addGroup(group.start,group.count,group.materialIndex);}return geometry2;}toJSON(){const data={metadata:{version:4.5,type:'BufferGeometry',generator:'BufferGeometry.toJSON'}};// standard BufferGeometry serialization\ndata.uuid=this.uuid;data.type=this.type;if(this.name!=='')data.name=this.name;if(object_keys(this.userData).length>0)data.userData=this.userData;if(this.parameters!==undefined){const parameters=this.parameters;for(const key in parameters){if(parameters[key]!==undefined)data[key]=parameters[key];}return data;}// for simplicity the code assumes attributes are not shared across geometries, see #15811\ndata.data={attributes:{}};const index=this.index;if(index!==null){data.data.index={type:index.array.constructor.name,array:slice(Array.prototype).call(index.array)};}const attributes=this.attributes;for(const key in attributes){const attribute=attributes[key];data.data.attributes[key]=attribute.toJSON(data.data);}const morphAttributes={};let hasMorphAttributes=false;for(const key in this.morphAttributes){const attributeArray=this.morphAttributes[key];const array=[];for(let i=0,il=attributeArray.length;i<il;i++){const attribute=attributeArray[i];array.push(attribute.toJSON(data.data));}if(array.length>0){morphAttributes[key]=array;hasMorphAttributes=true;}}if(hasMorphAttributes){data.data.morphAttributes=morphAttributes;data.data.morphTargetsRelative=this.morphTargetsRelative;}const groups=this.groups;if(groups.length>0){data.data.groups=JSON.parse(stringify(groups));}const boundingSphere=this.boundingSphere;if(boundingSphere!==null){data.data.boundingSphere={center:boundingSphere.center.toArray(),radius:boundingSphere.radius};}return data;}clone(){return new this.constructor().copy(this);}copy(source){// reset\nthis.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;// used for storing cloned, shared data\nconst data={};// name\nthis.name=source.name;// index\nconst index=source.index;if(index!==null){this.setIndex(index.clone(data));}// attributes\nconst attributes=source.attributes;for(const name in attributes){const attribute=attributes[name];this.setAttribute(name,attribute.clone(data));}// morph attributes\nconst morphAttributes=source.morphAttributes;for(const name in morphAttributes){const array=[];const morphAttribute=morphAttributes[name];// morphAttribute: array of Float32BufferAttributes\nfor(let i=0,l=morphAttribute.length;i<l;i++){array.push(morphAttribute[i].clone(data));}this.morphAttributes[name]=array;}this.morphTargetsRelative=source.morphTargetsRelative;// groups\nconst groups=source.groups;for(let i=0,l=groups.length;i<l;i++){const group=groups[i];this.addGroup(group.start,group.count,group.materialIndex);}// bounding box\nconst boundingBox=source.boundingBox;if(boundingBox!==null){this.boundingBox=boundingBox.clone();}// bounding sphere\nconst boundingSphere=source.boundingSphere;if(boundingSphere!==null){this.boundingSphere=boundingSphere.clone();}// draw range\nthis.drawRange.start=source.drawRange.start;this.drawRange.count=source.drawRange.count;// user data\nthis.userData=source.userData;// geometry generator parameters\nif(source.parameters!==undefined)this.parameters=object_assign({},source.parameters);return this;}dispose(){this.dispatchEvent({type:'dispose'});}}const _inverseMatrix$2=/*@__PURE__*/new Matrix4();const _ray$2=/*@__PURE__*/new Ray();const _sphere$3=/*@__PURE__*/new Sphere();const _vA$1=/*@__PURE__*/new three_module_Vector3();const _vB$1=/*@__PURE__*/new three_module_Vector3();const _vC$1=/*@__PURE__*/new three_module_Vector3();const _tempA=/*@__PURE__*/new three_module_Vector3();const _tempB=/*@__PURE__*/new three_module_Vector3();const _tempC=/*@__PURE__*/new three_module_Vector3();const _morphA=/*@__PURE__*/new three_module_Vector3();const _morphB=/*@__PURE__*/new three_module_Vector3();const _morphC=/*@__PURE__*/new three_module_Vector3();const _uvA$1=/*@__PURE__*/new Vector2();const _uvB$1=/*@__PURE__*/new Vector2();const _uvC$1=/*@__PURE__*/new Vector2();const _intersectionPoint=/*@__PURE__*/new three_module_Vector3();const _intersectionPointWorld=/*@__PURE__*/new three_module_Vector3();class Mesh extends Object3D{constructor(geometry=new BufferGeometry(),material=new MeshBasicMaterial()){super();this.isMesh=true;this.type='Mesh';this.geometry=geometry;this.material=material;this.updateMorphTargets();}copy(source,recursive){super.copy(source,recursive);if(source.morphTargetInfluences!==undefined){var _context15;this.morphTargetInfluences=slice(_context15=source.morphTargetInfluences).call(_context15);}if(source.morphTargetDictionary!==undefined){this.morphTargetDictionary=object_assign({},source.morphTargetDictionary);}this.material=source.material;this.geometry=source.geometry;return this;}updateMorphTargets(){const geometry=this.geometry;const morphAttributes=geometry.morphAttributes;const keys=object_keys(morphAttributes);if(keys.length>0){const morphAttribute=morphAttributes[keys[0]];if(morphAttribute!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;m<ml;m++){const name=morphAttribute[m].name||String(m);this.morphTargetInfluences.push(0);this.morphTargetDictionary[name]=m;}}}}raycast(raycaster,intersects){const geometry=this.geometry;const material=this.material;const matrixWorld=this.matrixWorld;if(material===undefined)return;// Checking boundingSphere distance to ray\nif(geometry.boundingSphere===null)geometry.computeBoundingSphere();_sphere$3.copy(geometry.boundingSphere);_sphere$3.applyMatrix4(matrixWorld);if(raycaster.ray.intersectsSphere(_sphere$3)===false)return;//\n_inverseMatrix$2.copy(matrixWorld).invert();_ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2);// Check boundingBox before continuing\nif(geometry.boundingBox!==null){if(_ray$2.intersectsBox(geometry.boundingBox)===false)return;}let intersection;const index=geometry.index;const position=geometry.attributes.position;const morphPosition=geometry.morphAttributes.position;const morphTargetsRelative=geometry.morphTargetsRelative;const uv=geometry.attributes.uv;const uv2=geometry.attributes.uv2;const groups=geometry.groups;const drawRange=geometry.drawRange;if(index!==null){// indexed buffer geometry\nif(is_array(material)){for(let i=0,il=groups.length;i<il;i++){const group=groups[i];const groupMaterial=material[group.materialIndex];const start=Math.max(group.start,drawRange.start);const end=Math.min(index.count,Math.min(group.start+group.count,drawRange.start+drawRange.count));for(let j=start,jl=end;j<jl;j+=3){const a=index.getX(j);const b=index.getX(j+1);const c=index.getX(j+2);intersection=checkBufferGeometryIntersection(this,groupMaterial,raycaster,_ray$2,position,morphPosition,morphTargetsRelative,uv,uv2,a,b,c);if(intersection){intersection.faceIndex=Math.floor(j/3);// triangle number in indexed buffer semantics\nintersection.face.materialIndex=group.materialIndex;intersects.push(intersection);}}}}else{const start=Math.max(0,drawRange.start);const end=Math.min(index.count,drawRange.start+drawRange.count);for(let i=start,il=end;i<il;i+=3){const a=index.getX(i);const b=index.getX(i+1);const c=index.getX(i+2);intersection=checkBufferGeometryIntersection(this,material,raycaster,_ray$2,position,morphPosition,morphTargetsRelative,uv,uv2,a,b,c);if(intersection){intersection.faceIndex=Math.floor(i/3);// triangle number in indexed buffer semantics\nintersects.push(intersection);}}}}else if(position!==undefined){// non-indexed buffer geometry\nif(is_array(material)){for(let i=0,il=groups.length;i<il;i++){const group=groups[i];const groupMaterial=material[group.materialIndex];const start=Math.max(group.start,drawRange.start);const end=Math.min(position.count,Math.min(group.start+group.count,drawRange.start+drawRange.count));for(let j=start,jl=end;j<jl;j+=3){const a=j;const b=j+1;const c=j+2;intersection=checkBufferGeometryIntersection(this,groupMaterial,raycaster,_ray$2,position,morphPosition,morphTargetsRelative,uv,uv2,a,b,c);if(intersection){intersection.faceIndex=Math.floor(j/3);// triangle number in non-indexed buffer semantics\nintersection.face.materialIndex=group.materialIndex;intersects.push(intersection);}}}}else{const start=Math.max(0,drawRange.start);const end=Math.min(position.count,drawRange.start+drawRange.count);for(let i=start,il=end;i<il;i+=3){const a=i;const b=i+1;const c=i+2;intersection=checkBufferGeometryIntersection(this,material,raycaster,_ray$2,position,morphPosition,morphTargetsRelative,uv,uv2,a,b,c);if(intersection){intersection.faceIndex=Math.floor(i/3);// triangle number in non-indexed buffer semantics\nintersects.push(intersection);}}}}}}function checkIntersection(object,material,raycaster,ray,pA,pB,pC,point){let intersect;if(material.side===BackSide){intersect=ray.intersectTriangle(pC,pB,pA,true,point);}else{intersect=ray.intersectTriangle(pA,pB,pC,material.side!==DoubleSide,point);}if(intersect===null)return null;_intersectionPointWorld.copy(point);_intersectionPointWorld.applyMatrix4(object.matrixWorld);const distance=raycaster.ray.origin.distanceTo(_intersectionPointWorld);if(distance<raycaster.near||distance>raycaster.far)return null;return{distance:distance,point:_intersectionPointWorld.clone(),object:object};}function checkBufferGeometryIntersection(object,material,raycaster,ray,position,morphPosition,morphTargetsRelative,uv,uv2,a,b,c){_vA$1.fromBufferAttribute(position,a);_vB$1.fromBufferAttribute(position,b);_vC$1.fromBufferAttribute(position,c);const morphInfluences=object.morphTargetInfluences;if(morphPosition&&morphInfluences){_morphA.set(0,0,0);_morphB.set(0,0,0);_morphC.set(0,0,0);for(let i=0,il=morphPosition.length;i<il;i++){const influence=morphInfluences[i];const morphAttribute=morphPosition[i];if(influence===0)continue;_tempA.fromBufferAttribute(morphAttribute,a);_tempB.fromBufferAttribute(morphAttribute,b);_tempC.fromBufferAttribute(morphAttribute,c);if(morphTargetsRelative){_morphA.addScaledVector(_tempA,influence);_morphB.addScaledVector(_tempB,influence);_morphC.addScaledVector(_tempC,influence);}else{_morphA.addScaledVector(_tempA.sub(_vA$1),influence);_morphB.addScaledVector(_tempB.sub(_vB$1),influence);_morphC.addScaledVector(_tempC.sub(_vC$1),influence);}}_vA$1.add(_morphA);_vB$1.add(_morphB);_vC$1.add(_morphC);}if(object.isSkinnedMesh){object.boneTransform(a,_vA$1);object.boneTransform(b,_vB$1);object.boneTransform(c,_vC$1);}const intersection=checkIntersection(object,material,raycaster,ray,_vA$1,_vB$1,_vC$1,_intersectionPoint);if(intersection){if(uv){_uvA$1.fromBufferAttribute(uv,a);_uvB$1.fromBufferAttribute(uv,b);_uvC$1.fromBufferAttribute(uv,c);intersection.uv=three_module_Triangle.getUV(_intersectionPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2());}if(uv2){_uvA$1.fromBufferAttribute(uv2,a);_uvB$1.fromBufferAttribute(uv2,b);_uvC$1.fromBufferAttribute(uv2,c);intersection.uv2=three_module_Triangle.getUV(_intersectionPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2());}const face={a:a,b:b,c:c,normal:new three_module_Vector3(),materialIndex:0};three_module_Triangle.getNormal(_vA$1,_vB$1,_vC$1,face.normal);intersection.face=face;}return intersection;}class BoxGeometry extends BufferGeometry{constructor(width=1,height=1,depth=1,widthSegments=1,heightSegments=1,depthSegments=1){super();this.type='BoxGeometry';this.parameters={width:width,height:height,depth:depth,widthSegments:widthSegments,heightSegments:heightSegments,depthSegments:depthSegments};const scope=this;// segments\nwidthSegments=Math.floor(widthSegments);heightSegments=Math.floor(heightSegments);depthSegments=Math.floor(depthSegments);// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// helper variables\nlet numberOfVertices=0;let groupStart=0;// build each side of the box geometry\nbuildPlane('z','y','x',-1,-1,depth,height,width,depthSegments,heightSegments,0);// px\nbuildPlane('z','y','x',1,-1,depth,height,-width,depthSegments,heightSegments,1);// nx\nbuildPlane('x','z','y',1,1,width,depth,height,widthSegments,depthSegments,2);// py\nbuildPlane('x','z','y',1,-1,width,depth,-height,widthSegments,depthSegments,3);// ny\nbuildPlane('x','y','z',1,-1,width,height,depth,widthSegments,heightSegments,4);// pz\nbuildPlane('x','y','z',-1,-1,width,height,-depth,widthSegments,heightSegments,5);// nz\n// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));function buildPlane(u,v,w,udir,vdir,width,height,depth,gridX,gridY,materialIndex){const segmentWidth=width/gridX;const segmentHeight=height/gridY;const widthHalf=width/2;const heightHalf=height/2;const depthHalf=depth/2;const gridX1=gridX+1;const gridY1=gridY+1;let vertexCounter=0;let groupCount=0;const vector=new three_module_Vector3();// generate vertices, normals and uvs\nfor(let iy=0;iy<gridY1;iy++){const y=iy*segmentHeight-heightHalf;for(let ix=0;ix<gridX1;ix++){const x=ix*segmentWidth-widthHalf;// set values to correct vector component\nvector[u]=x*udir;vector[v]=y*vdir;vector[w]=depthHalf;// now apply vector to vertex buffer\nvertices.push(vector.x,vector.y,vector.z);// set values to correct vector component\nvector[u]=0;vector[v]=0;vector[w]=depth>0?1:-1;// now apply vector to normal buffer\nnormals.push(vector.x,vector.y,vector.z);// uvs\nuvs.push(ix/gridX);uvs.push(1-iy/gridY);// counters\nvertexCounter+=1;}}// indices\n// 1. you need three indices to draw a single face\n// 2. a single segment consists of two faces\n// 3. so we need to generate six (2*3) indices per segment\nfor(let iy=0;iy<gridY;iy++){for(let ix=0;ix<gridX;ix++){const a=numberOfVertices+ix+gridX1*iy;const b=numberOfVertices+ix+gridX1*(iy+1);const c=numberOfVertices+(ix+1)+gridX1*(iy+1);const d=numberOfVertices+(ix+1)+gridX1*iy;// faces\nindices.push(a,b,d);indices.push(b,c,d);// increase counter\ngroupCount+=6;}}// add a group to the geometry. this will ensure multi material support\nscope.addGroup(groupStart,groupCount,materialIndex);// calculate new start value for groups\ngroupStart+=groupCount;// update total number of vertices\nnumberOfVertices+=vertexCounter;}}static fromJSON(data){return new BoxGeometry(data.width,data.height,data.depth,data.widthSegments,data.heightSegments,data.depthSegments);}}/**\n * Uniform Utilities\n */function cloneUniforms(src){const dst={};for(const u in src){dst[u]={};for(const p in src[u]){const property=src[u][p];if(property&&(property.isColor||property.isMatrix3||property.isMatrix4||property.isVector2||property.isVector3||property.isVector4||property.isTexture||property.isQuaternion)){dst[u][p]=property.clone();}else if(is_array(property)){dst[u][p]=slice(property).call(property);}else{dst[u][p]=property;}}}return dst;}function mergeUniforms(uniforms){const merged={};for(let u=0;u<uniforms.length;u++){const tmp=cloneUniforms(uniforms[u]);for(const p in tmp){merged[p]=tmp[p];}}return merged;}function cloneUniformsGroups(src){const dst=[];for(let u=0;u<src.length;u++){dst.push(src[u].clone());}return dst;}// Legacy\nconst UniformsUtils={clone:cloneUniforms,merge:mergeUniforms};var default_vertex=\"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";var default_fragment=\"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";class ShaderMaterial extends Material{constructor(parameters){super();this.isShaderMaterial=true;this.type='ShaderMaterial';this.defines={};this.uniforms={};this.uniformsGroups=[];this.vertexShader=default_vertex;this.fragmentShader=default_fragment;this.linewidth=1;this.wireframe=false;this.wireframeLinewidth=1;this.fog=false;// set to use scene fog\nthis.lights=false;// set to use scene lights\nthis.clipping=false;// set to use user-defined clipping planes\nthis.extensions={derivatives:false,// set to use derivatives\nfragDepth:false,// set to use fragment depth values\ndrawBuffers:false,// set to use draw buffers\nshaderTextureLOD:false// set to use shader texture LOD\n};// When rendered geometry doesn't include these attributes but the material does,\n// use these default values in WebGL. This avoids errors when buffer data is missing.\nthis.defaultAttributeValues={'color':[1,1,1],'uv':[0,0],'uv2':[0,0]};this.index0AttributeName=undefined;this.uniformsNeedUpdate=false;this.glslVersion=null;if(parameters!==undefined){this.setValues(parameters);}}copy(source){super.copy(source);this.fragmentShader=source.fragmentShader;this.vertexShader=source.vertexShader;this.uniforms=cloneUniforms(source.uniforms);this.uniformsGroups=cloneUniformsGroups(source.uniformsGroups);this.defines=object_assign({},source.defines);this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.fog=source.fog;this.lights=source.lights;this.clipping=source.clipping;this.extensions=object_assign({},source.extensions);this.glslVersion=source.glslVersion;return this;}toJSON(meta){const data=super.toJSON(meta);data.glslVersion=this.glslVersion;data.uniforms={};for(const name in this.uniforms){const uniform=this.uniforms[name];const value=uniform.value;if(value&&value.isTexture){data.uniforms[name]={type:'t',value:value.toJSON(meta).uuid};}else if(value&&value.isColor){data.uniforms[name]={type:'c',value:value.getHex()};}else if(value&&value.isVector2){data.uniforms[name]={type:'v2',value:value.toArray()};}else if(value&&value.isVector3){data.uniforms[name]={type:'v3',value:value.toArray()};}else if(value&&value.isVector4){data.uniforms[name]={type:'v4',value:value.toArray()};}else if(value&&value.isMatrix3){data.uniforms[name]={type:'m3',value:value.toArray()};}else if(value&&value.isMatrix4){data.uniforms[name]={type:'m4',value:value.toArray()};}else{data.uniforms[name]={value:value};// note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n}}if(object_keys(this.defines).length>0)data.defines=this.defines;data.vertexShader=this.vertexShader;data.fragmentShader=this.fragmentShader;const extensions={};for(const key in this.extensions){if(this.extensions[key]===true)extensions[key]=true;}if(object_keys(extensions).length>0)data.extensions=extensions;return data;}}class Camera extends Object3D{constructor(){super();this.isCamera=true;this.type='Camera';this.matrixWorldInverse=new Matrix4();this.projectionMatrix=new Matrix4();this.projectionMatrixInverse=new Matrix4();}copy(source,recursive){super.copy(source,recursive);this.matrixWorldInverse.copy(source.matrixWorldInverse);this.projectionMatrix.copy(source.projectionMatrix);this.projectionMatrixInverse.copy(source.projectionMatrixInverse);return this;}getWorldDirection(target){this.updateWorldMatrix(true,false);const e=this.matrixWorld.elements;return target.set(-e[8],-e[9],-e[10]).normalize();}updateMatrixWorld(force){super.updateMatrixWorld(force);this.matrixWorldInverse.copy(this.matrixWorld).invert();}updateWorldMatrix(updateParents,updateChildren){super.updateWorldMatrix(updateParents,updateChildren);this.matrixWorldInverse.copy(this.matrixWorld).invert();}clone(){return new this.constructor().copy(this);}}class PerspectiveCamera extends Camera{constructor(fov=50,aspect=1,near=0.1,far=2000){super();this.isPerspectiveCamera=true;this.type='PerspectiveCamera';this.fov=fov;this.zoom=1;this.near=near;this.far=far;this.focus=10;this.aspect=aspect;this.view=null;this.filmGauge=35;// width of the film (default in millimeters)\nthis.filmOffset=0;// horizontal film offset (same unit as gauge)\nthis.updateProjectionMatrix();}copy(source,recursive){super.copy(source,recursive);this.fov=source.fov;this.zoom=source.zoom;this.near=source.near;this.far=source.far;this.focus=source.focus;this.aspect=source.aspect;this.view=source.view===null?null:object_assign({},source.view);this.filmGauge=source.filmGauge;this.filmOffset=source.filmOffset;return this;}/**\n\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * Values for focal length and film gauge must have the same unit.\n\t */setFocalLength(focalLength){/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */const vExtentSlope=0.5*this.getFilmHeight()/focalLength;this.fov=three_module_RAD2DEG*2*Math.atan(vExtentSlope);this.updateProjectionMatrix();}/**\n\t * Calculates the focal length from the current .fov and .filmGauge.\n\t */getFocalLength(){const vExtentSlope=Math.tan(three_module_DEG2RAD*0.5*this.fov);return 0.5*this.getFilmHeight()/vExtentSlope;}getEffectiveFOV(){return three_module_RAD2DEG*2*Math.atan(Math.tan(three_module_DEG2RAD*0.5*this.fov)/this.zoom);}getFilmWidth(){// film not completely covered in portrait format (aspect < 1)\nreturn this.filmGauge*Math.min(this.aspect,1);}getFilmHeight(){// film not completely covered in landscape format (aspect > 1)\nreturn this.filmGauge/Math.max(this.aspect,1);}/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *\n\t * +---+---+---+\n\t * | A | B | C |\n\t * +---+---+---+\n\t * | D | E | F |\n\t * +---+---+---+\n\t *\n\t * then for each monitor you would call it like this\n\t *\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t */setViewOffset(fullWidth,fullHeight,x,y,width,height){this.aspect=fullWidth/fullHeight;if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1};}this.view.enabled=true;this.view.fullWidth=fullWidth;this.view.fullHeight=fullHeight;this.view.offsetX=x;this.view.offsetY=y;this.view.width=width;this.view.height=height;this.updateProjectionMatrix();}clearViewOffset(){if(this.view!==null){this.view.enabled=false;}this.updateProjectionMatrix();}updateProjectionMatrix(){const near=this.near;let top=near*Math.tan(three_module_DEG2RAD*0.5*this.fov)/this.zoom;let height=2*top;let width=this.aspect*height;let left=-0.5*width;const view=this.view;if(this.view!==null&&this.view.enabled){const fullWidth=view.fullWidth,fullHeight=view.fullHeight;left+=view.offsetX*width/fullWidth;top-=view.offsetY*height/fullHeight;width*=view.width/fullWidth;height*=view.height/fullHeight;}const skew=this.filmOffset;if(skew!==0)left+=near*skew/this.getFilmWidth();this.projectionMatrix.makePerspective(left,left+width,top,top-height,near,this.far);this.projectionMatrixInverse.copy(this.projectionMatrix).invert();}toJSON(meta){const data=super.toJSON(meta);data.object.fov=this.fov;data.object.zoom=this.zoom;data.object.near=this.near;data.object.far=this.far;data.object.focus=this.focus;data.object.aspect=this.aspect;if(this.view!==null)data.object.view=object_assign({},this.view);data.object.filmGauge=this.filmGauge;data.object.filmOffset=this.filmOffset;return data;}}const fov=90,aspect=1;class CubeCamera extends Object3D{constructor(near,far,renderTarget){super();this.type='CubeCamera';this.renderTarget=renderTarget;const cameraPX=new PerspectiveCamera(fov,aspect,near,far);cameraPX.layers=this.layers;cameraPX.up.set(0,-1,0);cameraPX.lookAt(new three_module_Vector3(1,0,0));this.add(cameraPX);const cameraNX=new PerspectiveCamera(fov,aspect,near,far);cameraNX.layers=this.layers;cameraNX.up.set(0,-1,0);cameraNX.lookAt(new three_module_Vector3(-1,0,0));this.add(cameraNX);const cameraPY=new PerspectiveCamera(fov,aspect,near,far);cameraPY.layers=this.layers;cameraPY.up.set(0,0,1);cameraPY.lookAt(new three_module_Vector3(0,1,0));this.add(cameraPY);const cameraNY=new PerspectiveCamera(fov,aspect,near,far);cameraNY.layers=this.layers;cameraNY.up.set(0,0,-1);cameraNY.lookAt(new three_module_Vector3(0,-1,0));this.add(cameraNY);const cameraPZ=new PerspectiveCamera(fov,aspect,near,far);cameraPZ.layers=this.layers;cameraPZ.up.set(0,-1,0);cameraPZ.lookAt(new three_module_Vector3(0,0,1));this.add(cameraPZ);const cameraNZ=new PerspectiveCamera(fov,aspect,near,far);cameraNZ.layers=this.layers;cameraNZ.up.set(0,-1,0);cameraNZ.lookAt(new three_module_Vector3(0,0,-1));this.add(cameraNZ);}update(renderer,scene){if(this.parent===null)this.updateMatrixWorld();const renderTarget=this.renderTarget;const[cameraPX,cameraNX,cameraPY,cameraNY,cameraPZ,cameraNZ]=this.children;const currentRenderTarget=renderer.getRenderTarget();const currentToneMapping=renderer.toneMapping;const currentXrEnabled=renderer.xr.enabled;renderer.toneMapping=NoToneMapping;renderer.xr.enabled=false;const generateMipmaps=renderTarget.texture.generateMipmaps;renderTarget.texture.generateMipmaps=false;renderer.setRenderTarget(renderTarget,0);renderer.render(scene,cameraPX);renderer.setRenderTarget(renderTarget,1);renderer.render(scene,cameraNX);renderer.setRenderTarget(renderTarget,2);renderer.render(scene,cameraPY);renderer.setRenderTarget(renderTarget,3);renderer.render(scene,cameraNY);renderer.setRenderTarget(renderTarget,4);renderer.render(scene,cameraPZ);renderTarget.texture.generateMipmaps=generateMipmaps;renderer.setRenderTarget(renderTarget,5);renderer.render(scene,cameraNZ);renderer.setRenderTarget(currentRenderTarget);renderer.toneMapping=currentToneMapping;renderer.xr.enabled=currentXrEnabled;renderTarget.texture.needsPMREMUpdate=true;}}class CubeTexture extends Texture{constructor(images,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding){images=images!==undefined?images:[];mapping=mapping!==undefined?mapping:CubeReflectionMapping;super(images,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding);this.isCubeTexture=true;this.flipY=false;}get images(){return this.image;}set images(value){this.image=value;}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(size=1,options={}){super(size,size,options);this.isWebGLCubeRenderTarget=true;const image={width:size,height:size,depth:1};const images=[image,image,image,image,image,image];this.texture=new CubeTexture(images,options.mapping,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.encoding);// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\nthis.texture.isRenderTargetTexture=true;this.texture.generateMipmaps=options.generateMipmaps!==undefined?options.generateMipmaps:false;this.texture.minFilter=options.minFilter!==undefined?options.minFilter:LinearFilter;}fromEquirectangularTexture(renderer,texture){this.texture.type=texture.type;this.texture.encoding=texture.encoding;this.texture.generateMipmaps=texture.generateMipmaps;this.texture.minFilter=texture.minFilter;this.texture.magFilter=texture.magFilter;const shader={uniforms:{tEquirect:{value:null}},vertexShader:/* glsl */`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,fragmentShader:/* glsl */`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`};const geometry=new BoxGeometry(5,5,5);const material=new ShaderMaterial({name:'CubemapFromEquirect',uniforms:cloneUniforms(shader.uniforms),vertexShader:shader.vertexShader,fragmentShader:shader.fragmentShader,side:BackSide,blending:NoBlending});material.uniforms.tEquirect.value=texture;const mesh=new Mesh(geometry,material);const currentMinFilter=texture.minFilter;// Avoid blurred poles\nif(texture.minFilter===LinearMipmapLinearFilter)texture.minFilter=LinearFilter;const camera=new CubeCamera(1,10,this);camera.update(renderer,mesh);texture.minFilter=currentMinFilter;mesh.geometry.dispose();mesh.material.dispose();return this;}clear(renderer,color,depth,stencil){const currentRenderTarget=renderer.getRenderTarget();for(let i=0;i<6;i++){renderer.setRenderTarget(this,i);renderer.clear(color,depth,stencil);}renderer.setRenderTarget(currentRenderTarget);}}const _vector1=/*@__PURE__*/new three_module_Vector3();const _vector2=/*@__PURE__*/new three_module_Vector3();const _normalMatrix=/*@__PURE__*/new Matrix3();class Plane{constructor(normal=new three_module_Vector3(1,0,0),constant=0){this.isPlane=true;// normal is assumed to be normalized\nthis.normal=normal;this.constant=constant;}set(normal,constant){this.normal.copy(normal);this.constant=constant;return this;}setComponents(x,y,z,w){this.normal.set(x,y,z);this.constant=w;return this;}setFromNormalAndCoplanarPoint(normal,point){this.normal.copy(normal);this.constant=-point.dot(this.normal);return this;}setFromCoplanarPoints(a,b,c){const normal=_vector1.subVectors(c,b).cross(_vector2.subVectors(a,b)).normalize();// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\nthis.setFromNormalAndCoplanarPoint(normal,a);return this;}copy(plane){this.normal.copy(plane.normal);this.constant=plane.constant;return this;}normalize(){// Note: will lead to a divide by zero if the plane is invalid.\nconst inverseNormalLength=1.0/this.normal.length();this.normal.multiplyScalar(inverseNormalLength);this.constant*=inverseNormalLength;return this;}negate(){this.constant*=-1;this.normal.negate();return this;}distanceToPoint(point){return this.normal.dot(point)+this.constant;}distanceToSphere(sphere){return this.distanceToPoint(sphere.center)-sphere.radius;}projectPoint(point,target){return target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);}intersectLine(line,target){const direction=line.delta(_vector1);const denominator=this.normal.dot(direction);if(denominator===0){// line is coplanar, return origin\nif(this.distanceToPoint(line.start)===0){return target.copy(line.start);}// Unsure if this is the correct method to handle this case.\nreturn null;}const t=-(line.start.dot(this.normal)+this.constant)/denominator;if(t<0||t>1){return null;}return target.copy(direction).multiplyScalar(t).add(line.start);}intersectsLine(line){// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\nconst startSign=this.distanceToPoint(line.start);const endSign=this.distanceToPoint(line.end);return startSign<0&&endSign>0||endSign<0&&startSign>0;}intersectsBox(box){return box.intersectsPlane(this);}intersectsSphere(sphere){return sphere.intersectsPlane(this);}coplanarPoint(target){return target.copy(this.normal).multiplyScalar(-this.constant);}applyMatrix4(matrix,optionalNormalMatrix){const normalMatrix=optionalNormalMatrix||_normalMatrix.getNormalMatrix(matrix);const referencePoint=this.coplanarPoint(_vector1).applyMatrix4(matrix);const normal=this.normal.applyMatrix3(normalMatrix).normalize();this.constant=-referencePoint.dot(normal);return this;}translate(offset){this.constant-=offset.dot(this.normal);return this;}equals(plane){return plane.normal.equals(this.normal)&&plane.constant===this.constant;}clone(){return new this.constructor().copy(this);}}const _sphere$2=/*@__PURE__*/new Sphere();const _vector$7=/*@__PURE__*/new three_module_Vector3();class Frustum{constructor(p0=new Plane(),p1=new Plane(),p2=new Plane(),p3=new Plane(),p4=new Plane(),p5=new Plane()){this.planes=[p0,p1,p2,p3,p4,p5];}set(p0,p1,p2,p3,p4,p5){const planes=this.planes;planes[0].copy(p0);planes[1].copy(p1);planes[2].copy(p2);planes[3].copy(p3);planes[4].copy(p4);planes[5].copy(p5);return this;}copy(frustum){const planes=this.planes;for(let i=0;i<6;i++){planes[i].copy(frustum.planes[i]);}return this;}setFromProjectionMatrix(m){const planes=this.planes;const me=m.elements;const me0=me[0],me1=me[1],me2=me[2],me3=me[3];const me4=me[4],me5=me[5],me6=me[6],me7=me[7];const me8=me[8],me9=me[9],me10=me[10],me11=me[11];const me12=me[12],me13=me[13],me14=me[14],me15=me[15];planes[0].setComponents(me3-me0,me7-me4,me11-me8,me15-me12).normalize();planes[1].setComponents(me3+me0,me7+me4,me11+me8,me15+me12).normalize();planes[2].setComponents(me3+me1,me7+me5,me11+me9,me15+me13).normalize();planes[3].setComponents(me3-me1,me7-me5,me11-me9,me15-me13).normalize();planes[4].setComponents(me3-me2,me7-me6,me11-me10,me15-me14).normalize();planes[5].setComponents(me3+me2,me7+me6,me11+me10,me15+me14).normalize();return this;}intersectsObject(object){const geometry=object.geometry;if(geometry.boundingSphere===null)geometry.computeBoundingSphere();_sphere$2.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);return this.intersectsSphere(_sphere$2);}intersectsSprite(sprite){_sphere$2.center.set(0,0,0);_sphere$2.radius=0.7071067811865476;_sphere$2.applyMatrix4(sprite.matrixWorld);return this.intersectsSphere(_sphere$2);}intersectsSphere(sphere){const planes=this.planes;const center=sphere.center;const negRadius=-sphere.radius;for(let i=0;i<6;i++){const distance=planes[i].distanceToPoint(center);if(distance<negRadius){return false;}}return true;}intersectsBox(box){const planes=this.planes;for(let i=0;i<6;i++){const plane=planes[i];// corner at max distance\n_vector$7.x=plane.normal.x>0?box.max.x:box.min.x;_vector$7.y=plane.normal.y>0?box.max.y:box.min.y;_vector$7.z=plane.normal.z>0?box.max.z:box.min.z;if(plane.distanceToPoint(_vector$7)<0){return false;}}return true;}containsPoint(point){const planes=this.planes;for(let i=0;i<6;i++){if(planes[i].distanceToPoint(point)<0){return false;}}return true;}clone(){return new this.constructor().copy(this);}}function WebGLAnimation(){let context=null;let isAnimating=false;let animationLoop=null;let requestId=null;function onAnimationFrame(time,frame){animationLoop(time,frame);requestId=context.requestAnimationFrame(onAnimationFrame);}return{start:function(){if(isAnimating===true)return;if(animationLoop===null)return;requestId=context.requestAnimationFrame(onAnimationFrame);isAnimating=true;},stop:function(){context.cancelAnimationFrame(requestId);isAnimating=false;},setAnimationLoop:function(callback){animationLoop=callback;},setContext:function(value){context=value;}};}function WebGLAttributes(gl,capabilities){const isWebGL2=capabilities.isWebGL2;const buffers=new weak_map();function createBuffer(attribute,bufferType){const array=attribute.array;const usage=attribute.usage;const buffer=gl.createBuffer();gl.bindBuffer(bufferType,buffer);gl.bufferData(bufferType,array,usage);attribute.onUploadCallback();let type;if(array instanceof Float32Array){type=5126;}else if(array instanceof Uint16Array){if(attribute.isFloat16BufferAttribute){if(isWebGL2){type=5131;}else{throw new Error('THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.');}}else{type=5123;}}else if(array instanceof Int16Array){type=5122;}else if(array instanceof Uint32Array){type=5125;}else if(array instanceof Int32Array){type=5124;}else if(array instanceof Int8Array){type=5120;}else if(array instanceof Uint8Array){type=5121;}else if(array instanceof Uint8ClampedArray){type=5121;}else{throw new Error('THREE.WebGLAttributes: Unsupported buffer data format: '+array);}return{buffer:buffer,type:type,bytesPerElement:array.BYTES_PER_ELEMENT,version:attribute.version};}function updateBuffer(buffer,attribute,bufferType){const array=attribute.array;const updateRange=attribute.updateRange;gl.bindBuffer(bufferType,buffer);if(updateRange.count===-1){// Not using update ranges\ngl.bufferSubData(bufferType,0,array);}else{if(isWebGL2){gl.bufferSubData(bufferType,updateRange.offset*array.BYTES_PER_ELEMENT,array,updateRange.offset,updateRange.count);}else{gl.bufferSubData(bufferType,updateRange.offset*array.BYTES_PER_ELEMENT,array.subarray(updateRange.offset,updateRange.offset+updateRange.count));}updateRange.count=-1;// reset range\n}}//\nfunction get(attribute){if(attribute.isInterleavedBufferAttribute)attribute=attribute.data;return buffers.get(attribute);}function remove(attribute){if(attribute.isInterleavedBufferAttribute)attribute=attribute.data;const data=buffers.get(attribute);if(data){gl.deleteBuffer(data.buffer);buffers.delete(attribute);}}function update(attribute,bufferType){if(attribute.isGLBufferAttribute){const cached=buffers.get(attribute);if(!cached||cached.version<attribute.version){buffers.set(attribute,{buffer:attribute.buffer,type:attribute.type,bytesPerElement:attribute.elementSize,version:attribute.version});}return;}if(attribute.isInterleavedBufferAttribute)attribute=attribute.data;const data=buffers.get(attribute);if(data===undefined){buffers.set(attribute,createBuffer(attribute,bufferType));}else if(data.version<attribute.version){updateBuffer(data.buffer,attribute,bufferType);data.version=attribute.version;}}return{get:get,remove:remove,update:update};}class PlaneGeometry extends BufferGeometry{constructor(width=1,height=1,widthSegments=1,heightSegments=1){super();this.type='PlaneGeometry';this.parameters={width:width,height:height,widthSegments:widthSegments,heightSegments:heightSegments};const width_half=width/2;const height_half=height/2;const gridX=Math.floor(widthSegments);const gridY=Math.floor(heightSegments);const gridX1=gridX+1;const gridY1=gridY+1;const segment_width=width/gridX;const segment_height=height/gridY;//\nconst indices=[];const vertices=[];const normals=[];const uvs=[];for(let iy=0;iy<gridY1;iy++){const y=iy*segment_height-height_half;for(let ix=0;ix<gridX1;ix++){const x=ix*segment_width-width_half;vertices.push(x,-y,0);normals.push(0,0,1);uvs.push(ix/gridX);uvs.push(1-iy/gridY);}}for(let iy=0;iy<gridY;iy++){for(let ix=0;ix<gridX;ix++){const a=ix+gridX1*iy;const b=ix+gridX1*(iy+1);const c=ix+1+gridX1*(iy+1);const d=ix+1+gridX1*iy;indices.push(a,b,d);indices.push(b,c,d);}}this.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));}static fromJSON(data){return new PlaneGeometry(data.width,data.height,data.widthSegments,data.heightSegments);}}var alphamap_fragment=\"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\";var alphamap_pars_fragment=\"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";var alphatest_fragment=\"#ifdef USE_ALPHATEST\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n#endif\";var alphatest_pars_fragment=\"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";var aomap_fragment=\"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\";var aomap_pars_fragment=\"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";var begin_vertex=\"vec3 transformed = vec3( position );\";var beginnormal_vertex=\"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";var bsdfs=\"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\\n float x2 = x * x;\\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( V * D );\\n}\\n#ifdef USE_IRIDESCENCE\\n\\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\\n\\t\\tfloat alpha = pow2( roughness );\\n\\t\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\t\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\t\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\t\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\t\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\t\\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\\n\\t\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\t\\tfloat D = D_GGX( alpha, dotNH );\\n\\t\\treturn F * ( V * D );\\n\\t}\\n#endif\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tfloat invAlpha = 1.0 / alpha;\\n\\tfloat cos2h = dotNH * dotNH;\\n\\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\\tfloat V = V_Neubelt( dotNV, dotNL );\\n\\treturn sheenColor * ( D * V );\\n}\\n#endif\";var iridescence_fragment=\"#ifdef USE_IRIDESCENCE\\n\\tconst mat3 XYZ_TO_REC709 = mat3(\\n\\t\\t 3.2404542, -0.9692660, 0.0556434,\\n\\t\\t-1.5371385, 1.8760108, -0.2040259,\\n\\t\\t-0.4985314, 0.0415560, 1.0572252\\n\\t);\\n\\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\\n\\t\\tvec3 sqrtF0 = sqrt( fresnel0 );\\n\\t\\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\\n\\t}\\n\\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\\n\\t\\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\\n\\t}\\n\\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\\n\\t\\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\\n\\t}\\n\\tvec3 evalSensitivity( float OPD, vec3 shift ) {\\n\\t\\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\\n\\t\\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\\n\\t\\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\\n\\t\\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\\n\\t\\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\\n\\t\\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\\n\\t\\txyz /= 1.0685e-7;\\n\\t\\tvec3 rgb = XYZ_TO_REC709 * xyz;\\n\\t\\treturn rgb;\\n\\t}\\n\\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\\n\\t\\tvec3 I;\\n\\t\\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\\n\\t\\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\\n\\t\\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\\n\\t\\tif ( cosTheta2Sq < 0.0 ) {\\n\\t\\t\\t return vec3( 1.0 );\\n\\t\\t}\\n\\t\\tfloat cosTheta2 = sqrt( cosTheta2Sq );\\n\\t\\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\\n\\t\\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\\n\\t\\tfloat R21 = R12;\\n\\t\\tfloat T121 = 1.0 - R12;\\n\\t\\tfloat phi12 = 0.0;\\n\\t\\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\\n\\t\\tfloat phi21 = PI - phi12;\\n\\t\\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\\t\\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\\n\\t\\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\\n\\t\\tvec3 phi23 = vec3( 0.0 );\\n\\t\\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\\n\\t\\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\\n\\t\\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\\n\\t\\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\\n\\t\\tvec3 phi = vec3( phi21 ) + phi23;\\n\\t\\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\\n\\t\\tvec3 r123 = sqrt( R123 );\\n\\t\\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\\n\\t\\tvec3 C0 = R12 + Rs;\\n\\t\\tI = C0;\\n\\t\\tvec3 Cm = Rs - T121;\\n\\t\\tfor ( int m = 1; m <= 2; ++ m ) {\\n\\t\\t\\tCm *= r123;\\n\\t\\t\\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\\n\\t\\t\\tI += Cm * Sm;\\n\\t\\t}\\n\\t\\treturn max( I, vec3( 0.0 ) );\\n\\t}\\n#endif\";var bumpmap_pars_fragment=\"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\\n\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\\t\\tvec3 vSigmaX = dFdx( surf_pos.xyz );\\n\\t\\tvec3 vSigmaY = dFdy( surf_pos.xyz );\\n\\t\\tvec3 vN = surf_norm;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\";var clipping_planes_fragment=\"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\";var clipping_planes_pars_fragment=\"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";var clipping_planes_pars_vertex=\"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";var clipping_planes_vertex=\"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";var color_fragment=\"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";var color_pars_fragment=\"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";var color_pars_vertex=\"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";var color_vertex=\"#if defined( USE_COLOR_ALPHA )\\n\\tvColor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvColor = vec3( 1.0 );\\n#endif\\n#ifdef USE_COLOR\\n\\tvColor *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\\tvColor.xyz *= instanceColor.xyz;\\n#endif\";var common=\"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nvec3 pow2( const in vec3 x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\\tfloat precisionSafeLength( vec3 v ) {\\n\\t\\tfloat maxComponent = max3( abs( v ) );\\n\\t\\treturn length( v / maxComponent ) * maxComponent;\\n\\t}\\n#endif\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal;\\n#endif\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nfloat luminance( const in vec3 rgb ) {\\n\\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\\n\\treturn dot( weights, rgb );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\treturn vec2( u, v );\\n}\";var cube_uv_reflection_fragment=\"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_minTileSize 16.0\\n\\tfloat getFace( vec3 direction ) {\\n\\t\\tvec3 absDirection = abs( direction );\\n\\t\\tfloat face = - 1.0;\\n\\t\\tif ( absDirection.x > absDirection.z ) {\\n\\t\\t\\tif ( absDirection.x > absDirection.y )\\n\\t\\t\\t\\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t} else {\\n\\t\\t\\tif ( absDirection.z > absDirection.y )\\n\\t\\t\\t\\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t}\\n\\t\\treturn face;\\n\\t}\\n\\tvec2 getUV( vec3 direction, float face ) {\\n\\t\\tvec2 uv;\\n\\t\\tif ( face == 0.0 ) {\\n\\t\\t\\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 1.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\\t\\t} else if ( face == 2.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\\t\\t} else if ( face == 3.0 ) {\\n\\t\\t\\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 4.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\\t\\t} else {\\n\\t\\t\\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\\t\\t}\\n\\t\\treturn 0.5 * ( uv + 1.0 );\\n\\t}\\n\\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\\t\\tfloat face = getFace( direction );\\n\\t\\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\\t\\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\\t\\tfloat faceSize = exp2( mipInt );\\n\\t\\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\\n\\t\\tif ( face > 2.0 ) {\\n\\t\\t\\tuv.y += faceSize;\\n\\t\\t\\tface -= 3.0;\\n\\t\\t}\\n\\t\\tuv.x += face * faceSize;\\n\\t\\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\\n\\t\\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\\n\\t\\tuv.x *= CUBEUV_TEXEL_WIDTH;\\n\\t\\tuv.y *= CUBEUV_TEXEL_HEIGHT;\\n\\t\\t#ifdef texture2DGradEXT\\n\\t\\t\\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( envMap, uv ).rgb;\\n\\t\\t#endif\\n\\t}\\n\\t#define cubeUV_r0 1.0\\n\\t#define cubeUV_v0 0.339\\n\\t#define cubeUV_m0 - 2.0\\n\\t#define cubeUV_r1 0.8\\n\\t#define cubeUV_v1 0.276\\n\\t#define cubeUV_m1 - 1.0\\n\\t#define cubeUV_r4 0.4\\n\\t#define cubeUV_v4 0.046\\n\\t#define cubeUV_m4 2.0\\n\\t#define cubeUV_r5 0.305\\n\\t#define cubeUV_v5 0.016\\n\\t#define cubeUV_m5 3.0\\n\\t#define cubeUV_r6 0.21\\n\\t#define cubeUV_v6 0.0038\\n\\t#define cubeUV_m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= cubeUV_r1 ) {\\n\\t\\t\\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\\n\\t\\t} else if ( roughness >= cubeUV_r4 ) {\\n\\t\\t\\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\\n\\t\\t} else if ( roughness >= cubeUV_r5 ) {\\n\\t\\t\\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\\n\\t\\t} else if ( roughness >= cubeUV_r6 ) {\\n\\t\\t\\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\\n\\t\\t} else {\\n\\t\\t\\tmip = - 2.0 * log2( 1.16 * roughness );\\t\\t}\\n\\t\\treturn mip;\\n\\t}\\n\\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\\t\\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\\n\\t\\tfloat mipF = fract( mip );\\n\\t\\tfloat mipInt = floor( mip );\\n\\t\\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\\t\\tif ( mipF == 0.0 ) {\\n\\t\\t\\treturn vec4( color0, 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\\t\\t\\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\\t\\t}\\n\\t}\\n#endif\";var defaultnormal_vertex=\"vec3 transformedNormal = objectNormal;\\n#ifdef USE_INSTANCING\\n\\tmat3 m = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\\n\\ttransformedNormal = m * transformedNormal;\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\";var displacementmap_pars_vertex=\"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";var displacementmap_vertex=\"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\\n#endif\";var emissivemap_fragment=\"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\";var emissivemap_pars_fragment=\"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";var encodings_fragment=\"gl_FragColor = linearToOutputTexel( gl_FragColor );\";var encodings_pars_fragment=\"vec4 LinearToLinear( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\\n}\";var envmap_fragment=\"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvec3 cameraToFrag;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\";var envmap_common_pars_fragment=\"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\t\\n#endif\";var envmap_pars_fragment=\"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\";var envmap_pars_vertex=\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\t\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\";var envmap_vertex=\"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\";var fog_vertex=\"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";var fog_pars_vertex=\"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";var fog_fragment=\"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\";var fog_pars_fragment=\"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\tvarying float vFogDepth;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\";var gradientmap_pars_fragment=\"#ifdef USE_GRADIENTMAP\\n\\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\tfloat dotNL = dot( normal, lightDirection );\\n\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t#ifdef USE_GRADIENTMAP\\n\\t\\treturn vec3( texture2D( gradientMap, coord ).r );\\n\\t#else\\n\\t\\tvec2 fw = fwidth( coord ) * 0.5;\\n\\t\\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\\n\\t#endif\\n}\";var lightmap_fragment=\"#ifdef USE_LIGHTMAP\\n\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\\treflectedLight.indirectDiffuse += lightMapIrradiance;\\n#endif\";var lightmap_pars_fragment=\"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";var lights_lambert_fragment=\"LambertMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularStrength = specularStrength;\";var lights_lambert_pars_fragment=\"varying vec3 vViewPosition;\\nstruct LambertMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Lambert\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Lambert\\n#define Material_LightProbeLOD( material )\\t(0)\";var lights_pars_begin=\"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\nuniform vec3 lightProbe[ 9 ];\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t}\\n\\t\\treturn distanceFalloff;\\n\\t#else\\n\\t\\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\\n\\t\\t\\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t#endif\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tlight.color = directionalLight.color;\\n\\t\\tlight.direction = directionalLight.direction;\\n\\t\\tlight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tlight.color = pointLight.color;\\n\\t\\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\\t\\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\tif ( spotAttenuation > 0.0 ) {\\n\\t\\t\\tfloat lightDistance = length( lVector );\\n\\t\\t\\tlight.color = spotLight.color * spotAttenuation;\\n\\t\\t\\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t\\t} else {\\n\\t\\t\\tlight.color = vec3( 0.0 );\\n\\t\\t\\tlight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\\t\\tfloat dotNL = dot( normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\";var envmap_physical_pars_fragment=\"#if defined( USE_ENVMAP )\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\\n\\t\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 reflectVec = reflect( - viewDir, normal );\\n\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\\n\\t\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n#endif\";var lights_toon_fragment=\"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";var lights_toon_pars_fragment=\"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Toon\\n#define Material_LightProbeLOD( material )\\t(0)\";var lights_phong_fragment=\"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";var lights_phong_pars_fragment=\"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\\tvec3 diffuseColor;\\n\\tvec3 specularColor;\\n\\tfloat specularShininess;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\";var lights_physical_fragment=\"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\\tmaterial.ior = ior;\\n\\t#ifdef SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularColorFactor = specularColor;\\n\\t\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\t\\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\\n\\t\\t#endif\\n\\t\\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\\t#else\\n\\t\\tfloat specularIntensityFactor = 1.0;\\n\\t\\tvec3 specularColorFactor = vec3( 1.0 );\\n\\t\\tmaterial.specularF90 = 1.0;\\n\\t#endif\\n\\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tmaterial.clearcoat = clearcoat;\\n\\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\\tmaterial.clearcoatF90 = 1.0;\\n\\t#ifdef USE_CLEARCOATMAP\\n\\t\\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\\n\\t#endif\\n\\tmaterial.clearcoat = saturate( material.clearcoat );\\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\\tmaterial.clearcoatRoughness += geometryRoughness;\\n\\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tmaterial.iridescence = iridescence;\\n\\tmaterial.iridescenceIOR = iridescenceIOR;\\n\\t#ifdef USE_IRIDESCENCEMAP\\n\\t\\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\t\\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\\n\\t#else\\n\\t\\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\\n\\t#endif\\n#endif\\n#ifdef USE_SHEEN\\n\\tmaterial.sheenColor = sheenColor;\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\\n\\t#endif\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\\n\\t#endif\\n#endif\";var lights_physical_pars_fragment=\"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat clearcoat;\\n\\t\\tfloat clearcoatRoughness;\\n\\t\\tvec3 clearcoatF0;\\n\\t\\tfloat clearcoatF90;\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tfloat iridescence;\\n\\t\\tfloat iridescenceIOR;\\n\\t\\tfloat iridescenceThickness;\\n\\t\\tvec3 iridescenceFresnel;\\n\\t\\tvec3 iridescenceF0;\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tvec3 sheenColor;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n\\t#ifdef IOR\\n\\t\\tfloat ior;\\n\\t#endif\\n\\t#ifdef USE_TRANSMISSION\\n\\t\\tfloat transmission;\\n\\t\\tfloat transmissionAlpha;\\n\\t\\tfloat thickness;\\n\\t\\tfloat attenuationDistance;\\n\\t\\tvec3 attenuationColor;\\n\\t#endif\\n};\\nvec3 clearcoatSpecular = vec3( 0.0 );\\nvec3 sheenSpecular = vec3( 0.0 );\\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat r2 = roughness * roughness;\\n\\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\\n\\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\\n\\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\\n\\treturn saturate( DG * RECIPROCAL_PI );\\n}\\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\\n\\treturn fab;\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\n#ifdef USE_IRIDESCENCE\\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#else\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#endif\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\\n\\t#else\\n\\t\\tvec3 Fr = specularColor;\\n\\t#endif\\n\\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\\tsingleScatter += FssEss;\\n\\tmultiScatter += Fms * Ems;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.roughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3( 0, 1, 0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\\n\\t#else\\n\\t\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\\n\\t#endif\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\\n\\t#else\\n\\t\\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\t#endif\\n\\tvec3 totalScattering = singleScattering + multiScattering;\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\\n\\treflectedLight.indirectSpecular += radiance * singleScattering;\\n\\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\";var lights_fragment_begin=\"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\n#ifdef USE_CLEARCOAT\\n\\tgeometry.clearcoatNormal = clearcoatNormal;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\\n\\tif ( material.iridescenceThickness == 0.0 ) {\\n\\t\\tmaterial.iridescence = 0.0;\\n\\t} else {\\n\\t\\tmaterial.iridescence = saturate( material.iridescence );\\n\\t}\\n\\tif ( material.iridescence > 0.0 ) {\\n\\t\\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\\n\\t\\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\\n\\t}\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointLightInfo( pointLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\\n\\t\\tpointLightShadow = pointLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\tvec4 spotColor;\\n\\tvec3 spotLightCoord;\\n\\tbool inSpotLightMap;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotLightInfo( spotLight, geometry, directLight );\\n\\t\\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\\n\\t\\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\\n\\t\\t#else\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\\t\\t#endif\\n\\t\\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\\n\\t\\t\\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\\n\\t\\t\\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\\n\\t\\t\\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\\n\\t\\t\\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\\n\\t\\t#endif\\n\\t\\t#undef SPOT_LIGHT_MAP_INDEX\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\tspotLightShadow = spotLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\\t\\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 iblIrradiance = vec3( 0.0 );\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\";var lights_fragment_maps=\"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometry.normal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\";var lights_fragment_end=\"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\\n#endif\";var logdepthbuf_fragment=\"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";var logdepthbuf_pars_fragment=\"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";var logdepthbuf_pars_vertex=\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t\\tvarying float vIsPerspective;\\n\\t#else\\n\\t\\tuniform float logDepthBufFC;\\n\\t#endif\\n#endif\";var logdepthbuf_vertex=\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n\\t#else\\n\\t\\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\\n\\t\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\t\\tgl_Position.z *= gl_Position.w;\\n\\t\\t}\\n\\t#endif\\n#endif\";var map_fragment=\"#ifdef USE_MAP\\n\\tvec4 sampledDiffuseColor = texture2D( map, vUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE\\n\\t\\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\\n\\t#endif\\n\\tdiffuseColor *= sampledDiffuseColor;\\n#endif\";var map_pars_fragment=\"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";var map_particle_fragment=\"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n#endif\\n#ifdef USE_MAP\\n\\tdiffuseColor *= texture2D( map, uv );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\";var map_particle_pars_fragment=\"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tuniform mat3 uvTransform;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";var metalnessmap_fragment=\"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";var metalnessmap_pars_fragment=\"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";var morphcolor_vertex=\"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\\n\\tvColor *= morphTargetBaseInfluence;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t#if defined( USE_COLOR_ALPHA )\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t#elif defined( USE_COLOR )\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\\n\\t\\t#endif\\n\\t}\\n#endif\";var morphnormal_vertex=\"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\\n\\t\\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\\n\\t\\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\\n\\t\\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\\n\\t#endif\\n#endif\";var morphtarget_pars_vertex=\"#ifdef USE_MORPHTARGETS\\n\\tuniform float morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t\\tuniform sampler2DArray morphTargetsTexture;\\n\\t\\tuniform ivec2 morphTargetsTextureSize;\\n\\t\\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\\n\\t\\t\\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\\n\\t\\t\\tint y = texelIndex / morphTargetsTextureSize.x;\\n\\t\\t\\tint x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\t\\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\\n\\t\\t\\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\tuniform float morphTargetInfluences[ 8 ];\\n\\t\\t#else\\n\\t\\t\\tuniform float morphTargetInfluences[ 4 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";var morphtarget_vertex=\"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\\n\\t\\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\\n\\t\\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\\n\\t\\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\\n\\t\\t\\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\\n\\t\\t\\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\\n\\t\\t\\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";var normal_fragment_begin=\"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\\tvec3 fdx = dFdx( vViewPosition );\\n\\tvec3 fdy = dFdy( vViewPosition );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\t#ifdef USE_TANGENT\\n\\t\\tvec3 tangent = normalize( vTangent );\\n\\t\\tvec3 bitangent = normalize( vBitangent );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\ttangent = tangent * faceDirection;\\n\\t\\t\\tbitangent = bitangent * faceDirection;\\n\\t\\t#endif\\n\\t\\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tmat3 vTBN = mat3( tangent, bitangent, normal );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\nvec3 geometryNormal = normal;\";var normal_fragment_maps=\"#ifdef OBJECTSPACE_NORMALMAP\\n\\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tnormal = - normal;\\n\\t#endif\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\tnormal = normalize( normalMatrix * normal );\\n#elif defined( TANGENTSPACE_NORMALMAP )\\n\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tnormal = normalize( vTBN * mapN );\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\";var normal_pars_fragment=\"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";var normal_pars_vertex=\"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";var normal_vertex=\"#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n\\t#ifdef USE_TANGENT\\n\\t\\tvTangent = normalize( transformedTangent );\\n\\t\\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\t#endif\\n#endif\";var normalmap_pars_fragment=\"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef OBJECTSPACE_NORMALMAP\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\\n\\t\\tvec3 q0 = dFdx( eye_pos.xyz );\\n\\t\\tvec3 q1 = dFdy( eye_pos.xyz );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\t\\tvec3 N = surf_norm;\\n\\t\\tvec3 q1perp = cross( q1, N );\\n\\t\\tvec3 q0perp = cross( N, q0 );\\n\\t\\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\\t\\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\\t\\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\\t\\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\\n\\t\\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\\n\\t}\\n#endif\";var clearcoat_normal_fragment_begin=\"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = geometryNormal;\\n#endif\";var clearcoat_normal_fragment_maps=\"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\\n\\t#else\\n\\t\\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\\n\\t#endif\\n#endif\";var clearcoat_pars_fragment=\"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\";var iridescence_pars_fragment=\"#ifdef USE_IRIDESCENCEMAP\\n\\tuniform sampler2D iridescenceMap;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tuniform sampler2D iridescenceThicknessMap;\\n#endif\";var output_fragment=\"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\";var packing=\"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nvec2 packDepthToRG( in highp float v ) {\\n\\treturn packDepthToRGBA( v ).yx;\\n}\\nfloat unpackRGToDepth( const in highp vec2 v ) {\\n\\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\\n}\\nvec4 pack2HalfToRGBA( vec2 v ) {\\n\\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( vec4 v ) {\\n\\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\";var premultiplied_alpha_fragment=\"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";var project_vertex=\"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\";var dithering_fragment=\"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";var dithering_pars_fragment=\"#ifdef DITHERING\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\";var roughnessmap_fragment=\"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";var roughnessmap_pars_fragment=\"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";var shadowmap_pars_fragment=\"#if NUM_SPOT_LIGHT_COORDS > 0\\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#if NUM_SPOT_LIGHT_MAPS > 0\\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\\n\\t\\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\\n\\t}\\n\\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\\n\\t\\tfloat occlusion = 1.0;\\n\\t\\tvec2 distribution = texture2DDistribution( shadow, uv );\\n\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\tif (hard_shadow != 1.0 ) {\\n\\t\\t\\tfloat distance = compare - distribution.x ;\\n\\t\\t\\tfloat variance = max( 0.00000, distribution.y * distribution.y );\\n\\t\\t\\tfloat softness_probability = variance / (variance + distance * distance );\\t\\t\\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\\t\\t\\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\\n\\t\\t}\\n\\t\\treturn occlusion;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx2 = dx0 / 2.0;\\n\\t\\t\\tfloat dy2 = dy0 / 2.0;\\n\\t\\t\\tfloat dx3 = dx1 / 2.0;\\n\\t\\t\\tfloat dy3 = dy1 / 2.0;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 17.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx = texelSize.x;\\n\\t\\t\\tfloat dy = texelSize.y;\\n\\t\\t\\tvec2 uv = shadowCoord.xy;\\n\\t\\t\\tvec2 f = fract( uv * shadowMapSize + 0.5 );\\n\\t\\t\\tuv -= f * texelSize;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t f.y )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\";var shadowmap_pars_vertex=\"#if NUM_SPOT_LIGHT_COORDS > 0\\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n#endif\";var shadowmap_vertex=\"#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\tvec4 shadowWorldPosition;\\n\\t#endif\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_COORDS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition;\\n\\t\\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\t\\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\\n\\t\\t#endif\\n\\t\\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\";var shadowmask_pars_fragment=\"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tspotLight = spotLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tpointLight = pointLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\";var skinbase_vertex=\"#ifdef USE_SKINNING\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\";var skinning_pars_vertex=\"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\tuniform highp sampler2D boneTexture;\\n\\tuniform int boneTextureSize;\\n\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\tfloat j = i * 4.0;\\n\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\ty = dy * ( y + 0.5 );\\n\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\treturn bone;\\n\\t}\\n#endif\";var skinning_vertex=\"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\";var skinnormal_vertex=\"#ifdef USE_SKINNING\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\\t#ifdef USE_TANGENT\\n\\t\\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#endif\\n#endif\";var specularmap_fragment=\"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";var specularmap_pars_fragment=\"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";var tonemapping_fragment=\"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";var tonemapping_pars_fragment=\"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\\tconst mat3 ACESInputMat = mat3(\\n\\t\\tvec3( 0.59719, 0.07600, 0.02840 ),\\t\\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\\t\\tvec3( 0.04823, 0.01566, 0.83777 )\\n\\t);\\n\\tconst mat3 ACESOutputMat = mat3(\\n\\t\\tvec3( 1.60475, -0.10208, -0.00327 ),\\t\\tvec3( -0.53108, 1.10813, -0.07276 ),\\n\\t\\tvec3( -0.07367, -0.00605, 1.07602 )\\n\\t);\\n\\tcolor *= toneMappingExposure / 0.6;\\n\\tcolor = ACESInputMat * color;\\n\\tcolor = RRTAndODTFit( color );\\n\\tcolor = ACESOutputMat * color;\\n\\treturn saturate( color );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\";var transmission_fragment=\"#ifdef USE_TRANSMISSION\\n\\tmaterial.transmission = transmission;\\n\\tmaterial.transmissionAlpha = 1.0;\\n\\tmaterial.thickness = thickness;\\n\\tmaterial.attenuationDistance = attenuationDistance;\\n\\tmaterial.attenuationColor = attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmission = getIBLVolumeRefraction(\\n\\t\\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\\n\\t\\tmaterial.attenuationColor, material.attenuationDistance );\\n\\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\\n\\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\\n#endif\";var transmission_pars_fragment=\"#ifdef USE_TRANSMISSION\\n\\tuniform float transmission;\\n\\tuniform float thickness;\\n\\tuniform float attenuationDistance;\\n\\tuniform vec3 attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tuniform sampler2D transmissionMap;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tuniform sampler2D thicknessMap;\\n\\t#endif\\n\\tuniform vec2 transmissionSamplerSize;\\n\\tuniform sampler2D transmissionSamplerMap;\\n\\tuniform mat4 modelMatrix;\\n\\tuniform mat4 projectionMatrix;\\n\\tvarying vec3 vWorldPosition;\\n\\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\\n\\t\\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\\t\\tvec3 modelScale;\\n\\t\\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\\t\\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\\t\\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\\t\\treturn normalize( refractionVector ) * thickness * modelScale;\\n\\t}\\n\\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\\n\\t\\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\\t}\\n\\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\\n\\t\\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\t#ifdef texture2DLodEXT\\n\\t\\t\\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tif ( isinf( attenuationDistance ) ) {\\n\\t\\t\\treturn radiance;\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance * radiance;\\n\\t\\t}\\n\\t}\\n\\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\\n\\t\\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\\n\\t\\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\\n\\t\\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\trefractionCoords += 1.0;\\n\\t\\trefractionCoords /= 2.0;\\n\\t\\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\\n\\t}\\n#endif\";var uv_pars_fragment=\"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\\n\\tvarying vec2 vUv;\\n#endif\";var uv_pars_vertex=\"#ifdef USE_UV\\n\\t#ifdef UVS_VERTEX_ONLY\\n\\t\\tvec2 vUv;\\n\\t#else\\n\\t\\tvarying vec2 vUv;\\n\\t#endif\\n\\tuniform mat3 uvTransform;\\n#endif\";var uv_vertex=\"#ifdef USE_UV\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\";var uv2_pars_fragment=\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\";var uv2_pars_vertex=\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n\\tuniform mat3 uv2Transform;\\n#endif\";var uv2_vertex=\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\\n#endif\";var worldpos_vertex=\"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\";const vertex$h=\"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\";const fragment$h=\"uniform sampler2D t2D;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tgl_FragColor = texture2D( t2D, vUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE\\n\\t\\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\\n\\t#endif\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";const vertex$g=\"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\";const fragment$g=\"#ifdef ENVMAP_TYPE_CUBE\\n\\tuniform samplerCube envMap;\\n#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\tuniform sampler2D envMap;\\n#endif\\nuniform float flipEnvMap;\\nuniform float backgroundBlurriness;\\nvarying vec3 vWorldDirection;\\n#include <cube_uv_reflection_fragment>\\nvoid main() {\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\\n\\t#else\\n\\t\\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\t#endif\\n\\tgl_FragColor = texColor;\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";const vertex$f=\"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\";const fragment$f=\"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\nvoid main() {\\n\\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\\n\\tgl_FragColor = texColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";const vertex$e=\"#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvHighPrecisionZW = gl_Position.zw;\\n}\";const fragment$e=\"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\\t#endif\\n}\";const vertex$d=\"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvWorldPosition = worldPosition.xyz;\\n}\";const fragment$d=\"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\";const vertex$c=\"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\";const fragment$c=\"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";const vertex$b=\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$b=\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <color_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\";const vertex$a=\"#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinbase_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t\\t#include <defaultnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$a=\"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include <aomap_fragment>\\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";const vertex$9=\"#define LAMBERT\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$9=\"#define LAMBERT\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_lambert_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_lambert_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";const vertex$8=\"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n}\";const fragment$8=\"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tvec3 viewDir = normalize( vViewPosition );\\n\\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\\tvec3 y = cross( viewDir, x );\\n\\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\\n\\t#ifdef USE_MATCAP\\n\\t\\tvec4 matcapColor = texture2D( matcap, uv );\\n\\t#else\\n\\t\\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\\n\\t#endif\\n\\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";const vertex$7=\"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\";const fragment$7=\"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n\\t#ifdef OPAQUE\\n\\t\\tgl_FragColor.a = 1.0;\\n\\t#endif\\n}\";const vertex$6=\"#define PHONG\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$6=\"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_phong_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";const vertex$5=\"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\";const fragment$5=\"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n#ifdef SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularColor;\\n\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\tuniform sampler2D specularColorMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tuniform float iridescence;\\n\\tuniform float iridescenceIOR;\\n\\tuniform float iridescenceThicknessMinimum;\\n\\tuniform float iridescenceThicknessMaximum;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenColor;\\n\\tuniform float sheenRoughness;\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tuniform sampler2D sheenColorMap;\\n\\t#endif\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tuniform sampler2D sheenRoughnessMap;\\n\\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <bsdfs>\\n#include <iridescence_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_physical_pars_fragment>\\n#include <transmission_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <clearcoat_pars_fragment>\\n#include <iridescence_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <roughnessmap_fragment>\\n\\t#include <metalnessmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <clearcoat_normal_fragment_begin>\\n\\t#include <clearcoat_normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_physical_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include <transmission_fragment>\\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\t#ifdef USE_SHEEN\\n\\t\\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\\n\\t\\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\\n\\t#endif\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";const vertex$4=\"#define TOON\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$4=\"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_toon_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_toon_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";const vertex$3=\"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\t#include <morphcolor_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\tgl_PointSize = size;\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\\t#endif\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$3=\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_particle_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\";const vertex$2=\"#include <common>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$2=\"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\";const vertex$1=\"uniform float rotation;\\nuniform vec2 center;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\tvec2 scale;\\n\\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\\n\\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\\n\\t#ifndef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) scale *= - mvPosition.z;\\n\\t#endif\\n\\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\\tvec2 rotatedPosition;\\n\\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\";const fragment$1=\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\";const ShaderChunk={alphamap_fragment:alphamap_fragment,alphamap_pars_fragment:alphamap_pars_fragment,alphatest_fragment:alphatest_fragment,alphatest_pars_fragment:alphatest_pars_fragment,aomap_fragment:aomap_fragment,aomap_pars_fragment:aomap_pars_fragment,begin_vertex:begin_vertex,beginnormal_vertex:beginnormal_vertex,bsdfs:bsdfs,iridescence_fragment:iridescence_fragment,bumpmap_pars_fragment:bumpmap_pars_fragment,clipping_planes_fragment:clipping_planes_fragment,clipping_planes_pars_fragment:clipping_planes_pars_fragment,clipping_planes_pars_vertex:clipping_planes_pars_vertex,clipping_planes_vertex:clipping_planes_vertex,color_fragment:color_fragment,color_pars_fragment:color_pars_fragment,color_pars_vertex:color_pars_vertex,color_vertex:color_vertex,common:common,cube_uv_reflection_fragment:cube_uv_reflection_fragment,defaultnormal_vertex:defaultnormal_vertex,displacementmap_pars_vertex:displacementmap_pars_vertex,displacementmap_vertex:displacementmap_vertex,emissivemap_fragment:emissivemap_fragment,emissivemap_pars_fragment:emissivemap_pars_fragment,encodings_fragment:encodings_fragment,encodings_pars_fragment:encodings_pars_fragment,envmap_fragment:envmap_fragment,envmap_common_pars_fragment:envmap_common_pars_fragment,envmap_pars_fragment:envmap_pars_fragment,envmap_pars_vertex:envmap_pars_vertex,envmap_physical_pars_fragment:envmap_physical_pars_fragment,envmap_vertex:envmap_vertex,fog_vertex:fog_vertex,fog_pars_vertex:fog_pars_vertex,fog_fragment:fog_fragment,fog_pars_fragment:fog_pars_fragment,gradientmap_pars_fragment:gradientmap_pars_fragment,lightmap_fragment:lightmap_fragment,lightmap_pars_fragment:lightmap_pars_fragment,lights_lambert_fragment:lights_lambert_fragment,lights_lambert_pars_fragment:lights_lambert_pars_fragment,lights_pars_begin:lights_pars_begin,lights_toon_fragment:lights_toon_fragment,lights_toon_pars_fragment:lights_toon_pars_fragment,lights_phong_fragment:lights_phong_fragment,lights_phong_pars_fragment:lights_phong_pars_fragment,lights_physical_fragment:lights_physical_fragment,lights_physical_pars_fragment:lights_physical_pars_fragment,lights_fragment_begin:lights_fragment_begin,lights_fragment_maps:lights_fragment_maps,lights_fragment_end:lights_fragment_end,logdepthbuf_fragment:logdepthbuf_fragment,logdepthbuf_pars_fragment:logdepthbuf_pars_fragment,logdepthbuf_pars_vertex:logdepthbuf_pars_vertex,logdepthbuf_vertex:logdepthbuf_vertex,map_fragment:map_fragment,map_pars_fragment:map_pars_fragment,map_particle_fragment:map_particle_fragment,map_particle_pars_fragment:map_particle_pars_fragment,metalnessmap_fragment:metalnessmap_fragment,metalnessmap_pars_fragment:metalnessmap_pars_fragment,morphcolor_vertex:morphcolor_vertex,morphnormal_vertex:morphnormal_vertex,morphtarget_pars_vertex:morphtarget_pars_vertex,morphtarget_vertex:morphtarget_vertex,normal_fragment_begin:normal_fragment_begin,normal_fragment_maps:normal_fragment_maps,normal_pars_fragment:normal_pars_fragment,normal_pars_vertex:normal_pars_vertex,normal_vertex:normal_vertex,normalmap_pars_fragment:normalmap_pars_fragment,clearcoat_normal_fragment_begin:clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps:clearcoat_normal_fragment_maps,clearcoat_pars_fragment:clearcoat_pars_fragment,iridescence_pars_fragment:iridescence_pars_fragment,output_fragment:output_fragment,packing:packing,premultiplied_alpha_fragment:premultiplied_alpha_fragment,project_vertex:project_vertex,dithering_fragment:dithering_fragment,dithering_pars_fragment:dithering_pars_fragment,roughnessmap_fragment:roughnessmap_fragment,roughnessmap_pars_fragment:roughnessmap_pars_fragment,shadowmap_pars_fragment:shadowmap_pars_fragment,shadowmap_pars_vertex:shadowmap_pars_vertex,shadowmap_vertex:shadowmap_vertex,shadowmask_pars_fragment:shadowmask_pars_fragment,skinbase_vertex:skinbase_vertex,skinning_pars_vertex:skinning_pars_vertex,skinning_vertex:skinning_vertex,skinnormal_vertex:skinnormal_vertex,specularmap_fragment:specularmap_fragment,specularmap_pars_fragment:specularmap_pars_fragment,tonemapping_fragment:tonemapping_fragment,tonemapping_pars_fragment:tonemapping_pars_fragment,transmission_fragment:transmission_fragment,transmission_pars_fragment:transmission_pars_fragment,uv_pars_fragment:uv_pars_fragment,uv_pars_vertex:uv_pars_vertex,uv_vertex:uv_vertex,uv2_pars_fragment:uv2_pars_fragment,uv2_pars_vertex:uv2_pars_vertex,uv2_vertex:uv2_vertex,worldpos_vertex:worldpos_vertex,background_vert:vertex$h,background_frag:fragment$h,backgroundCube_vert:vertex$g,backgroundCube_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1};/**\n * Uniforms library for shared webgl shaders\n */const UniformsLib={common:{diffuse:{value:/*@__PURE__*/new Color(0xffffff)},opacity:{value:1.0},map:{value:null},uvTransform:{value:/*@__PURE__*/new Matrix3()},uv2Transform:{value:/*@__PURE__*/new Matrix3()},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1.0},// basic, lambert, phong\nior:{value:1.5},// physical\nrefractionRatio:{value:0.98}// basic, lambert, phong\n},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:/*@__PURE__*/new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:0.00025},fogNear:{value:1},fogFar:{value:2000},fogColor:{value:/*@__PURE__*/new Color(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\nrectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:/*@__PURE__*/new Color(0xffffff)},opacity:{value:1.0},size:{value:1.0},scale:{value:1.0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:/*@__PURE__*/new Matrix3()}},sprite:{diffuse:{value:/*@__PURE__*/new Color(0xffffff)},opacity:{value:1.0},center:{value:/*@__PURE__*/new Vector2(0.5,0.5)},rotation:{value:0.0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:/*@__PURE__*/new Matrix3()}}};const ShaderLib={basic:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:/*@__PURE__*/new Color(0x000000)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:/*@__PURE__*/new Color(0x000000)},specular:{value:/*@__PURE__*/new Color(0x111111)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:/*@__PURE__*/new Color(0x000000)},roughness:{value:1.0},metalness:{value:0.0},envMapIntensity:{value:1}// temporary\n}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:/*@__PURE__*/new Color(0x000000)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1.0}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:/*@__PURE__*/new Matrix3()},t2D:{value:null}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0}},vertexShader:ShaderChunk.backgroundCube_vert,fragmentShader:ShaderChunk.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1.0}},vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:/*@__PURE__*/new three_module_Vector3()},nearDistance:{value:1},farDistance:{value:1000}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:/*@__PURE__*/mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:/*@__PURE__*/new Color(0x00000)},opacity:{value:1.0}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:/*@__PURE__*/mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:/*@__PURE__*/new Vector2(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:/*@__PURE__*/new Color(0x000000)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:/*@__PURE__*/new Vector2()},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:/*@__PURE__*/new Color(0x000000)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:/*@__PURE__*/new Color(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};function WebGLBackground(renderer,cubemaps,cubeuvmaps,state,objects,alpha,premultipliedAlpha){const clearColor=new Color(0x000000);let clearAlpha=alpha===true?0:1;let planeMesh;let boxMesh;let currentBackground=null;let currentBackgroundVersion=0;let currentTonemapping=null;function render(renderList,scene){let forceClear=false;let background=scene.isScene===true?scene.background:null;if(background&&background.isTexture){const usePMREM=scene.backgroundBlurriness>0;// use PMREM if the user wants to blur the background\nbackground=(usePMREM?cubeuvmaps:cubemaps).get(background);}// Ignore background in AR\n// TODO: Reconsider this.\nconst xr=renderer.xr;const session=xr.getSession&&xr.getSession();if(session&&session.environmentBlendMode==='additive'){background=null;}if(background===null){setClear(clearColor,clearAlpha);}else if(background&&background.isColor){setClear(background,1);forceClear=true;}if(renderer.autoClear||forceClear){renderer.clear(renderer.autoClearColor,renderer.autoClearDepth,renderer.autoClearStencil);}if(background&&(background.isCubeTexture||background.mapping===CubeUVReflectionMapping)){if(boxMesh===undefined){boxMesh=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:'BackgroundCubeMaterial',uniforms:cloneUniforms(ShaderLib.backgroundCube.uniforms),vertexShader:ShaderLib.backgroundCube.vertexShader,fragmentShader:ShaderLib.backgroundCube.fragmentShader,side:BackSide,depthTest:false,depthWrite:false,fog:false}));boxMesh.geometry.deleteAttribute('normal');boxMesh.geometry.deleteAttribute('uv');boxMesh.onBeforeRender=function(renderer,scene,camera){this.matrixWorld.copyPosition(camera.matrixWorld);};// add \"envMap\" material property so the renderer can evaluate it like for built-in materials\ndefine_property(boxMesh.material,'envMap',{get:function(){return this.uniforms.envMap.value;}});objects.update(boxMesh);}boxMesh.material.uniforms.envMap.value=background;boxMesh.material.uniforms.flipEnvMap.value=background.isCubeTexture&&background.isRenderTargetTexture===false?-1:1;boxMesh.material.uniforms.backgroundBlurriness.value=scene.backgroundBlurriness;if(currentBackground!==background||currentBackgroundVersion!==background.version||currentTonemapping!==renderer.toneMapping){boxMesh.material.needsUpdate=true;currentBackground=background;currentBackgroundVersion=background.version;currentTonemapping=renderer.toneMapping;}boxMesh.layers.enableAll();// push to the pre-sorted opaque render list\nrenderList.unshift(boxMesh,boxMesh.geometry,boxMesh.material,0,0,null);}else if(background&&background.isTexture){if(planeMesh===undefined){planeMesh=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:'BackgroundMaterial',uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:false,depthWrite:false,fog:false}));planeMesh.geometry.deleteAttribute('normal');// add \"map\" material property so the renderer can evaluate it like for built-in materials\ndefine_property(planeMesh.material,'map',{get:function(){return this.uniforms.t2D.value;}});objects.update(planeMesh);}planeMesh.material.uniforms.t2D.value=background;if(background.matrixAutoUpdate===true){background.updateMatrix();}planeMesh.material.uniforms.uvTransform.value.copy(background.matrix);if(currentBackground!==background||currentBackgroundVersion!==background.version||currentTonemapping!==renderer.toneMapping){planeMesh.material.needsUpdate=true;currentBackground=background;currentBackgroundVersion=background.version;currentTonemapping=renderer.toneMapping;}planeMesh.layers.enableAll();// push to the pre-sorted opaque render list\nrenderList.unshift(planeMesh,planeMesh.geometry,planeMesh.material,0,0,null);}}function setClear(color,alpha){state.buffers.color.setClear(color.r,color.g,color.b,alpha,premultipliedAlpha);}return{getClearColor:function(){return clearColor;},setClearColor:function(color,alpha=1){clearColor.set(color);clearAlpha=alpha;setClear(clearColor,clearAlpha);},getClearAlpha:function(){return clearAlpha;},setClearAlpha:function(alpha){clearAlpha=alpha;setClear(clearColor,clearAlpha);},render:render};}function WebGLBindingStates(gl,extensions,attributes,capabilities){const maxVertexAttributes=gl.getParameter(34921);const extension=capabilities.isWebGL2?null:extensions.get('OES_vertex_array_object');const vaoAvailable=capabilities.isWebGL2||extension!==null;const bindingStates={};const defaultState=createBindingState(null);let currentState=defaultState;let forceUpdate=false;function setup(object,material,program,geometry,index){let updateBuffers=false;if(vaoAvailable){const state=getBindingState(geometry,program,material);if(currentState!==state){currentState=state;bindVertexArrayObject(currentState.object);}updateBuffers=needsUpdate(object,geometry,program,index);if(updateBuffers)saveCache(object,geometry,program,index);}else{const wireframe=material.wireframe===true;if(currentState.geometry!==geometry.id||currentState.program!==program.id||currentState.wireframe!==wireframe){currentState.geometry=geometry.id;currentState.program=program.id;currentState.wireframe=wireframe;updateBuffers=true;}}if(index!==null){attributes.update(index,34963);}if(updateBuffers||forceUpdate){forceUpdate=false;setupVertexAttributes(object,material,program,geometry);if(index!==null){gl.bindBuffer(34963,attributes.get(index).buffer);}}}function createVertexArrayObject(){if(capabilities.isWebGL2)return gl.createVertexArray();return extension.createVertexArrayOES();}function bindVertexArrayObject(vao){if(capabilities.isWebGL2)return gl.bindVertexArray(vao);return extension.bindVertexArrayOES(vao);}function deleteVertexArrayObject(vao){if(capabilities.isWebGL2)return gl.deleteVertexArray(vao);return extension.deleteVertexArrayOES(vao);}function getBindingState(geometry,program,material){const wireframe=material.wireframe===true;let programMap=bindingStates[geometry.id];if(programMap===undefined){programMap={};bindingStates[geometry.id]=programMap;}let stateMap=programMap[program.id];if(stateMap===undefined){stateMap={};programMap[program.id]=stateMap;}let state=stateMap[wireframe];if(state===undefined){state=createBindingState(createVertexArrayObject());stateMap[wireframe]=state;}return state;}function createBindingState(vao){const newAttributes=[];const enabledAttributes=[];const attributeDivisors=[];for(let i=0;i<maxVertexAttributes;i++){newAttributes[i]=0;enabledAttributes[i]=0;attributeDivisors[i]=0;}return{// for backward compatibility on non-VAO support browser\ngeometry:null,program:null,wireframe:false,newAttributes:newAttributes,enabledAttributes:enabledAttributes,attributeDivisors:attributeDivisors,object:vao,attributes:{},index:null};}function needsUpdate(object,geometry,program,index){const cachedAttributes=currentState.attributes;const geometryAttributes=geometry.attributes;let attributesNum=0;const programAttributes=program.getAttributes();for(const name in programAttributes){const programAttribute=programAttributes[name];if(programAttribute.location>=0){const cachedAttribute=cachedAttributes[name];let geometryAttribute=geometryAttributes[name];if(geometryAttribute===undefined){if(name==='instanceMatrix'&&object.instanceMatrix)geometryAttribute=object.instanceMatrix;if(name==='instanceColor'&&object.instanceColor)geometryAttribute=object.instanceColor;}if(cachedAttribute===undefined)return true;if(cachedAttribute.attribute!==geometryAttribute)return true;if(geometryAttribute&&cachedAttribute.data!==geometryAttribute.data)return true;attributesNum++;}}if(currentState.attributesNum!==attributesNum)return true;if(currentState.index!==index)return true;return false;}function saveCache(object,geometry,program,index){const cache={};const attributes=geometry.attributes;let attributesNum=0;const programAttributes=program.getAttributes();for(const name in programAttributes){const programAttribute=programAttributes[name];if(programAttribute.location>=0){let attribute=attributes[name];if(attribute===undefined){if(name==='instanceMatrix'&&object.instanceMatrix)attribute=object.instanceMatrix;if(name==='instanceColor'&&object.instanceColor)attribute=object.instanceColor;}const data={};data.attribute=attribute;if(attribute&&attribute.data){data.data=attribute.data;}cache[name]=data;attributesNum++;}}currentState.attributes=cache;currentState.attributesNum=attributesNum;currentState.index=index;}function initAttributes(){const newAttributes=currentState.newAttributes;for(let i=0,il=newAttributes.length;i<il;i++){newAttributes[i]=0;}}function enableAttribute(attribute){enableAttributeAndDivisor(attribute,0);}function enableAttributeAndDivisor(attribute,meshPerAttribute){const newAttributes=currentState.newAttributes;const enabledAttributes=currentState.enabledAttributes;const attributeDivisors=currentState.attributeDivisors;newAttributes[attribute]=1;if(enabledAttributes[attribute]===0){gl.enableVertexAttribArray(attribute);enabledAttributes[attribute]=1;}if(attributeDivisors[attribute]!==meshPerAttribute){const extension=capabilities.isWebGL2?gl:extensions.get('ANGLE_instanced_arrays');extension[capabilities.isWebGL2?'vertexAttribDivisor':'vertexAttribDivisorANGLE'](attribute,meshPerAttribute);attributeDivisors[attribute]=meshPerAttribute;}}function disableUnusedAttributes(){const newAttributes=currentState.newAttributes;const enabledAttributes=currentState.enabledAttributes;for(let i=0,il=enabledAttributes.length;i<il;i++){if(enabledAttributes[i]!==newAttributes[i]){gl.disableVertexAttribArray(i);enabledAttributes[i]=0;}}}function vertexAttribPointer(index,size,type,normalized,stride,offset){if(capabilities.isWebGL2===true&&(type===5124||type===5125)){gl.vertexAttribIPointer(index,size,type,stride,offset);}else{gl.vertexAttribPointer(index,size,type,normalized,stride,offset);}}function setupVertexAttributes(object,material,program,geometry){if(capabilities.isWebGL2===false&&(object.isInstancedMesh||geometry.isInstancedBufferGeometry)){if(extensions.get('ANGLE_instanced_arrays')===null)return;}initAttributes();const geometryAttributes=geometry.attributes;const programAttributes=program.getAttributes();const materialDefaultAttributeValues=material.defaultAttributeValues;for(const name in programAttributes){const programAttribute=programAttributes[name];if(programAttribute.location>=0){let geometryAttribute=geometryAttributes[name];if(geometryAttribute===undefined){if(name==='instanceMatrix'&&object.instanceMatrix)geometryAttribute=object.instanceMatrix;if(name==='instanceColor'&&object.instanceColor)geometryAttribute=object.instanceColor;}if(geometryAttribute!==undefined){const normalized=geometryAttribute.normalized;const size=geometryAttribute.itemSize;const attribute=attributes.get(geometryAttribute);// TODO Attribute may not be available on context restore\nif(attribute===undefined)continue;const buffer=attribute.buffer;const type=attribute.type;const bytesPerElement=attribute.bytesPerElement;if(geometryAttribute.isInterleavedBufferAttribute){const data=geometryAttribute.data;const stride=data.stride;const offset=geometryAttribute.offset;if(data.isInstancedInterleavedBuffer){for(let i=0;i<programAttribute.locationSize;i++){enableAttributeAndDivisor(programAttribute.location+i,data.meshPerAttribute);}if(object.isInstancedMesh!==true&&geometry._maxInstanceCount===undefined){geometry._maxInstanceCount=data.meshPerAttribute*data.count;}}else{for(let i=0;i<programAttribute.locationSize;i++){enableAttribute(programAttribute.location+i);}}gl.bindBuffer(34962,buffer);for(let i=0;i<programAttribute.locationSize;i++){vertexAttribPointer(programAttribute.location+i,size/programAttribute.locationSize,type,normalized,stride*bytesPerElement,(offset+size/programAttribute.locationSize*i)*bytesPerElement);}}else{if(geometryAttribute.isInstancedBufferAttribute){for(let i=0;i<programAttribute.locationSize;i++){enableAttributeAndDivisor(programAttribute.location+i,geometryAttribute.meshPerAttribute);}if(object.isInstancedMesh!==true&&geometry._maxInstanceCount===undefined){geometry._maxInstanceCount=geometryAttribute.meshPerAttribute*geometryAttribute.count;}}else{for(let i=0;i<programAttribute.locationSize;i++){enableAttribute(programAttribute.location+i);}}gl.bindBuffer(34962,buffer);for(let i=0;i<programAttribute.locationSize;i++){vertexAttribPointer(programAttribute.location+i,size/programAttribute.locationSize,type,normalized,size*bytesPerElement,size/programAttribute.locationSize*i*bytesPerElement);}}}else if(materialDefaultAttributeValues!==undefined){const value=materialDefaultAttributeValues[name];if(value!==undefined){switch(value.length){case 2:gl.vertexAttrib2fv(programAttribute.location,value);break;case 3:gl.vertexAttrib3fv(programAttribute.location,value);break;case 4:gl.vertexAttrib4fv(programAttribute.location,value);break;default:gl.vertexAttrib1fv(programAttribute.location,value);}}}}}disableUnusedAttributes();}function dispose(){reset();for(const geometryId in bindingStates){const programMap=bindingStates[geometryId];for(const programId in programMap){const stateMap=programMap[programId];for(const wireframe in stateMap){deleteVertexArrayObject(stateMap[wireframe].object);delete stateMap[wireframe];}delete programMap[programId];}delete bindingStates[geometryId];}}function releaseStatesOfGeometry(geometry){if(bindingStates[geometry.id]===undefined)return;const programMap=bindingStates[geometry.id];for(const programId in programMap){const stateMap=programMap[programId];for(const wireframe in stateMap){deleteVertexArrayObject(stateMap[wireframe].object);delete stateMap[wireframe];}delete programMap[programId];}delete bindingStates[geometry.id];}function releaseStatesOfProgram(program){for(const geometryId in bindingStates){const programMap=bindingStates[geometryId];if(programMap[program.id]===undefined)continue;const stateMap=programMap[program.id];for(const wireframe in stateMap){deleteVertexArrayObject(stateMap[wireframe].object);delete stateMap[wireframe];}delete programMap[program.id];}}function reset(){resetDefaultState();forceUpdate=true;if(currentState===defaultState)return;currentState=defaultState;bindVertexArrayObject(currentState.object);}// for backward-compatibility\nfunction resetDefaultState(){defaultState.geometry=null;defaultState.program=null;defaultState.wireframe=false;}return{setup:setup,reset:reset,resetDefaultState:resetDefaultState,dispose:dispose,releaseStatesOfGeometry:releaseStatesOfGeometry,releaseStatesOfProgram:releaseStatesOfProgram,initAttributes:initAttributes,enableAttribute:enableAttribute,disableUnusedAttributes:disableUnusedAttributes};}function WebGLBufferRenderer(gl,extensions,info,capabilities){const isWebGL2=capabilities.isWebGL2;let mode;function setMode(value){mode=value;}function render(start,count){gl.drawArrays(mode,start,count);info.update(count,mode,1);}function renderInstances(start,count,primcount){if(primcount===0)return;let extension,methodName;if(isWebGL2){extension=gl;methodName='drawArraysInstanced';}else{extension=extensions.get('ANGLE_instanced_arrays');methodName='drawArraysInstancedANGLE';if(extension===null){console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');return;}}extension[methodName](mode,start,count,primcount);info.update(count,mode,primcount);}//\nthis.setMode=setMode;this.render=render;this.renderInstances=renderInstances;}function WebGLCapabilities(gl,extensions,parameters){let maxAnisotropy;function getMaxAnisotropy(){if(maxAnisotropy!==undefined)return maxAnisotropy;if(extensions.has('EXT_texture_filter_anisotropic')===true){const extension=extensions.get('EXT_texture_filter_anisotropic');maxAnisotropy=gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT);}else{maxAnisotropy=0;}return maxAnisotropy;}function getMaxPrecision(precision){if(precision==='highp'){if(gl.getShaderPrecisionFormat(35633,36338).precision>0&&gl.getShaderPrecisionFormat(35632,36338).precision>0){return'highp';}precision='mediump';}if(precision==='mediump'){if(gl.getShaderPrecisionFormat(35633,36337).precision>0&&gl.getShaderPrecisionFormat(35632,36337).precision>0){return'mediump';}}return'lowp';}const isWebGL2=typeof WebGL2RenderingContext!=='undefined'&&gl instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!=='undefined'&&gl instanceof WebGL2ComputeRenderingContext;let precision=parameters.precision!==undefined?parameters.precision:'highp';const maxPrecision=getMaxPrecision(precision);if(maxPrecision!==precision){console.warn('THREE.WebGLRenderer:',precision,'not supported, using',maxPrecision,'instead.');precision=maxPrecision;}const drawBuffers=isWebGL2||extensions.has('WEBGL_draw_buffers');const logarithmicDepthBuffer=parameters.logarithmicDepthBuffer===true;const maxTextures=gl.getParameter(34930);const maxVertexTextures=gl.getParameter(35660);const maxTextureSize=gl.getParameter(3379);const maxCubemapSize=gl.getParameter(34076);const maxAttributes=gl.getParameter(34921);const maxVertexUniforms=gl.getParameter(36347);const maxVaryings=gl.getParameter(36348);const maxFragmentUniforms=gl.getParameter(36349);const vertexTextures=maxVertexTextures>0;const floatFragmentTextures=isWebGL2||extensions.has('OES_texture_float');const floatVertexTextures=vertexTextures&&floatFragmentTextures;const maxSamples=isWebGL2?gl.getParameter(36183):0;return{isWebGL2:isWebGL2,drawBuffers:drawBuffers,getMaxAnisotropy:getMaxAnisotropy,getMaxPrecision:getMaxPrecision,precision:precision,logarithmicDepthBuffer:logarithmicDepthBuffer,maxTextures:maxTextures,maxVertexTextures:maxVertexTextures,maxTextureSize:maxTextureSize,maxCubemapSize:maxCubemapSize,maxAttributes:maxAttributes,maxVertexUniforms:maxVertexUniforms,maxVaryings:maxVaryings,maxFragmentUniforms:maxFragmentUniforms,vertexTextures:vertexTextures,floatFragmentTextures:floatFragmentTextures,floatVertexTextures:floatVertexTextures,maxSamples:maxSamples};}function WebGLClipping(properties){const scope=this;let globalState=null,numGlobalPlanes=0,localClippingEnabled=false,renderingShadows=false;const plane=new Plane(),viewNormalMatrix=new Matrix3(),uniform={value:null,needsUpdate:false};this.uniform=uniform;this.numPlanes=0;this.numIntersection=0;this.init=function(planes,enableLocalClipping,camera){const enabled=planes.length!==0||enableLocalClipping||// enable state of previous frame - the clipping code has to\n// run another frame in order to reset the state:\nnumGlobalPlanes!==0||localClippingEnabled;localClippingEnabled=enableLocalClipping;globalState=projectPlanes(planes,camera,0);numGlobalPlanes=planes.length;return enabled;};this.beginShadows=function(){renderingShadows=true;projectPlanes(null);};this.endShadows=function(){renderingShadows=false;resetGlobalState();};this.setState=function(material,camera,useCache){const planes=material.clippingPlanes,clipIntersection=material.clipIntersection,clipShadows=material.clipShadows;const materialProperties=properties.get(material);if(!localClippingEnabled||planes===null||planes.length===0||renderingShadows&&!clipShadows){// there's no local clipping\nif(renderingShadows){// there's no global clipping\nprojectPlanes(null);}else{resetGlobalState();}}else{const nGlobal=renderingShadows?0:numGlobalPlanes,lGlobal=nGlobal*4;let dstArray=materialProperties.clippingState||null;uniform.value=dstArray;// ensure unique state\ndstArray=projectPlanes(planes,camera,lGlobal,useCache);for(let i=0;i!==lGlobal;++i){dstArray[i]=globalState[i];}materialProperties.clippingState=dstArray;this.numIntersection=clipIntersection?this.numPlanes:0;this.numPlanes+=nGlobal;}};function resetGlobalState(){if(uniform.value!==globalState){uniform.value=globalState;uniform.needsUpdate=numGlobalPlanes>0;}scope.numPlanes=numGlobalPlanes;scope.numIntersection=0;}function projectPlanes(planes,camera,dstOffset,skipTransform){const nPlanes=planes!==null?planes.length:0;let dstArray=null;if(nPlanes!==0){dstArray=uniform.value;if(skipTransform!==true||dstArray===null){const flatSize=dstOffset+nPlanes*4,viewMatrix=camera.matrixWorldInverse;viewNormalMatrix.getNormalMatrix(viewMatrix);if(dstArray===null||dstArray.length<flatSize){dstArray=new Float32Array(flatSize);}for(let i=0,i4=dstOffset;i!==nPlanes;++i,i4+=4){plane.copy(planes[i]).applyMatrix4(viewMatrix,viewNormalMatrix);plane.normal.toArray(dstArray,i4);dstArray[i4+3]=plane.constant;}}uniform.value=dstArray;uniform.needsUpdate=true;}scope.numPlanes=nPlanes;scope.numIntersection=0;return dstArray;}}function WebGLCubeMaps(renderer){let cubemaps=new weak_map();function mapTextureMapping(texture,mapping){if(mapping===EquirectangularReflectionMapping){texture.mapping=CubeReflectionMapping;}else if(mapping===EquirectangularRefractionMapping){texture.mapping=CubeRefractionMapping;}return texture;}function get(texture){if(texture&&texture.isTexture&&texture.isRenderTargetTexture===false){const mapping=texture.mapping;if(mapping===EquirectangularReflectionMapping||mapping===EquirectangularRefractionMapping){if(cubemaps.has(texture)){const cubemap=cubemaps.get(texture).texture;return mapTextureMapping(cubemap,texture.mapping);}else{const image=texture.image;if(image&&image.height>0){const renderTarget=new WebGLCubeRenderTarget(image.height/2);renderTarget.fromEquirectangularTexture(renderer,texture);cubemaps.set(texture,renderTarget);texture.addEventListener('dispose',onTextureDispose);return mapTextureMapping(renderTarget.texture,texture.mapping);}else{// image not yet ready. try the conversion next frame\nreturn null;}}}}return texture;}function onTextureDispose(event){const texture=event.target;texture.removeEventListener('dispose',onTextureDispose);const cubemap=cubemaps.get(texture);if(cubemap!==undefined){cubemaps.delete(texture);cubemap.dispose();}}function dispose(){cubemaps=new weak_map();}return{get:get,dispose:dispose};}class OrthographicCamera extends Camera{constructor(left=-1,right=1,top=1,bottom=-1,near=0.1,far=2000){super();this.isOrthographicCamera=true;this.type='OrthographicCamera';this.zoom=1;this.view=null;this.left=left;this.right=right;this.top=top;this.bottom=bottom;this.near=near;this.far=far;this.updateProjectionMatrix();}copy(source,recursive){super.copy(source,recursive);this.left=source.left;this.right=source.right;this.top=source.top;this.bottom=source.bottom;this.near=source.near;this.far=source.far;this.zoom=source.zoom;this.view=source.view===null?null:object_assign({},source.view);return this;}setViewOffset(fullWidth,fullHeight,x,y,width,height){if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1};}this.view.enabled=true;this.view.fullWidth=fullWidth;this.view.fullHeight=fullHeight;this.view.offsetX=x;this.view.offsetY=y;this.view.width=width;this.view.height=height;this.updateProjectionMatrix();}clearViewOffset(){if(this.view!==null){this.view.enabled=false;}this.updateProjectionMatrix();}updateProjectionMatrix(){const dx=(this.right-this.left)/(2*this.zoom);const dy=(this.top-this.bottom)/(2*this.zoom);const cx=(this.right+this.left)/2;const cy=(this.top+this.bottom)/2;let left=cx-dx;let right=cx+dx;let top=cy+dy;let bottom=cy-dy;if(this.view!==null&&this.view.enabled){const scaleW=(this.right-this.left)/this.view.fullWidth/this.zoom;const scaleH=(this.top-this.bottom)/this.view.fullHeight/this.zoom;left+=scaleW*this.view.offsetX;right=left+scaleW*this.view.width;top-=scaleH*this.view.offsetY;bottom=top-scaleH*this.view.height;}this.projectionMatrix.makeOrthographic(left,right,top,bottom,this.near,this.far);this.projectionMatrixInverse.copy(this.projectionMatrix).invert();}toJSON(meta){const data=super.toJSON(meta);data.object.zoom=this.zoom;data.object.left=this.left;data.object.right=this.right;data.object.top=this.top;data.object.bottom=this.bottom;data.object.near=this.near;data.object.far=this.far;if(this.view!==null)data.object.view=object_assign({},this.view);return data;}}const LOD_MIN=4;// The standard deviations (radians) associated with the extra mips. These are\n// chosen to approximate a Trowbridge-Reitz distribution function times the\n// geometric shadowing function. These sigma values squared must match the\n// variance #defines in cube_uv_reflection_fragment.glsl.js.\nconst EXTRA_LOD_SIGMA=[0.125,0.215,0.35,0.446,0.526,0.582];// The maximum length of the blur for loop. Smaller sigmas will use fewer\n// samples and exit early, but not recompile the shader.\nconst MAX_SAMPLES=20;const _flatCamera=/*@__PURE__*/new OrthographicCamera();const _clearColor=/*@__PURE__*/new Color();let _oldTarget=null;// Golden Ratio\nconst PHI=(1+Math.sqrt(5))/2;const INV_PHI=1/PHI;// Vertices of a dodecahedron (except the opposites, which represent the\n// same axis), used as axis directions evenly spread on a sphere.\nconst _axisDirections=[/*@__PURE__*/new three_module_Vector3(1,1,1),/*@__PURE__*/new three_module_Vector3(-1,1,1),/*@__PURE__*/new three_module_Vector3(1,1,-1),/*@__PURE__*/new three_module_Vector3(-1,1,-1),/*@__PURE__*/new three_module_Vector3(0,PHI,INV_PHI),/*@__PURE__*/new three_module_Vector3(0,PHI,-INV_PHI),/*@__PURE__*/new three_module_Vector3(INV_PHI,0,PHI),/*@__PURE__*/new three_module_Vector3(-INV_PHI,0,PHI),/*@__PURE__*/new three_module_Vector3(PHI,INV_PHI,0),/*@__PURE__*/new three_module_Vector3(-PHI,INV_PHI,0)];/**\n * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n * (PMREM) from a cubeMap environment texture. This allows different levels of\n * blur to be quickly accessed based on material roughness. It is packed into a\n * special CubeUV format that allows us to perform custom interpolation so that\n * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n * higher roughness levels. In this way we maintain resolution to smoothly\n * interpolate diffuse lighting while limiting sampling computation.\n *\n * Paper: Fast, Accurate Image-Based Lighting\n * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view\n*/class PMREMGenerator{constructor(renderer){this._renderer=renderer;this._pingPongRenderTarget=null;this._lodMax=0;this._cubeSize=0;this._lodPlanes=[];this._sizeLods=[];this._sigmas=[];this._blurMaterial=null;this._cubemapMaterial=null;this._equirectMaterial=null;this._compileMaterial(this._blurMaterial);}/**\n\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t * and far planes ensure the scene is rendered in its entirety (the cubeCamera\n\t * is placed at the origin).\n\t */fromScene(scene,sigma=0,near=0.1,far=100){_oldTarget=this._renderer.getRenderTarget();this._setSize(256);const cubeUVRenderTarget=this._allocateTargets();cubeUVRenderTarget.depthBuffer=true;this._sceneToCubeUV(scene,near,far,cubeUVRenderTarget);if(sigma>0){this._blur(cubeUVRenderTarget,0,0,sigma);}this._applyPMREM(cubeUVRenderTarget);this._cleanup(cubeUVRenderTarget);return cubeUVRenderTarget;}/**\n\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t * or HDR. The ideal input image size is 1k (1024 x 512),\n\t * as this matches best with the 256 x 256 cubemap output.\n\t */fromEquirectangular(equirectangular,renderTarget=null){return this._fromTexture(equirectangular,renderTarget);}/**\n\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t * or HDR. The ideal input cube size is 256 x 256,\n\t * as this matches best with the 256 x 256 cubemap output.\n\t */fromCubemap(cubemap,renderTarget=null){return this._fromTexture(cubemap,renderTarget);}/**\n\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */compileCubemapShader(){if(this._cubemapMaterial===null){this._cubemapMaterial=_getCubemapMaterial();this._compileMaterial(this._cubemapMaterial);}}/**\n\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */compileEquirectangularShader(){if(this._equirectMaterial===null){this._equirectMaterial=_getEquirectMaterial();this._compileMaterial(this._equirectMaterial);}}/**\n\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t * one of them will cause any others to also become unusable.\n\t */dispose(){this._dispose();if(this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose();}// private interface\n_setSize(cubeSize){this._lodMax=Math.floor(log2(cubeSize));this._cubeSize=Math.pow(2,this._lodMax);}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let i=0;i<this._lodPlanes.length;i++){this._lodPlanes[i].dispose();}}_cleanup(outputTarget){this._renderer.setRenderTarget(_oldTarget);outputTarget.scissorTest=false;_setViewport(outputTarget,0,0,outputTarget.width,outputTarget.height);}_fromTexture(texture,renderTarget){if(texture.mapping===CubeReflectionMapping||texture.mapping===CubeRefractionMapping){this._setSize(texture.image.length===0?16:texture.image[0].width||texture.image[0].image.width);}else{// Equirectangular\nthis._setSize(texture.image.width/4);}_oldTarget=this._renderer.getRenderTarget();const cubeUVRenderTarget=renderTarget||this._allocateTargets();this._textureToCubeUV(texture,cubeUVRenderTarget);this._applyPMREM(cubeUVRenderTarget);this._cleanup(cubeUVRenderTarget);return cubeUVRenderTarget;}_allocateTargets(){const width=3*Math.max(this._cubeSize,16*7);const height=4*this._cubeSize;const params={magFilter:LinearFilter,minFilter:LinearFilter,generateMipmaps:false,type:HalfFloatType,format:RGBAFormat,encoding:LinearEncoding,depthBuffer:false};const cubeUVRenderTarget=_createRenderTarget(width,height,params);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==width){if(this._pingPongRenderTarget!==null){this._dispose();}this._pingPongRenderTarget=_createRenderTarget(width,height,params);const{_lodMax}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=_createPlanes(_lodMax));this._blurMaterial=_getBlurShader(_lodMax,width,height);}return cubeUVRenderTarget;}_compileMaterial(material){const tmpMesh=new Mesh(this._lodPlanes[0],material);this._renderer.compile(tmpMesh,_flatCamera);}_sceneToCubeUV(scene,near,far,cubeUVRenderTarget){const fov=90;const aspect=1;const cubeCamera=new PerspectiveCamera(fov,aspect,near,far);const upSign=[1,-1,1,1,1,1];const forwardSign=[1,1,1,-1,-1,-1];const renderer=this._renderer;const originalAutoClear=renderer.autoClear;const toneMapping=renderer.toneMapping;renderer.getClearColor(_clearColor);renderer.toneMapping=NoToneMapping;renderer.autoClear=false;const backgroundMaterial=new MeshBasicMaterial({name:'PMREM.Background',side:BackSide,depthWrite:false,depthTest:false});const backgroundBox=new Mesh(new BoxGeometry(),backgroundMaterial);let useSolidColor=false;const background=scene.background;if(background){if(background.isColor){backgroundMaterial.color.copy(background);scene.background=null;useSolidColor=true;}}else{backgroundMaterial.color.copy(_clearColor);useSolidColor=true;}for(let i=0;i<6;i++){const col=i%3;if(col===0){cubeCamera.up.set(0,upSign[i],0);cubeCamera.lookAt(forwardSign[i],0,0);}else if(col===1){cubeCamera.up.set(0,0,upSign[i]);cubeCamera.lookAt(0,forwardSign[i],0);}else{cubeCamera.up.set(0,upSign[i],0);cubeCamera.lookAt(0,0,forwardSign[i]);}const size=this._cubeSize;_setViewport(cubeUVRenderTarget,col*size,i>2?size:0,size,size);renderer.setRenderTarget(cubeUVRenderTarget);if(useSolidColor){renderer.render(backgroundBox,cubeCamera);}renderer.render(scene,cubeCamera);}backgroundBox.geometry.dispose();backgroundBox.material.dispose();renderer.toneMapping=toneMapping;renderer.autoClear=originalAutoClear;scene.background=background;}_textureToCubeUV(texture,cubeUVRenderTarget){const renderer=this._renderer;const isCubeTexture=texture.mapping===CubeReflectionMapping||texture.mapping===CubeRefractionMapping;if(isCubeTexture){if(this._cubemapMaterial===null){this._cubemapMaterial=_getCubemapMaterial();}this._cubemapMaterial.uniforms.flipEnvMap.value=texture.isRenderTargetTexture===false?-1:1;}else{if(this._equirectMaterial===null){this._equirectMaterial=_getEquirectMaterial();}}const material=isCubeTexture?this._cubemapMaterial:this._equirectMaterial;const mesh=new Mesh(this._lodPlanes[0],material);const uniforms=material.uniforms;uniforms['envMap'].value=texture;const size=this._cubeSize;_setViewport(cubeUVRenderTarget,0,0,3*size,2*size);renderer.setRenderTarget(cubeUVRenderTarget);renderer.render(mesh,_flatCamera);}_applyPMREM(cubeUVRenderTarget){const renderer=this._renderer;const autoClear=renderer.autoClear;renderer.autoClear=false;for(let i=1;i<this._lodPlanes.length;i++){const sigma=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]);const poleAxis=_axisDirections[(i-1)%_axisDirections.length];this._blur(cubeUVRenderTarget,i-1,i,sigma,poleAxis);}renderer.autoClear=autoClear;}/**\n\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t * accurate at the poles, but still does a decent job.\n\t */_blur(cubeUVRenderTarget,lodIn,lodOut,sigma,poleAxis){const pingPongRenderTarget=this._pingPongRenderTarget;this._halfBlur(cubeUVRenderTarget,pingPongRenderTarget,lodIn,lodOut,sigma,'latitudinal',poleAxis);this._halfBlur(pingPongRenderTarget,cubeUVRenderTarget,lodOut,lodOut,sigma,'longitudinal',poleAxis);}_halfBlur(targetIn,targetOut,lodIn,lodOut,sigmaRadians,direction,poleAxis){const renderer=this._renderer;const blurMaterial=this._blurMaterial;if(direction!=='latitudinal'&&direction!=='longitudinal'){console.error('blur direction must be either latitudinal or longitudinal!');}// Number of standard deviations at which to cut off the discrete approximation.\nconst STANDARD_DEVIATIONS=3;const blurMesh=new Mesh(this._lodPlanes[lodOut],blurMaterial);const blurUniforms=blurMaterial.uniforms;const pixels=this._sizeLods[lodIn]-1;const radiansPerPixel=isFinite(sigmaRadians)?Math.PI/(2*pixels):2*Math.PI/(2*MAX_SAMPLES-1);const sigmaPixels=sigmaRadians/radiansPerPixel;const samples=isFinite(sigmaRadians)?1+Math.floor(STANDARD_DEVIATIONS*sigmaPixels):MAX_SAMPLES;if(samples>MAX_SAMPLES){console.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to ${MAX_SAMPLES}`);}const weights=[];let sum=0;for(let i=0;i<MAX_SAMPLES;++i){const x=i/sigmaPixels;const weight=Math.exp(-x*x/2);weights.push(weight);if(i===0){sum+=weight;}else if(i<samples){sum+=2*weight;}}for(let i=0;i<weights.length;i++){weights[i]=weights[i]/sum;}blurUniforms['envMap'].value=targetIn.texture;blurUniforms['samples'].value=samples;blurUniforms['weights'].value=weights;blurUniforms['latitudinal'].value=direction==='latitudinal';if(poleAxis){blurUniforms['poleAxis'].value=poleAxis;}const{_lodMax}=this;blurUniforms['dTheta'].value=radiansPerPixel;blurUniforms['mipInt'].value=_lodMax-lodIn;const outputSize=this._sizeLods[lodOut];const x=3*outputSize*(lodOut>_lodMax-LOD_MIN?lodOut-_lodMax+LOD_MIN:0);const y=4*(this._cubeSize-outputSize);_setViewport(targetOut,x,y,3*outputSize,2*outputSize);renderer.setRenderTarget(targetOut);renderer.render(blurMesh,_flatCamera);}}function _createPlanes(lodMax){const lodPlanes=[];const sizeLods=[];const sigmas=[];let lod=lodMax;const totalLods=lodMax-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let i=0;i<totalLods;i++){const sizeLod=Math.pow(2,lod);sizeLods.push(sizeLod);let sigma=1.0/sizeLod;if(i>lodMax-LOD_MIN){sigma=EXTRA_LOD_SIGMA[i-lodMax+LOD_MIN-1];}else if(i===0){sigma=0;}sigmas.push(sigma);const texelSize=1.0/(sizeLod-2);const min=-texelSize;const max=1+texelSize;const uv1=[min,min,max,min,max,max,min,min,max,max,min,max];const cubeFaces=6;const vertices=6;const positionSize=3;const uvSize=2;const faceIndexSize=1;const position=new Float32Array(positionSize*vertices*cubeFaces);const uv=new Float32Array(uvSize*vertices*cubeFaces);const faceIndex=new Float32Array(faceIndexSize*vertices*cubeFaces);for(let face=0;face<cubeFaces;face++){const x=face%3*2/3-1;const y=face>2?0:-1;const coordinates=[x,y,0,x+2/3,y,0,x+2/3,y+1,0,x,y,0,x+2/3,y+1,0,x,y+1,0];position.set(coordinates,positionSize*vertices*face);uv.set(uv1,uvSize*vertices*face);const fill=[face,face,face,face,face,face];faceIndex.set(fill,faceIndexSize*vertices*face);}const planes=new BufferGeometry();planes.setAttribute('position',new BufferAttribute(position,positionSize));planes.setAttribute('uv',new BufferAttribute(uv,uvSize));planes.setAttribute('faceIndex',new BufferAttribute(faceIndex,faceIndexSize));lodPlanes.push(planes);if(lod>LOD_MIN){lod--;}}return{lodPlanes,sizeLods,sigmas};}function _createRenderTarget(width,height,params){const cubeUVRenderTarget=new WebGLRenderTarget(width,height,params);cubeUVRenderTarget.texture.mapping=CubeUVReflectionMapping;cubeUVRenderTarget.texture.name='PMREM.cubeUv';cubeUVRenderTarget.scissorTest=true;return cubeUVRenderTarget;}function _setViewport(target,x,y,width,height){target.viewport.set(x,y,width,height);target.scissor.set(x,y,width,height);}function _getBlurShader(lodMax,width,height){const weights=new Float32Array(MAX_SAMPLES);const poleAxis=new three_module_Vector3(0,1,0);const shaderMaterial=new ShaderMaterial({name:'SphericalGaussianBlur',defines:{'n':MAX_SAMPLES,'CUBEUV_TEXEL_WIDTH':1.0/width,'CUBEUV_TEXEL_HEIGHT':1.0/height,'CUBEUV_MAX_MIP':`${lodMax}.0`},uniforms:{'envMap':{value:null},'samples':{value:1},'weights':{value:weights},'latitudinal':{value:false},'dTheta':{value:0},'mipInt':{value:0},'poleAxis':{value:poleAxis}},vertexShader:_getCommonVertexShader(),fragmentShader:/* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,blending:NoBlending,depthTest:false,depthWrite:false});return shaderMaterial;}function _getEquirectMaterial(){return new ShaderMaterial({name:'EquirectangularToCubeUV',uniforms:{'envMap':{value:null}},vertexShader:_getCommonVertexShader(),fragmentShader:/* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,blending:NoBlending,depthTest:false,depthWrite:false});}function _getCubemapMaterial(){return new ShaderMaterial({name:'CubemapToCubeUV',uniforms:{'envMap':{value:null},'flipEnvMap':{value:-1}},vertexShader:_getCommonVertexShader(),fragmentShader:/* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,blending:NoBlending,depthTest:false,depthWrite:false});}function _getCommonVertexShader(){return(/* glsl */`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`);}function WebGLCubeUVMaps(renderer){let cubeUVmaps=new weak_map();let pmremGenerator=null;function get(texture){if(texture&&texture.isTexture){const mapping=texture.mapping;const isEquirectMap=mapping===EquirectangularReflectionMapping||mapping===EquirectangularRefractionMapping;const isCubeMap=mapping===CubeReflectionMapping||mapping===CubeRefractionMapping;// equirect/cube map to cubeUV conversion\nif(isEquirectMap||isCubeMap){if(texture.isRenderTargetTexture&&texture.needsPMREMUpdate===true){texture.needsPMREMUpdate=false;let renderTarget=cubeUVmaps.get(texture);if(pmremGenerator===null)pmremGenerator=new PMREMGenerator(renderer);renderTarget=isEquirectMap?pmremGenerator.fromEquirectangular(texture,renderTarget):pmremGenerator.fromCubemap(texture,renderTarget);cubeUVmaps.set(texture,renderTarget);return renderTarget.texture;}else{if(cubeUVmaps.has(texture)){return cubeUVmaps.get(texture).texture;}else{const image=texture.image;if(isEquirectMap&&image&&image.height>0||isCubeMap&&image&&isCubeTextureComplete(image)){if(pmremGenerator===null)pmremGenerator=new PMREMGenerator(renderer);const renderTarget=isEquirectMap?pmremGenerator.fromEquirectangular(texture):pmremGenerator.fromCubemap(texture);cubeUVmaps.set(texture,renderTarget);texture.addEventListener('dispose',onTextureDispose);return renderTarget.texture;}else{// image not yet ready. try the conversion next frame\nreturn null;}}}}}return texture;}function isCubeTextureComplete(image){let count=0;const length=6;for(let i=0;i<length;i++){if(image[i]!==undefined)count++;}return count===length;}function onTextureDispose(event){const texture=event.target;texture.removeEventListener('dispose',onTextureDispose);const cubemapUV=cubeUVmaps.get(texture);if(cubemapUV!==undefined){cubeUVmaps.delete(texture);cubemapUV.dispose();}}function dispose(){cubeUVmaps=new weak_map();if(pmremGenerator!==null){pmremGenerator.dispose();pmremGenerator=null;}}return{get:get,dispose:dispose};}function WebGLExtensions(gl){const extensions={};function getExtension(name){if(extensions[name]!==undefined){return extensions[name];}let extension;switch(name){case'WEBGL_depth_texture':extension=gl.getExtension('WEBGL_depth_texture')||gl.getExtension('MOZ_WEBGL_depth_texture')||gl.getExtension('WEBKIT_WEBGL_depth_texture');break;case'EXT_texture_filter_anisotropic':extension=gl.getExtension('EXT_texture_filter_anisotropic')||gl.getExtension('MOZ_EXT_texture_filter_anisotropic')||gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic');break;case'WEBGL_compressed_texture_s3tc':extension=gl.getExtension('WEBGL_compressed_texture_s3tc')||gl.getExtension('MOZ_WEBGL_compressed_texture_s3tc')||gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');break;case'WEBGL_compressed_texture_pvrtc':extension=gl.getExtension('WEBGL_compressed_texture_pvrtc')||gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');break;default:extension=gl.getExtension(name);}extensions[name]=extension;return extension;}return{has:function(name){return getExtension(name)!==null;},init:function(capabilities){if(capabilities.isWebGL2){getExtension('EXT_color_buffer_float');}else{getExtension('WEBGL_depth_texture');getExtension('OES_texture_float');getExtension('OES_texture_half_float');getExtension('OES_texture_half_float_linear');getExtension('OES_standard_derivatives');getExtension('OES_element_index_uint');getExtension('OES_vertex_array_object');getExtension('ANGLE_instanced_arrays');}getExtension('OES_texture_float_linear');getExtension('EXT_color_buffer_half_float');getExtension('WEBGL_multisampled_render_to_texture');},get:function(name){const extension=getExtension(name);if(extension===null){console.warn('THREE.WebGLRenderer: '+name+' extension not supported.');}return extension;}};}function WebGLGeometries(gl,attributes,info,bindingStates){const geometries={};const wireframeAttributes=new weak_map();function onGeometryDispose(event){const geometry=event.target;if(geometry.index!==null){attributes.remove(geometry.index);}for(const name in geometry.attributes){attributes.remove(geometry.attributes[name]);}geometry.removeEventListener('dispose',onGeometryDispose);delete geometries[geometry.id];const attribute=wireframeAttributes.get(geometry);if(attribute){attributes.remove(attribute);wireframeAttributes.delete(geometry);}bindingStates.releaseStatesOfGeometry(geometry);if(geometry.isInstancedBufferGeometry===true){delete geometry._maxInstanceCount;}//\ninfo.memory.geometries--;}function get(object,geometry){if(geometries[geometry.id]===true)return geometry;geometry.addEventListener('dispose',onGeometryDispose);geometries[geometry.id]=true;info.memory.geometries++;return geometry;}function update(geometry){const geometryAttributes=geometry.attributes;// Updating index buffer in VAO now. See WebGLBindingStates.\nfor(const name in geometryAttributes){attributes.update(geometryAttributes[name],34962);}// morph targets\nconst morphAttributes=geometry.morphAttributes;for(const name in morphAttributes){const array=morphAttributes[name];for(let i=0,l=array.length;i<l;i++){attributes.update(array[i],34962);}}}function updateWireframeAttribute(geometry){const indices=[];const geometryIndex=geometry.index;const geometryPosition=geometry.attributes.position;let version=0;if(geometryIndex!==null){const array=geometryIndex.array;version=geometryIndex.version;for(let i=0,l=array.length;i<l;i+=3){const a=array[i+0];const b=array[i+1];const c=array[i+2];indices.push(a,b,b,c,c,a);}}else{const array=geometryPosition.array;version=geometryPosition.version;for(let i=0,l=array.length/3-1;i<l;i+=3){const a=i+0;const b=i+1;const c=i+2;indices.push(a,b,b,c,c,a);}}const attribute=new(arrayNeedsUint32(indices)?Uint32BufferAttribute:Uint16BufferAttribute)(indices,1);attribute.version=version;// Updating index buffer in VAO now. See WebGLBindingStates\n//\nconst previousAttribute=wireframeAttributes.get(geometry);if(previousAttribute)attributes.remove(previousAttribute);//\nwireframeAttributes.set(geometry,attribute);}function getWireframeAttribute(geometry){const currentAttribute=wireframeAttributes.get(geometry);if(currentAttribute){const geometryIndex=geometry.index;if(geometryIndex!==null){// if the attribute is obsolete, create a new one\nif(currentAttribute.version<geometryIndex.version){updateWireframeAttribute(geometry);}}}else{updateWireframeAttribute(geometry);}return wireframeAttributes.get(geometry);}return{get:get,update:update,getWireframeAttribute:getWireframeAttribute};}function WebGLIndexedBufferRenderer(gl,extensions,info,capabilities){const isWebGL2=capabilities.isWebGL2;let mode;function setMode(value){mode=value;}let type,bytesPerElement;function setIndex(value){type=value.type;bytesPerElement=value.bytesPerElement;}function render(start,count){gl.drawElements(mode,count,type,start*bytesPerElement);info.update(count,mode,1);}function renderInstances(start,count,primcount){if(primcount===0)return;let extension,methodName;if(isWebGL2){extension=gl;methodName='drawElementsInstanced';}else{extension=extensions.get('ANGLE_instanced_arrays');methodName='drawElementsInstancedANGLE';if(extension===null){console.error('THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');return;}}extension[methodName](mode,count,type,start*bytesPerElement,primcount);info.update(count,mode,primcount);}//\nthis.setMode=setMode;this.setIndex=setIndex;this.render=render;this.renderInstances=renderInstances;}function WebGLInfo(gl){const memory={geometries:0,textures:0};const render={frame:0,calls:0,triangles:0,points:0,lines:0};function update(count,mode,instanceCount){render.calls++;switch(mode){case 4:render.triangles+=instanceCount*(count/3);break;case 1:render.lines+=instanceCount*(count/2);break;case 3:render.lines+=instanceCount*(count-1);break;case 2:render.lines+=instanceCount*count;break;case 0:render.points+=instanceCount*count;break;default:console.error('THREE.WebGLInfo: Unknown draw mode:',mode);break;}}function reset(){render.frame++;render.calls=0;render.triangles=0;render.points=0;render.lines=0;}return{memory:memory,render:render,programs:null,autoReset:true,reset:reset,update:update};}function numericalSort(a,b){return a[0]-b[0];}function absNumericalSort(a,b){return Math.abs(b[1])-Math.abs(a[1]);}function WebGLMorphtargets(gl,capabilities,textures){const influencesList={};const morphInfluences=new Float32Array(8);const morphTextures=new weak_map();const morph=new Vector4();const workInfluences=[];for(let i=0;i<8;i++){workInfluences[i]=[i,0];}function update(object,geometry,material,program){const objectInfluences=object.morphTargetInfluences;if(capabilities.isWebGL2===true){// instead of using attributes, the WebGL 2 code path encodes morph targets\n// into an array of data textures. Each layer represents a single morph target.\nconst morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color;const morphTargetsCount=morphAttribute!==undefined?morphAttribute.length:0;let entry=morphTextures.get(geometry);if(entry===undefined||entry.count!==morphTargetsCount){if(entry!==undefined)entry.texture.dispose();const hasMorphPosition=geometry.morphAttributes.position!==undefined;const hasMorphNormals=geometry.morphAttributes.normal!==undefined;const hasMorphColors=geometry.morphAttributes.color!==undefined;const morphTargets=geometry.morphAttributes.position||[];const morphNormals=geometry.morphAttributes.normal||[];const morphColors=geometry.morphAttributes.color||[];let vertexDataCount=0;if(hasMorphPosition===true)vertexDataCount=1;if(hasMorphNormals===true)vertexDataCount=2;if(hasMorphColors===true)vertexDataCount=3;let width=geometry.attributes.position.count*vertexDataCount;let height=1;if(width>capabilities.maxTextureSize){height=Math.ceil(width/capabilities.maxTextureSize);width=capabilities.maxTextureSize;}const buffer=new Float32Array(width*height*4*morphTargetsCount);const texture=new DataArrayTexture(buffer,width,height,morphTargetsCount);texture.type=FloatType;texture.needsUpdate=true;// fill buffer\nconst vertexDataStride=vertexDataCount*4;for(let i=0;i<morphTargetsCount;i++){const morphTarget=morphTargets[i];const morphNormal=morphNormals[i];const morphColor=morphColors[i];const offset=width*height*4*i;for(let j=0;j<morphTarget.count;j++){const stride=j*vertexDataStride;if(hasMorphPosition===true){morph.fromBufferAttribute(morphTarget,j);buffer[offset+stride+0]=morph.x;buffer[offset+stride+1]=morph.y;buffer[offset+stride+2]=morph.z;buffer[offset+stride+3]=0;}if(hasMorphNormals===true){morph.fromBufferAttribute(morphNormal,j);buffer[offset+stride+4]=morph.x;buffer[offset+stride+5]=morph.y;buffer[offset+stride+6]=morph.z;buffer[offset+stride+7]=0;}if(hasMorphColors===true){morph.fromBufferAttribute(morphColor,j);buffer[offset+stride+8]=morph.x;buffer[offset+stride+9]=morph.y;buffer[offset+stride+10]=morph.z;buffer[offset+stride+11]=morphColor.itemSize===4?morph.w:1;}}}entry={count:morphTargetsCount,texture:texture,size:new Vector2(width,height)};morphTextures.set(geometry,entry);function disposeTexture(){texture.dispose();morphTextures.delete(geometry);geometry.removeEventListener('dispose',disposeTexture);}geometry.addEventListener('dispose',disposeTexture);}//\nlet morphInfluencesSum=0;for(let i=0;i<objectInfluences.length;i++){morphInfluencesSum+=objectInfluences[i];}const morphBaseInfluence=geometry.morphTargetsRelative?1:1-morphInfluencesSum;program.getUniforms().setValue(gl,'morphTargetBaseInfluence',morphBaseInfluence);program.getUniforms().setValue(gl,'morphTargetInfluences',objectInfluences);program.getUniforms().setValue(gl,'morphTargetsTexture',entry.texture,textures);program.getUniforms().setValue(gl,'morphTargetsTextureSize',entry.size);}else{// When object doesn't have morph target influences defined, we treat it as a 0-length array\n// This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences\nconst length=objectInfluences===undefined?0:objectInfluences.length;let influences=influencesList[geometry.id];if(influences===undefined||influences.length!==length){// initialise list\ninfluences=[];for(let i=0;i<length;i++){influences[i]=[i,0];}influencesList[geometry.id]=influences;}// Collect influences\nfor(let i=0;i<length;i++){const influence=influences[i];influence[0]=i;influence[1]=objectInfluences[i];}instance_sort(influences).call(influences,absNumericalSort);for(let i=0;i<8;i++){if(i<length&&influences[i][1]){workInfluences[i][0]=influences[i][0];workInfluences[i][1]=influences[i][1];}else{workInfluences[i][0]=max_safe_integer;workInfluences[i][1]=0;}}instance_sort(workInfluences).call(workInfluences,numericalSort);const morphTargets=geometry.morphAttributes.position;const morphNormals=geometry.morphAttributes.normal;let morphInfluencesSum=0;for(let i=0;i<8;i++){const influence=workInfluences[i];const index=influence[0];const value=influence[1];if(index!==max_safe_integer&&value){if(morphTargets&&geometry.getAttribute('morphTarget'+i)!==morphTargets[index]){geometry.setAttribute('morphTarget'+i,morphTargets[index]);}if(morphNormals&&geometry.getAttribute('morphNormal'+i)!==morphNormals[index]){geometry.setAttribute('morphNormal'+i,morphNormals[index]);}morphInfluences[i]=value;morphInfluencesSum+=value;}else{if(morphTargets&&geometry.hasAttribute('morphTarget'+i)===true){geometry.deleteAttribute('morphTarget'+i);}if(morphNormals&&geometry.hasAttribute('morphNormal'+i)===true){geometry.deleteAttribute('morphNormal'+i);}morphInfluences[i]=0;}}// GLSL shader uses formula baseinfluence * base + sum(target * influence)\n// This allows us to switch between absolute morphs and relative morphs without changing shader code\n// When baseinfluence = 1 - sum(influence), the above is equivalent to sum((target - base) * influence)\nconst morphBaseInfluence=geometry.morphTargetsRelative?1:1-morphInfluencesSum;program.getUniforms().setValue(gl,'morphTargetBaseInfluence',morphBaseInfluence);program.getUniforms().setValue(gl,'morphTargetInfluences',morphInfluences);}}return{update:update};}function WebGLObjects(gl,geometries,attributes,info){let updateMap=new weak_map();function update(object){const frame=info.render.frame;const geometry=object.geometry;const buffergeometry=geometries.get(object,geometry);// Update once per frame\nif(updateMap.get(buffergeometry)!==frame){geometries.update(buffergeometry);updateMap.set(buffergeometry,frame);}if(object.isInstancedMesh){if(object.hasEventListener('dispose',onInstancedMeshDispose)===false){object.addEventListener('dispose',onInstancedMeshDispose);}attributes.update(object.instanceMatrix,34962);if(object.instanceColor!==null){attributes.update(object.instanceColor,34962);}}return buffergeometry;}function dispose(){updateMap=new weak_map();}function onInstancedMeshDispose(event){const instancedMesh=event.target;instancedMesh.removeEventListener('dispose',onInstancedMeshDispose);attributes.remove(instancedMesh.instanceMatrix);if(instancedMesh.instanceColor!==null)attributes.remove(instancedMesh.instanceColor);}return{update:update,dispose:dispose};}/**\n * Uniforms of a program.\n * Those form a tree structure with a special top-level container for the root,\n * which you get by calling 'new WebGLUniforms( gl, program )'.\n *\n *\n * Properties of inner nodes including the top-level container:\n *\n * .seq - array of nested uniforms\n * .map - nested uniforms by name\n *\n *\n * Methods of all nodes except the top-level container:\n *\n * .setValue( gl, value, [textures] )\n *\n * \t\tuploads a uniform value(s)\n * \tthe 'textures' parameter is needed for sampler uniforms\n *\n *\n * Static methods of the top-level container (textures factorizations):\n *\n * .upload( gl, seq, values, textures )\n *\n * \t\tsets uniforms in 'seq' to 'values[id].value'\n *\n * .seqWithValue( seq, values ) : filteredSeq\n *\n * \t\tfilters 'seq' entries with corresponding entry in values\n *\n *\n * Methods of the top-level container (textures factorizations):\n *\n * .setValue( gl, name, value, textures )\n *\n * \t\tsets uniform with name 'name' to 'value'\n *\n * .setOptional( gl, obj, prop )\n *\n * \t\tlike .set for an optional property of the object\n *\n */const emptyTexture=/*@__PURE__*/new Texture();const emptyArrayTexture=/*@__PURE__*/new DataArrayTexture();const empty3dTexture=/*@__PURE__*/new Data3DTexture();const emptyCubeTexture=/*@__PURE__*/new CubeTexture();// --- Utilities ---\n// Array Caches (provide typed arrays for temporary by size)\nconst arrayCacheF32=[];const arrayCacheI32=[];// Float32Array caches used for uploading Matrix uniforms\nconst mat4array=new Float32Array(16);const mat3array=new Float32Array(9);const mat2array=new Float32Array(4);// Flattening for arrays of vectors and matrices\nfunction flatten(array,nBlocks,blockSize){const firstElem=array[0];if(firstElem<=0||firstElem>0)return array;// unoptimized: ! isNaN( firstElem )\n// see http://jacksondunstan.com/articles/983\nconst n=nBlocks*blockSize;let r=arrayCacheF32[n];if(r===undefined){r=new Float32Array(n);arrayCacheF32[n]=r;}if(nBlocks!==0){firstElem.toArray(r,0);for(let i=1,offset=0;i!==nBlocks;++i){offset+=blockSize;array[i].toArray(r,offset);}}return r;}function arraysEqual(a,b){if(a.length!==b.length)return false;for(let i=0,l=a.length;i<l;i++){if(a[i]!==b[i])return false;}return true;}function copyArray(a,b){for(let i=0,l=b.length;i<l;i++){a[i]=b[i];}}// Texture unit allocation\nfunction allocTexUnits(textures,n){let r=arrayCacheI32[n];if(r===undefined){r=new Int32Array(n);arrayCacheI32[n]=r;}for(let i=0;i!==n;++i){r[i]=textures.allocateTextureUnit();}return r;}// --- Setters ---\n// Note: Defining these methods externally, because they come in a bunch\n// and this way their names minify.\n// Single scalar\nfunction setValueV1f(gl,v){const cache=this.cache;if(cache[0]===v)return;gl.uniform1f(this.addr,v);cache[0]=v;}// Single float vector (from flat array or THREE.VectorN)\nfunction setValueV2f(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y){gl.uniform2f(this.addr,v.x,v.y);cache[0]=v.x;cache[1]=v.y;}}else{if(arraysEqual(cache,v))return;gl.uniform2fv(this.addr,v);copyArray(cache,v);}}function setValueV3f(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y||cache[2]!==v.z){gl.uniform3f(this.addr,v.x,v.y,v.z);cache[0]=v.x;cache[1]=v.y;cache[2]=v.z;}}else if(v.r!==undefined){if(cache[0]!==v.r||cache[1]!==v.g||cache[2]!==v.b){gl.uniform3f(this.addr,v.r,v.g,v.b);cache[0]=v.r;cache[1]=v.g;cache[2]=v.b;}}else{if(arraysEqual(cache,v))return;gl.uniform3fv(this.addr,v);copyArray(cache,v);}}function setValueV4f(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y||cache[2]!==v.z||cache[3]!==v.w){gl.uniform4f(this.addr,v.x,v.y,v.z,v.w);cache[0]=v.x;cache[1]=v.y;cache[2]=v.z;cache[3]=v.w;}}else{if(arraysEqual(cache,v))return;gl.uniform4fv(this.addr,v);copyArray(cache,v);}}// Single matrix (from flat array or THREE.MatrixN)\nfunction setValueM2(gl,v){const cache=this.cache;const elements=v.elements;if(elements===undefined){if(arraysEqual(cache,v))return;gl.uniformMatrix2fv(this.addr,false,v);copyArray(cache,v);}else{if(arraysEqual(cache,elements))return;mat2array.set(elements);gl.uniformMatrix2fv(this.addr,false,mat2array);copyArray(cache,elements);}}function setValueM3(gl,v){const cache=this.cache;const elements=v.elements;if(elements===undefined){if(arraysEqual(cache,v))return;gl.uniformMatrix3fv(this.addr,false,v);copyArray(cache,v);}else{if(arraysEqual(cache,elements))return;mat3array.set(elements);gl.uniformMatrix3fv(this.addr,false,mat3array);copyArray(cache,elements);}}function setValueM4(gl,v){const cache=this.cache;const elements=v.elements;if(elements===undefined){if(arraysEqual(cache,v))return;gl.uniformMatrix4fv(this.addr,false,v);copyArray(cache,v);}else{if(arraysEqual(cache,elements))return;mat4array.set(elements);gl.uniformMatrix4fv(this.addr,false,mat4array);copyArray(cache,elements);}}// Single integer / boolean\nfunction setValueV1i(gl,v){const cache=this.cache;if(cache[0]===v)return;gl.uniform1i(this.addr,v);cache[0]=v;}// Single integer / boolean vector (from flat array or THREE.VectorN)\nfunction setValueV2i(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y){gl.uniform2i(this.addr,v.x,v.y);cache[0]=v.x;cache[1]=v.y;}}else{if(arraysEqual(cache,v))return;gl.uniform2iv(this.addr,v);copyArray(cache,v);}}function setValueV3i(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y||cache[2]!==v.z){gl.uniform3i(this.addr,v.x,v.y,v.z);cache[0]=v.x;cache[1]=v.y;cache[2]=v.z;}}else{if(arraysEqual(cache,v))return;gl.uniform3iv(this.addr,v);copyArray(cache,v);}}function setValueV4i(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y||cache[2]!==v.z||cache[3]!==v.w){gl.uniform4i(this.addr,v.x,v.y,v.z,v.w);cache[0]=v.x;cache[1]=v.y;cache[2]=v.z;cache[3]=v.w;}}else{if(arraysEqual(cache,v))return;gl.uniform4iv(this.addr,v);copyArray(cache,v);}}// Single unsigned integer\nfunction setValueV1ui(gl,v){const cache=this.cache;if(cache[0]===v)return;gl.uniform1ui(this.addr,v);cache[0]=v;}// Single unsigned integer vector (from flat array or THREE.VectorN)\nfunction setValueV2ui(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y){gl.uniform2ui(this.addr,v.x,v.y);cache[0]=v.x;cache[1]=v.y;}}else{if(arraysEqual(cache,v))return;gl.uniform2uiv(this.addr,v);copyArray(cache,v);}}function setValueV3ui(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y||cache[2]!==v.z){gl.uniform3ui(this.addr,v.x,v.y,v.z);cache[0]=v.x;cache[1]=v.y;cache[2]=v.z;}}else{if(arraysEqual(cache,v))return;gl.uniform3uiv(this.addr,v);copyArray(cache,v);}}function setValueV4ui(gl,v){const cache=this.cache;if(v.x!==undefined){if(cache[0]!==v.x||cache[1]!==v.y||cache[2]!==v.z||cache[3]!==v.w){gl.uniform4ui(this.addr,v.x,v.y,v.z,v.w);cache[0]=v.x;cache[1]=v.y;cache[2]=v.z;cache[3]=v.w;}}else{if(arraysEqual(cache,v))return;gl.uniform4uiv(this.addr,v);copyArray(cache,v);}}// Single texture (2D / Cube)\nfunction setValueT1(gl,v,textures){const cache=this.cache;const unit=textures.allocateTextureUnit();if(cache[0]!==unit){gl.uniform1i(this.addr,unit);cache[0]=unit;}textures.setTexture2D(v||emptyTexture,unit);}function setValueT3D1(gl,v,textures){const cache=this.cache;const unit=textures.allocateTextureUnit();if(cache[0]!==unit){gl.uniform1i(this.addr,unit);cache[0]=unit;}textures.setTexture3D(v||empty3dTexture,unit);}function setValueT6(gl,v,textures){const cache=this.cache;const unit=textures.allocateTextureUnit();if(cache[0]!==unit){gl.uniform1i(this.addr,unit);cache[0]=unit;}textures.setTextureCube(v||emptyCubeTexture,unit);}function setValueT2DArray1(gl,v,textures){const cache=this.cache;const unit=textures.allocateTextureUnit();if(cache[0]!==unit){gl.uniform1i(this.addr,unit);cache[0]=unit;}textures.setTexture2DArray(v||emptyArrayTexture,unit);}// Helper to pick the right setter for the singular case\nfunction getSingularSetter(type){switch(type){case 0x1406:return setValueV1f;// FLOAT\ncase 0x8b50:return setValueV2f;// _VEC2\ncase 0x8b51:return setValueV3f;// _VEC3\ncase 0x8b52:return setValueV4f;// _VEC4\ncase 0x8b5a:return setValueM2;// _MAT2\ncase 0x8b5b:return setValueM3;// _MAT3\ncase 0x8b5c:return setValueM4;// _MAT4\ncase 0x1404:case 0x8b56:return setValueV1i;// INT, BOOL\ncase 0x8b53:case 0x8b57:return setValueV2i;// _VEC2\ncase 0x8b54:case 0x8b58:return setValueV3i;// _VEC3\ncase 0x8b55:case 0x8b59:return setValueV4i;// _VEC4\ncase 0x1405:return setValueV1ui;// UINT\ncase 0x8dc6:return setValueV2ui;// _VEC2\ncase 0x8dc7:return setValueV3ui;// _VEC3\ncase 0x8dc8:return setValueV4ui;// _VEC4\ncase 0x8b5e:// SAMPLER_2D\ncase 0x8d66:// SAMPLER_EXTERNAL_OES\ncase 0x8dca:// INT_SAMPLER_2D\ncase 0x8dd2:// UNSIGNED_INT_SAMPLER_2D\ncase 0x8b62:// SAMPLER_2D_SHADOW\nreturn setValueT1;case 0x8b5f:// SAMPLER_3D\ncase 0x8dcb:// INT_SAMPLER_3D\ncase 0x8dd3:// UNSIGNED_INT_SAMPLER_3D\nreturn setValueT3D1;case 0x8b60:// SAMPLER_CUBE\ncase 0x8dcc:// INT_SAMPLER_CUBE\ncase 0x8dd4:// UNSIGNED_INT_SAMPLER_CUBE\ncase 0x8dc5:// SAMPLER_CUBE_SHADOW\nreturn setValueT6;case 0x8dc1:// SAMPLER_2D_ARRAY\ncase 0x8dcf:// INT_SAMPLER_2D_ARRAY\ncase 0x8dd7:// UNSIGNED_INT_SAMPLER_2D_ARRAY\ncase 0x8dc4:// SAMPLER_2D_ARRAY_SHADOW\nreturn setValueT2DArray1;}}// Array of scalars\nfunction setValueV1fArray(gl,v){gl.uniform1fv(this.addr,v);}// Array of vectors (from flat array or array of THREE.VectorN)\nfunction setValueV2fArray(gl,v){const data=flatten(v,this.size,2);gl.uniform2fv(this.addr,data);}function setValueV3fArray(gl,v){const data=flatten(v,this.size,3);gl.uniform3fv(this.addr,data);}function setValueV4fArray(gl,v){const data=flatten(v,this.size,4);gl.uniform4fv(this.addr,data);}// Array of matrices (from flat array or array of THREE.MatrixN)\nfunction setValueM2Array(gl,v){const data=flatten(v,this.size,4);gl.uniformMatrix2fv(this.addr,false,data);}function setValueM3Array(gl,v){const data=flatten(v,this.size,9);gl.uniformMatrix3fv(this.addr,false,data);}function setValueM4Array(gl,v){const data=flatten(v,this.size,16);gl.uniformMatrix4fv(this.addr,false,data);}// Array of integer / boolean\nfunction setValueV1iArray(gl,v){gl.uniform1iv(this.addr,v);}// Array of integer / boolean vectors (from flat array)\nfunction setValueV2iArray(gl,v){gl.uniform2iv(this.addr,v);}function setValueV3iArray(gl,v){gl.uniform3iv(this.addr,v);}function setValueV4iArray(gl,v){gl.uniform4iv(this.addr,v);}// Array of unsigned integer\nfunction setValueV1uiArray(gl,v){gl.uniform1uiv(this.addr,v);}// Array of unsigned integer vectors (from flat array)\nfunction setValueV2uiArray(gl,v){gl.uniform2uiv(this.addr,v);}function setValueV3uiArray(gl,v){gl.uniform3uiv(this.addr,v);}function setValueV4uiArray(gl,v){gl.uniform4uiv(this.addr,v);}// Array of textures (2D / 3D / Cube / 2DArray)\nfunction setValueT1Array(gl,v,textures){const cache=this.cache;const n=v.length;const units=allocTexUnits(textures,n);if(!arraysEqual(cache,units)){gl.uniform1iv(this.addr,units);copyArray(cache,units);}for(let i=0;i!==n;++i){textures.setTexture2D(v[i]||emptyTexture,units[i]);}}function setValueT3DArray(gl,v,textures){const cache=this.cache;const n=v.length;const units=allocTexUnits(textures,n);if(!arraysEqual(cache,units)){gl.uniform1iv(this.addr,units);copyArray(cache,units);}for(let i=0;i!==n;++i){textures.setTexture3D(v[i]||empty3dTexture,units[i]);}}function setValueT6Array(gl,v,textures){const cache=this.cache;const n=v.length;const units=allocTexUnits(textures,n);if(!arraysEqual(cache,units)){gl.uniform1iv(this.addr,units);copyArray(cache,units);}for(let i=0;i!==n;++i){textures.setTextureCube(v[i]||emptyCubeTexture,units[i]);}}function setValueT2DArrayArray(gl,v,textures){const cache=this.cache;const n=v.length;const units=allocTexUnits(textures,n);if(!arraysEqual(cache,units)){gl.uniform1iv(this.addr,units);copyArray(cache,units);}for(let i=0;i!==n;++i){textures.setTexture2DArray(v[i]||emptyArrayTexture,units[i]);}}// Helper to pick the right setter for a pure (bottom-level) array\nfunction getPureArraySetter(type){switch(type){case 0x1406:return setValueV1fArray;// FLOAT\ncase 0x8b50:return setValueV2fArray;// _VEC2\ncase 0x8b51:return setValueV3fArray;// _VEC3\ncase 0x8b52:return setValueV4fArray;// _VEC4\ncase 0x8b5a:return setValueM2Array;// _MAT2\ncase 0x8b5b:return setValueM3Array;// _MAT3\ncase 0x8b5c:return setValueM4Array;// _MAT4\ncase 0x1404:case 0x8b56:return setValueV1iArray;// INT, BOOL\ncase 0x8b53:case 0x8b57:return setValueV2iArray;// _VEC2\ncase 0x8b54:case 0x8b58:return setValueV3iArray;// _VEC3\ncase 0x8b55:case 0x8b59:return setValueV4iArray;// _VEC4\ncase 0x1405:return setValueV1uiArray;// UINT\ncase 0x8dc6:return setValueV2uiArray;// _VEC2\ncase 0x8dc7:return setValueV3uiArray;// _VEC3\ncase 0x8dc8:return setValueV4uiArray;// _VEC4\ncase 0x8b5e:// SAMPLER_2D\ncase 0x8d66:// SAMPLER_EXTERNAL_OES\ncase 0x8dca:// INT_SAMPLER_2D\ncase 0x8dd2:// UNSIGNED_INT_SAMPLER_2D\ncase 0x8b62:// SAMPLER_2D_SHADOW\nreturn setValueT1Array;case 0x8b5f:// SAMPLER_3D\ncase 0x8dcb:// INT_SAMPLER_3D\ncase 0x8dd3:// UNSIGNED_INT_SAMPLER_3D\nreturn setValueT3DArray;case 0x8b60:// SAMPLER_CUBE\ncase 0x8dcc:// INT_SAMPLER_CUBE\ncase 0x8dd4:// UNSIGNED_INT_SAMPLER_CUBE\ncase 0x8dc5:// SAMPLER_CUBE_SHADOW\nreturn setValueT6Array;case 0x8dc1:// SAMPLER_2D_ARRAY\ncase 0x8dcf:// INT_SAMPLER_2D_ARRAY\ncase 0x8dd7:// UNSIGNED_INT_SAMPLER_2D_ARRAY\ncase 0x8dc4:// SAMPLER_2D_ARRAY_SHADOW\nreturn setValueT2DArrayArray;}}// --- Uniform Classes ---\nclass SingleUniform{constructor(id,activeInfo,addr){this.id=id;this.addr=addr;this.cache=[];this.setValue=getSingularSetter(activeInfo.type);// this.path = activeInfo.name; // DEBUG\n}}class PureArrayUniform{constructor(id,activeInfo,addr){this.id=id;this.addr=addr;this.cache=[];this.size=activeInfo.size;this.setValue=getPureArraySetter(activeInfo.type);// this.path = activeInfo.name; // DEBUG\n}}class StructuredUniform{constructor(id){this.id=id;this.seq=[];this.map={};}setValue(gl,value,textures){const seq=this.seq;for(let i=0,n=seq.length;i!==n;++i){const u=seq[i];u.setValue(gl,value[u.id],textures);}}}// --- Top-level ---\n// Parser - builds up the property tree from the path strings\nconst RePathPart=/(\\w+)(\\])?(\\[|\\.)?/g;// extracts\n// \t- the identifier (member name or array index)\n// - followed by an optional right bracket (found when array index)\n// - followed by an optional left bracket or dot (type of subscript)\n//\n// Note: These portions can be read in a non-overlapping fashion and\n// allow straightforward parsing of the hierarchy that WebGL encodes\n// in the uniform names.\nfunction addUniform(container,uniformObject){container.seq.push(uniformObject);instance_map(container)[uniformObject.id]=uniformObject;}function parseUniform(activeInfo,addr,container){const path=activeInfo.name,pathLength=path.length;// reset RegExp object, because of the early exit of a previous run\nRePathPart.lastIndex=0;while(true){const match=RePathPart.exec(path),matchEnd=RePathPart.lastIndex;let id=match[1];const idIsIndex=match[2]===']',subscript=match[3];if(idIsIndex)id=id|0;// convert to integer\nif(subscript===undefined||subscript==='['&&matchEnd+2===pathLength){// bare name or \"pure\" bottom-level array \"[0]\" suffix\naddUniform(container,subscript===undefined?new SingleUniform(id,activeInfo,addr):new PureArrayUniform(id,activeInfo,addr));break;}else{// step into inner node / create it in case it doesn't exist\nconst map=instance_map(container);let next=map[id];if(next===undefined){next=new StructuredUniform(id);addUniform(container,next);}container=next;}}}// Root Container\nclass WebGLUniforms{constructor(gl,program){this.seq=[];this.map={};const n=gl.getProgramParameter(program,35718);for(let i=0;i<n;++i){const info=gl.getActiveUniform(program,i),addr=gl.getUniformLocation(program,info.name);parseUniform(info,addr,this);}}setValue(gl,name,value,textures){const u=instance_map(this)[name];if(u!==undefined)u.setValue(gl,value,textures);}setOptional(gl,object,name){const v=object[name];if(v!==undefined)this.setValue(gl,name,v);}static upload(gl,seq,values,textures){for(let i=0,n=seq.length;i!==n;++i){const u=seq[i],v=values[u.id];if(v.needsUpdate!==false){// note: always updating when .needsUpdate is undefined\nu.setValue(gl,v.value,textures);}}}static seqWithValue(seq,values){const r=[];for(let i=0,n=seq.length;i!==n;++i){const u=seq[i];if(u.id in values)r.push(u);}return r;}}function WebGLShader(gl,type,string){const shader=gl.createShader(type);gl.shaderSource(shader,string);gl.compileShader(shader);return shader;}let programIdCount=0;function handleSource(string,errorLine){const lines=string.split('\\n');const lines2=[];const from=Math.max(errorLine-6,0);const to=Math.min(errorLine+6,lines.length);for(let i=from;i<to;i++){const line=i+1;lines2.push(`${line===errorLine?'>':' '} ${line}: ${lines[i]}`);}return lines2.join('\\n');}function getEncodingComponents(encoding){switch(encoding){case LinearEncoding:return['Linear','( value )'];case sRGBEncoding:return['sRGB','( value )'];default:console.warn('THREE.WebGLProgram: Unsupported encoding:',encoding);return['Linear','( value )'];}}function getShaderErrors(gl,shader,type){var _context16;const status=gl.getShaderParameter(shader,35713);const errors=trim(_context16=gl.getShaderInfoLog(shader)).call(_context16);if(status&&errors==='')return'';const errorMatches=/ERROR: 0:(\\d+)/.exec(errors);if(errorMatches){// --enable-privileged-webgl-extension\n// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\nconst errorLine=parse_int(errorMatches[1]);return type.toUpperCase()+'\\n\\n'+errors+'\\n\\n'+handleSource(gl.getShaderSource(shader),errorLine);}else{return errors;}}function getTexelEncodingFunction(functionName,encoding){const components=getEncodingComponents(encoding);return'vec4 '+functionName+'( vec4 value ) { return LinearTo'+components[0]+components[1]+'; }';}function getToneMappingFunction(functionName,toneMapping){let toneMappingName;switch(toneMapping){case LinearToneMapping:toneMappingName='Linear';break;case ReinhardToneMapping:toneMappingName='Reinhard';break;case CineonToneMapping:toneMappingName='OptimizedCineon';break;case ACESFilmicToneMapping:toneMappingName='ACESFilmic';break;case CustomToneMapping:toneMappingName='Custom';break;default:console.warn('THREE.WebGLProgram: Unsupported toneMapping:',toneMapping);toneMappingName='Linear';}return'vec3 '+functionName+'( vec3 color ) { return '+toneMappingName+'ToneMapping( color ); }';}function generateExtensions(parameters){const chunks=[parameters.extensionDerivatives||!!parameters.envMapCubeUVHeight||parameters.bumpMap||parameters.tangentSpaceNormalMap||parameters.clearcoatNormalMap||parameters.flatShading||parameters.shaderID==='physical'?'#extension GL_OES_standard_derivatives : enable':'',(parameters.extensionFragDepth||parameters.logarithmicDepthBuffer)&&parameters.rendererExtensionFragDepth?'#extension GL_EXT_frag_depth : enable':'',parameters.extensionDrawBuffers&&parameters.rendererExtensionDrawBuffers?'#extension GL_EXT_draw_buffers : require':'',(parameters.extensionShaderTextureLOD||parameters.envMap||parameters.transmission)&&parameters.rendererExtensionShaderTextureLod?'#extension GL_EXT_shader_texture_lod : enable':''];return filter(chunks).call(chunks,filterEmptyLine).join('\\n');}function generateDefines(defines){const chunks=[];for(const name in defines){const value=defines[name];if(value===false)continue;chunks.push('#define '+name+' '+value);}return chunks.join('\\n');}function fetchAttributeLocations(gl,program){const attributes={};const n=gl.getProgramParameter(program,35721);for(let i=0;i<n;i++){const info=gl.getActiveAttrib(program,i);const name=info.name;let locationSize=1;if(info.type===35674)locationSize=2;if(info.type===35675)locationSize=3;if(info.type===35676)locationSize=4;// console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\nattributes[name]={type:info.type,location:gl.getAttribLocation(program,name),locationSize:locationSize};}return attributes;}function filterEmptyLine(string){return string!=='';}function replaceLightNums(string,parameters){const numSpotLightCoords=parameters.numSpotLightShadows+parameters.numSpotLightMaps-parameters.numSpotLightShadowsWithMaps;return string.replace(/NUM_DIR_LIGHTS/g,parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g,parameters.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,parameters.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,numSpotLightCoords).replace(/NUM_RECT_AREA_LIGHTS/g,parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g,parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,parameters.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,parameters.numPointLightShadows);}function replaceClippingPlaneNums(string,parameters){return string.replace(/NUM_CLIPPING_PLANES/g,parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,parameters.numClippingPlanes-parameters.numClipIntersection);}// Resolve Includes\nconst includePattern=/^[ \\t]*#include +<([\\w\\d./]+)>/gm;function resolveIncludes(string){return string.replace(includePattern,includeReplacer);}function includeReplacer(match,include){const string=ShaderChunk[include];if(string===undefined){throw new Error('Can not resolve #include <'+include+'>');}return resolveIncludes(string);}// Unroll Loops\nconst unrollLoopPattern=/#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;function unrollLoops(string){return string.replace(unrollLoopPattern,loopReplacer);}function loopReplacer(match,start,end,snippet){let string='';for(let i=parse_int(start);i<parse_int(end);i++){string+=snippet.replace(/\\[\\s*i\\s*\\]/g,'[ '+i+' ]').replace(/UNROLLED_LOOP_INDEX/g,i);}return string;}//\nfunction generatePrecision(parameters){let precisionstring='precision '+parameters.precision+' float;\\nprecision '+parameters.precision+' int;';if(parameters.precision==='highp'){precisionstring+='\\n#define HIGH_PRECISION';}else if(parameters.precision==='mediump'){precisionstring+='\\n#define MEDIUM_PRECISION';}else if(parameters.precision==='lowp'){precisionstring+='\\n#define LOW_PRECISION';}return precisionstring;}function generateShadowMapTypeDefine(parameters){let shadowMapTypeDefine='SHADOWMAP_TYPE_BASIC';if(parameters.shadowMapType===PCFShadowMap){shadowMapTypeDefine='SHADOWMAP_TYPE_PCF';}else if(parameters.shadowMapType===PCFSoftShadowMap){shadowMapTypeDefine='SHADOWMAP_TYPE_PCF_SOFT';}else if(parameters.shadowMapType===VSMShadowMap){shadowMapTypeDefine='SHADOWMAP_TYPE_VSM';}return shadowMapTypeDefine;}function generateEnvMapTypeDefine(parameters){let envMapTypeDefine='ENVMAP_TYPE_CUBE';if(parameters.envMap){switch(parameters.envMapMode){case CubeReflectionMapping:case CubeRefractionMapping:envMapTypeDefine='ENVMAP_TYPE_CUBE';break;case CubeUVReflectionMapping:envMapTypeDefine='ENVMAP_TYPE_CUBE_UV';break;}}return envMapTypeDefine;}function generateEnvMapModeDefine(parameters){let envMapModeDefine='ENVMAP_MODE_REFLECTION';if(parameters.envMap){switch(parameters.envMapMode){case CubeRefractionMapping:envMapModeDefine='ENVMAP_MODE_REFRACTION';break;}}return envMapModeDefine;}function generateEnvMapBlendingDefine(parameters){let envMapBlendingDefine='ENVMAP_BLENDING_NONE';if(parameters.envMap){switch(parameters.combine){case MultiplyOperation:envMapBlendingDefine='ENVMAP_BLENDING_MULTIPLY';break;case MixOperation:envMapBlendingDefine='ENVMAP_BLENDING_MIX';break;case AddOperation:envMapBlendingDefine='ENVMAP_BLENDING_ADD';break;}}return envMapBlendingDefine;}function generateCubeUVSize(parameters){const imageHeight=parameters.envMapCubeUVHeight;if(imageHeight===null)return null;const maxMip=log2(imageHeight)-2;const texelHeight=1.0/imageHeight;const texelWidth=1.0/(3*Math.max(Math.pow(2,maxMip),7*16));return{texelWidth,texelHeight,maxMip};}function WebGLProgram(renderer,cacheKey,parameters,bindingStates){// TODO Send this event to Three.js DevTools\n// console.log( 'WebGLProgram', cacheKey );\nconst gl=renderer.getContext();const defines=parameters.defines;let vertexShader=parameters.vertexShader;let fragmentShader=parameters.fragmentShader;const shadowMapTypeDefine=generateShadowMapTypeDefine(parameters);const envMapTypeDefine=generateEnvMapTypeDefine(parameters);const envMapModeDefine=generateEnvMapModeDefine(parameters);const envMapBlendingDefine=generateEnvMapBlendingDefine(parameters);const envMapCubeUVSize=generateCubeUVSize(parameters);const customExtensions=parameters.isWebGL2?'':generateExtensions(parameters);const customDefines=generateDefines(defines);const program=gl.createProgram();let prefixVertex,prefixFragment;let versionString=parameters.glslVersion?'#version '+parameters.glslVersion+'\\n':'';if(parameters.isRawShaderMaterial){var _context17,_context18;prefixVertex=filter(_context17=[customDefines]).call(_context17,filterEmptyLine).join('\\n');if(prefixVertex.length>0){prefixVertex+='\\n';}prefixFragment=filter(_context18=[customExtensions,customDefines]).call(_context18,filterEmptyLine).join('\\n');if(prefixFragment.length>0){prefixFragment+='\\n';}}else{var _context19,_context20;prefixVertex=filter(_context19=[generatePrecision(parameters),'#define SHADER_NAME '+parameters.shaderName,customDefines,parameters.instancing?'#define USE_INSTANCING':'',parameters.instancingColor?'#define USE_INSTANCING_COLOR':'',parameters.supportsVertexTextures?'#define VERTEX_TEXTURES':'',parameters.useFog&&parameters.fog?'#define USE_FOG':'',parameters.useFog&&parameters.fogExp2?'#define FOG_EXP2':'',instance_map(parameters)?'#define USE_MAP':'',parameters.envMap?'#define USE_ENVMAP':'',parameters.envMap?'#define '+envMapModeDefine:'',parameters.lightMap?'#define USE_LIGHTMAP':'',parameters.aoMap?'#define USE_AOMAP':'',parameters.emissiveMap?'#define USE_EMISSIVEMAP':'',parameters.bumpMap?'#define USE_BUMPMAP':'',parameters.normalMap?'#define USE_NORMALMAP':'',parameters.normalMap&&parameters.objectSpaceNormalMap?'#define OBJECTSPACE_NORMALMAP':'',parameters.normalMap&&parameters.tangentSpaceNormalMap?'#define TANGENTSPACE_NORMALMAP':'',parameters.clearcoatMap?'#define USE_CLEARCOATMAP':'',parameters.clearcoatRoughnessMap?'#define USE_CLEARCOAT_ROUGHNESSMAP':'',parameters.clearcoatNormalMap?'#define USE_CLEARCOAT_NORMALMAP':'',parameters.iridescenceMap?'#define USE_IRIDESCENCEMAP':'',parameters.iridescenceThicknessMap?'#define USE_IRIDESCENCE_THICKNESSMAP':'',parameters.displacementMap&&parameters.supportsVertexTextures?'#define USE_DISPLACEMENTMAP':'',parameters.specularMap?'#define USE_SPECULARMAP':'',parameters.specularIntensityMap?'#define USE_SPECULARINTENSITYMAP':'',parameters.specularColorMap?'#define USE_SPECULARCOLORMAP':'',parameters.roughnessMap?'#define USE_ROUGHNESSMAP':'',parameters.metalnessMap?'#define USE_METALNESSMAP':'',parameters.alphaMap?'#define USE_ALPHAMAP':'',parameters.transmission?'#define USE_TRANSMISSION':'',parameters.transmissionMap?'#define USE_TRANSMISSIONMAP':'',parameters.thicknessMap?'#define USE_THICKNESSMAP':'',parameters.sheenColorMap?'#define USE_SHEENCOLORMAP':'',parameters.sheenRoughnessMap?'#define USE_SHEENROUGHNESSMAP':'',parameters.vertexTangents?'#define USE_TANGENT':'',parameters.vertexColors?'#define USE_COLOR':'',parameters.vertexAlphas?'#define USE_COLOR_ALPHA':'',parameters.vertexUvs?'#define USE_UV':'',parameters.uvsVertexOnly?'#define UVS_VERTEX_ONLY':'',parameters.flatShading?'#define FLAT_SHADED':'',parameters.skinning?'#define USE_SKINNING':'',parameters.morphTargets?'#define USE_MORPHTARGETS':'',parameters.morphNormals&&parameters.flatShading===false?'#define USE_MORPHNORMALS':'',parameters.morphColors&&parameters.isWebGL2?'#define USE_MORPHCOLORS':'',parameters.morphTargetsCount>0&&parameters.isWebGL2?'#define MORPHTARGETS_TEXTURE':'',parameters.morphTargetsCount>0&&parameters.isWebGL2?'#define MORPHTARGETS_TEXTURE_STRIDE '+parameters.morphTextureStride:'',parameters.morphTargetsCount>0&&parameters.isWebGL2?'#define MORPHTARGETS_COUNT '+parameters.morphTargetsCount:'',parameters.doubleSided?'#define DOUBLE_SIDED':'',parameters.flipSided?'#define FLIP_SIDED':'',parameters.shadowMapEnabled?'#define USE_SHADOWMAP':'',parameters.shadowMapEnabled?'#define '+shadowMapTypeDefine:'',parameters.sizeAttenuation?'#define USE_SIZEATTENUATION':'',parameters.logarithmicDepthBuffer?'#define USE_LOGDEPTHBUF':'',parameters.logarithmicDepthBuffer&&parameters.rendererExtensionFragDepth?'#define USE_LOGDEPTHBUF_EXT':'','uniform mat4 modelMatrix;','uniform mat4 modelViewMatrix;','uniform mat4 projectionMatrix;','uniform mat4 viewMatrix;','uniform mat3 normalMatrix;','uniform vec3 cameraPosition;','uniform bool isOrthographic;','#ifdef USE_INSTANCING','\tattribute mat4 instanceMatrix;','#endif','#ifdef USE_INSTANCING_COLOR','\tattribute vec3 instanceColor;','#endif','attribute vec3 position;','attribute vec3 normal;','attribute vec2 uv;','#ifdef USE_TANGENT','\tattribute vec4 tangent;','#endif','#if defined( USE_COLOR_ALPHA )','\tattribute vec4 color;','#elif defined( USE_COLOR )','\tattribute vec3 color;','#endif','#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )','\tattribute vec3 morphTarget0;','\tattribute vec3 morphTarget1;','\tattribute vec3 morphTarget2;','\tattribute vec3 morphTarget3;','\t#ifdef USE_MORPHNORMALS','\t\tattribute vec3 morphNormal0;','\t\tattribute vec3 morphNormal1;','\t\tattribute vec3 morphNormal2;','\t\tattribute vec3 morphNormal3;','\t#else','\t\tattribute vec3 morphTarget4;','\t\tattribute vec3 morphTarget5;','\t\tattribute vec3 morphTarget6;','\t\tattribute vec3 morphTarget7;','\t#endif','#endif','#ifdef USE_SKINNING','\tattribute vec4 skinIndex;','\tattribute vec4 skinWeight;','#endif','\\n']).call(_context19,filterEmptyLine).join('\\n');prefixFragment=filter(_context20=[customExtensions,generatePrecision(parameters),'#define SHADER_NAME '+parameters.shaderName,customDefines,parameters.useFog&&parameters.fog?'#define USE_FOG':'',parameters.useFog&&parameters.fogExp2?'#define FOG_EXP2':'',instance_map(parameters)?'#define USE_MAP':'',parameters.matcap?'#define USE_MATCAP':'',parameters.envMap?'#define USE_ENVMAP':'',parameters.envMap?'#define '+envMapTypeDefine:'',parameters.envMap?'#define '+envMapModeDefine:'',parameters.envMap?'#define '+envMapBlendingDefine:'',envMapCubeUVSize?'#define CUBEUV_TEXEL_WIDTH '+envMapCubeUVSize.texelWidth:'',envMapCubeUVSize?'#define CUBEUV_TEXEL_HEIGHT '+envMapCubeUVSize.texelHeight:'',envMapCubeUVSize?'#define CUBEUV_MAX_MIP '+envMapCubeUVSize.maxMip+'.0':'',parameters.lightMap?'#define USE_LIGHTMAP':'',parameters.aoMap?'#define USE_AOMAP':'',parameters.emissiveMap?'#define USE_EMISSIVEMAP':'',parameters.bumpMap?'#define USE_BUMPMAP':'',parameters.normalMap?'#define USE_NORMALMAP':'',parameters.normalMap&&parameters.objectSpaceNormalMap?'#define OBJECTSPACE_NORMALMAP':'',parameters.normalMap&&parameters.tangentSpaceNormalMap?'#define TANGENTSPACE_NORMALMAP':'',parameters.clearcoat?'#define USE_CLEARCOAT':'',parameters.clearcoatMap?'#define USE_CLEARCOATMAP':'',parameters.clearcoatRoughnessMap?'#define USE_CLEARCOAT_ROUGHNESSMAP':'',parameters.clearcoatNormalMap?'#define USE_CLEARCOAT_NORMALMAP':'',parameters.iridescence?'#define USE_IRIDESCENCE':'',parameters.iridescenceMap?'#define USE_IRIDESCENCEMAP':'',parameters.iridescenceThicknessMap?'#define USE_IRIDESCENCE_THICKNESSMAP':'',parameters.specularMap?'#define USE_SPECULARMAP':'',parameters.specularIntensityMap?'#define USE_SPECULARINTENSITYMAP':'',parameters.specularColorMap?'#define USE_SPECULARCOLORMAP':'',parameters.roughnessMap?'#define USE_ROUGHNESSMAP':'',parameters.metalnessMap?'#define USE_METALNESSMAP':'',parameters.alphaMap?'#define USE_ALPHAMAP':'',parameters.alphaTest?'#define USE_ALPHATEST':'',parameters.sheen?'#define USE_SHEEN':'',parameters.sheenColorMap?'#define USE_SHEENCOLORMAP':'',parameters.sheenRoughnessMap?'#define USE_SHEENROUGHNESSMAP':'',parameters.transmission?'#define USE_TRANSMISSION':'',parameters.transmissionMap?'#define USE_TRANSMISSIONMAP':'',parameters.thicknessMap?'#define USE_THICKNESSMAP':'',parameters.decodeVideoTexture?'#define DECODE_VIDEO_TEXTURE':'',parameters.vertexTangents?'#define USE_TANGENT':'',parameters.vertexColors||parameters.instancingColor?'#define USE_COLOR':'',parameters.vertexAlphas?'#define USE_COLOR_ALPHA':'',parameters.vertexUvs?'#define USE_UV':'',parameters.uvsVertexOnly?'#define UVS_VERTEX_ONLY':'',parameters.gradientMap?'#define USE_GRADIENTMAP':'',parameters.flatShading?'#define FLAT_SHADED':'',parameters.doubleSided?'#define DOUBLE_SIDED':'',parameters.flipSided?'#define FLIP_SIDED':'',parameters.shadowMapEnabled?'#define USE_SHADOWMAP':'',parameters.shadowMapEnabled?'#define '+shadowMapTypeDefine:'',parameters.premultipliedAlpha?'#define PREMULTIPLIED_ALPHA':'',parameters.physicallyCorrectLights?'#define PHYSICALLY_CORRECT_LIGHTS':'',parameters.logarithmicDepthBuffer?'#define USE_LOGDEPTHBUF':'',parameters.logarithmicDepthBuffer&&parameters.rendererExtensionFragDepth?'#define USE_LOGDEPTHBUF_EXT':'','uniform mat4 viewMatrix;','uniform vec3 cameraPosition;','uniform bool isOrthographic;',parameters.toneMapping!==NoToneMapping?'#define TONE_MAPPING':'',parameters.toneMapping!==NoToneMapping?ShaderChunk['tonemapping_pars_fragment']:'',// this code is required here because it is used by the toneMapping() function defined below\nparameters.toneMapping!==NoToneMapping?getToneMappingFunction('toneMapping',parameters.toneMapping):'',parameters.dithering?'#define DITHERING':'',parameters.opaque?'#define OPAQUE':'',ShaderChunk['encodings_pars_fragment'],// this code is required here because it is used by the various encoding/decoding function defined below\ngetTexelEncodingFunction('linearToOutputTexel',parameters.outputEncoding),parameters.useDepthPacking?'#define DEPTH_PACKING '+parameters.depthPacking:'','\\n']).call(_context20,filterEmptyLine).join('\\n');}vertexShader=resolveIncludes(vertexShader);vertexShader=replaceLightNums(vertexShader,parameters);vertexShader=replaceClippingPlaneNums(vertexShader,parameters);fragmentShader=resolveIncludes(fragmentShader);fragmentShader=replaceLightNums(fragmentShader,parameters);fragmentShader=replaceClippingPlaneNums(fragmentShader,parameters);vertexShader=unrollLoops(vertexShader);fragmentShader=unrollLoops(fragmentShader);if(parameters.isWebGL2&&parameters.isRawShaderMaterial!==true){// GLSL 3.0 conversion for built-in materials and ShaderMaterial\nversionString='#version 300 es\\n';prefixVertex=['precision mediump sampler2DArray;','#define attribute in','#define varying out','#define texture2D texture'].join('\\n')+'\\n'+prefixVertex;prefixFragment=['#define varying in',parameters.glslVersion===GLSL3?'':'layout(location = 0) out highp vec4 pc_fragColor;',parameters.glslVersion===GLSL3?'':'#define gl_FragColor pc_fragColor','#define gl_FragDepthEXT gl_FragDepth','#define texture2D texture','#define textureCube texture','#define texture2DProj textureProj','#define texture2DLodEXT textureLod','#define texture2DProjLodEXT textureProjLod','#define textureCubeLodEXT textureLod','#define texture2DGradEXT textureGrad','#define texture2DProjGradEXT textureProjGrad','#define textureCubeGradEXT textureGrad'].join('\\n')+'\\n'+prefixFragment;}const vertexGlsl=versionString+prefixVertex+vertexShader;const fragmentGlsl=versionString+prefixFragment+fragmentShader;// console.log( '*VERTEX*', vertexGlsl );\n// console.log( '*FRAGMENT*', fragmentGlsl );\nconst glVertexShader=WebGLShader(gl,35633,vertexGlsl);const glFragmentShader=WebGLShader(gl,35632,fragmentGlsl);gl.attachShader(program,glVertexShader);gl.attachShader(program,glFragmentShader);// Force a particular attribute to index 0.\nif(parameters.index0AttributeName!==undefined){gl.bindAttribLocation(program,0,parameters.index0AttributeName);}else if(parameters.morphTargets===true){// programs with morphTargets displace position out of attribute 0\ngl.bindAttribLocation(program,0,'position');}gl.linkProgram(program);// check for link errors\nif(renderer.debug.checkShaderErrors){var _context21,_context22,_context23;const programLog=trim(_context21=gl.getProgramInfoLog(program)).call(_context21);const vertexLog=trim(_context22=gl.getShaderInfoLog(glVertexShader)).call(_context22);const fragmentLog=trim(_context23=gl.getShaderInfoLog(glFragmentShader)).call(_context23);let runnable=true;let haveDiagnostics=true;if(gl.getProgramParameter(program,35714)===false){runnable=false;const vertexErrors=getShaderErrors(gl,glVertexShader,'vertex');const fragmentErrors=getShaderErrors(gl,glFragmentShader,'fragment');console.error('THREE.WebGLProgram: Shader Error '+gl.getError()+' - '+'VALIDATE_STATUS '+gl.getProgramParameter(program,35715)+'\\n\\n'+'Program Info Log: '+programLog+'\\n'+vertexErrors+'\\n'+fragmentErrors);}else if(programLog!==''){console.warn('THREE.WebGLProgram: Program Info Log:',programLog);}else if(vertexLog===''||fragmentLog===''){haveDiagnostics=false;}if(haveDiagnostics){this.diagnostics={runnable:runnable,programLog:programLog,vertexShader:{log:vertexLog,prefix:prefixVertex},fragmentShader:{log:fragmentLog,prefix:prefixFragment}};}}// Clean up\n// Crashes in iOS9 and iOS10. #18402\n// gl.detachShader( program, glVertexShader );\n// gl.detachShader( program, glFragmentShader );\ngl.deleteShader(glVertexShader);gl.deleteShader(glFragmentShader);// set up caching for uniform locations\nlet cachedUniforms;this.getUniforms=function(){if(cachedUniforms===undefined){cachedUniforms=new WebGLUniforms(gl,program);}return cachedUniforms;};// set up caching for attribute locations\nlet cachedAttributes;this.getAttributes=function(){if(cachedAttributes===undefined){cachedAttributes=fetchAttributeLocations(gl,program);}return cachedAttributes;};// free resource\nthis.destroy=function(){bindingStates.releaseStatesOfProgram(this);gl.deleteProgram(program);this.program=undefined;};//\nthis.name=parameters.shaderName;this.id=programIdCount++;this.cacheKey=cacheKey;this.usedTimes=1;this.program=program;this.vertexShader=glVertexShader;this.fragmentShader=glFragmentShader;return this;}let _id=0;class WebGLShaderCache{constructor(){this.shaderCache=new map();this.materialCache=new map();}update(material){const vertexShader=material.vertexShader;const fragmentShader=material.fragmentShader;const vertexShaderStage=this._getShaderStage(vertexShader);const fragmentShaderStage=this._getShaderStage(fragmentShader);const materialShaders=this._getShaderCacheForMaterial(material);if(materialShaders.has(vertexShaderStage)===false){materialShaders.add(vertexShaderStage);vertexShaderStage.usedTimes++;}if(materialShaders.has(fragmentShaderStage)===false){materialShaders.add(fragmentShaderStage);fragmentShaderStage.usedTimes++;}return this;}remove(material){const materialShaders=this.materialCache.get(material);for(const shaderStage of materialShaders){shaderStage.usedTimes--;if(shaderStage.usedTimes===0)this.shaderCache.delete(shaderStage.code);}this.materialCache.delete(material);return this;}getVertexShaderID(material){return this._getShaderStage(material.vertexShader).id;}getFragmentShaderID(material){return this._getShaderStage(material.fragmentShader).id;}dispose(){this.shaderCache.clear();this.materialCache.clear();}_getShaderCacheForMaterial(material){const cache=this.materialCache;let set=cache.get(material);if(set===undefined){set=new core_js_set();cache.set(material,set);}return set;}_getShaderStage(code){const cache=this.shaderCache;let stage=cache.get(code);if(stage===undefined){stage=new WebGLShaderStage(code);cache.set(code,stage);}return stage;}}class WebGLShaderStage{constructor(code){this.id=_id++;this.code=code;this.usedTimes=0;}}function WebGLPrograms(renderer,cubemaps,cubeuvmaps,extensions,capabilities,bindingStates,clipping){const _programLayers=new Layers();const _customShaders=new WebGLShaderCache();const programs=[];const isWebGL2=capabilities.isWebGL2;const logarithmicDepthBuffer=capabilities.logarithmicDepthBuffer;const vertexTextures=capabilities.vertexTextures;let precision=capabilities.precision;const shaderIDs={MeshDepthMaterial:'depth',MeshDistanceMaterial:'distanceRGBA',MeshNormalMaterial:'normal',MeshBasicMaterial:'basic',MeshLambertMaterial:'lambert',MeshPhongMaterial:'phong',MeshToonMaterial:'toon',MeshStandardMaterial:'physical',MeshPhysicalMaterial:'physical',MeshMatcapMaterial:'matcap',LineBasicMaterial:'basic',LineDashedMaterial:'dashed',PointsMaterial:'points',ShadowMaterial:'shadow',SpriteMaterial:'sprite'};function getParameters(material,lights,shadows,scene,object){const fog=scene.fog;const geometry=object.geometry;const environment=material.isMeshStandardMaterial?scene.environment:null;const envMap=(material.isMeshStandardMaterial?cubeuvmaps:cubemaps).get(material.envMap||environment);const envMapCubeUVHeight=!!envMap&&envMap.mapping===CubeUVReflectionMapping?envMap.image.height:null;const shaderID=shaderIDs[material.type];// heuristics to create shader parameters according to lights in the scene\n// (not to blow over maxLights budget)\nif(material.precision!==null){precision=capabilities.getMaxPrecision(material.precision);if(precision!==material.precision){console.warn('THREE.WebGLProgram.getParameters:',material.precision,'not supported, using',precision,'instead.');}}//\nconst morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color;const morphTargetsCount=morphAttribute!==undefined?morphAttribute.length:0;let morphTextureStride=0;if(geometry.morphAttributes.position!==undefined)morphTextureStride=1;if(geometry.morphAttributes.normal!==undefined)morphTextureStride=2;if(geometry.morphAttributes.color!==undefined)morphTextureStride=3;//\nlet vertexShader,fragmentShader;let customVertexShaderID,customFragmentShaderID;if(shaderID){const shader=ShaderLib[shaderID];vertexShader=shader.vertexShader;fragmentShader=shader.fragmentShader;}else{vertexShader=material.vertexShader;fragmentShader=material.fragmentShader;_customShaders.update(material);customVertexShaderID=_customShaders.getVertexShaderID(material);customFragmentShaderID=_customShaders.getFragmentShaderID(material);}const currentRenderTarget=renderer.getRenderTarget();const useAlphaTest=material.alphaTest>0;const useClearcoat=material.clearcoat>0;const useIridescence=material.iridescence>0;const parameters={isWebGL2:isWebGL2,shaderID:shaderID,shaderName:material.type,vertexShader:vertexShader,fragmentShader:fragmentShader,defines:material.defines,customVertexShaderID:customVertexShaderID,customFragmentShaderID:customFragmentShaderID,isRawShaderMaterial:material.isRawShaderMaterial===true,glslVersion:material.glslVersion,precision:precision,instancing:object.isInstancedMesh===true,instancingColor:object.isInstancedMesh===true&&object.instanceColor!==null,supportsVertexTextures:vertexTextures,outputEncoding:currentRenderTarget===null?renderer.outputEncoding:currentRenderTarget.isXRRenderTarget===true?currentRenderTarget.texture.encoding:LinearEncoding,map:!!instance_map(material),matcap:!!material.matcap,envMap:!!envMap,envMapMode:envMap&&envMap.mapping,envMapCubeUVHeight:envMapCubeUVHeight,lightMap:!!material.lightMap,aoMap:!!material.aoMap,emissiveMap:!!material.emissiveMap,bumpMap:!!material.bumpMap,normalMap:!!material.normalMap,objectSpaceNormalMap:material.normalMapType===ObjectSpaceNormalMap,tangentSpaceNormalMap:material.normalMapType===TangentSpaceNormalMap,decodeVideoTexture:!!instance_map(material)&&instance_map(material).isVideoTexture===true&&instance_map(material).encoding===sRGBEncoding,clearcoat:useClearcoat,clearcoatMap:useClearcoat&&!!material.clearcoatMap,clearcoatRoughnessMap:useClearcoat&&!!material.clearcoatRoughnessMap,clearcoatNormalMap:useClearcoat&&!!material.clearcoatNormalMap,iridescence:useIridescence,iridescenceMap:useIridescence&&!!material.iridescenceMap,iridescenceThicknessMap:useIridescence&&!!material.iridescenceThicknessMap,displacementMap:!!material.displacementMap,roughnessMap:!!material.roughnessMap,metalnessMap:!!material.metalnessMap,specularMap:!!material.specularMap,specularIntensityMap:!!material.specularIntensityMap,specularColorMap:!!material.specularColorMap,opaque:material.transparent===false&&material.blending===NormalBlending,alphaMap:!!material.alphaMap,alphaTest:useAlphaTest,gradientMap:!!material.gradientMap,sheen:material.sheen>0,sheenColorMap:!!material.sheenColorMap,sheenRoughnessMap:!!material.sheenRoughnessMap,transmission:material.transmission>0,transmissionMap:!!material.transmissionMap,thicknessMap:!!material.thicknessMap,combine:material.combine,vertexTangents:!!material.normalMap&&!!geometry.attributes.tangent,vertexColors:material.vertexColors,vertexAlphas:material.vertexColors===true&&!!geometry.attributes.color&&geometry.attributes.color.itemSize===4,vertexUvs:!!instance_map(material)||!!material.bumpMap||!!material.normalMap||!!material.specularMap||!!material.alphaMap||!!material.emissiveMap||!!material.roughnessMap||!!material.metalnessMap||!!material.clearcoatMap||!!material.clearcoatRoughnessMap||!!material.clearcoatNormalMap||!!material.iridescenceMap||!!material.iridescenceThicknessMap||!!material.displacementMap||!!material.transmissionMap||!!material.thicknessMap||!!material.specularIntensityMap||!!material.specularColorMap||!!material.sheenColorMap||!!material.sheenRoughnessMap,uvsVertexOnly:!(!!instance_map(material)||!!material.bumpMap||!!material.normalMap||!!material.specularMap||!!material.alphaMap||!!material.emissiveMap||!!material.roughnessMap||!!material.metalnessMap||!!material.clearcoatNormalMap||!!material.iridescenceMap||!!material.iridescenceThicknessMap||material.transmission>0||!!material.transmissionMap||!!material.thicknessMap||!!material.specularIntensityMap||!!material.specularColorMap||material.sheen>0||!!material.sheenColorMap||!!material.sheenRoughnessMap)&&!!material.displacementMap,fog:!!fog,useFog:material.fog===true,fogExp2:fog&&fog.isFogExp2,flatShading:!!material.flatShading,sizeAttenuation:material.sizeAttenuation,logarithmicDepthBuffer:logarithmicDepthBuffer,skinning:object.isSkinnedMesh===true,morphTargets:geometry.morphAttributes.position!==undefined,morphNormals:geometry.morphAttributes.normal!==undefined,morphColors:geometry.morphAttributes.color!==undefined,morphTargetsCount:morphTargetsCount,morphTextureStride:morphTextureStride,numDirLights:lights.directional.length,numPointLights:lights.point.length,numSpotLights:lights.spot.length,numSpotLightMaps:lights.spotLightMap.length,numRectAreaLights:lights.rectArea.length,numHemiLights:lights.hemi.length,numDirLightShadows:lights.directionalShadowMap.length,numPointLightShadows:lights.pointShadowMap.length,numSpotLightShadows:lights.spotShadowMap.length,numSpotLightShadowsWithMaps:lights.numSpotLightShadowsWithMaps,numClippingPlanes:clipping.numPlanes,numClipIntersection:clipping.numIntersection,dithering:material.dithering,shadowMapEnabled:renderer.shadowMap.enabled&&shadows.length>0,shadowMapType:renderer.shadowMap.type,toneMapping:material.toneMapped?renderer.toneMapping:NoToneMapping,physicallyCorrectLights:renderer.physicallyCorrectLights,premultipliedAlpha:material.premultipliedAlpha,doubleSided:material.side===DoubleSide,flipSided:material.side===BackSide,useDepthPacking:!!material.depthPacking,depthPacking:material.depthPacking||0,index0AttributeName:material.index0AttributeName,extensionDerivatives:material.extensions&&material.extensions.derivatives,extensionFragDepth:material.extensions&&material.extensions.fragDepth,extensionDrawBuffers:material.extensions&&material.extensions.drawBuffers,extensionShaderTextureLOD:material.extensions&&material.extensions.shaderTextureLOD,rendererExtensionFragDepth:isWebGL2||extensions.has('EXT_frag_depth'),rendererExtensionDrawBuffers:isWebGL2||extensions.has('WEBGL_draw_buffers'),rendererExtensionShaderTextureLod:isWebGL2||extensions.has('EXT_shader_texture_lod'),customProgramCacheKey:material.customProgramCacheKey()};return parameters;}function getProgramCacheKey(parameters){const array=[];if(parameters.shaderID){array.push(parameters.shaderID);}else{array.push(parameters.customVertexShaderID);array.push(parameters.customFragmentShaderID);}if(parameters.defines!==undefined){for(const name in parameters.defines){array.push(name);array.push(parameters.defines[name]);}}if(parameters.isRawShaderMaterial===false){getProgramCacheKeyParameters(array,parameters);getProgramCacheKeyBooleans(array,parameters);array.push(renderer.outputEncoding);}array.push(parameters.customProgramCacheKey);return array.join();}function getProgramCacheKeyParameters(array,parameters){array.push(parameters.precision);array.push(parameters.outputEncoding);array.push(parameters.envMapMode);array.push(parameters.envMapCubeUVHeight);array.push(parameters.combine);array.push(parameters.vertexUvs);array.push(parameters.fogExp2);array.push(parameters.sizeAttenuation);array.push(parameters.morphTargetsCount);array.push(parameters.morphAttributeCount);array.push(parameters.numDirLights);array.push(parameters.numPointLights);array.push(parameters.numSpotLights);array.push(parameters.numSpotLightMaps);array.push(parameters.numHemiLights);array.push(parameters.numRectAreaLights);array.push(parameters.numDirLightShadows);array.push(parameters.numPointLightShadows);array.push(parameters.numSpotLightShadows);array.push(parameters.numSpotLightShadowsWithMaps);array.push(parameters.shadowMapType);array.push(parameters.toneMapping);array.push(parameters.numClippingPlanes);array.push(parameters.numClipIntersection);array.push(parameters.depthPacking);}function getProgramCacheKeyBooleans(array,parameters){_programLayers.disableAll();if(parameters.isWebGL2)_programLayers.enable(0);if(parameters.supportsVertexTextures)_programLayers.enable(1);if(parameters.instancing)_programLayers.enable(2);if(parameters.instancingColor)_programLayers.enable(3);if(instance_map(parameters))_programLayers.enable(4);if(parameters.matcap)_programLayers.enable(5);if(parameters.envMap)_programLayers.enable(6);if(parameters.lightMap)_programLayers.enable(7);if(parameters.aoMap)_programLayers.enable(8);if(parameters.emissiveMap)_programLayers.enable(9);if(parameters.bumpMap)_programLayers.enable(10);if(parameters.normalMap)_programLayers.enable(11);if(parameters.objectSpaceNormalMap)_programLayers.enable(12);if(parameters.tangentSpaceNormalMap)_programLayers.enable(13);if(parameters.clearcoat)_programLayers.enable(14);if(parameters.clearcoatMap)_programLayers.enable(15);if(parameters.clearcoatRoughnessMap)_programLayers.enable(16);if(parameters.clearcoatNormalMap)_programLayers.enable(17);if(parameters.iridescence)_programLayers.enable(18);if(parameters.iridescenceMap)_programLayers.enable(19);if(parameters.iridescenceThicknessMap)_programLayers.enable(20);if(parameters.displacementMap)_programLayers.enable(21);if(parameters.specularMap)_programLayers.enable(22);if(parameters.roughnessMap)_programLayers.enable(23);if(parameters.metalnessMap)_programLayers.enable(24);if(parameters.gradientMap)_programLayers.enable(25);if(parameters.alphaMap)_programLayers.enable(26);if(parameters.alphaTest)_programLayers.enable(27);if(parameters.vertexColors)_programLayers.enable(28);if(parameters.vertexAlphas)_programLayers.enable(29);if(parameters.vertexUvs)_programLayers.enable(30);if(parameters.vertexTangents)_programLayers.enable(31);if(parameters.uvsVertexOnly)_programLayers.enable(32);array.push(_programLayers.mask);_programLayers.disableAll();if(parameters.fog)_programLayers.enable(0);if(parameters.useFog)_programLayers.enable(1);if(parameters.flatShading)_programLayers.enable(2);if(parameters.logarithmicDepthBuffer)_programLayers.enable(3);if(parameters.skinning)_programLayers.enable(4);if(parameters.morphTargets)_programLayers.enable(5);if(parameters.morphNormals)_programLayers.enable(6);if(parameters.morphColors)_programLayers.enable(7);if(parameters.premultipliedAlpha)_programLayers.enable(8);if(parameters.shadowMapEnabled)_programLayers.enable(9);if(parameters.physicallyCorrectLights)_programLayers.enable(10);if(parameters.doubleSided)_programLayers.enable(11);if(parameters.flipSided)_programLayers.enable(12);if(parameters.useDepthPacking)_programLayers.enable(13);if(parameters.dithering)_programLayers.enable(14);if(parameters.specularIntensityMap)_programLayers.enable(15);if(parameters.specularColorMap)_programLayers.enable(16);if(parameters.transmission)_programLayers.enable(17);if(parameters.transmissionMap)_programLayers.enable(18);if(parameters.thicknessMap)_programLayers.enable(19);if(parameters.sheen)_programLayers.enable(20);if(parameters.sheenColorMap)_programLayers.enable(21);if(parameters.sheenRoughnessMap)_programLayers.enable(22);if(parameters.decodeVideoTexture)_programLayers.enable(23);if(parameters.opaque)_programLayers.enable(24);array.push(_programLayers.mask);}function getUniforms(material){const shaderID=shaderIDs[material.type];let uniforms;if(shaderID){const shader=ShaderLib[shaderID];uniforms=UniformsUtils.clone(shader.uniforms);}else{uniforms=material.uniforms;}return uniforms;}function acquireProgram(parameters,cacheKey){let program;// Check if code has been already compiled\nfor(let p=0,pl=programs.length;p<pl;p++){const preexistingProgram=programs[p];if(preexistingProgram.cacheKey===cacheKey){program=preexistingProgram;++program.usedTimes;break;}}if(program===undefined){program=new WebGLProgram(renderer,cacheKey,parameters,bindingStates);programs.push(program);}return program;}function releaseProgram(program){if(--program.usedTimes===0){// Remove from unordered set\nconst i=index_of(programs).call(programs,program);programs[i]=programs[programs.length-1];programs.pop();// Free WebGL resources\nprogram.destroy();}}function releaseShaderCache(material){_customShaders.remove(material);}function dispose(){_customShaders.dispose();}return{getParameters:getParameters,getProgramCacheKey:getProgramCacheKey,getUniforms:getUniforms,acquireProgram:acquireProgram,releaseProgram:releaseProgram,releaseShaderCache:releaseShaderCache,// Exposed for resource monitoring & error feedback via renderer.info:\nprograms:programs,dispose:dispose};}function WebGLProperties(){let properties=new weak_map();function get(object){let map=properties.get(object);if(map===undefined){map={};properties.set(object,map);}return map;}function remove(object){properties.delete(object);}function update(object,key,value){properties.get(object)[key]=value;}function dispose(){properties=new weak_map();}return{get:get,remove:remove,update:update,dispose:dispose};}function painterSortStable(a,b){if(a.groupOrder!==b.groupOrder){return a.groupOrder-b.groupOrder;}else if(a.renderOrder!==b.renderOrder){return a.renderOrder-b.renderOrder;}else if(a.material.id!==b.material.id){return a.material.id-b.material.id;}else if(a.z!==b.z){return a.z-b.z;}else{return a.id-b.id;}}function reversePainterSortStable(a,b){if(a.groupOrder!==b.groupOrder){return a.groupOrder-b.groupOrder;}else if(a.renderOrder!==b.renderOrder){return a.renderOrder-b.renderOrder;}else if(a.z!==b.z){return b.z-a.z;}else{return a.id-b.id;}}function WebGLRenderList(){const renderItems=[];let renderItemsIndex=0;const opaque=[];const transmissive=[];const transparent=[];function init(){renderItemsIndex=0;opaque.length=0;transmissive.length=0;transparent.length=0;}function getNextRenderItem(object,geometry,material,groupOrder,z,group){let renderItem=renderItems[renderItemsIndex];if(renderItem===undefined){renderItem={id:object.id,object:object,geometry:geometry,material:material,groupOrder:groupOrder,renderOrder:object.renderOrder,z:z,group:group};renderItems[renderItemsIndex]=renderItem;}else{renderItem.id=object.id;renderItem.object=object;renderItem.geometry=geometry;renderItem.material=material;renderItem.groupOrder=groupOrder;renderItem.renderOrder=object.renderOrder;renderItem.z=z;renderItem.group=group;}renderItemsIndex++;return renderItem;}function push(object,geometry,material,groupOrder,z,group){const renderItem=getNextRenderItem(object,geometry,material,groupOrder,z,group);if(material.transmission>0.0){transmissive.push(renderItem);}else if(material.transparent===true){transparent.push(renderItem);}else{opaque.push(renderItem);}}function unshift(object,geometry,material,groupOrder,z,group){const renderItem=getNextRenderItem(object,geometry,material,groupOrder,z,group);if(material.transmission>0.0){transmissive.unshift(renderItem);}else if(material.transparent===true){transparent.unshift(renderItem);}else{opaque.unshift(renderItem);}}function sort(customOpaqueSort,customTransparentSort){if(opaque.length>1)instance_sort(opaque).call(opaque,customOpaqueSort||painterSortStable);if(transmissive.length>1)instance_sort(transmissive).call(transmissive,customTransparentSort||reversePainterSortStable);if(transparent.length>1)instance_sort(transparent).call(transparent,customTransparentSort||reversePainterSortStable);}function finish(){// Clear references from inactive renderItems in the list\nfor(let i=renderItemsIndex,il=renderItems.length;i<il;i++){const renderItem=renderItems[i];if(renderItem.id===null)break;renderItem.id=null;renderItem.object=null;renderItem.geometry=null;renderItem.material=null;renderItem.group=null;}}return{opaque:opaque,transmissive:transmissive,transparent:transparent,init:init,push:push,unshift:unshift,finish:finish,sort:sort};}function WebGLRenderLists(){let lists=new weak_map();function get(scene,renderCallDepth){const listArray=lists.get(scene);let list;if(listArray===undefined){list=new WebGLRenderList();lists.set(scene,[list]);}else{if(renderCallDepth>=listArray.length){list=new WebGLRenderList();listArray.push(list);}else{list=listArray[renderCallDepth];}}return list;}function dispose(){lists=new weak_map();}return{get:get,dispose:dispose};}function UniformsCache(){const lights={};return{get:function(light){if(lights[light.id]!==undefined){return lights[light.id];}let uniforms;switch(light.type){case'DirectionalLight':uniforms={direction:new three_module_Vector3(),color:new Color()};break;case'SpotLight':uniforms={position:new three_module_Vector3(),direction:new three_module_Vector3(),color:new Color(),distance:0,coneCos:0,penumbraCos:0,decay:0};break;case'PointLight':uniforms={position:new three_module_Vector3(),color:new Color(),distance:0,decay:0};break;case'HemisphereLight':uniforms={direction:new three_module_Vector3(),skyColor:new Color(),groundColor:new Color()};break;case'RectAreaLight':uniforms={color:new Color(),position:new three_module_Vector3(),halfWidth:new three_module_Vector3(),halfHeight:new three_module_Vector3()};break;}lights[light.id]=uniforms;return uniforms;}};}function ShadowUniformsCache(){const lights={};return{get:function(light){if(lights[light.id]!==undefined){return lights[light.id];}let uniforms;switch(light.type){case'DirectionalLight':uniforms={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2()};break;case'SpotLight':uniforms={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2()};break;case'PointLight':uniforms={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2(),shadowCameraNear:1,shadowCameraFar:1000};break;// TODO (abelnation): set RectAreaLight shadow uniforms\n}lights[light.id]=uniforms;return uniforms;}};}let nextVersion=0;function shadowCastingAndTexturingLightsFirst(lightA,lightB){return(lightB.castShadow?2:0)-(lightA.castShadow?2:0)+(instance_map(lightB)?1:0)-(instance_map(lightA)?1:0);}function WebGLLights(extensions,capabilities){const cache=new UniformsCache();const shadowCache=ShadowUniformsCache();const state={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let i=0;i<9;i++)state.probe.push(new three_module_Vector3());const vector3=new three_module_Vector3();const matrix4=new Matrix4();const matrix42=new Matrix4();function setup(lights,physicallyCorrectLights){let r=0,g=0,b=0;for(let i=0;i<9;i++)state.probe[i].set(0,0,0);let directionalLength=0;let pointLength=0;let spotLength=0;let rectAreaLength=0;let hemiLength=0;let numDirectionalShadows=0;let numPointShadows=0;let numSpotShadows=0;let numSpotMaps=0;let numSpotShadowsWithMaps=0;// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]\ninstance_sort(lights).call(lights,shadowCastingAndTexturingLightsFirst);// artist-friendly light intensity scaling factor\nconst scaleFactor=physicallyCorrectLights!==true?Math.PI:1;for(let i=0,l=lights.length;i<l;i++){const light=lights[i];const color=light.color;const intensity=light.intensity;const distance=light.distance;const shadowMap=light.shadow&&instance_map(light.shadow)?instance_map(light.shadow).texture:null;if(light.isAmbientLight){r+=color.r*intensity*scaleFactor;g+=color.g*intensity*scaleFactor;b+=color.b*intensity*scaleFactor;}else if(light.isLightProbe){for(let j=0;j<9;j++){state.probe[j].addScaledVector(light.sh.coefficients[j],intensity);}}else if(light.isDirectionalLight){const uniforms=cache.get(light);uniforms.color.copy(light.color).multiplyScalar(light.intensity*scaleFactor);if(light.castShadow){const shadow=light.shadow;const shadowUniforms=shadowCache.get(light);shadowUniforms.shadowBias=shadow.bias;shadowUniforms.shadowNormalBias=shadow.normalBias;shadowUniforms.shadowRadius=shadow.radius;shadowUniforms.shadowMapSize=shadow.mapSize;state.directionalShadow[directionalLength]=shadowUniforms;state.directionalShadowMap[directionalLength]=shadowMap;state.directionalShadowMatrix[directionalLength]=light.shadow.matrix;numDirectionalShadows++;}state.directional[directionalLength]=uniforms;directionalLength++;}else if(light.isSpotLight){const uniforms=cache.get(light);uniforms.position.setFromMatrixPosition(light.matrixWorld);uniforms.color.copy(color).multiplyScalar(intensity*scaleFactor);uniforms.distance=distance;uniforms.coneCos=Math.cos(light.angle);uniforms.penumbraCos=Math.cos(light.angle*(1-light.penumbra));uniforms.decay=light.decay;state.spot[spotLength]=uniforms;const shadow=light.shadow;if(instance_map(light)){state.spotLightMap[numSpotMaps]=instance_map(light);numSpotMaps++;// make sure the lightMatrix is up to date\n// TODO : do it if required only\nshadow.updateMatrices(light);if(light.castShadow)numSpotShadowsWithMaps++;}state.spotLightMatrix[spotLength]=shadow.matrix;if(light.castShadow){const shadowUniforms=shadowCache.get(light);shadowUniforms.shadowBias=shadow.bias;shadowUniforms.shadowNormalBias=shadow.normalBias;shadowUniforms.shadowRadius=shadow.radius;shadowUniforms.shadowMapSize=shadow.mapSize;state.spotShadow[spotLength]=shadowUniforms;state.spotShadowMap[spotLength]=shadowMap;numSpotShadows++;}spotLength++;}else if(light.isRectAreaLight){const uniforms=cache.get(light);// (a) intensity is the total visible light emitted\n//uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );\n// (b) intensity is the brightness of the light\nuniforms.color.copy(color).multiplyScalar(intensity);uniforms.halfWidth.set(light.width*0.5,0.0,0.0);uniforms.halfHeight.set(0.0,light.height*0.5,0.0);state.rectArea[rectAreaLength]=uniforms;rectAreaLength++;}else if(light.isPointLight){const uniforms=cache.get(light);uniforms.color.copy(light.color).multiplyScalar(light.intensity*scaleFactor);uniforms.distance=light.distance;uniforms.decay=light.decay;if(light.castShadow){const shadow=light.shadow;const shadowUniforms=shadowCache.get(light);shadowUniforms.shadowBias=shadow.bias;shadowUniforms.shadowNormalBias=shadow.normalBias;shadowUniforms.shadowRadius=shadow.radius;shadowUniforms.shadowMapSize=shadow.mapSize;shadowUniforms.shadowCameraNear=shadow.camera.near;shadowUniforms.shadowCameraFar=shadow.camera.far;state.pointShadow[pointLength]=shadowUniforms;state.pointShadowMap[pointLength]=shadowMap;state.pointShadowMatrix[pointLength]=light.shadow.matrix;numPointShadows++;}state.point[pointLength]=uniforms;pointLength++;}else if(light.isHemisphereLight){const uniforms=cache.get(light);uniforms.skyColor.copy(light.color).multiplyScalar(intensity*scaleFactor);uniforms.groundColor.copy(light.groundColor).multiplyScalar(intensity*scaleFactor);state.hemi[hemiLength]=uniforms;hemiLength++;}}if(rectAreaLength>0){if(capabilities.isWebGL2){// WebGL 2\nstate.rectAreaLTC1=UniformsLib.LTC_FLOAT_1;state.rectAreaLTC2=UniformsLib.LTC_FLOAT_2;}else{// WebGL 1\nif(extensions.has('OES_texture_float_linear')===true){state.rectAreaLTC1=UniformsLib.LTC_FLOAT_1;state.rectAreaLTC2=UniformsLib.LTC_FLOAT_2;}else if(extensions.has('OES_texture_half_float_linear')===true){state.rectAreaLTC1=UniformsLib.LTC_HALF_1;state.rectAreaLTC2=UniformsLib.LTC_HALF_2;}else{console.error('THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.');}}}state.ambient[0]=r;state.ambient[1]=g;state.ambient[2]=b;const hash=state.hash;if(hash.directionalLength!==directionalLength||hash.pointLength!==pointLength||hash.spotLength!==spotLength||hash.rectAreaLength!==rectAreaLength||hash.hemiLength!==hemiLength||hash.numDirectionalShadows!==numDirectionalShadows||hash.numPointShadows!==numPointShadows||hash.numSpotShadows!==numSpotShadows||hash.numSpotMaps!==numSpotMaps){state.directional.length=directionalLength;state.spot.length=spotLength;state.rectArea.length=rectAreaLength;state.point.length=pointLength;state.hemi.length=hemiLength;state.directionalShadow.length=numDirectionalShadows;state.directionalShadowMap.length=numDirectionalShadows;state.pointShadow.length=numPointShadows;state.pointShadowMap.length=numPointShadows;state.spotShadow.length=numSpotShadows;state.spotShadowMap.length=numSpotShadows;state.directionalShadowMatrix.length=numDirectionalShadows;state.pointShadowMatrix.length=numPointShadows;state.spotLightMatrix.length=numSpotShadows+numSpotMaps-numSpotShadowsWithMaps;state.spotLightMap.length=numSpotMaps;state.numSpotLightShadowsWithMaps=numSpotShadowsWithMaps;hash.directionalLength=directionalLength;hash.pointLength=pointLength;hash.spotLength=spotLength;hash.rectAreaLength=rectAreaLength;hash.hemiLength=hemiLength;hash.numDirectionalShadows=numDirectionalShadows;hash.numPointShadows=numPointShadows;hash.numSpotShadows=numSpotShadows;hash.numSpotMaps=numSpotMaps;state.version=nextVersion++;}}function setupView(lights,camera){let directionalLength=0;let pointLength=0;let spotLength=0;let rectAreaLength=0;let hemiLength=0;const viewMatrix=camera.matrixWorldInverse;for(let i=0,l=lights.length;i<l;i++){const light=lights[i];if(light.isDirectionalLight){const uniforms=state.directional[directionalLength];uniforms.direction.setFromMatrixPosition(light.matrixWorld);vector3.setFromMatrixPosition(light.target.matrixWorld);uniforms.direction.sub(vector3);uniforms.direction.transformDirection(viewMatrix);directionalLength++;}else if(light.isSpotLight){const uniforms=state.spot[spotLength];uniforms.position.setFromMatrixPosition(light.matrixWorld);uniforms.position.applyMatrix4(viewMatrix);uniforms.direction.setFromMatrixPosition(light.matrixWorld);vector3.setFromMatrixPosition(light.target.matrixWorld);uniforms.direction.sub(vector3);uniforms.direction.transformDirection(viewMatrix);spotLength++;}else if(light.isRectAreaLight){const uniforms=state.rectArea[rectAreaLength];uniforms.position.setFromMatrixPosition(light.matrixWorld);uniforms.position.applyMatrix4(viewMatrix);// extract local rotation of light to derive width/height half vectors\nmatrix42.identity();matrix4.copy(light.matrixWorld);matrix4.premultiply(viewMatrix);matrix42.extractRotation(matrix4);uniforms.halfWidth.set(light.width*0.5,0.0,0.0);uniforms.halfHeight.set(0.0,light.height*0.5,0.0);uniforms.halfWidth.applyMatrix4(matrix42);uniforms.halfHeight.applyMatrix4(matrix42);rectAreaLength++;}else if(light.isPointLight){const uniforms=state.point[pointLength];uniforms.position.setFromMatrixPosition(light.matrixWorld);uniforms.position.applyMatrix4(viewMatrix);pointLength++;}else if(light.isHemisphereLight){const uniforms=state.hemi[hemiLength];uniforms.direction.setFromMatrixPosition(light.matrixWorld);uniforms.direction.transformDirection(viewMatrix);hemiLength++;}}}return{setup:setup,setupView:setupView,state:state};}function WebGLRenderState(extensions,capabilities){const lights=new WebGLLights(extensions,capabilities);const lightsArray=[];const shadowsArray=[];function init(){lightsArray.length=0;shadowsArray.length=0;}function pushLight(light){lightsArray.push(light);}function pushShadow(shadowLight){shadowsArray.push(shadowLight);}function setupLights(physicallyCorrectLights){lights.setup(lightsArray,physicallyCorrectLights);}function setupLightsView(camera){lights.setupView(lightsArray,camera);}const state={lightsArray:lightsArray,shadowsArray:shadowsArray,lights:lights};return{init:init,state:state,setupLights:setupLights,setupLightsView:setupLightsView,pushLight:pushLight,pushShadow:pushShadow};}function WebGLRenderStates(extensions,capabilities){let renderStates=new weak_map();function get(scene,renderCallDepth=0){const renderStateArray=renderStates.get(scene);let renderState;if(renderStateArray===undefined){renderState=new WebGLRenderState(extensions,capabilities);renderStates.set(scene,[renderState]);}else{if(renderCallDepth>=renderStateArray.length){renderState=new WebGLRenderState(extensions,capabilities);renderStateArray.push(renderState);}else{renderState=renderStateArray[renderCallDepth];}}return renderState;}function dispose(){renderStates=new weak_map();}return{get:get,dispose:dispose};}class MeshDepthMaterial extends Material{constructor(parameters){super();this.isMeshDepthMaterial=true;this.type='MeshDepthMaterial';this.depthPacking=BasicDepthPacking;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(parameters);}copy(source){super.copy(source);this.depthPacking=source.depthPacking;this.map=instance_map(source);this.alphaMap=source.alphaMap;this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;return this;}}class MeshDistanceMaterial extends Material{constructor(parameters){super();this.isMeshDistanceMaterial=true;this.type='MeshDistanceMaterial';this.referencePosition=new three_module_Vector3();this.nearDistance=1;this.farDistance=1000;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.setValues(parameters);}copy(source){super.copy(source);this.referencePosition.copy(source.referencePosition);this.nearDistance=source.nearDistance;this.farDistance=source.farDistance;this.map=instance_map(source);this.alphaMap=source.alphaMap;this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;return this;}}const vertex=\"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";const fragment=\"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\n#include <packing>\\nvoid main() {\\n\\tconst float samples = float( VSM_SAMPLES );\\n\\tfloat mean = 0.0;\\n\\tfloat squared_mean = 0.0;\\n\\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\\t\\tfloat uvOffset = uvStart + i * uvStride;\\n\\t\\t#ifdef HORIZONTAL_PASS\\n\\t\\t\\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\\n\\t\\t\\tmean += distribution.x;\\n\\t\\t\\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\\t\\t#else\\n\\t\\t\\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\\n\\t\\t\\tmean += depth;\\n\\t\\t\\tsquared_mean += depth * depth;\\n\\t\\t#endif\\n\\t}\\n\\tmean = mean / samples;\\n\\tsquared_mean = squared_mean / samples;\\n\\tfloat std_dev = sqrt( squared_mean - mean * mean );\\n\\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\\n}\";function WebGLShadowMap(_renderer,_objects,_capabilities){let _frustum=new Frustum();const _shadowMapSize=new Vector2(),_viewportSize=new Vector2(),_viewport=new Vector4(),_depthMaterial=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),_distanceMaterial=new MeshDistanceMaterial(),_materialCache={},_maxTextureSize=_capabilities.maxTextureSize;const shadowSide={0:BackSide,1:FrontSide,2:DoubleSide};const shadowMaterialVertical=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2()},radius:{value:4.0}},vertexShader:vertex,fragmentShader:fragment});const shadowMaterialHorizontal=shadowMaterialVertical.clone();shadowMaterialHorizontal.defines.HORIZONTAL_PASS=1;const fullScreenTri=new BufferGeometry();fullScreenTri.setAttribute('position',new BufferAttribute(new Float32Array([-1,-1,0.5,3,-1,0.5,-1,3,0.5]),3));const fullScreenMesh=new Mesh(fullScreenTri,shadowMaterialVertical);const scope=this;this.enabled=false;this.autoUpdate=true;this.needsUpdate=false;this.type=PCFShadowMap;this.render=function(lights,scene,camera){if(scope.enabled===false)return;if(scope.autoUpdate===false&&scope.needsUpdate===false)return;if(lights.length===0)return;const currentRenderTarget=_renderer.getRenderTarget();const activeCubeFace=_renderer.getActiveCubeFace();const activeMipmapLevel=_renderer.getActiveMipmapLevel();const _state=_renderer.state;// Set GL state for depth map.\n_state.setBlending(NoBlending);_state.buffers.color.setClear(1,1,1,1);_state.buffers.depth.setTest(true);_state.setScissorTest(false);// render depth map\nfor(let i=0,il=lights.length;i<il;i++){const light=lights[i];const shadow=light.shadow;if(shadow===undefined){console.warn('THREE.WebGLShadowMap:',light,'has no shadow.');continue;}if(shadow.autoUpdate===false&&shadow.needsUpdate===false)continue;_shadowMapSize.copy(shadow.mapSize);const shadowFrameExtents=shadow.getFrameExtents();_shadowMapSize.multiply(shadowFrameExtents);_viewportSize.copy(shadow.mapSize);if(_shadowMapSize.x>_maxTextureSize||_shadowMapSize.y>_maxTextureSize){if(_shadowMapSize.x>_maxTextureSize){_viewportSize.x=Math.floor(_maxTextureSize/shadowFrameExtents.x);_shadowMapSize.x=_viewportSize.x*shadowFrameExtents.x;shadow.mapSize.x=_viewportSize.x;}if(_shadowMapSize.y>_maxTextureSize){_viewportSize.y=Math.floor(_maxTextureSize/shadowFrameExtents.y);_shadowMapSize.y=_viewportSize.y*shadowFrameExtents.y;shadow.mapSize.y=_viewportSize.y;}}if(instance_map(shadow)===null){const pars=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};shadow.map=new WebGLRenderTarget(_shadowMapSize.x,_shadowMapSize.y,pars);instance_map(shadow).texture.name=light.name+'.shadowMap';shadow.camera.updateProjectionMatrix();}_renderer.setRenderTarget(instance_map(shadow));_renderer.clear();const viewportCount=shadow.getViewportCount();for(let vp=0;vp<viewportCount;vp++){const viewport=shadow.getViewport(vp);_viewport.set(_viewportSize.x*viewport.x,_viewportSize.y*viewport.y,_viewportSize.x*viewport.z,_viewportSize.y*viewport.w);_state.viewport(_viewport);shadow.updateMatrices(light,vp);_frustum=shadow.getFrustum();renderObject(scene,camera,shadow.camera,light,this.type);}// do blur pass for VSM\nif(shadow.isPointLightShadow!==true&&this.type===VSMShadowMap){VSMPass(shadow,camera);}shadow.needsUpdate=false;}scope.needsUpdate=false;_renderer.setRenderTarget(currentRenderTarget,activeCubeFace,activeMipmapLevel);};function VSMPass(shadow,camera){const geometry=_objects.update(fullScreenMesh);if(shadowMaterialVertical.defines.VSM_SAMPLES!==shadow.blurSamples){shadowMaterialVertical.defines.VSM_SAMPLES=shadow.blurSamples;shadowMaterialHorizontal.defines.VSM_SAMPLES=shadow.blurSamples;shadowMaterialVertical.needsUpdate=true;shadowMaterialHorizontal.needsUpdate=true;}if(shadow.mapPass===null){shadow.mapPass=new WebGLRenderTarget(_shadowMapSize.x,_shadowMapSize.y);}// vertical pass\nshadowMaterialVertical.uniforms.shadow_pass.value=instance_map(shadow).texture;shadowMaterialVertical.uniforms.resolution.value=shadow.mapSize;shadowMaterialVertical.uniforms.radius.value=shadow.radius;_renderer.setRenderTarget(shadow.mapPass);_renderer.clear();_renderer.renderBufferDirect(camera,null,geometry,shadowMaterialVertical,fullScreenMesh,null);// horizontal pass\nshadowMaterialHorizontal.uniforms.shadow_pass.value=shadow.mapPass.texture;shadowMaterialHorizontal.uniforms.resolution.value=shadow.mapSize;shadowMaterialHorizontal.uniforms.radius.value=shadow.radius;_renderer.setRenderTarget(instance_map(shadow));_renderer.clear();_renderer.renderBufferDirect(camera,null,geometry,shadowMaterialHorizontal,fullScreenMesh,null);}function getDepthMaterial(object,material,light,shadowCameraNear,shadowCameraFar,type){let result=null;const customMaterial=light.isPointLight===true?object.customDistanceMaterial:object.customDepthMaterial;if(customMaterial!==undefined){result=customMaterial;}else{result=light.isPointLight===true?_distanceMaterial:_depthMaterial;}if(_renderer.localClippingEnabled&&material.clipShadows===true&&is_array(material.clippingPlanes)&&material.clippingPlanes.length!==0||material.displacementMap&&material.displacementScale!==0||material.alphaMap&&material.alphaTest>0){// in this case we need a unique material instance reflecting the\n// appropriate state\nconst keyA=result.uuid,keyB=material.uuid;let materialsForVariant=_materialCache[keyA];if(materialsForVariant===undefined){materialsForVariant={};_materialCache[keyA]=materialsForVariant;}let cachedMaterial=materialsForVariant[keyB];if(cachedMaterial===undefined){cachedMaterial=result.clone();materialsForVariant[keyB]=cachedMaterial;}result=cachedMaterial;}result.visible=material.visible;result.wireframe=material.wireframe;if(type===VSMShadowMap){result.side=material.shadowSide!==null?material.shadowSide:material.side;}else{result.side=material.shadowSide!==null?material.shadowSide:shadowSide[material.side];}result.alphaMap=material.alphaMap;result.alphaTest=material.alphaTest;result.clipShadows=material.clipShadows;result.clippingPlanes=material.clippingPlanes;result.clipIntersection=material.clipIntersection;result.displacementMap=material.displacementMap;result.displacementScale=material.displacementScale;result.displacementBias=material.displacementBias;result.wireframeLinewidth=material.wireframeLinewidth;result.linewidth=material.linewidth;if(light.isPointLight===true&&result.isMeshDistanceMaterial===true){result.referencePosition.setFromMatrixPosition(light.matrixWorld);result.nearDistance=shadowCameraNear;result.farDistance=shadowCameraFar;}return result;}function renderObject(object,camera,shadowCamera,light,type){if(object.visible===false)return;const visible=object.layers.test(camera.layers);if(visible&&(object.isMesh||object.isLine||object.isPoints)){if((object.castShadow||object.receiveShadow&&type===VSMShadowMap)&&(!object.frustumCulled||_frustum.intersectsObject(object))){object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse,object.matrixWorld);const geometry=_objects.update(object);const material=object.material;if(is_array(material)){const groups=geometry.groups;for(let k=0,kl=groups.length;k<kl;k++){const group=groups[k];const groupMaterial=material[group.materialIndex];if(groupMaterial&&groupMaterial.visible){const depthMaterial=getDepthMaterial(object,groupMaterial,light,shadowCamera.near,shadowCamera.far,type);_renderer.renderBufferDirect(shadowCamera,null,geometry,depthMaterial,object,group);}}}else if(material.visible){const depthMaterial=getDepthMaterial(object,material,light,shadowCamera.near,shadowCamera.far,type);_renderer.renderBufferDirect(shadowCamera,null,geometry,depthMaterial,object,null);}}}const children=object.children;for(let i=0,l=children.length;i<l;i++){renderObject(children[i],camera,shadowCamera,light,type);}}}function WebGLState(gl,extensions,capabilities){const isWebGL2=capabilities.isWebGL2;function ColorBuffer(){let locked=false;const color=new Vector4();let currentColorMask=null;const currentColorClear=new Vector4(0,0,0,0);return{setMask:function(colorMask){if(currentColorMask!==colorMask&&!locked){gl.colorMask(colorMask,colorMask,colorMask,colorMask);currentColorMask=colorMask;}},setLocked:function(lock){locked=lock;},setClear:function(r,g,b,a,premultipliedAlpha){if(premultipliedAlpha===true){r*=a;g*=a;b*=a;}color.set(r,g,b,a);if(currentColorClear.equals(color)===false){gl.clearColor(r,g,b,a);currentColorClear.copy(color);}},reset:function(){locked=false;currentColorMask=null;currentColorClear.set(-1,0,0,0);// set to invalid state\n}};}function DepthBuffer(){let locked=false;let currentDepthMask=null;let currentDepthFunc=null;let currentDepthClear=null;return{setTest:function(depthTest){if(depthTest){enable(2929);}else{disable(2929);}},setMask:function(depthMask){if(currentDepthMask!==depthMask&&!locked){gl.depthMask(depthMask);currentDepthMask=depthMask;}},setFunc:function(depthFunc){if(currentDepthFunc!==depthFunc){switch(depthFunc){case NeverDepth:gl.depthFunc(512);break;case AlwaysDepth:gl.depthFunc(519);break;case LessDepth:gl.depthFunc(513);break;case LessEqualDepth:gl.depthFunc(515);break;case EqualDepth:gl.depthFunc(514);break;case GreaterEqualDepth:gl.depthFunc(518);break;case GreaterDepth:gl.depthFunc(516);break;case NotEqualDepth:gl.depthFunc(517);break;default:gl.depthFunc(515);}currentDepthFunc=depthFunc;}},setLocked:function(lock){locked=lock;},setClear:function(depth){if(currentDepthClear!==depth){gl.clearDepth(depth);currentDepthClear=depth;}},reset:function(){locked=false;currentDepthMask=null;currentDepthFunc=null;currentDepthClear=null;}};}function StencilBuffer(){let locked=false;let currentStencilMask=null;let currentStencilFunc=null;let currentStencilRef=null;let currentStencilFuncMask=null;let currentStencilFail=null;let currentStencilZFail=null;let currentStencilZPass=null;let currentStencilClear=null;return{setTest:function(stencilTest){if(!locked){if(stencilTest){enable(2960);}else{disable(2960);}}},setMask:function(stencilMask){if(currentStencilMask!==stencilMask&&!locked){gl.stencilMask(stencilMask);currentStencilMask=stencilMask;}},setFunc:function(stencilFunc,stencilRef,stencilMask){if(currentStencilFunc!==stencilFunc||currentStencilRef!==stencilRef||currentStencilFuncMask!==stencilMask){gl.stencilFunc(stencilFunc,stencilRef,stencilMask);currentStencilFunc=stencilFunc;currentStencilRef=stencilRef;currentStencilFuncMask=stencilMask;}},setOp:function(stencilFail,stencilZFail,stencilZPass){if(currentStencilFail!==stencilFail||currentStencilZFail!==stencilZFail||currentStencilZPass!==stencilZPass){gl.stencilOp(stencilFail,stencilZFail,stencilZPass);currentStencilFail=stencilFail;currentStencilZFail=stencilZFail;currentStencilZPass=stencilZPass;}},setLocked:function(lock){locked=lock;},setClear:function(stencil){if(currentStencilClear!==stencil){gl.clearStencil(stencil);currentStencilClear=stencil;}},reset:function(){locked=false;currentStencilMask=null;currentStencilFunc=null;currentStencilRef=null;currentStencilFuncMask=null;currentStencilFail=null;currentStencilZFail=null;currentStencilZPass=null;currentStencilClear=null;}};}//\nconst colorBuffer=new ColorBuffer();const depthBuffer=new DepthBuffer();const stencilBuffer=new StencilBuffer();const uboBindings=new weak_map();const uboProgamMap=new weak_map();let enabledCapabilities={};let currentBoundFramebuffers={};let currentDrawbuffers=new weak_map();let defaultDrawbuffers=[];let currentProgram=null;let currentBlendingEnabled=false;let currentBlending=null;let currentBlendEquation=null;let currentBlendSrc=null;let currentBlendDst=null;let currentBlendEquationAlpha=null;let currentBlendSrcAlpha=null;let currentBlendDstAlpha=null;let currentPremultipledAlpha=false;let currentFlipSided=null;let currentCullFace=null;let currentLineWidth=null;let currentPolygonOffsetFactor=null;let currentPolygonOffsetUnits=null;const maxTextures=gl.getParameter(35661);let lineWidthAvailable=false;let version=0;const glVersion=gl.getParameter(7938);if(index_of(glVersion).call(glVersion,'WebGL')!==-1){version=parse_float(/^WebGL (\\d)/.exec(glVersion)[1]);lineWidthAvailable=version>=1.0;}else if(index_of(glVersion).call(glVersion,'OpenGL ES')!==-1){version=parse_float(/^OpenGL ES (\\d)/.exec(glVersion)[1]);lineWidthAvailable=version>=2.0;}let currentTextureSlot=null;let currentBoundTextures={};const scissorParam=gl.getParameter(3088);const viewportParam=gl.getParameter(2978);const currentScissor=new Vector4().fromArray(scissorParam);const currentViewport=new Vector4().fromArray(viewportParam);function createTexture(type,target,count){const data=new Uint8Array(4);// 4 is required to match default unpack alignment of 4.\nconst texture=gl.createTexture();gl.bindTexture(type,texture);gl.texParameteri(type,10241,9728);gl.texParameteri(type,10240,9728);for(let i=0;i<count;i++){gl.texImage2D(target+i,0,6408,1,1,0,6408,5121,data);}return texture;}const emptyTextures={};emptyTextures[3553]=createTexture(3553,3553,1);emptyTextures[34067]=createTexture(34067,34069,6);// init\ncolorBuffer.setClear(0,0,0,1);depthBuffer.setClear(1);stencilBuffer.setClear(0);enable(2929);depthBuffer.setFunc(LessEqualDepth);setFlipSided(false);setCullFace(CullFaceBack);enable(2884);setBlending(NoBlending);//\nfunction enable(id){if(enabledCapabilities[id]!==true){gl.enable(id);enabledCapabilities[id]=true;}}function disable(id){if(enabledCapabilities[id]!==false){gl.disable(id);enabledCapabilities[id]=false;}}function bindFramebuffer(target,framebuffer){if(currentBoundFramebuffers[target]!==framebuffer){gl.bindFramebuffer(target,framebuffer);currentBoundFramebuffers[target]=framebuffer;if(isWebGL2){// 36009 is equivalent to 36160\nif(target===36009){currentBoundFramebuffers[36160]=framebuffer;}if(target===36160){currentBoundFramebuffers[36009]=framebuffer;}}return true;}return false;}function drawBuffers(renderTarget,framebuffer){let drawBuffers=defaultDrawbuffers;let needsUpdate=false;if(renderTarget){drawBuffers=currentDrawbuffers.get(framebuffer);if(drawBuffers===undefined){drawBuffers=[];currentDrawbuffers.set(framebuffer,drawBuffers);}if(renderTarget.isWebGLMultipleRenderTargets){const textures=renderTarget.texture;if(drawBuffers.length!==textures.length||drawBuffers[0]!==36064){for(let i=0,il=textures.length;i<il;i++){drawBuffers[i]=36064+i;}drawBuffers.length=textures.length;needsUpdate=true;}}else{if(drawBuffers[0]!==36064){drawBuffers[0]=36064;needsUpdate=true;}}}else{if(drawBuffers[0]!==1029){drawBuffers[0]=1029;needsUpdate=true;}}if(needsUpdate){if(capabilities.isWebGL2){gl.drawBuffers(drawBuffers);}else{extensions.get('WEBGL_draw_buffers').drawBuffersWEBGL(drawBuffers);}}}function useProgram(program){if(currentProgram!==program){gl.useProgram(program);currentProgram=program;return true;}return false;}const equationToGL={[AddEquation]:32774,[SubtractEquation]:32778,[ReverseSubtractEquation]:32779};if(isWebGL2){equationToGL[MinEquation]=32775;equationToGL[MaxEquation]=32776;}else{const extension=extensions.get('EXT_blend_minmax');if(extension!==null){equationToGL[MinEquation]=extension.MIN_EXT;equationToGL[MaxEquation]=extension.MAX_EXT;}}const factorToGL={[ZeroFactor]:0,[OneFactor]:1,[SrcColorFactor]:768,[SrcAlphaFactor]:770,[SrcAlphaSaturateFactor]:776,[DstColorFactor]:774,[DstAlphaFactor]:772,[OneMinusSrcColorFactor]:769,[OneMinusSrcAlphaFactor]:771,[OneMinusDstColorFactor]:775,[OneMinusDstAlphaFactor]:773};function setBlending(blending,blendEquation,blendSrc,blendDst,blendEquationAlpha,blendSrcAlpha,blendDstAlpha,premultipliedAlpha){if(blending===NoBlending){if(currentBlendingEnabled===true){disable(3042);currentBlendingEnabled=false;}return;}if(currentBlendingEnabled===false){enable(3042);currentBlendingEnabled=true;}if(blending!==CustomBlending){if(blending!==currentBlending||premultipliedAlpha!==currentPremultipledAlpha){if(currentBlendEquation!==AddEquation||currentBlendEquationAlpha!==AddEquation){gl.blendEquation(32774);currentBlendEquation=AddEquation;currentBlendEquationAlpha=AddEquation;}if(premultipliedAlpha){switch(blending){case NormalBlending:gl.blendFuncSeparate(1,771,1,771);break;case AdditiveBlending:gl.blendFunc(1,1);break;case SubtractiveBlending:gl.blendFuncSeparate(0,769,0,1);break;case MultiplyBlending:gl.blendFuncSeparate(0,768,0,770);break;default:console.error('THREE.WebGLState: Invalid blending: ',blending);break;}}else{switch(blending){case NormalBlending:gl.blendFuncSeparate(770,771,1,771);break;case AdditiveBlending:gl.blendFunc(770,1);break;case SubtractiveBlending:gl.blendFuncSeparate(0,769,0,1);break;case MultiplyBlending:gl.blendFunc(0,768);break;default:console.error('THREE.WebGLState: Invalid blending: ',blending);break;}}currentBlendSrc=null;currentBlendDst=null;currentBlendSrcAlpha=null;currentBlendDstAlpha=null;currentBlending=blending;currentPremultipledAlpha=premultipliedAlpha;}return;}// custom blending\nblendEquationAlpha=blendEquationAlpha||blendEquation;blendSrcAlpha=blendSrcAlpha||blendSrc;blendDstAlpha=blendDstAlpha||blendDst;if(blendEquation!==currentBlendEquation||blendEquationAlpha!==currentBlendEquationAlpha){gl.blendEquationSeparate(equationToGL[blendEquation],equationToGL[blendEquationAlpha]);currentBlendEquation=blendEquation;currentBlendEquationAlpha=blendEquationAlpha;}if(blendSrc!==currentBlendSrc||blendDst!==currentBlendDst||blendSrcAlpha!==currentBlendSrcAlpha||blendDstAlpha!==currentBlendDstAlpha){gl.blendFuncSeparate(factorToGL[blendSrc],factorToGL[blendDst],factorToGL[blendSrcAlpha],factorToGL[blendDstAlpha]);currentBlendSrc=blendSrc;currentBlendDst=blendDst;currentBlendSrcAlpha=blendSrcAlpha;currentBlendDstAlpha=blendDstAlpha;}currentBlending=blending;currentPremultipledAlpha=null;}function setMaterial(material,frontFaceCW){material.side===DoubleSide?disable(2884):enable(2884);let flipSided=material.side===BackSide;if(frontFaceCW)flipSided=!flipSided;setFlipSided(flipSided);material.blending===NormalBlending&&material.transparent===false?setBlending(NoBlending):setBlending(material.blending,material.blendEquation,material.blendSrc,material.blendDst,material.blendEquationAlpha,material.blendSrcAlpha,material.blendDstAlpha,material.premultipliedAlpha);depthBuffer.setFunc(material.depthFunc);depthBuffer.setTest(material.depthTest);depthBuffer.setMask(material.depthWrite);colorBuffer.setMask(material.colorWrite);const stencilWrite=material.stencilWrite;stencilBuffer.setTest(stencilWrite);if(stencilWrite){stencilBuffer.setMask(material.stencilWriteMask);stencilBuffer.setFunc(material.stencilFunc,material.stencilRef,material.stencilFuncMask);stencilBuffer.setOp(material.stencilFail,material.stencilZFail,material.stencilZPass);}setPolygonOffset(material.polygonOffset,material.polygonOffsetFactor,material.polygonOffsetUnits);material.alphaToCoverage===true?enable(32926):disable(32926);}//\nfunction setFlipSided(flipSided){if(currentFlipSided!==flipSided){if(flipSided){gl.frontFace(2304);}else{gl.frontFace(2305);}currentFlipSided=flipSided;}}function setCullFace(cullFace){if(cullFace!==CullFaceNone){enable(2884);if(cullFace!==currentCullFace){if(cullFace===CullFaceBack){gl.cullFace(1029);}else if(cullFace===CullFaceFront){gl.cullFace(1028);}else{gl.cullFace(1032);}}}else{disable(2884);}currentCullFace=cullFace;}function setLineWidth(width){if(width!==currentLineWidth){if(lineWidthAvailable)gl.lineWidth(width);currentLineWidth=width;}}function setPolygonOffset(polygonOffset,factor,units){if(polygonOffset){enable(32823);if(currentPolygonOffsetFactor!==factor||currentPolygonOffsetUnits!==units){gl.polygonOffset(factor,units);currentPolygonOffsetFactor=factor;currentPolygonOffsetUnits=units;}}else{disable(32823);}}function setScissorTest(scissorTest){if(scissorTest){enable(3089);}else{disable(3089);}}// texture\nfunction activeTexture(webglSlot){if(webglSlot===undefined)webglSlot=33984+maxTextures-1;if(currentTextureSlot!==webglSlot){gl.activeTexture(webglSlot);currentTextureSlot=webglSlot;}}function bindTexture(webglType,webglTexture,webglSlot){if(webglSlot===undefined){if(currentTextureSlot===null){webglSlot=33984+maxTextures-1;}else{webglSlot=currentTextureSlot;}}let boundTexture=currentBoundTextures[webglSlot];if(boundTexture===undefined){boundTexture={type:undefined,texture:undefined};currentBoundTextures[webglSlot]=boundTexture;}if(boundTexture.type!==webglType||boundTexture.texture!==webglTexture){if(currentTextureSlot!==webglSlot){gl.activeTexture(webglSlot);currentTextureSlot=webglSlot;}gl.bindTexture(webglType,webglTexture||emptyTextures[webglType]);boundTexture.type=webglType;boundTexture.texture=webglTexture;}}function unbindTexture(){const boundTexture=currentBoundTextures[currentTextureSlot];if(boundTexture!==undefined&&boundTexture.type!==undefined){gl.bindTexture(boundTexture.type,null);boundTexture.type=undefined;boundTexture.texture=undefined;}}function compressedTexImage2D(){try{gl.compressedTexImage2D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function compressedTexImage3D(){try{gl.compressedTexImage3D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function texSubImage2D(){try{gl.texSubImage2D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function texSubImage3D(){try{gl.texSubImage3D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function compressedTexSubImage2D(){try{gl.compressedTexSubImage2D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function compressedTexSubImage3D(){try{gl.compressedTexSubImage3D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function texStorage2D(){try{gl.texStorage2D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function texStorage3D(){try{gl.texStorage3D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function texImage2D(){try{gl.texImage2D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}function texImage3D(){try{gl.texImage3D.apply(gl,arguments);}catch(error){console.error('THREE.WebGLState:',error);}}//\nfunction scissor(scissor){if(currentScissor.equals(scissor)===false){gl.scissor(scissor.x,scissor.y,scissor.z,scissor.w);currentScissor.copy(scissor);}}function viewport(viewport){if(currentViewport.equals(viewport)===false){gl.viewport(viewport.x,viewport.y,viewport.z,viewport.w);currentViewport.copy(viewport);}}function updateUBOMapping(uniformsGroup,program){let mapping=uboProgamMap.get(program);if(mapping===undefined){mapping=new weak_map();uboProgamMap.set(program,mapping);}let blockIndex=mapping.get(uniformsGroup);if(blockIndex===undefined){blockIndex=gl.getUniformBlockIndex(program,uniformsGroup.name);mapping.set(uniformsGroup,blockIndex);}}function uniformBlockBinding(uniformsGroup,program){const mapping=uboProgamMap.get(program);const blockIndex=mapping.get(uniformsGroup);if(uboBindings.get(uniformsGroup)!==blockIndex){// bind shader specific block index to global block point\ngl.uniformBlockBinding(program,blockIndex,uniformsGroup.__bindingPointIndex);uboBindings.set(uniformsGroup,blockIndex);}}//\nfunction reset(){// reset state\ngl.disable(3042);gl.disable(2884);gl.disable(2929);gl.disable(32823);gl.disable(3089);gl.disable(2960);gl.disable(32926);gl.blendEquation(32774);gl.blendFunc(1,0);gl.blendFuncSeparate(1,0,1,0);gl.colorMask(true,true,true,true);gl.clearColor(0,0,0,0);gl.depthMask(true);gl.depthFunc(513);gl.clearDepth(1);gl.stencilMask(0xffffffff);gl.stencilFunc(519,0,0xffffffff);gl.stencilOp(7680,7680,7680);gl.clearStencil(0);gl.cullFace(1029);gl.frontFace(2305);gl.polygonOffset(0,0);gl.activeTexture(33984);gl.bindFramebuffer(36160,null);if(isWebGL2===true){gl.bindFramebuffer(36009,null);gl.bindFramebuffer(36008,null);}gl.useProgram(null);gl.lineWidth(1);gl.scissor(0,0,gl.canvas.width,gl.canvas.height);gl.viewport(0,0,gl.canvas.width,gl.canvas.height);// reset internals\nenabledCapabilities={};currentTextureSlot=null;currentBoundTextures={};currentBoundFramebuffers={};currentDrawbuffers=new weak_map();defaultDrawbuffers=[];currentProgram=null;currentBlendingEnabled=false;currentBlending=null;currentBlendEquation=null;currentBlendSrc=null;currentBlendDst=null;currentBlendEquationAlpha=null;currentBlendSrcAlpha=null;currentBlendDstAlpha=null;currentPremultipledAlpha=false;currentFlipSided=null;currentCullFace=null;currentLineWidth=null;currentPolygonOffsetFactor=null;currentPolygonOffsetUnits=null;currentScissor.set(0,0,gl.canvas.width,gl.canvas.height);currentViewport.set(0,0,gl.canvas.width,gl.canvas.height);colorBuffer.reset();depthBuffer.reset();stencilBuffer.reset();}return{buffers:{color:colorBuffer,depth:depthBuffer,stencil:stencilBuffer},enable:enable,disable:disable,bindFramebuffer:bindFramebuffer,drawBuffers:drawBuffers,useProgram:useProgram,setBlending:setBlending,setMaterial:setMaterial,setFlipSided:setFlipSided,setCullFace:setCullFace,setLineWidth:setLineWidth,setPolygonOffset:setPolygonOffset,setScissorTest:setScissorTest,activeTexture:activeTexture,bindTexture:bindTexture,unbindTexture:unbindTexture,compressedTexImage2D:compressedTexImage2D,compressedTexImage3D:compressedTexImage3D,texImage2D:texImage2D,texImage3D:texImage3D,updateUBOMapping:updateUBOMapping,uniformBlockBinding:uniformBlockBinding,texStorage2D:texStorage2D,texStorage3D:texStorage3D,texSubImage2D:texSubImage2D,texSubImage3D:texSubImage3D,compressedTexSubImage2D:compressedTexSubImage2D,compressedTexSubImage3D:compressedTexSubImage3D,scissor:scissor,viewport:viewport,reset:reset};}function WebGLTextures(_gl,extensions,state,properties,capabilities,utils,info){const isWebGL2=capabilities.isWebGL2;const maxTextures=capabilities.maxTextures;const maxCubemapSize=capabilities.maxCubemapSize;const maxTextureSize=capabilities.maxTextureSize;const maxSamples=capabilities.maxSamples;const multisampledRTTExt=extensions.has('WEBGL_multisampled_render_to_texture')?extensions.get('WEBGL_multisampled_render_to_texture'):null;const supportsInvalidateFramebuffer=/OculusBrowser/g.test(typeof navigator==='undefined'?'':navigator.userAgent);const _videoTextures=new weak_map();let _canvas;const _sources=new weak_map();// maps WebglTexture objects to instances of Source\n// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\nlet useOffscreenCanvas=false;try{useOffscreenCanvas=typeof OffscreenCanvas!=='undefined'// eslint-disable-next-line compat/compat\n&&new OffscreenCanvas(1,1).getContext('2d')!==null;}catch(err){// Ignore any errors\n}function createCanvas(width,height){// Use OffscreenCanvas when available. Specially needed in web workers\nreturn useOffscreenCanvas?// eslint-disable-next-line compat/compat\nnew OffscreenCanvas(width,height):createElementNS('canvas');}function resizeImage(image,needsPowerOfTwo,needsNewCanvas,maxSize){let scale=1;// handle case if texture exceeds max size\nif(image.width>maxSize||image.height>maxSize){scale=maxSize/Math.max(image.width,image.height);}// only perform resize if necessary\nif(scale<1||needsPowerOfTwo===true){// only perform resize for certain image types\nif(typeof HTMLImageElement!=='undefined'&&image instanceof HTMLImageElement||typeof HTMLCanvasElement!=='undefined'&&image instanceof HTMLCanvasElement||typeof ImageBitmap!=='undefined'&&image instanceof ImageBitmap){const floor=needsPowerOfTwo?three_module_floorPowerOfTwo:Math.floor;const width=floor(scale*image.width);const height=floor(scale*image.height);if(_canvas===undefined)_canvas=createCanvas(width,height);// cube textures can't reuse the same canvas\nconst canvas=needsNewCanvas?createCanvas(width,height):_canvas;canvas.width=width;canvas.height=height;const context=canvas.getContext('2d');context.drawImage(image,0,0,width,height);console.warn('THREE.WebGLRenderer: Texture has been resized from ('+image.width+'x'+image.height+') to ('+width+'x'+height+').');return canvas;}else{if('data'in image){console.warn('THREE.WebGLRenderer: Image in DataTexture is too big ('+image.width+'x'+image.height+').');}return image;}}return image;}function isPowerOfTwo$1(image){return three_module_isPowerOfTwo(image.width)&&three_module_isPowerOfTwo(image.height);}function textureNeedsPowerOfTwo(texture){if(isWebGL2)return false;return texture.wrapS!==ClampToEdgeWrapping||texture.wrapT!==ClampToEdgeWrapping||texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter;}function textureNeedsGenerateMipmaps(texture,supportsMips){return texture.generateMipmaps&&supportsMips&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter;}function generateMipmap(target){_gl.generateMipmap(target);}function getInternalFormat(internalFormatName,glFormat,glType,encoding,forceLinearEncoding=false){if(isWebGL2===false)return glFormat;if(internalFormatName!==null){if(_gl[internalFormatName]!==undefined)return _gl[internalFormatName];console.warn('THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\''+internalFormatName+'\\'');}let internalFormat=glFormat;if(glFormat===6403){if(glType===5126)internalFormat=33326;if(glType===5131)internalFormat=33325;if(glType===5121)internalFormat=33321;}if(glFormat===33319){if(glType===5126)internalFormat=33328;if(glType===5131)internalFormat=33327;if(glType===5121)internalFormat=33323;}if(glFormat===6408){if(glType===5126)internalFormat=34836;if(glType===5131)internalFormat=34842;if(glType===5121)internalFormat=encoding===sRGBEncoding&&forceLinearEncoding===false?35907:32856;if(glType===32819)internalFormat=32854;if(glType===32820)internalFormat=32855;}if(internalFormat===33325||internalFormat===33326||internalFormat===33327||internalFormat===33328||internalFormat===34842||internalFormat===34836){extensions.get('EXT_color_buffer_float');}return internalFormat;}function getMipLevels(texture,image,supportsMips){if(textureNeedsGenerateMipmaps(texture,supportsMips)===true||texture.isFramebufferTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter){return log2(Math.max(image.width,image.height))+1;}else if(texture.mipmaps!==undefined&&texture.mipmaps.length>0){// user-defined mipmaps\nreturn texture.mipmaps.length;}else if(texture.isCompressedTexture&&is_array(texture.image)){return image.mipmaps.length;}else{// texture without mipmaps (only base level)\nreturn 1;}}// Fallback filters for non-power-of-2 textures\nfunction filterFallback(f){if(f===NearestFilter||f===NearestMipmapNearestFilter||f===NearestMipmapLinearFilter){return 9728;}return 9729;}//\nfunction onTextureDispose(event){const texture=event.target;texture.removeEventListener('dispose',onTextureDispose);deallocateTexture(texture);if(texture.isVideoTexture){_videoTextures.delete(texture);}}function onRenderTargetDispose(event){const renderTarget=event.target;renderTarget.removeEventListener('dispose',onRenderTargetDispose);deallocateRenderTarget(renderTarget);}//\nfunction deallocateTexture(texture){const textureProperties=properties.get(texture);if(textureProperties.__webglInit===undefined)return;// check if it's necessary to remove the WebGLTexture object\nconst source=texture.source;const webglTextures=_sources.get(source);if(webglTextures){const webglTexture=webglTextures[textureProperties.__cacheKey];webglTexture.usedTimes--;// the WebGLTexture object is not used anymore, remove it\nif(webglTexture.usedTimes===0){deleteTexture(texture);}// remove the weak map entry if no WebGLTexture uses the source anymore\nif(object_keys(webglTextures).length===0){_sources.delete(source);}}properties.remove(texture);}function deleteTexture(texture){const textureProperties=properties.get(texture);_gl.deleteTexture(textureProperties.__webglTexture);const source=texture.source;const webglTextures=_sources.get(source);delete webglTextures[textureProperties.__cacheKey];info.memory.textures--;}function deallocateRenderTarget(renderTarget){const texture=renderTarget.texture;const renderTargetProperties=properties.get(renderTarget);const textureProperties=properties.get(texture);if(textureProperties.__webglTexture!==undefined){_gl.deleteTexture(textureProperties.__webglTexture);info.memory.textures--;}if(renderTarget.depthTexture){renderTarget.depthTexture.dispose();}if(renderTarget.isWebGLCubeRenderTarget){for(let i=0;i<6;i++){_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]);if(renderTargetProperties.__webglDepthbuffer)_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]);}}else{_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer);if(renderTargetProperties.__webglDepthbuffer)_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer);if(renderTargetProperties.__webglMultisampledFramebuffer)_gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer);if(renderTargetProperties.__webglColorRenderbuffer){for(let i=0;i<renderTargetProperties.__webglColorRenderbuffer.length;i++){if(renderTargetProperties.__webglColorRenderbuffer[i])_gl.deleteRenderbuffer(renderTargetProperties.__webglColorRenderbuffer[i]);}}if(renderTargetProperties.__webglDepthRenderbuffer)_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthRenderbuffer);}if(renderTarget.isWebGLMultipleRenderTargets){for(let i=0,il=texture.length;i<il;i++){const attachmentProperties=properties.get(texture[i]);if(attachmentProperties.__webglTexture){_gl.deleteTexture(attachmentProperties.__webglTexture);info.memory.textures--;}properties.remove(texture[i]);}}properties.remove(texture);properties.remove(renderTarget);}//\nlet textureUnits=0;function resetTextureUnits(){textureUnits=0;}function allocateTextureUnit(){const textureUnit=textureUnits;if(textureUnit>=maxTextures){console.warn('THREE.WebGLTextures: Trying to use '+textureUnit+' texture units while this GPU supports only '+maxTextures);}textureUnits+=1;return textureUnit;}function getTextureCacheKey(texture){const array=[];array.push(texture.wrapS);array.push(texture.wrapT);array.push(texture.wrapR||0);array.push(texture.magFilter);array.push(texture.minFilter);array.push(texture.anisotropy);array.push(texture.internalFormat);array.push(texture.format);array.push(texture.type);array.push(texture.generateMipmaps);array.push(texture.premultiplyAlpha);array.push(texture.flipY);array.push(texture.unpackAlignment);array.push(texture.encoding);return array.join();}//\nfunction setTexture2D(texture,slot){const textureProperties=properties.get(texture);if(texture.isVideoTexture)updateVideoTexture(texture);if(texture.isRenderTargetTexture===false&&texture.version>0&&textureProperties.__version!==texture.version){const image=texture.image;if(image===null){console.warn('THREE.WebGLRenderer: Texture marked for update but no image data found.');}else if(image.complete===false){console.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete');}else{uploadTexture(textureProperties,texture,slot);return;}}state.bindTexture(3553,textureProperties.__webglTexture,33984+slot);}function setTexture2DArray(texture,slot){const textureProperties=properties.get(texture);if(texture.version>0&&textureProperties.__version!==texture.version){uploadTexture(textureProperties,texture,slot);return;}state.bindTexture(35866,textureProperties.__webglTexture,33984+slot);}function setTexture3D(texture,slot){const textureProperties=properties.get(texture);if(texture.version>0&&textureProperties.__version!==texture.version){uploadTexture(textureProperties,texture,slot);return;}state.bindTexture(32879,textureProperties.__webglTexture,33984+slot);}function setTextureCube(texture,slot){const textureProperties=properties.get(texture);if(texture.version>0&&textureProperties.__version!==texture.version){uploadCubeTexture(textureProperties,texture,slot);return;}state.bindTexture(34067,textureProperties.__webglTexture,33984+slot);}const wrappingToGL={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648};const filterToGL={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function setTextureParameters(textureType,texture,supportsMips){if(supportsMips){_gl.texParameteri(textureType,10242,wrappingToGL[texture.wrapS]);_gl.texParameteri(textureType,10243,wrappingToGL[texture.wrapT]);if(textureType===32879||textureType===35866){_gl.texParameteri(textureType,32882,wrappingToGL[texture.wrapR]);}_gl.texParameteri(textureType,10240,filterToGL[texture.magFilter]);_gl.texParameteri(textureType,10241,filterToGL[texture.minFilter]);}else{_gl.texParameteri(textureType,10242,33071);_gl.texParameteri(textureType,10243,33071);if(textureType===32879||textureType===35866){_gl.texParameteri(textureType,32882,33071);}if(texture.wrapS!==ClampToEdgeWrapping||texture.wrapT!==ClampToEdgeWrapping){console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.');}_gl.texParameteri(textureType,10240,filterFallback(texture.magFilter));_gl.texParameteri(textureType,10241,filterFallback(texture.minFilter));if(texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter){console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.');}}if(extensions.has('EXT_texture_filter_anisotropic')===true){const extension=extensions.get('EXT_texture_filter_anisotropic');if(texture.type===FloatType&&extensions.has('OES_texture_float_linear')===false)return;// verify extension for WebGL 1 and WebGL 2\nif(isWebGL2===false&&texture.type===HalfFloatType&&extensions.has('OES_texture_half_float_linear')===false)return;// verify extension for WebGL 1 only\nif(texture.anisotropy>1||properties.get(texture).__currentAnisotropy){_gl.texParameterf(textureType,extension.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(texture.anisotropy,capabilities.getMaxAnisotropy()));properties.get(texture).__currentAnisotropy=texture.anisotropy;}}}function initTexture(textureProperties,texture){let forceUpload=false;if(textureProperties.__webglInit===undefined){textureProperties.__webglInit=true;texture.addEventListener('dispose',onTextureDispose);}// create Source <-> WebGLTextures mapping if necessary\nconst source=texture.source;let webglTextures=_sources.get(source);if(webglTextures===undefined){webglTextures={};_sources.set(source,webglTextures);}// check if there is already a WebGLTexture object for the given texture parameters\nconst textureCacheKey=getTextureCacheKey(texture);if(textureCacheKey!==textureProperties.__cacheKey){// if not, create a new instance of WebGLTexture\nif(webglTextures[textureCacheKey]===undefined){// create new entry\nwebglTextures[textureCacheKey]={texture:_gl.createTexture(),usedTimes:0};info.memory.textures++;// when a new instance of WebGLTexture was created, a texture upload is required\n// even if the image contents are identical\nforceUpload=true;}webglTextures[textureCacheKey].usedTimes++;// every time the texture cache key changes, it's necessary to check if an instance of\n// WebGLTexture can be deleted in order to avoid a memory leak.\nconst webglTexture=webglTextures[textureProperties.__cacheKey];if(webglTexture!==undefined){webglTextures[textureProperties.__cacheKey].usedTimes--;if(webglTexture.usedTimes===0){deleteTexture(texture);}}// store references to cache key and WebGLTexture object\ntextureProperties.__cacheKey=textureCacheKey;textureProperties.__webglTexture=webglTextures[textureCacheKey].texture;}return forceUpload;}function uploadTexture(textureProperties,texture,slot){let textureType=3553;if(texture.isDataArrayTexture||texture.isCompressedArrayTexture)textureType=35866;if(texture.isData3DTexture)textureType=32879;const forceUpload=initTexture(textureProperties,texture);const source=texture.source;state.bindTexture(textureType,textureProperties.__webglTexture,33984+slot);const sourceProperties=properties.get(source);if(source.version!==sourceProperties.__version||forceUpload===true){state.activeTexture(33984+slot);_gl.pixelStorei(37440,texture.flipY);_gl.pixelStorei(37441,texture.premultiplyAlpha);_gl.pixelStorei(3317,texture.unpackAlignment);_gl.pixelStorei(37443,0);const needsPowerOfTwo=textureNeedsPowerOfTwo(texture)&&isPowerOfTwo$1(texture.image)===false;let image=resizeImage(texture.image,needsPowerOfTwo,false,maxTextureSize);image=verifyColorSpace(texture,image);const supportsMips=isPowerOfTwo$1(image)||isWebGL2,glFormat=utils.convert(texture.format,texture.encoding);let glType=utils.convert(texture.type),glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.encoding,texture.isVideoTexture);setTextureParameters(textureType,texture,supportsMips);let mipmap;const mipmaps=texture.mipmaps;const useTexStorage=isWebGL2&&texture.isVideoTexture!==true;const allocateMemory=sourceProperties.__version===undefined||forceUpload===true;const levels=getMipLevels(texture,image,supportsMips);if(texture.isDepthTexture){// populate depth texture with dummy data\nglInternalFormat=6402;if(isWebGL2){if(texture.type===FloatType){glInternalFormat=36012;}else if(texture.type===UnsignedIntType){glInternalFormat=33190;}else if(texture.type===UnsignedInt248Type){glInternalFormat=35056;}else{glInternalFormat=33189;// WebGL2 requires sized internalformat for glTexImage2D\n}}else{if(texture.type===FloatType){console.error('WebGLRenderer: Floating point depth texture requires WebGL2.');}}// validation checks for WebGL 1\nif(texture.format===DepthFormat&&glInternalFormat===6402){// The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n// DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT\n// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\nif(texture.type!==UnsignedShortType&&texture.type!==UnsignedIntType){console.warn('THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.');texture.type=UnsignedIntType;glType=utils.convert(texture.type);}}if(texture.format===DepthStencilFormat&&glInternalFormat===6402){// Depth stencil textures need the DEPTH_STENCIL internal format\n// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\nglInternalFormat=34041;// The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n// DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL.\n// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\nif(texture.type!==UnsignedInt248Type){console.warn('THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.');texture.type=UnsignedInt248Type;glType=utils.convert(texture.type);}}//\nif(allocateMemory){if(useTexStorage){state.texStorage2D(3553,1,glInternalFormat,image.width,image.height);}else{state.texImage2D(3553,0,glInternalFormat,image.width,image.height,0,glFormat,glType,null);}}}else if(texture.isDataTexture){// use manually created mipmaps if available\n// if there are no manual mipmaps\n// set 0 level mipmap and then use GL to generate other mipmap levels\nif(mipmaps.length>0&&supportsMips){if(useTexStorage&&allocateMemory){state.texStorage2D(3553,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);}for(let i=0,il=mipmaps.length;i<il;i++){mipmap=mipmaps[i];if(useTexStorage){state.texSubImage2D(3553,i,0,0,mipmap.width,mipmap.height,glFormat,glType,mipmap.data);}else{state.texImage2D(3553,i,glInternalFormat,mipmap.width,mipmap.height,0,glFormat,glType,mipmap.data);}}texture.generateMipmaps=false;}else{if(useTexStorage){if(allocateMemory){state.texStorage2D(3553,levels,glInternalFormat,image.width,image.height);}state.texSubImage2D(3553,0,0,0,image.width,image.height,glFormat,glType,image.data);}else{state.texImage2D(3553,0,glInternalFormat,image.width,image.height,0,glFormat,glType,image.data);}}}else if(texture.isCompressedTexture){if(texture.isCompressedArrayTexture){if(useTexStorage&&allocateMemory){state.texStorage3D(35866,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height,image.depth);}for(let i=0,il=mipmaps.length;i<il;i++){mipmap=mipmaps[i];if(texture.format!==RGBAFormat){if(glFormat!==null){if(useTexStorage){state.compressedTexSubImage3D(35866,i,0,0,0,mipmap.width,mipmap.height,image.depth,glFormat,mipmap.data,0,0);}else{state.compressedTexImage3D(35866,i,glInternalFormat,mipmap.width,mipmap.height,image.depth,0,mipmap.data,0,0);}}else{console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()');}}else{if(useTexStorage){state.texSubImage3D(35866,i,0,0,0,mipmap.width,mipmap.height,image.depth,glFormat,glType,mipmap.data);}else{state.texImage3D(35866,i,glInternalFormat,mipmap.width,mipmap.height,image.depth,0,glFormat,glType,mipmap.data);}}}}else{if(useTexStorage&&allocateMemory){state.texStorage2D(3553,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);}for(let i=0,il=mipmaps.length;i<il;i++){mipmap=mipmaps[i];if(texture.format!==RGBAFormat){if(glFormat!==null){if(useTexStorage){state.compressedTexSubImage2D(3553,i,0,0,mipmap.width,mipmap.height,glFormat,mipmap.data);}else{state.compressedTexImage2D(3553,i,glInternalFormat,mipmap.width,mipmap.height,0,mipmap.data);}}else{console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()');}}else{if(useTexStorage){state.texSubImage2D(3553,i,0,0,mipmap.width,mipmap.height,glFormat,glType,mipmap.data);}else{state.texImage2D(3553,i,glInternalFormat,mipmap.width,mipmap.height,0,glFormat,glType,mipmap.data);}}}}}else if(texture.isDataArrayTexture){if(useTexStorage){if(allocateMemory){state.texStorage3D(35866,levels,glInternalFormat,image.width,image.height,image.depth);}state.texSubImage3D(35866,0,0,0,0,image.width,image.height,image.depth,glFormat,glType,image.data);}else{state.texImage3D(35866,0,glInternalFormat,image.width,image.height,image.depth,0,glFormat,glType,image.data);}}else if(texture.isData3DTexture){if(useTexStorage){if(allocateMemory){state.texStorage3D(32879,levels,glInternalFormat,image.width,image.height,image.depth);}state.texSubImage3D(32879,0,0,0,0,image.width,image.height,image.depth,glFormat,glType,image.data);}else{state.texImage3D(32879,0,glInternalFormat,image.width,image.height,image.depth,0,glFormat,glType,image.data);}}else if(texture.isFramebufferTexture){if(allocateMemory){if(useTexStorage){state.texStorage2D(3553,levels,glInternalFormat,image.width,image.height);}else{let width=image.width,height=image.height;for(let i=0;i<levels;i++){state.texImage2D(3553,i,glInternalFormat,width,height,0,glFormat,glType,null);width>>=1;height>>=1;}}}}else{// regular Texture (image, video, canvas)\n// use manually created mipmaps if available\n// if there are no manual mipmaps\n// set 0 level mipmap and then use GL to generate other mipmap levels\nif(mipmaps.length>0&&supportsMips){if(useTexStorage&&allocateMemory){state.texStorage2D(3553,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);}for(let i=0,il=mipmaps.length;i<il;i++){mipmap=mipmaps[i];if(useTexStorage){state.texSubImage2D(3553,i,0,0,glFormat,glType,mipmap);}else{state.texImage2D(3553,i,glInternalFormat,glFormat,glType,mipmap);}}texture.generateMipmaps=false;}else{if(useTexStorage){if(allocateMemory){state.texStorage2D(3553,levels,glInternalFormat,image.width,image.height);}state.texSubImage2D(3553,0,0,0,glFormat,glType,image);}else{state.texImage2D(3553,0,glInternalFormat,glFormat,glType,image);}}}if(textureNeedsGenerateMipmaps(texture,supportsMips)){generateMipmap(textureType);}sourceProperties.__version=source.version;if(texture.onUpdate)texture.onUpdate(texture);}textureProperties.__version=texture.version;}function uploadCubeTexture(textureProperties,texture,slot){if(texture.image.length!==6)return;const forceUpload=initTexture(textureProperties,texture);const source=texture.source;state.bindTexture(34067,textureProperties.__webglTexture,33984+slot);const sourceProperties=properties.get(source);if(source.version!==sourceProperties.__version||forceUpload===true){state.activeTexture(33984+slot);_gl.pixelStorei(37440,texture.flipY);_gl.pixelStorei(37441,texture.premultiplyAlpha);_gl.pixelStorei(3317,texture.unpackAlignment);_gl.pixelStorei(37443,0);const isCompressed=texture.isCompressedTexture||texture.image[0].isCompressedTexture;const isDataTexture=texture.image[0]&&texture.image[0].isDataTexture;const cubeImage=[];for(let i=0;i<6;i++){if(!isCompressed&&!isDataTexture){cubeImage[i]=resizeImage(texture.image[i],false,true,maxCubemapSize);}else{cubeImage[i]=isDataTexture?texture.image[i].image:texture.image[i];}cubeImage[i]=verifyColorSpace(texture,cubeImage[i]);}const image=cubeImage[0],supportsMips=isPowerOfTwo$1(image)||isWebGL2,glFormat=utils.convert(texture.format,texture.encoding),glType=utils.convert(texture.type),glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.encoding);const useTexStorage=isWebGL2&&texture.isVideoTexture!==true;const allocateMemory=sourceProperties.__version===undefined||forceUpload===true;let levels=getMipLevels(texture,image,supportsMips);setTextureParameters(34067,texture,supportsMips);let mipmaps;if(isCompressed){if(useTexStorage&&allocateMemory){state.texStorage2D(34067,levels,glInternalFormat,image.width,image.height);}for(let i=0;i<6;i++){mipmaps=cubeImage[i].mipmaps;for(let j=0;j<mipmaps.length;j++){const mipmap=mipmaps[j];if(texture.format!==RGBAFormat){if(glFormat!==null){if(useTexStorage){state.compressedTexSubImage2D(34069+i,j,0,0,mipmap.width,mipmap.height,glFormat,mipmap.data);}else{state.compressedTexImage2D(34069+i,j,glInternalFormat,mipmap.width,mipmap.height,0,mipmap.data);}}else{console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()');}}else{if(useTexStorage){state.texSubImage2D(34069+i,j,0,0,mipmap.width,mipmap.height,glFormat,glType,mipmap.data);}else{state.texImage2D(34069+i,j,glInternalFormat,mipmap.width,mipmap.height,0,glFormat,glType,mipmap.data);}}}}}else{mipmaps=texture.mipmaps;if(useTexStorage&&allocateMemory){// TODO: Uniformly handle mipmap definitions\n// Normal textures and compressed cube textures define base level + mips with their mipmap array\n// Uncompressed cube textures use their mipmap array only for mips (no base level)\nif(mipmaps.length>0)levels++;state.texStorage2D(34067,levels,glInternalFormat,cubeImage[0].width,cubeImage[0].height);}for(let i=0;i<6;i++){if(isDataTexture){if(useTexStorage){state.texSubImage2D(34069+i,0,0,0,cubeImage[i].width,cubeImage[i].height,glFormat,glType,cubeImage[i].data);}else{state.texImage2D(34069+i,0,glInternalFormat,cubeImage[i].width,cubeImage[i].height,0,glFormat,glType,cubeImage[i].data);}for(let j=0;j<mipmaps.length;j++){const mipmap=mipmaps[j];const mipmapImage=mipmap.image[i].image;if(useTexStorage){state.texSubImage2D(34069+i,j+1,0,0,mipmapImage.width,mipmapImage.height,glFormat,glType,mipmapImage.data);}else{state.texImage2D(34069+i,j+1,glInternalFormat,mipmapImage.width,mipmapImage.height,0,glFormat,glType,mipmapImage.data);}}}else{if(useTexStorage){state.texSubImage2D(34069+i,0,0,0,glFormat,glType,cubeImage[i]);}else{state.texImage2D(34069+i,0,glInternalFormat,glFormat,glType,cubeImage[i]);}for(let j=0;j<mipmaps.length;j++){const mipmap=mipmaps[j];if(useTexStorage){state.texSubImage2D(34069+i,j+1,0,0,glFormat,glType,mipmap.image[i]);}else{state.texImage2D(34069+i,j+1,glInternalFormat,glFormat,glType,mipmap.image[i]);}}}}}if(textureNeedsGenerateMipmaps(texture,supportsMips)){// We assume images for cube map have the same size.\ngenerateMipmap(34067);}sourceProperties.__version=source.version;if(texture.onUpdate)texture.onUpdate(texture);}textureProperties.__version=texture.version;}// Render targets\n// Setup storage for target texture and bind it to correct framebuffer\nfunction setupFrameBufferTexture(framebuffer,renderTarget,texture,attachment,textureTarget){const glFormat=utils.convert(texture.format,texture.encoding);const glType=utils.convert(texture.type);const glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.encoding);const renderTargetProperties=properties.get(renderTarget);if(!renderTargetProperties.__hasExternalTextures){if(textureTarget===32879||textureTarget===35866){state.texImage3D(textureTarget,0,glInternalFormat,renderTarget.width,renderTarget.height,renderTarget.depth,0,glFormat,glType,null);}else{state.texImage2D(textureTarget,0,glInternalFormat,renderTarget.width,renderTarget.height,0,glFormat,glType,null);}}state.bindFramebuffer(36160,framebuffer);if(useMultisampledRTT(renderTarget)){multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160,attachment,textureTarget,properties.get(texture).__webglTexture,0,getRenderTargetSamples(renderTarget));}else if(textureTarget===3553||textureTarget>=34069&&textureTarget<=34074){// see #24753\n_gl.framebufferTexture2D(36160,attachment,textureTarget,properties.get(texture).__webglTexture,0);}state.bindFramebuffer(36160,null);}// Setup storage for internal depth/stencil buffers and bind to correct framebuffer\nfunction setupRenderBufferStorage(renderbuffer,renderTarget,isMultisample){_gl.bindRenderbuffer(36161,renderbuffer);if(renderTarget.depthBuffer&&!renderTarget.stencilBuffer){let glInternalFormat=33189;if(isMultisample||useMultisampledRTT(renderTarget)){const depthTexture=renderTarget.depthTexture;if(depthTexture&&depthTexture.isDepthTexture){if(depthTexture.type===FloatType){glInternalFormat=36012;}else if(depthTexture.type===UnsignedIntType){glInternalFormat=33190;}}const samples=getRenderTargetSamples(renderTarget);if(useMultisampledRTT(renderTarget)){multisampledRTTExt.renderbufferStorageMultisampleEXT(36161,samples,glInternalFormat,renderTarget.width,renderTarget.height);}else{_gl.renderbufferStorageMultisample(36161,samples,glInternalFormat,renderTarget.width,renderTarget.height);}}else{_gl.renderbufferStorage(36161,glInternalFormat,renderTarget.width,renderTarget.height);}_gl.framebufferRenderbuffer(36160,36096,36161,renderbuffer);}else if(renderTarget.depthBuffer&&renderTarget.stencilBuffer){const samples=getRenderTargetSamples(renderTarget);if(isMultisample&&useMultisampledRTT(renderTarget)===false){_gl.renderbufferStorageMultisample(36161,samples,35056,renderTarget.width,renderTarget.height);}else if(useMultisampledRTT(renderTarget)){multisampledRTTExt.renderbufferStorageMultisampleEXT(36161,samples,35056,renderTarget.width,renderTarget.height);}else{_gl.renderbufferStorage(36161,34041,renderTarget.width,renderTarget.height);}_gl.framebufferRenderbuffer(36160,33306,36161,renderbuffer);}else{const textures=renderTarget.isWebGLMultipleRenderTargets===true?renderTarget.texture:[renderTarget.texture];for(let i=0;i<textures.length;i++){const texture=textures[i];const glFormat=utils.convert(texture.format,texture.encoding);const glType=utils.convert(texture.type);const glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.encoding);const samples=getRenderTargetSamples(renderTarget);if(isMultisample&&useMultisampledRTT(renderTarget)===false){_gl.renderbufferStorageMultisample(36161,samples,glInternalFormat,renderTarget.width,renderTarget.height);}else if(useMultisampledRTT(renderTarget)){multisampledRTTExt.renderbufferStorageMultisampleEXT(36161,samples,glInternalFormat,renderTarget.width,renderTarget.height);}else{_gl.renderbufferStorage(36161,glInternalFormat,renderTarget.width,renderTarget.height);}}}_gl.bindRenderbuffer(36161,null);}// Setup resources for a Depth Texture for a FBO (needs an extension)\nfunction setupDepthTexture(framebuffer,renderTarget){const isCube=renderTarget&&renderTarget.isWebGLCubeRenderTarget;if(isCube)throw new Error('Depth Texture with cube render targets is not supported');state.bindFramebuffer(36160,framebuffer);if(!(renderTarget.depthTexture&&renderTarget.depthTexture.isDepthTexture)){throw new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');}// upload an empty depth texture with framebuffer size\nif(!properties.get(renderTarget.depthTexture).__webglTexture||renderTarget.depthTexture.image.width!==renderTarget.width||renderTarget.depthTexture.image.height!==renderTarget.height){renderTarget.depthTexture.image.width=renderTarget.width;renderTarget.depthTexture.image.height=renderTarget.height;renderTarget.depthTexture.needsUpdate=true;}setTexture2D(renderTarget.depthTexture,0);const webglDepthTexture=properties.get(renderTarget.depthTexture).__webglTexture;const samples=getRenderTargetSamples(renderTarget);if(renderTarget.depthTexture.format===DepthFormat){if(useMultisampledRTT(renderTarget)){multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160,36096,3553,webglDepthTexture,0,samples);}else{_gl.framebufferTexture2D(36160,36096,3553,webglDepthTexture,0);}}else if(renderTarget.depthTexture.format===DepthStencilFormat){if(useMultisampledRTT(renderTarget)){multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160,33306,3553,webglDepthTexture,0,samples);}else{_gl.framebufferTexture2D(36160,33306,3553,webglDepthTexture,0);}}else{throw new Error('Unknown depthTexture format');}}// Setup GL resources for a non-texture depth buffer\nfunction setupDepthRenderbuffer(renderTarget){const renderTargetProperties=properties.get(renderTarget);const isCube=renderTarget.isWebGLCubeRenderTarget===true;if(renderTarget.depthTexture&&!renderTargetProperties.__autoAllocateDepthBuffer){if(isCube)throw new Error('target.depthTexture not supported in Cube render targets');setupDepthTexture(renderTargetProperties.__webglFramebuffer,renderTarget);}else{if(isCube){renderTargetProperties.__webglDepthbuffer=[];for(let i=0;i<6;i++){state.bindFramebuffer(36160,renderTargetProperties.__webglFramebuffer[i]);renderTargetProperties.__webglDepthbuffer[i]=_gl.createRenderbuffer();setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i],renderTarget,false);}}else{state.bindFramebuffer(36160,renderTargetProperties.__webglFramebuffer);renderTargetProperties.__webglDepthbuffer=_gl.createRenderbuffer();setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer,renderTarget,false);}}state.bindFramebuffer(36160,null);}// rebind framebuffer with external textures\nfunction rebindTextures(renderTarget,colorTexture,depthTexture){const renderTargetProperties=properties.get(renderTarget);if(colorTexture!==undefined){setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer,renderTarget,renderTarget.texture,36064,3553);}if(depthTexture!==undefined){setupDepthRenderbuffer(renderTarget);}}// Set up GL resources for the render target\nfunction setupRenderTarget(renderTarget){const texture=renderTarget.texture;const renderTargetProperties=properties.get(renderTarget);const textureProperties=properties.get(texture);renderTarget.addEventListener('dispose',onRenderTargetDispose);if(renderTarget.isWebGLMultipleRenderTargets!==true){if(textureProperties.__webglTexture===undefined){textureProperties.__webglTexture=_gl.createTexture();}textureProperties.__version=texture.version;info.memory.textures++;}const isCube=renderTarget.isWebGLCubeRenderTarget===true;const isMultipleRenderTargets=renderTarget.isWebGLMultipleRenderTargets===true;const supportsMips=isPowerOfTwo$1(renderTarget)||isWebGL2;// Setup framebuffer\nif(isCube){renderTargetProperties.__webglFramebuffer=[];for(let i=0;i<6;i++){renderTargetProperties.__webglFramebuffer[i]=_gl.createFramebuffer();}}else{renderTargetProperties.__webglFramebuffer=_gl.createFramebuffer();if(isMultipleRenderTargets){if(capabilities.drawBuffers){const textures=renderTarget.texture;for(let i=0,il=textures.length;i<il;i++){const attachmentProperties=properties.get(textures[i]);if(attachmentProperties.__webglTexture===undefined){attachmentProperties.__webglTexture=_gl.createTexture();info.memory.textures++;}}}else{console.warn('THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.');}}if(isWebGL2&&renderTarget.samples>0&&useMultisampledRTT(renderTarget)===false){const textures=isMultipleRenderTargets?texture:[texture];renderTargetProperties.__webglMultisampledFramebuffer=_gl.createFramebuffer();renderTargetProperties.__webglColorRenderbuffer=[];state.bindFramebuffer(36160,renderTargetProperties.__webglMultisampledFramebuffer);for(let i=0;i<textures.length;i++){const texture=textures[i];renderTargetProperties.__webglColorRenderbuffer[i]=_gl.createRenderbuffer();_gl.bindRenderbuffer(36161,renderTargetProperties.__webglColorRenderbuffer[i]);const glFormat=utils.convert(texture.format,texture.encoding);const glType=utils.convert(texture.type);const glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.encoding,renderTarget.isXRRenderTarget===true);const samples=getRenderTargetSamples(renderTarget);_gl.renderbufferStorageMultisample(36161,samples,glInternalFormat,renderTarget.width,renderTarget.height);_gl.framebufferRenderbuffer(36160,36064+i,36161,renderTargetProperties.__webglColorRenderbuffer[i]);}_gl.bindRenderbuffer(36161,null);if(renderTarget.depthBuffer){renderTargetProperties.__webglDepthRenderbuffer=_gl.createRenderbuffer();setupRenderBufferStorage(renderTargetProperties.__webglDepthRenderbuffer,renderTarget,true);}state.bindFramebuffer(36160,null);}}// Setup color buffer\nif(isCube){state.bindTexture(34067,textureProperties.__webglTexture);setTextureParameters(34067,texture,supportsMips);for(let i=0;i<6;i++){setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i],renderTarget,texture,36064,34069+i);}if(textureNeedsGenerateMipmaps(texture,supportsMips)){generateMipmap(34067);}state.unbindTexture();}else if(isMultipleRenderTargets){const textures=renderTarget.texture;for(let i=0,il=textures.length;i<il;i++){const attachment=textures[i];const attachmentProperties=properties.get(attachment);state.bindTexture(3553,attachmentProperties.__webglTexture);setTextureParameters(3553,attachment,supportsMips);setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer,renderTarget,attachment,36064+i,3553);if(textureNeedsGenerateMipmaps(attachment,supportsMips)){generateMipmap(3553);}}state.unbindTexture();}else{let glTextureType=3553;if(renderTarget.isWebGL3DRenderTarget||renderTarget.isWebGLArrayRenderTarget){if(isWebGL2){glTextureType=renderTarget.isWebGL3DRenderTarget?32879:35866;}else{console.error('THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.');}}state.bindTexture(glTextureType,textureProperties.__webglTexture);setTextureParameters(glTextureType,texture,supportsMips);setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer,renderTarget,texture,36064,glTextureType);if(textureNeedsGenerateMipmaps(texture,supportsMips)){generateMipmap(glTextureType);}state.unbindTexture();}// Setup depth and stencil buffers\nif(renderTarget.depthBuffer){setupDepthRenderbuffer(renderTarget);}}function updateRenderTargetMipmap(renderTarget){const supportsMips=isPowerOfTwo$1(renderTarget)||isWebGL2;const textures=renderTarget.isWebGLMultipleRenderTargets===true?renderTarget.texture:[renderTarget.texture];for(let i=0,il=textures.length;i<il;i++){const texture=textures[i];if(textureNeedsGenerateMipmaps(texture,supportsMips)){const target=renderTarget.isWebGLCubeRenderTarget?34067:3553;const webglTexture=properties.get(texture).__webglTexture;state.bindTexture(target,webglTexture);generateMipmap(target);state.unbindTexture();}}}function updateMultisampleRenderTarget(renderTarget){if(isWebGL2&&renderTarget.samples>0&&useMultisampledRTT(renderTarget)===false){const textures=renderTarget.isWebGLMultipleRenderTargets?renderTarget.texture:[renderTarget.texture];const width=renderTarget.width;const height=renderTarget.height;let mask=16384;const invalidationArray=[];const depthStyle=renderTarget.stencilBuffer?33306:36096;const renderTargetProperties=properties.get(renderTarget);const isMultipleRenderTargets=renderTarget.isWebGLMultipleRenderTargets===true;// If MRT we need to remove FBO attachments\nif(isMultipleRenderTargets){for(let i=0;i<textures.length;i++){state.bindFramebuffer(36160,renderTargetProperties.__webglMultisampledFramebuffer);_gl.framebufferRenderbuffer(36160,36064+i,36161,null);state.bindFramebuffer(36160,renderTargetProperties.__webglFramebuffer);_gl.framebufferTexture2D(36009,36064+i,3553,null,0);}}state.bindFramebuffer(36008,renderTargetProperties.__webglMultisampledFramebuffer);state.bindFramebuffer(36009,renderTargetProperties.__webglFramebuffer);for(let i=0;i<textures.length;i++){invalidationArray.push(36064+i);if(renderTarget.depthBuffer){invalidationArray.push(depthStyle);}const ignoreDepthValues=renderTargetProperties.__ignoreDepthValues!==undefined?renderTargetProperties.__ignoreDepthValues:false;if(ignoreDepthValues===false){if(renderTarget.depthBuffer)mask|=256;if(renderTarget.stencilBuffer)mask|=1024;}if(isMultipleRenderTargets){_gl.framebufferRenderbuffer(36008,36064,36161,renderTargetProperties.__webglColorRenderbuffer[i]);}if(ignoreDepthValues===true){_gl.invalidateFramebuffer(36008,[depthStyle]);_gl.invalidateFramebuffer(36009,[depthStyle]);}if(isMultipleRenderTargets){const webglTexture=properties.get(textures[i]).__webglTexture;_gl.framebufferTexture2D(36009,36064,3553,webglTexture,0);}_gl.blitFramebuffer(0,0,width,height,0,0,width,height,mask,9728);if(supportsInvalidateFramebuffer){_gl.invalidateFramebuffer(36008,invalidationArray);}}state.bindFramebuffer(36008,null);state.bindFramebuffer(36009,null);// If MRT since pre-blit we removed the FBO we need to reconstruct the attachments\nif(isMultipleRenderTargets){for(let i=0;i<textures.length;i++){state.bindFramebuffer(36160,renderTargetProperties.__webglMultisampledFramebuffer);_gl.framebufferRenderbuffer(36160,36064+i,36161,renderTargetProperties.__webglColorRenderbuffer[i]);const webglTexture=properties.get(textures[i]).__webglTexture;state.bindFramebuffer(36160,renderTargetProperties.__webglFramebuffer);_gl.framebufferTexture2D(36009,36064+i,3553,webglTexture,0);}}state.bindFramebuffer(36009,renderTargetProperties.__webglMultisampledFramebuffer);}}function getRenderTargetSamples(renderTarget){return Math.min(maxSamples,renderTarget.samples);}function useMultisampledRTT(renderTarget){const renderTargetProperties=properties.get(renderTarget);return isWebGL2&&renderTarget.samples>0&&extensions.has('WEBGL_multisampled_render_to_texture')===true&&renderTargetProperties.__useRenderToTexture!==false;}function updateVideoTexture(texture){const frame=info.render.frame;// Check the last frame we updated the VideoTexture\nif(_videoTextures.get(texture)!==frame){_videoTextures.set(texture,frame);texture.update();}}function verifyColorSpace(texture,image){const encoding=texture.encoding;const format=texture.format;const type=texture.type;if(texture.isCompressedTexture===true||texture.isVideoTexture===true||texture.format===_SRGBAFormat)return image;if(encoding!==LinearEncoding){// sRGB\nif(encoding===sRGBEncoding){if(isWebGL2===false){// in WebGL 1, try to use EXT_sRGB extension and unsized formats\nif(extensions.has('EXT_sRGB')===true&&format===RGBAFormat){texture.format=_SRGBAFormat;// it's not possible to generate mips in WebGL 1 with this extension\ntexture.minFilter=LinearFilter;texture.generateMipmaps=false;}else{// slow fallback (CPU decode)\nimage=ImageUtils.sRGBToLinear(image);}}else{// in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format\nif(format!==RGBAFormat||type!==UnsignedByteType){console.warn('THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.');}}}else{console.error('THREE.WebGLTextures: Unsupported texture encoding:',encoding);}}return image;}//\nthis.allocateTextureUnit=allocateTextureUnit;this.resetTextureUnits=resetTextureUnits;this.setTexture2D=setTexture2D;this.setTexture2DArray=setTexture2DArray;this.setTexture3D=setTexture3D;this.setTextureCube=setTextureCube;this.rebindTextures=rebindTextures;this.setupRenderTarget=setupRenderTarget;this.updateRenderTargetMipmap=updateRenderTargetMipmap;this.updateMultisampleRenderTarget=updateMultisampleRenderTarget;this.setupDepthRenderbuffer=setupDepthRenderbuffer;this.setupFrameBufferTexture=setupFrameBufferTexture;this.useMultisampledRTT=useMultisampledRTT;}function WebGLUtils(gl,extensions,capabilities){const isWebGL2=capabilities.isWebGL2;function convert(p,encoding=null){let extension;if(p===UnsignedByteType)return 5121;if(p===UnsignedShort4444Type)return 32819;if(p===UnsignedShort5551Type)return 32820;if(p===ByteType)return 5120;if(p===ShortType)return 5122;if(p===UnsignedShortType)return 5123;if(p===IntType)return 5124;if(p===UnsignedIntType)return 5125;if(p===FloatType)return 5126;if(p===HalfFloatType){if(isWebGL2)return 5131;extension=extensions.get('OES_texture_half_float');if(extension!==null){return extension.HALF_FLOAT_OES;}else{return null;}}if(p===AlphaFormat)return 6406;if(p===RGBAFormat)return 6408;if(p===LuminanceFormat)return 6409;if(p===LuminanceAlphaFormat)return 6410;if(p===DepthFormat)return 6402;if(p===DepthStencilFormat)return 34041;if(p===RedFormat)return 6403;// @deprecated since r137\nif(p===RGBFormat){console.warn('THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228');return 6408;}// WebGL 1 sRGB fallback\nif(p===_SRGBAFormat){extension=extensions.get('EXT_sRGB');if(extension!==null){return extension.SRGB_ALPHA_EXT;}else{return null;}}// WebGL2 formats.\nif(p===RedIntegerFormat)return 36244;if(p===RGFormat)return 33319;if(p===RGIntegerFormat)return 33320;if(p===RGBAIntegerFormat)return 36249;// S3TC\nif(p===RGB_S3TC_DXT1_Format||p===RGBA_S3TC_DXT1_Format||p===RGBA_S3TC_DXT3_Format||p===RGBA_S3TC_DXT5_Format){if(encoding===sRGBEncoding){extension=extensions.get('WEBGL_compressed_texture_s3tc_srgb');if(extension!==null){if(p===RGB_S3TC_DXT1_Format)return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(p===RGBA_S3TC_DXT1_Format)return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(p===RGBA_S3TC_DXT3_Format)return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(p===RGBA_S3TC_DXT5_Format)return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;}else{return null;}}else{extension=extensions.get('WEBGL_compressed_texture_s3tc');if(extension!==null){if(p===RGB_S3TC_DXT1_Format)return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;if(p===RGBA_S3TC_DXT1_Format)return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(p===RGBA_S3TC_DXT3_Format)return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(p===RGBA_S3TC_DXT5_Format)return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;}else{return null;}}}// PVRTC\nif(p===RGB_PVRTC_4BPPV1_Format||p===RGB_PVRTC_2BPPV1_Format||p===RGBA_PVRTC_4BPPV1_Format||p===RGBA_PVRTC_2BPPV1_Format){extension=extensions.get('WEBGL_compressed_texture_pvrtc');if(extension!==null){if(p===RGB_PVRTC_4BPPV1_Format)return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(p===RGB_PVRTC_2BPPV1_Format)return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(p===RGBA_PVRTC_4BPPV1_Format)return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(p===RGBA_PVRTC_2BPPV1_Format)return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;}else{return null;}}// ETC1\nif(p===RGB_ETC1_Format){extension=extensions.get('WEBGL_compressed_texture_etc1');if(extension!==null){return extension.COMPRESSED_RGB_ETC1_WEBGL;}else{return null;}}// ETC2\nif(p===RGB_ETC2_Format||p===RGBA_ETC2_EAC_Format){extension=extensions.get('WEBGL_compressed_texture_etc');if(extension!==null){if(p===RGB_ETC2_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ETC2:extension.COMPRESSED_RGB8_ETC2;if(p===RGBA_ETC2_EAC_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:extension.COMPRESSED_RGBA8_ETC2_EAC;}else{return null;}}// ASTC\nif(p===RGBA_ASTC_4x4_Format||p===RGBA_ASTC_5x4_Format||p===RGBA_ASTC_5x5_Format||p===RGBA_ASTC_6x5_Format||p===RGBA_ASTC_6x6_Format||p===RGBA_ASTC_8x5_Format||p===RGBA_ASTC_8x6_Format||p===RGBA_ASTC_8x8_Format||p===RGBA_ASTC_10x5_Format||p===RGBA_ASTC_10x6_Format||p===RGBA_ASTC_10x8_Format||p===RGBA_ASTC_10x10_Format||p===RGBA_ASTC_12x10_Format||p===RGBA_ASTC_12x12_Format){extension=extensions.get('WEBGL_compressed_texture_astc');if(extension!==null){if(p===RGBA_ASTC_4x4_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:extension.COMPRESSED_RGBA_ASTC_4x4_KHR;if(p===RGBA_ASTC_5x4_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:extension.COMPRESSED_RGBA_ASTC_5x4_KHR;if(p===RGBA_ASTC_5x5_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:extension.COMPRESSED_RGBA_ASTC_5x5_KHR;if(p===RGBA_ASTC_6x5_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:extension.COMPRESSED_RGBA_ASTC_6x5_KHR;if(p===RGBA_ASTC_6x6_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:extension.COMPRESSED_RGBA_ASTC_6x6_KHR;if(p===RGBA_ASTC_8x5_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:extension.COMPRESSED_RGBA_ASTC_8x5_KHR;if(p===RGBA_ASTC_8x6_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:extension.COMPRESSED_RGBA_ASTC_8x6_KHR;if(p===RGBA_ASTC_8x8_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:extension.COMPRESSED_RGBA_ASTC_8x8_KHR;if(p===RGBA_ASTC_10x5_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:extension.COMPRESSED_RGBA_ASTC_10x5_KHR;if(p===RGBA_ASTC_10x6_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:extension.COMPRESSED_RGBA_ASTC_10x6_KHR;if(p===RGBA_ASTC_10x8_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:extension.COMPRESSED_RGBA_ASTC_10x8_KHR;if(p===RGBA_ASTC_10x10_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:extension.COMPRESSED_RGBA_ASTC_10x10_KHR;if(p===RGBA_ASTC_12x10_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:extension.COMPRESSED_RGBA_ASTC_12x10_KHR;if(p===RGBA_ASTC_12x12_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:extension.COMPRESSED_RGBA_ASTC_12x12_KHR;}else{return null;}}// BPTC\nif(p===RGBA_BPTC_Format){extension=extensions.get('EXT_texture_compression_bptc');if(extension!==null){if(p===RGBA_BPTC_Format)return encoding===sRGBEncoding?extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;}else{return null;}}//\nif(p===UnsignedInt248Type){if(isWebGL2)return 34042;extension=extensions.get('WEBGL_depth_texture');if(extension!==null){return extension.UNSIGNED_INT_24_8_WEBGL;}else{return null;}}// if \"p\" can't be resolved, assume the user defines a WebGL constant as a string (fallback/workaround for packed RGB formats)\nreturn gl[p]!==undefined?gl[p]:null;}return{convert:convert};}class ArrayCamera extends PerspectiveCamera{constructor(array=[]){super();this.isArrayCamera=true;this.cameras=array;}}class Group extends Object3D{constructor(){super();this.isGroup=true;this.type='Group';}}const _moveEvent={type:'move'};class WebXRController{constructor(){this._targetRay=null;this._grip=null;this._hand=null;}getHandSpace(){if(this._hand===null){this._hand=new Group();this._hand.matrixAutoUpdate=false;this._hand.visible=false;this._hand.joints={};this._hand.inputState={pinching:false};}return this._hand;}getTargetRaySpace(){if(this._targetRay===null){this._targetRay=new Group();this._targetRay.matrixAutoUpdate=false;this._targetRay.visible=false;this._targetRay.hasLinearVelocity=false;this._targetRay.linearVelocity=new three_module_Vector3();this._targetRay.hasAngularVelocity=false;this._targetRay.angularVelocity=new three_module_Vector3();}return this._targetRay;}getGripSpace(){if(this._grip===null){this._grip=new Group();this._grip.matrixAutoUpdate=false;this._grip.visible=false;this._grip.hasLinearVelocity=false;this._grip.linearVelocity=new three_module_Vector3();this._grip.hasAngularVelocity=false;this._grip.angularVelocity=new three_module_Vector3();}return this._grip;}dispatchEvent(event){if(this._targetRay!==null){this._targetRay.dispatchEvent(event);}if(this._grip!==null){this._grip.dispatchEvent(event);}if(this._hand!==null){this._hand.dispatchEvent(event);}return this;}disconnect(inputSource){this.dispatchEvent({type:'disconnected',data:inputSource});if(this._targetRay!==null){this._targetRay.visible=false;}if(this._grip!==null){this._grip.visible=false;}if(this._hand!==null){this._hand.visible=false;}return this;}update(inputSource,frame,referenceSpace){let inputPose=null;let gripPose=null;let handPose=null;const targetRay=this._targetRay;const grip=this._grip;const hand=this._hand;if(inputSource&&frame.session.visibilityState!=='visible-blurred'){if(hand&&inputSource.hand){handPose=true;for(const inputjoint of instance_values(_context24=inputSource.hand).call(_context24)){var _context24;// Update the joints groups with the XRJoint poses\nconst jointPose=frame.getJointPose(inputjoint,referenceSpace);if(hand.joints[inputjoint.jointName]===undefined){// The transform of this joint will be updated with the joint pose on each frame\nconst joint=new Group();joint.matrixAutoUpdate=false;joint.visible=false;hand.joints[inputjoint.jointName]=joint;// ??\nhand.add(joint);}const joint=hand.joints[inputjoint.jointName];if(jointPose!==null){joint.matrix.fromArray(jointPose.transform.matrix);joint.matrix.decompose(joint.position,joint.rotation,joint.scale);joint.jointRadius=jointPose.radius;}joint.visible=jointPose!==null;}// Custom events\n// Check pinchz\nconst indexTip=hand.joints['index-finger-tip'];const thumbTip=hand.joints['thumb-tip'];const distance=indexTip.position.distanceTo(thumbTip.position);const distanceToPinch=0.02;const threshold=0.005;if(hand.inputState.pinching&&distance>distanceToPinch+threshold){hand.inputState.pinching=false;this.dispatchEvent({type:'pinchend',handedness:inputSource.handedness,target:this});}else if(!hand.inputState.pinching&&distance<=distanceToPinch-threshold){hand.inputState.pinching=true;this.dispatchEvent({type:'pinchstart',handedness:inputSource.handedness,target:this});}}else{if(grip!==null&&inputSource.gripSpace){gripPose=frame.getPose(inputSource.gripSpace,referenceSpace);if(gripPose!==null){grip.matrix.fromArray(gripPose.transform.matrix);grip.matrix.decompose(grip.position,grip.rotation,grip.scale);if(gripPose.linearVelocity){grip.hasLinearVelocity=true;grip.linearVelocity.copy(gripPose.linearVelocity);}else{grip.hasLinearVelocity=false;}if(gripPose.angularVelocity){grip.hasAngularVelocity=true;grip.angularVelocity.copy(gripPose.angularVelocity);}else{grip.hasAngularVelocity=false;}}}}if(targetRay!==null){inputPose=frame.getPose(inputSource.targetRaySpace,referenceSpace);// Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it\nif(inputPose===null&&gripPose!==null){inputPose=gripPose;}if(inputPose!==null){targetRay.matrix.fromArray(inputPose.transform.matrix);targetRay.matrix.decompose(targetRay.position,targetRay.rotation,targetRay.scale);if(inputPose.linearVelocity){targetRay.hasLinearVelocity=true;targetRay.linearVelocity.copy(inputPose.linearVelocity);}else{targetRay.hasLinearVelocity=false;}if(inputPose.angularVelocity){targetRay.hasAngularVelocity=true;targetRay.angularVelocity.copy(inputPose.angularVelocity);}else{targetRay.hasAngularVelocity=false;}this.dispatchEvent(_moveEvent);}}}if(targetRay!==null){targetRay.visible=inputPose!==null;}if(grip!==null){grip.visible=gripPose!==null;}if(hand!==null){hand.visible=handPose!==null;}return this;}}class DepthTexture extends Texture{constructor(width,height,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,format){format=format!==undefined?format:DepthFormat;if(format!==DepthFormat&&format!==DepthStencilFormat){throw new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');}if(type===undefined&&format===DepthFormat)type=UnsignedIntType;if(type===undefined&&format===DepthStencilFormat)type=UnsignedInt248Type;super(null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy);this.isDepthTexture=true;this.image={width:width,height:height};this.magFilter=magFilter!==undefined?magFilter:NearestFilter;this.minFilter=minFilter!==undefined?minFilter:NearestFilter;this.flipY=false;this.generateMipmaps=false;}}class WebXRManager extends EventDispatcher{constructor(renderer,gl){super();const scope=this;let session=null;let framebufferScaleFactor=1.0;let referenceSpace=null;let referenceSpaceType='local-floor';let customReferenceSpace=null;let pose=null;let glBinding=null;let glProjLayer=null;let glBaseLayer=null;let xrFrame=null;const attributes=gl.getContextAttributes();let initialRenderTarget=null;let newRenderTarget=null;const controllers=[];const controllerInputSources=[];//\nconst cameraL=new PerspectiveCamera();cameraL.layers.enable(1);cameraL.viewport=new Vector4();const cameraR=new PerspectiveCamera();cameraR.layers.enable(2);cameraR.viewport=new Vector4();const cameras=[cameraL,cameraR];const cameraVR=new ArrayCamera();cameraVR.layers.enable(1);cameraVR.layers.enable(2);let _currentDepthNear=null;let _currentDepthFar=null;//\nthis.cameraAutoUpdate=true;this.enabled=false;this.isPresenting=false;this.getController=function(index){let controller=controllers[index];if(controller===undefined){controller=new WebXRController();controllers[index]=controller;}return controller.getTargetRaySpace();};this.getControllerGrip=function(index){let controller=controllers[index];if(controller===undefined){controller=new WebXRController();controllers[index]=controller;}return controller.getGripSpace();};this.getHand=function(index){let controller=controllers[index];if(controller===undefined){controller=new WebXRController();controllers[index]=controller;}return controller.getHandSpace();};//\nfunction onSessionEvent(event){const controllerIndex=index_of(controllerInputSources).call(controllerInputSources,event.inputSource);if(controllerIndex===-1){return;}const controller=controllers[controllerIndex];if(controller!==undefined){controller.dispatchEvent({type:event.type,data:event.inputSource});}}function onSessionEnd(){session.removeEventListener('select',onSessionEvent);session.removeEventListener('selectstart',onSessionEvent);session.removeEventListener('selectend',onSessionEvent);session.removeEventListener('squeeze',onSessionEvent);session.removeEventListener('squeezestart',onSessionEvent);session.removeEventListener('squeezeend',onSessionEvent);session.removeEventListener('end',onSessionEnd);session.removeEventListener('inputsourceschange',onInputSourcesChange);for(let i=0;i<controllers.length;i++){const inputSource=controllerInputSources[i];if(inputSource===null)continue;controllerInputSources[i]=null;controllers[i].disconnect(inputSource);}_currentDepthNear=null;_currentDepthFar=null;// restore framebuffer/rendering state\nrenderer.setRenderTarget(initialRenderTarget);glBaseLayer=null;glProjLayer=null;glBinding=null;session=null;newRenderTarget=null;//\nanimation.stop();scope.isPresenting=false;scope.dispatchEvent({type:'sessionend'});}this.setFramebufferScaleFactor=function(value){framebufferScaleFactor=value;if(scope.isPresenting===true){console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');}};this.setReferenceSpaceType=function(value){referenceSpaceType=value;if(scope.isPresenting===true){console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');}};this.getReferenceSpace=function(){return customReferenceSpace||referenceSpace;};this.setReferenceSpace=function(space){customReferenceSpace=space;};this.getBaseLayer=function(){return glProjLayer!==null?glProjLayer:glBaseLayer;};this.getBinding=function(){return glBinding;};this.getFrame=function(){return xrFrame;};this.getSession=function(){return session;};this.setSession=function(value){try{const _this2=this;session=value;const _temp3=function(){if(session!==null){function _temp2(){if(session.renderState.layers===undefined||renderer.capabilities.isWebGL2===false){const layerInit={antialias:session.renderState.layers===undefined?attributes.antialias:true,alpha:attributes.alpha,depth:attributes.depth,stencil:attributes.stencil,framebufferScaleFactor:framebufferScaleFactor};glBaseLayer=new XRWebGLLayer(session,gl,layerInit);session.updateRenderState({baseLayer:glBaseLayer});newRenderTarget=new WebGLRenderTarget(glBaseLayer.framebufferWidth,glBaseLayer.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,encoding:renderer.outputEncoding,stencilBuffer:attributes.stencil});}else{let depthFormat=null;let depthType=null;let glDepthFormat=null;if(attributes.depth){glDepthFormat=attributes.stencil?35056:33190;depthFormat=attributes.stencil?DepthStencilFormat:DepthFormat;depthType=attributes.stencil?UnsignedInt248Type:UnsignedIntType;}const projectionlayerInit={colorFormat:32856,depthFormat:glDepthFormat,scaleFactor:framebufferScaleFactor};glBinding=new XRWebGLBinding(session,gl);glProjLayer=glBinding.createProjectionLayer(projectionlayerInit);session.updateRenderState({layers:[glProjLayer]});newRenderTarget=new WebGLRenderTarget(glProjLayer.textureWidth,glProjLayer.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(glProjLayer.textureWidth,glProjLayer.textureHeight,depthType,undefined,undefined,undefined,undefined,undefined,undefined,depthFormat),stencilBuffer:attributes.stencil,encoding:renderer.outputEncoding,samples:attributes.antialias?4:0});const renderTargetProperties=renderer.properties.get(newRenderTarget);renderTargetProperties.__ignoreDepthValues=glProjLayer.ignoreDepthValues;}newRenderTarget.isXRRenderTarget=true;// TODO Remove this when possible, see #23278\n// Set foveation to maximum.\n_this2.setFoveation(1.0);customReferenceSpace=null;return promise.resolve(session.requestReferenceSpace(referenceSpaceType)).then(function(_session$requestRefer){referenceSpace=_session$requestRefer;animation.setContext(session);animation.start();scope.isPresenting=true;scope.dispatchEvent({type:'sessionstart'});});}initialRenderTarget=renderer.getRenderTarget();session.addEventListener('select',onSessionEvent);session.addEventListener('selectstart',onSessionEvent);session.addEventListener('selectend',onSessionEvent);session.addEventListener('squeeze',onSessionEvent);session.addEventListener('squeezestart',onSessionEvent);session.addEventListener('squeezeend',onSessionEvent);session.addEventListener('end',onSessionEnd);session.addEventListener('inputsourceschange',onInputSourcesChange);const _temp=function(){if(attributes.xrCompatible!==true){return promise.resolve(gl.makeXRCompatible()).then(function(){});}}();return _temp&&_temp.then?_temp.then(_temp2):_temp2(_temp);}}();return promise.resolve(_temp3&&_temp3.then?_temp3.then(function(){}):void 0);}catch(e){return promise.reject(e);}};function onInputSourcesChange(event){// Notify disconnected\nfor(let i=0;i<event.removed.length;i++){const inputSource=event.removed[i];const index=index_of(controllerInputSources).call(controllerInputSources,inputSource);if(index>=0){controllerInputSources[index]=null;controllers[index].dispatchEvent({type:'disconnected',data:inputSource});}}// Notify connected\nfor(let i=0;i<event.added.length;i++){const inputSource=event.added[i];let controllerIndex=index_of(controllerInputSources).call(controllerInputSources,inputSource);if(controllerIndex===-1){// Assign input source a controller that currently has no input source\nfor(let i=0;i<controllers.length;i++){if(i>=controllerInputSources.length){controllerInputSources.push(inputSource);controllerIndex=i;break;}else if(controllerInputSources[i]===null){controllerInputSources[i]=inputSource;controllerIndex=i;break;}}// If all controllers do currently receive input we ignore new ones\nif(controllerIndex===-1)break;}const controller=controllers[controllerIndex];if(controller){controller.dispatchEvent({type:'connected',data:inputSource});}}}//\nconst cameraLPos=new three_module_Vector3();const cameraRPos=new three_module_Vector3();/**\n\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t * the cameras' projection and world matrices have already been set.\n\t\t * And that near and far planes are identical for both cameras.\n\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t */function setProjectionFromUnion(camera,cameraL,cameraR){cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);const ipd=cameraLPos.distanceTo(cameraRPos);const projL=cameraL.projectionMatrix.elements;const projR=cameraR.projectionMatrix.elements;// VR systems will have identical far and near planes, and\n// most likely identical top and bottom frustum extents.\n// Use the left camera for these values.\nconst near=projL[14]/(projL[10]-1);const far=projL[14]/(projL[10]+1);const topFov=(projL[9]+1)/projL[5];const bottomFov=(projL[9]-1)/projL[5];const leftFov=(projL[8]-1)/projL[0];const rightFov=(projR[8]+1)/projR[0];const left=near*leftFov;const right=near*rightFov;// Calculate the new camera's position offset from the\n// left camera. xOffset should be roughly half `ipd`.\nconst zOffset=ipd/(-leftFov+rightFov);const xOffset=zOffset*-leftFov;// TODO: Better way to apply this offset?\ncameraL.matrixWorld.decompose(camera.position,camera.quaternion,camera.scale);camera.translateX(xOffset);camera.translateZ(zOffset);camera.matrixWorld.compose(camera.position,camera.quaternion,camera.scale);camera.matrixWorldInverse.copy(camera.matrixWorld).invert();// Find the union of the frustum values of the cameras and scale\n// the values so that the near plane's position does not change in world space,\n// although must now be relative to the new union camera.\nconst near2=near+zOffset;const far2=far+zOffset;const left2=left-xOffset;const right2=right+(ipd-xOffset);const top2=topFov*far/far2*near2;const bottom2=bottomFov*far/far2*near2;camera.projectionMatrix.makePerspective(left2,right2,top2,bottom2,near2,far2);}function updateCamera(camera,parent){if(parent===null){camera.matrixWorld.copy(camera.matrix);}else{camera.matrixWorld.multiplyMatrices(parent.matrixWorld,camera.matrix);}camera.matrixWorldInverse.copy(camera.matrixWorld).invert();}this.updateCamera=function(camera){if(session===null)return;cameraVR.near=cameraR.near=cameraL.near=camera.near;cameraVR.far=cameraR.far=cameraL.far=camera.far;if(_currentDepthNear!==cameraVR.near||_currentDepthFar!==cameraVR.far){// Note that the new renderState won't apply until the next frame. See #18320\nsession.updateRenderState({depthNear:cameraVR.near,depthFar:cameraVR.far});_currentDepthNear=cameraVR.near;_currentDepthFar=cameraVR.far;}const parent=camera.parent;const cameras=cameraVR.cameras;updateCamera(cameraVR,parent);for(let i=0;i<cameras.length;i++){updateCamera(cameras[i],parent);}cameraVR.matrixWorld.decompose(cameraVR.position,cameraVR.quaternion,cameraVR.scale);// update user camera and its children\ncamera.matrix.copy(cameraVR.matrix);camera.matrix.decompose(camera.position,camera.quaternion,camera.scale);const children=camera.children;for(let i=0,l=children.length;i<l;i++){children[i].updateMatrixWorld(true);}// update projection matrix for proper view frustum culling\nif(cameras.length===2){setProjectionFromUnion(cameraVR,cameraL,cameraR);}else{// assume single camera setup (AR)\ncameraVR.projectionMatrix.copy(cameraL.projectionMatrix);}};this.getCamera=function(){return cameraVR;};this.getFoveation=function(){if(glProjLayer!==null){return glProjLayer.fixedFoveation;}if(glBaseLayer!==null){return glBaseLayer.fixedFoveation;}return undefined;};this.setFoveation=function(foveation){// 0 = no foveation = full resolution\n// 1 = maximum foveation = the edges render at lower resolution\nif(glProjLayer!==null){glProjLayer.fixedFoveation=foveation;}if(glBaseLayer!==null&&glBaseLayer.fixedFoveation!==undefined){glBaseLayer.fixedFoveation=foveation;}};// Animation Loop\nlet onAnimationFrameCallback=null;function onAnimationFrame(time,frame){pose=frame.getViewerPose(customReferenceSpace||referenceSpace);xrFrame=frame;if(pose!==null){const views=pose.views;if(glBaseLayer!==null){renderer.setRenderTargetFramebuffer(newRenderTarget,glBaseLayer.framebuffer);renderer.setRenderTarget(newRenderTarget);}let cameraVRNeedsUpdate=false;// check if it's necessary to rebuild cameraVR's camera list\nif(views.length!==cameraVR.cameras.length){cameraVR.cameras.length=0;cameraVRNeedsUpdate=true;}for(let i=0;i<views.length;i++){const view=views[i];let viewport=null;if(glBaseLayer!==null){viewport=glBaseLayer.getViewport(view);}else{const glSubImage=glBinding.getViewSubImage(glProjLayer,view);viewport=glSubImage.viewport;// For side-by-side projection, we only produce a single texture for both eyes.\nif(i===0){renderer.setRenderTargetTextures(newRenderTarget,glSubImage.colorTexture,glProjLayer.ignoreDepthValues?undefined:glSubImage.depthStencilTexture);renderer.setRenderTarget(newRenderTarget);}}let camera=cameras[i];if(camera===undefined){camera=new PerspectiveCamera();camera.layers.enable(i);camera.viewport=new Vector4();cameras[i]=camera;}camera.matrix.fromArray(view.transform.matrix);camera.projectionMatrix.fromArray(view.projectionMatrix);camera.viewport.set(viewport.x,viewport.y,viewport.width,viewport.height);if(i===0){cameraVR.matrix.copy(camera.matrix);}if(cameraVRNeedsUpdate===true){cameraVR.cameras.push(camera);}}}//\nfor(let i=0;i<controllers.length;i++){const inputSource=controllerInputSources[i];const controller=controllers[i];if(inputSource!==null&&controller!==undefined){controller.update(inputSource,frame,customReferenceSpace||referenceSpace);}}if(onAnimationFrameCallback)onAnimationFrameCallback(time,frame);xrFrame=null;}const animation=new WebGLAnimation();animation.setAnimationLoop(onAnimationFrame);this.setAnimationLoop=function(callback){onAnimationFrameCallback=callback;};this.dispose=function(){};}}function WebGLMaterials(renderer,properties){function refreshFogUniforms(uniforms,fog){uniforms.fogColor.value.copy(fog.color);if(fog.isFog){uniforms.fogNear.value=fog.near;uniforms.fogFar.value=fog.far;}else if(fog.isFogExp2){uniforms.fogDensity.value=fog.density;}}function refreshMaterialUniforms(uniforms,material,pixelRatio,height,transmissionRenderTarget){if(material.isMeshBasicMaterial){refreshUniformsCommon(uniforms,material);}else if(material.isMeshLambertMaterial){refreshUniformsCommon(uniforms,material);}else if(material.isMeshToonMaterial){refreshUniformsCommon(uniforms,material);refreshUniformsToon(uniforms,material);}else if(material.isMeshPhongMaterial){refreshUniformsCommon(uniforms,material);refreshUniformsPhong(uniforms,material);}else if(material.isMeshStandardMaterial){refreshUniformsCommon(uniforms,material);refreshUniformsStandard(uniforms,material);if(material.isMeshPhysicalMaterial){refreshUniformsPhysical(uniforms,material,transmissionRenderTarget);}}else if(material.isMeshMatcapMaterial){refreshUniformsCommon(uniforms,material);refreshUniformsMatcap(uniforms,material);}else if(material.isMeshDepthMaterial){refreshUniformsCommon(uniforms,material);}else if(material.isMeshDistanceMaterial){refreshUniformsCommon(uniforms,material);refreshUniformsDistance(uniforms,material);}else if(material.isMeshNormalMaterial){refreshUniformsCommon(uniforms,material);}else if(material.isLineBasicMaterial){refreshUniformsLine(uniforms,material);if(material.isLineDashedMaterial){refreshUniformsDash(uniforms,material);}}else if(material.isPointsMaterial){refreshUniformsPoints(uniforms,material,pixelRatio,height);}else if(material.isSpriteMaterial){refreshUniformsSprites(uniforms,material);}else if(material.isShadowMaterial){uniforms.color.value.copy(material.color);uniforms.opacity.value=material.opacity;}else if(material.isShaderMaterial){material.uniformsNeedUpdate=false;// #15581\n}}function refreshUniformsCommon(uniforms,material){uniforms.opacity.value=material.opacity;if(material.color){uniforms.diffuse.value.copy(material.color);}if(material.emissive){uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity);}if(instance_map(material)){instance_map(uniforms).value=instance_map(material);}if(material.alphaMap){uniforms.alphaMap.value=material.alphaMap;}if(material.bumpMap){uniforms.bumpMap.value=material.bumpMap;uniforms.bumpScale.value=material.bumpScale;if(material.side===BackSide)uniforms.bumpScale.value*=-1;}if(material.displacementMap){uniforms.displacementMap.value=material.displacementMap;uniforms.displacementScale.value=material.displacementScale;uniforms.displacementBias.value=material.displacementBias;}if(material.emissiveMap){uniforms.emissiveMap.value=material.emissiveMap;}if(material.normalMap){uniforms.normalMap.value=material.normalMap;uniforms.normalScale.value.copy(material.normalScale);if(material.side===BackSide)uniforms.normalScale.value.negate();}if(material.specularMap){uniforms.specularMap.value=material.specularMap;}if(material.alphaTest>0){uniforms.alphaTest.value=material.alphaTest;}const envMap=properties.get(material).envMap;if(envMap){uniforms.envMap.value=envMap;uniforms.flipEnvMap.value=envMap.isCubeTexture&&envMap.isRenderTargetTexture===false?-1:1;uniforms.reflectivity.value=material.reflectivity;uniforms.ior.value=material.ior;uniforms.refractionRatio.value=material.refractionRatio;}if(material.lightMap){uniforms.lightMap.value=material.lightMap;// artist-friendly light intensity scaling factor\nconst scaleFactor=renderer.physicallyCorrectLights!==true?Math.PI:1;uniforms.lightMapIntensity.value=material.lightMapIntensity*scaleFactor;}if(material.aoMap){uniforms.aoMap.value=material.aoMap;uniforms.aoMapIntensity.value=material.aoMapIntensity;}// uv repeat and offset setting priorities\n// 1. color map\n// 2. specular map\n// 3. displacementMap map\n// 4. normal map\n// 5. bump map\n// 6. roughnessMap map\n// 7. metalnessMap map\n// 8. alphaMap map\n// 9. emissiveMap map\n// 10. clearcoat map\n// 11. clearcoat normal map\n// 12. clearcoat roughnessMap map\n// 13. iridescence map\n// 14. iridescence thickness map\n// 15. specular intensity map\n// 16. specular tint map\n// 17. transmission map\n// 18. thickness map\nlet uvScaleMap;if(instance_map(material)){uvScaleMap=instance_map(material);}else if(material.specularMap){uvScaleMap=material.specularMap;}else if(material.displacementMap){uvScaleMap=material.displacementMap;}else if(material.normalMap){uvScaleMap=material.normalMap;}else if(material.bumpMap){uvScaleMap=material.bumpMap;}else if(material.roughnessMap){uvScaleMap=material.roughnessMap;}else if(material.metalnessMap){uvScaleMap=material.metalnessMap;}else if(material.alphaMap){uvScaleMap=material.alphaMap;}else if(material.emissiveMap){uvScaleMap=material.emissiveMap;}else if(material.clearcoatMap){uvScaleMap=material.clearcoatMap;}else if(material.clearcoatNormalMap){uvScaleMap=material.clearcoatNormalMap;}else if(material.clearcoatRoughnessMap){uvScaleMap=material.clearcoatRoughnessMap;}else if(material.iridescenceMap){uvScaleMap=material.iridescenceMap;}else if(material.iridescenceThicknessMap){uvScaleMap=material.iridescenceThicknessMap;}else if(material.specularIntensityMap){uvScaleMap=material.specularIntensityMap;}else if(material.specularColorMap){uvScaleMap=material.specularColorMap;}else if(material.transmissionMap){uvScaleMap=material.transmissionMap;}else if(material.thicknessMap){uvScaleMap=material.thicknessMap;}else if(material.sheenColorMap){uvScaleMap=material.sheenColorMap;}else if(material.sheenRoughnessMap){uvScaleMap=material.sheenRoughnessMap;}if(uvScaleMap!==undefined){// backwards compatibility\nif(uvScaleMap.isWebGLRenderTarget){uvScaleMap=uvScaleMap.texture;}if(uvScaleMap.matrixAutoUpdate===true){uvScaleMap.updateMatrix();}uniforms.uvTransform.value.copy(uvScaleMap.matrix);}// uv repeat and offset setting priorities for uv2\n// 1. ao map\n// 2. light map\nlet uv2ScaleMap;if(material.aoMap){uv2ScaleMap=material.aoMap;}else if(material.lightMap){uv2ScaleMap=material.lightMap;}if(uv2ScaleMap!==undefined){// backwards compatibility\nif(uv2ScaleMap.isWebGLRenderTarget){uv2ScaleMap=uv2ScaleMap.texture;}if(uv2ScaleMap.matrixAutoUpdate===true){uv2ScaleMap.updateMatrix();}uniforms.uv2Transform.value.copy(uv2ScaleMap.matrix);}}function refreshUniformsLine(uniforms,material){uniforms.diffuse.value.copy(material.color);uniforms.opacity.value=material.opacity;}function refreshUniformsDash(uniforms,material){uniforms.dashSize.value=material.dashSize;uniforms.totalSize.value=material.dashSize+material.gapSize;uniforms.scale.value=material.scale;}function refreshUniformsPoints(uniforms,material,pixelRatio,height){uniforms.diffuse.value.copy(material.color);uniforms.opacity.value=material.opacity;uniforms.size.value=material.size*pixelRatio;uniforms.scale.value=height*0.5;if(instance_map(material)){instance_map(uniforms).value=instance_map(material);}if(material.alphaMap){uniforms.alphaMap.value=material.alphaMap;}if(material.alphaTest>0){uniforms.alphaTest.value=material.alphaTest;}// uv repeat and offset setting priorities\n// 1. color map\n// 2. alpha map\nlet uvScaleMap;if(instance_map(material)){uvScaleMap=instance_map(material);}else if(material.alphaMap){uvScaleMap=material.alphaMap;}if(uvScaleMap!==undefined){if(uvScaleMap.matrixAutoUpdate===true){uvScaleMap.updateMatrix();}uniforms.uvTransform.value.copy(uvScaleMap.matrix);}}function refreshUniformsSprites(uniforms,material){uniforms.diffuse.value.copy(material.color);uniforms.opacity.value=material.opacity;uniforms.rotation.value=material.rotation;if(instance_map(material)){instance_map(uniforms).value=instance_map(material);}if(material.alphaMap){uniforms.alphaMap.value=material.alphaMap;}if(material.alphaTest>0){uniforms.alphaTest.value=material.alphaTest;}// uv repeat and offset setting priorities\n// 1. color map\n// 2. alpha map\nlet uvScaleMap;if(instance_map(material)){uvScaleMap=instance_map(material);}else if(material.alphaMap){uvScaleMap=material.alphaMap;}if(uvScaleMap!==undefined){if(uvScaleMap.matrixAutoUpdate===true){uvScaleMap.updateMatrix();}uniforms.uvTransform.value.copy(uvScaleMap.matrix);}}function refreshUniformsPhong(uniforms,material){uniforms.specular.value.copy(material.specular);uniforms.shininess.value=Math.max(material.shininess,1e-4);// to prevent pow( 0.0, 0.0 )\n}function refreshUniformsToon(uniforms,material){if(material.gradientMap){uniforms.gradientMap.value=material.gradientMap;}}function refreshUniformsStandard(uniforms,material){uniforms.roughness.value=material.roughness;uniforms.metalness.value=material.metalness;if(material.roughnessMap){uniforms.roughnessMap.value=material.roughnessMap;}if(material.metalnessMap){uniforms.metalnessMap.value=material.metalnessMap;}const envMap=properties.get(material).envMap;if(envMap){//uniforms.envMap.value = material.envMap; // part of uniforms common\nuniforms.envMapIntensity.value=material.envMapIntensity;}}function refreshUniformsPhysical(uniforms,material,transmissionRenderTarget){uniforms.ior.value=material.ior;// also part of uniforms common\nif(material.sheen>0){uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen);uniforms.sheenRoughness.value=material.sheenRoughness;if(material.sheenColorMap){uniforms.sheenColorMap.value=material.sheenColorMap;}if(material.sheenRoughnessMap){uniforms.sheenRoughnessMap.value=material.sheenRoughnessMap;}}if(material.clearcoat>0){uniforms.clearcoat.value=material.clearcoat;uniforms.clearcoatRoughness.value=material.clearcoatRoughness;if(material.clearcoatMap){uniforms.clearcoatMap.value=material.clearcoatMap;}if(material.clearcoatRoughnessMap){uniforms.clearcoatRoughnessMap.value=material.clearcoatRoughnessMap;}if(material.clearcoatNormalMap){uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale);uniforms.clearcoatNormalMap.value=material.clearcoatNormalMap;if(material.side===BackSide){uniforms.clearcoatNormalScale.value.negate();}}}if(material.iridescence>0){uniforms.iridescence.value=material.iridescence;uniforms.iridescenceIOR.value=material.iridescenceIOR;uniforms.iridescenceThicknessMinimum.value=material.iridescenceThicknessRange[0];uniforms.iridescenceThicknessMaximum.value=material.iridescenceThicknessRange[1];if(material.iridescenceMap){uniforms.iridescenceMap.value=material.iridescenceMap;}if(material.iridescenceThicknessMap){uniforms.iridescenceThicknessMap.value=material.iridescenceThicknessMap;}}if(material.transmission>0){uniforms.transmission.value=material.transmission;uniforms.transmissionSamplerMap.value=transmissionRenderTarget.texture;uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width,transmissionRenderTarget.height);if(material.transmissionMap){uniforms.transmissionMap.value=material.transmissionMap;}uniforms.thickness.value=material.thickness;if(material.thicknessMap){uniforms.thicknessMap.value=material.thicknessMap;}uniforms.attenuationDistance.value=material.attenuationDistance;uniforms.attenuationColor.value.copy(material.attenuationColor);}uniforms.specularIntensity.value=material.specularIntensity;uniforms.specularColor.value.copy(material.specularColor);if(material.specularIntensityMap){uniforms.specularIntensityMap.value=material.specularIntensityMap;}if(material.specularColorMap){uniforms.specularColorMap.value=material.specularColorMap;}}function refreshUniformsMatcap(uniforms,material){if(material.matcap){uniforms.matcap.value=material.matcap;}}function refreshUniformsDistance(uniforms,material){uniforms.referencePosition.value.copy(material.referencePosition);uniforms.nearDistance.value=material.nearDistance;uniforms.farDistance.value=material.farDistance;}return{refreshFogUniforms:refreshFogUniforms,refreshMaterialUniforms:refreshMaterialUniforms};}function WebGLUniformsGroups(gl,info,capabilities,state){let buffers={};let updateList={};let allocatedBindingPoints=[];const maxBindingPoints=capabilities.isWebGL2?gl.getParameter(35375):0;// binding points are global whereas block indices are per shader program\nfunction bind(uniformsGroup,program){const webglProgram=program.program;state.uniformBlockBinding(uniformsGroup,webglProgram);}function update(uniformsGroup,program){let buffer=buffers[uniformsGroup.id];if(buffer===undefined){prepareUniformsGroup(uniformsGroup);buffer=createBuffer(uniformsGroup);buffers[uniformsGroup.id]=buffer;uniformsGroup.addEventListener('dispose',onUniformsGroupsDispose);}// ensure to update the binding points/block indices mapping for this program\nconst webglProgram=program.program;state.updateUBOMapping(uniformsGroup,webglProgram);// update UBO once per frame\nconst frame=info.render.frame;if(updateList[uniformsGroup.id]!==frame){updateBufferData(uniformsGroup);updateList[uniformsGroup.id]=frame;}}function createBuffer(uniformsGroup){// the setup of an UBO is independent of a particular shader program but global\nconst bindingPointIndex=allocateBindingPointIndex();uniformsGroup.__bindingPointIndex=bindingPointIndex;const buffer=gl.createBuffer();const size=uniformsGroup.__size;const usage=uniformsGroup.usage;gl.bindBuffer(35345,buffer);gl.bufferData(35345,size,usage);gl.bindBuffer(35345,null);gl.bindBufferBase(35345,bindingPointIndex,buffer);return buffer;}function allocateBindingPointIndex(){for(let i=0;i<maxBindingPoints;i++){if(index_of(allocatedBindingPoints).call(allocatedBindingPoints,i)===-1){allocatedBindingPoints.push(i);return i;}}console.error('THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.');return 0;}function updateBufferData(uniformsGroup){const buffer=buffers[uniformsGroup.id];const uniforms=uniformsGroup.uniforms;const cache=uniformsGroup.__cache;gl.bindBuffer(35345,buffer);for(let i=0,il=uniforms.length;i<il;i++){const uniform=uniforms[i];// partly update the buffer if necessary\nif(hasUniformChanged(uniform,i,cache)===true){const value=uniform.value;const offset=uniform.__offset;if(typeof value==='number'){uniform.__data[0]=value;gl.bufferSubData(35345,offset,uniform.__data);}else{if(uniform.value.isMatrix3){// manually converting 3x3 to 3x4\nuniform.__data[0]=uniform.value.elements[0];uniform.__data[1]=uniform.value.elements[1];uniform.__data[2]=uniform.value.elements[2];uniform.__data[3]=uniform.value.elements[0];uniform.__data[4]=uniform.value.elements[3];uniform.__data[5]=uniform.value.elements[4];uniform.__data[6]=uniform.value.elements[5];uniform.__data[7]=uniform.value.elements[0];uniform.__data[8]=uniform.value.elements[6];uniform.__data[9]=uniform.value.elements[7];uniform.__data[10]=uniform.value.elements[8];uniform.__data[11]=uniform.value.elements[0];}else{value.toArray(uniform.__data);}gl.bufferSubData(35345,offset,uniform.__data);}}}gl.bindBuffer(35345,null);}function hasUniformChanged(uniform,index,cache){const value=uniform.value;if(cache[index]===undefined){// cache entry does not exist so far\nif(typeof value==='number'){cache[index]=value;}else{cache[index]=value.clone();}return true;}else{// compare current value with cached entry\nif(typeof value==='number'){if(cache[index]!==value){cache[index]=value;return true;}}else{const cachedObject=cache[index];if(cachedObject.equals(value)===false){cachedObject.copy(value);return true;}}}return false;}function prepareUniformsGroup(uniformsGroup){// determine total buffer size according to the STD140 layout\n// Hint: STD140 is the only supported layout in WebGL 2\nconst uniforms=uniformsGroup.uniforms;let offset=0;// global buffer offset in bytes\nconst chunkSize=16;// size of a chunk in bytes\nlet chunkOffset=0;// offset within a single chunk in bytes\nfor(let i=0,l=uniforms.length;i<l;i++){const uniform=uniforms[i];const info=getUniformSize(uniform);// the following two properties will be used for partial buffer updates\nuniform.__data=new Float32Array(info.storage/Float32Array.BYTES_PER_ELEMENT);uniform.__offset=offset;//\nif(i>0){chunkOffset=offset%chunkSize;const remainingSizeInChunk=chunkSize-chunkOffset;// check for chunk overflow\nif(chunkOffset!==0&&remainingSizeInChunk-info.boundary<0){// add padding and adjust offset\noffset+=chunkSize-chunkOffset;uniform.__offset=offset;}}offset+=info.storage;}// ensure correct final padding\nchunkOffset=offset%chunkSize;if(chunkOffset>0)offset+=chunkSize-chunkOffset;//\nuniformsGroup.__size=offset;uniformsGroup.__cache={};return this;}function getUniformSize(uniform){const value=uniform.value;const info={boundary:0,// bytes\nstorage:0// bytes\n};// determine sizes according to STD140\nif(typeof value==='number'){// float/int\ninfo.boundary=4;info.storage=4;}else if(value.isVector2){// vec2\ninfo.boundary=8;info.storage=8;}else if(value.isVector3||value.isColor){// vec3\ninfo.boundary=16;info.storage=12;// evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes\n}else if(value.isVector4){// vec4\ninfo.boundary=16;info.storage=16;}else if(value.isMatrix3){// mat3 (in STD140 a 3x3 matrix is represented as 3x4)\ninfo.boundary=48;info.storage=48;}else if(value.isMatrix4){// mat4\ninfo.boundary=64;info.storage=64;}else if(value.isTexture){console.warn('THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.');}else{console.warn('THREE.WebGLRenderer: Unsupported uniform value type.',value);}return info;}function onUniformsGroupsDispose(event){const uniformsGroup=event.target;uniformsGroup.removeEventListener('dispose',onUniformsGroupsDispose);const index=index_of(allocatedBindingPoints).call(allocatedBindingPoints,uniformsGroup.__bindingPointIndex);splice(allocatedBindingPoints).call(allocatedBindingPoints,index,1);gl.deleteBuffer(buffers[uniformsGroup.id]);delete buffers[uniformsGroup.id];delete updateList[uniformsGroup.id];}function dispose(){for(const id in buffers){gl.deleteBuffer(buffers[id]);}allocatedBindingPoints=[];buffers={};updateList={};}return{bind:bind,update:update,dispose:dispose};}function createCanvasElement(){const canvas=createElementNS('canvas');canvas.style.display='block';return canvas;}function WebGLRenderer(parameters={}){this.isWebGLRenderer=true;const _canvas=parameters.canvas!==undefined?parameters.canvas:createCanvasElement(),_context=parameters.context!==undefined?parameters.context:null,_depth=parameters.depth!==undefined?parameters.depth:true,_stencil=parameters.stencil!==undefined?parameters.stencil:true,_antialias=parameters.antialias!==undefined?parameters.antialias:false,_premultipliedAlpha=parameters.premultipliedAlpha!==undefined?parameters.premultipliedAlpha:true,_preserveDrawingBuffer=parameters.preserveDrawingBuffer!==undefined?parameters.preserveDrawingBuffer:false,_powerPreference=parameters.powerPreference!==undefined?parameters.powerPreference:'default',_failIfMajorPerformanceCaveat=parameters.failIfMajorPerformanceCaveat!==undefined?parameters.failIfMajorPerformanceCaveat:false;let _alpha;if(_context!==null){_alpha=_context.getContextAttributes().alpha;}else{_alpha=parameters.alpha!==undefined?parameters.alpha:false;}let currentRenderList=null;let currentRenderState=null;// render() can be called from within a callback triggered by another render.\n// We track this so that the nested render call gets its list and state isolated from the parent render call.\nconst renderListStack=[];const renderStateStack=[];// public properties\nthis.domElement=_canvas;// Debug configuration container\nthis.debug={/**\n\t\t * Enables error checking and reporting when shader programs are being compiled\n\t\t * @type {boolean}\n\t\t */checkShaderErrors:true};// clearing\nthis.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;// scene graph\nthis.sortObjects=true;// user-defined clipping\nthis.clippingPlanes=[];this.localClippingEnabled=false;// physically based shading\nthis.outputEncoding=LinearEncoding;// physical lights\nthis.physicallyCorrectLights=false;// tone mapping\nthis.toneMapping=NoToneMapping;this.toneMappingExposure=1.0;//\ndefine_properties(this,{// @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d\ngammaFactor:{get:function(){console.warn('THREE.WebGLRenderer: .gammaFactor has been removed.');return 2;},set:function(){console.warn('THREE.WebGLRenderer: .gammaFactor has been removed.');}}});// internal properties\nconst _this=this;let _isContextLost=false;// internal state cache\nlet _currentActiveCubeFace=0;let _currentActiveMipmapLevel=0;let _currentRenderTarget=null;let _currentMaterialId=-1;let _currentCamera=null;const _currentViewport=new Vector4();const _currentScissor=new Vector4();let _currentScissorTest=null;//\nlet _width=_canvas.width;let _height=_canvas.height;let _pixelRatio=1;let _opaqueSort=null;let _transparentSort=null;const _viewport=new Vector4(0,0,_width,_height);const _scissor=new Vector4(0,0,_width,_height);let _scissorTest=false;// frustum\nconst _frustum=new Frustum();// clipping\nlet _clippingEnabled=false;let _localClippingEnabled=false;// transmission\nlet _transmissionRenderTarget=null;// camera matrices cache\nconst _projScreenMatrix=new Matrix4();const _vector2=new Vector2();const _vector3=new three_module_Vector3();const _emptyScene={background:null,fog:null,environment:null,overrideMaterial:null,isScene:true};function getTargetPixelRatio(){return _currentRenderTarget===null?_pixelRatio:1;}// initialize\nlet _gl=_context;function getContext(contextNames,contextAttributes){for(let i=0;i<contextNames.length;i++){const contextName=contextNames[i];const context=_canvas.getContext(contextName,contextAttributes);if(context!==null)return context;}return null;}try{const contextAttributes={alpha:true,depth:_depth,stencil:_stencil,antialias:_antialias,premultipliedAlpha:_premultipliedAlpha,preserveDrawingBuffer:_preserveDrawingBuffer,powerPreference:_powerPreference,failIfMajorPerformanceCaveat:_failIfMajorPerformanceCaveat};// OffscreenCanvas does not have setAttribute, see #22811\nif('setAttribute'in _canvas)_canvas.setAttribute('data-engine',`three.js r${REVISION}`);// event listeners must be registered before WebGL context is created, see #12753\n_canvas.addEventListener('webglcontextlost',onContextLost,false);_canvas.addEventListener('webglcontextrestored',onContextRestore,false);_canvas.addEventListener('webglcontextcreationerror',onContextCreationError,false);if(_gl===null){const contextNames=['webgl2','webgl','experimental-webgl'];if(_this.isWebGL1Renderer===true){contextNames.shift();}_gl=getContext(contextNames,contextAttributes);if(_gl===null){if(getContext(contextNames)){throw new Error('Error creating WebGL context with your selected attributes.');}else{throw new Error('Error creating WebGL context.');}}}// Some experimental-webgl implementations do not have getShaderPrecisionFormat\nif(_gl.getShaderPrecisionFormat===undefined){_gl.getShaderPrecisionFormat=function(){return{'rangeMin':1,'rangeMax':1,'precision':1};};}}catch(error){console.error('THREE.WebGLRenderer: '+error.message);throw error;}let extensions,capabilities,state,info;let properties,textures,cubemaps,cubeuvmaps,attributes,geometries,objects;let programCache,materials,renderLists,renderStates,clipping,shadowMap;let background,morphtargets,bufferRenderer,indexedBufferRenderer;let utils,bindingStates,uniformsGroups;function initGLContext(){extensions=new WebGLExtensions(_gl);capabilities=new WebGLCapabilities(_gl,extensions,parameters);extensions.init(capabilities);utils=new WebGLUtils(_gl,extensions,capabilities);state=new WebGLState(_gl,extensions,capabilities);info=new WebGLInfo();properties=new WebGLProperties();textures=new WebGLTextures(_gl,extensions,state,properties,capabilities,utils,info);cubemaps=new WebGLCubeMaps(_this);cubeuvmaps=new WebGLCubeUVMaps(_this);attributes=new WebGLAttributes(_gl,capabilities);bindingStates=new WebGLBindingStates(_gl,extensions,attributes,capabilities);geometries=new WebGLGeometries(_gl,attributes,info,bindingStates);objects=new WebGLObjects(_gl,geometries,attributes,info);morphtargets=new WebGLMorphtargets(_gl,capabilities,textures);clipping=new WebGLClipping(properties);programCache=new WebGLPrograms(_this,cubemaps,cubeuvmaps,extensions,capabilities,bindingStates,clipping);materials=new WebGLMaterials(_this,properties);renderLists=new WebGLRenderLists();renderStates=new WebGLRenderStates(extensions,capabilities);background=new WebGLBackground(_this,cubemaps,cubeuvmaps,state,objects,_alpha,_premultipliedAlpha);shadowMap=new WebGLShadowMap(_this,objects,capabilities);uniformsGroups=new WebGLUniformsGroups(_gl,info,capabilities,state);bufferRenderer=new WebGLBufferRenderer(_gl,extensions,info,capabilities);indexedBufferRenderer=new WebGLIndexedBufferRenderer(_gl,extensions,info,capabilities);info.programs=programCache.programs;_this.capabilities=capabilities;_this.extensions=extensions;_this.properties=properties;_this.renderLists=renderLists;_this.shadowMap=shadowMap;_this.state=state;_this.info=info;}initGLContext();// xr\nconst xr=new WebXRManager(_this,_gl);this.xr=xr;// API\nthis.getContext=function(){return _gl;};this.getContextAttributes=function(){return _gl.getContextAttributes();};this.forceContextLoss=function(){const extension=extensions.get('WEBGL_lose_context');if(extension)extension.loseContext();};this.forceContextRestore=function(){const extension=extensions.get('WEBGL_lose_context');if(extension)extension.restoreContext();};this.getPixelRatio=function(){return _pixelRatio;};this.setPixelRatio=function(value){if(value===undefined)return;_pixelRatio=value;this.setSize(_width,_height,false);};this.getSize=function(target){return target.set(_width,_height);};this.setSize=function(width,height,updateStyle){if(xr.isPresenting){console.warn('THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.');return;}_width=width;_height=height;_canvas.width=Math.floor(width*_pixelRatio);_canvas.height=Math.floor(height*_pixelRatio);if(updateStyle!==false){_canvas.style.width=width+'px';_canvas.style.height=height+'px';}this.setViewport(0,0,width,height);};this.getDrawingBufferSize=function(target){return target.set(_width*_pixelRatio,_height*_pixelRatio).floor();};this.setDrawingBufferSize=function(width,height,pixelRatio){_width=width;_height=height;_pixelRatio=pixelRatio;_canvas.width=Math.floor(width*pixelRatio);_canvas.height=Math.floor(height*pixelRatio);this.setViewport(0,0,width,height);};this.getCurrentViewport=function(target){return target.copy(_currentViewport);};this.getViewport=function(target){return target.copy(_viewport);};this.setViewport=function(x,y,width,height){if(x.isVector4){_viewport.set(x.x,x.y,x.z,x.w);}else{_viewport.set(x,y,width,height);}state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor());};this.getScissor=function(target){return target.copy(_scissor);};this.setScissor=function(x,y,width,height){if(x.isVector4){_scissor.set(x.x,x.y,x.z,x.w);}else{_scissor.set(x,y,width,height);}state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor());};this.getScissorTest=function(){return _scissorTest;};this.setScissorTest=function(boolean){state.setScissorTest(_scissorTest=boolean);};this.setOpaqueSort=function(method){_opaqueSort=method;};this.setTransparentSort=function(method){_transparentSort=method;};// Clearing\nthis.getClearColor=function(target){return target.copy(background.getClearColor());};this.setClearColor=function(){background.setClearColor.apply(background,arguments);};this.getClearAlpha=function(){return background.getClearAlpha();};this.setClearAlpha=function(){background.setClearAlpha.apply(background,arguments);};this.clear=function(color=true,depth=true,stencil=true){let bits=0;if(color)bits|=16384;if(depth)bits|=256;if(stencil)bits|=1024;_gl.clear(bits);};this.clearColor=function(){this.clear(true,false,false);};this.clearDepth=function(){this.clear(false,true,false);};this.clearStencil=function(){this.clear(false,false,true);};//\nthis.dispose=function(){_canvas.removeEventListener('webglcontextlost',onContextLost,false);_canvas.removeEventListener('webglcontextrestored',onContextRestore,false);_canvas.removeEventListener('webglcontextcreationerror',onContextCreationError,false);renderLists.dispose();renderStates.dispose();properties.dispose();cubemaps.dispose();cubeuvmaps.dispose();objects.dispose();bindingStates.dispose();uniformsGroups.dispose();programCache.dispose();xr.dispose();xr.removeEventListener('sessionstart',onXRSessionStart);xr.removeEventListener('sessionend',onXRSessionEnd);if(_transmissionRenderTarget){_transmissionRenderTarget.dispose();_transmissionRenderTarget=null;}animation.stop();};// Events\nfunction onContextLost(event){event.preventDefault();console.log('THREE.WebGLRenderer: Context Lost.');_isContextLost=true;}function/* event */onContextRestore(){console.log('THREE.WebGLRenderer: Context Restored.');_isContextLost=false;const infoAutoReset=info.autoReset;const shadowMapEnabled=shadowMap.enabled;const shadowMapAutoUpdate=shadowMap.autoUpdate;const shadowMapNeedsUpdate=shadowMap.needsUpdate;const shadowMapType=shadowMap.type;initGLContext();info.autoReset=infoAutoReset;shadowMap.enabled=shadowMapEnabled;shadowMap.autoUpdate=shadowMapAutoUpdate;shadowMap.needsUpdate=shadowMapNeedsUpdate;shadowMap.type=shadowMapType;}function onContextCreationError(event){console.error('THREE.WebGLRenderer: A WebGL context could not be created. Reason: ',event.statusMessage);}function onMaterialDispose(event){const material=event.target;material.removeEventListener('dispose',onMaterialDispose);deallocateMaterial(material);}// Buffer deallocation\nfunction deallocateMaterial(material){releaseMaterialProgramReferences(material);properties.remove(material);}function releaseMaterialProgramReferences(material){const programs=properties.get(material).programs;if(programs!==undefined){for_each(programs).call(programs,function(program){programCache.releaseProgram(program);});if(material.isShaderMaterial){programCache.releaseShaderCache(material);}}}// Buffer rendering\nthis.renderBufferDirect=function(camera,scene,geometry,material,object,group){if(scene===null)scene=_emptyScene;// renderBufferDirect second parameter used to be fog (could be null)\nconst frontFaceCW=object.isMesh&&object.matrixWorld.determinant()<0;const program=setProgram(camera,scene,geometry,material,object);state.setMaterial(material,frontFaceCW);//\nlet index=geometry.index;const position=geometry.attributes.position;//\nif(index===null){if(position===undefined||position.count===0)return;}else if(index.count===0){return;}//\nlet rangeFactor=1;if(material.wireframe===true){index=geometries.getWireframeAttribute(geometry);rangeFactor=2;}bindingStates.setup(object,material,program,geometry,index);let attribute;let renderer=bufferRenderer;if(index!==null){attribute=attributes.get(index);renderer=indexedBufferRenderer;renderer.setIndex(attribute);}//\nconst dataCount=index!==null?index.count:position.count;const rangeStart=geometry.drawRange.start*rangeFactor;const rangeCount=geometry.drawRange.count*rangeFactor;const groupStart=group!==null?group.start*rangeFactor:0;const groupCount=group!==null?group.count*rangeFactor:Infinity;const drawStart=Math.max(rangeStart,groupStart);const drawEnd=Math.min(dataCount,rangeStart+rangeCount,groupStart+groupCount)-1;const drawCount=Math.max(0,drawEnd-drawStart+1);if(drawCount===0)return;//\nif(object.isMesh){if(material.wireframe===true){state.setLineWidth(material.wireframeLinewidth*getTargetPixelRatio());renderer.setMode(1);}else{renderer.setMode(4);}}else if(object.isLine){let lineWidth=material.linewidth;if(lineWidth===undefined)lineWidth=1;// Not using Line*Material\nstate.setLineWidth(lineWidth*getTargetPixelRatio());if(object.isLineSegments){renderer.setMode(1);}else if(object.isLineLoop){renderer.setMode(2);}else{renderer.setMode(3);}}else if(object.isPoints){renderer.setMode(0);}else if(object.isSprite){renderer.setMode(4);}if(object.isInstancedMesh){renderer.renderInstances(drawStart,drawCount,object.count);}else if(geometry.isInstancedBufferGeometry){const instanceCount=Math.min(geometry.instanceCount,geometry._maxInstanceCount);renderer.renderInstances(drawStart,drawCount,instanceCount);}else{renderer.render(drawStart,drawCount);}};// Compile\nthis.compile=function(scene,camera){function prepare(material,scene,object){if(material.transparent===true&&material.side===DoubleSide){material.side=BackSide;material.needsUpdate=true;getProgram(material,scene,object);material.side=FrontSide;material.needsUpdate=true;getProgram(material,scene,object);material.side=DoubleSide;}else{getProgram(material,scene,object);}}currentRenderState=renderStates.get(scene);currentRenderState.init();renderStateStack.push(currentRenderState);scene.traverseVisible(function(object){if(object.isLight&&object.layers.test(camera.layers)){currentRenderState.pushLight(object);if(object.castShadow){currentRenderState.pushShadow(object);}}});currentRenderState.setupLights(_this.physicallyCorrectLights);scene.traverse(function(object){const material=object.material;if(material){if(is_array(material)){for(let i=0;i<material.length;i++){const material2=material[i];prepare(material2,scene,object);}}else{prepare(material,scene,object);}}});renderStateStack.pop();currentRenderState=null;};// Animation Loop\nlet onAnimationFrameCallback=null;function onAnimationFrame(time){if(onAnimationFrameCallback)onAnimationFrameCallback(time);}function onXRSessionStart(){animation.stop();}function onXRSessionEnd(){animation.start();}const animation=new WebGLAnimation();animation.setAnimationLoop(onAnimationFrame);if(typeof self!=='undefined')animation.setContext(self);this.setAnimationLoop=function(callback){onAnimationFrameCallback=callback;xr.setAnimationLoop(callback);callback===null?animation.stop():animation.start();};xr.addEventListener('sessionstart',onXRSessionStart);xr.addEventListener('sessionend',onXRSessionEnd);// Rendering\nthis.render=function(scene,camera){if(camera!==undefined&&camera.isCamera!==true){console.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.');return;}if(_isContextLost===true)return;// update scene graph\nif(scene.matrixWorldAutoUpdate===true)scene.updateMatrixWorld();// update camera matrices and frustum\nif(camera.parent===null&&camera.matrixWorldAutoUpdate===true)camera.updateMatrixWorld();if(xr.enabled===true&&xr.isPresenting===true){if(xr.cameraAutoUpdate===true)xr.updateCamera(camera);camera=xr.getCamera();// use XR camera for rendering\n}//\nif(scene.isScene===true)scene.onBeforeRender(_this,scene,camera,_currentRenderTarget);currentRenderState=renderStates.get(scene,renderStateStack.length);currentRenderState.init();renderStateStack.push(currentRenderState);_projScreenMatrix.multiplyMatrices(camera.projectionMatrix,camera.matrixWorldInverse);_frustum.setFromProjectionMatrix(_projScreenMatrix);_localClippingEnabled=this.localClippingEnabled;_clippingEnabled=clipping.init(this.clippingPlanes,_localClippingEnabled,camera);currentRenderList=renderLists.get(scene,renderListStack.length);currentRenderList.init();renderListStack.push(currentRenderList);projectObject(scene,camera,0,_this.sortObjects);currentRenderList.finish();if(_this.sortObjects===true){instance_sort(currentRenderList).call(currentRenderList,_opaqueSort,_transparentSort);}//\nif(_clippingEnabled===true)clipping.beginShadows();const shadowsArray=currentRenderState.state.shadowsArray;shadowMap.render(shadowsArray,scene,camera);if(_clippingEnabled===true)clipping.endShadows();//\nif(this.info.autoReset===true)this.info.reset();//\nbackground.render(currentRenderList,scene);// render scene\ncurrentRenderState.setupLights(_this.physicallyCorrectLights);if(camera.isArrayCamera){const cameras=camera.cameras;for(let i=0,l=cameras.length;i<l;i++){const camera2=cameras[i];renderScene(currentRenderList,scene,camera2,camera2.viewport);}}else{renderScene(currentRenderList,scene,camera);}//\nif(_currentRenderTarget!==null){// resolve multisample renderbuffers to a single-sample texture if necessary\ntextures.updateMultisampleRenderTarget(_currentRenderTarget);// Generate mipmap if we're using any kind of mipmap filtering\ntextures.updateRenderTargetMipmap(_currentRenderTarget);}//\nif(scene.isScene===true)scene.onAfterRender(_this,scene,camera);// _gl.finish();\nbindingStates.resetDefaultState();_currentMaterialId=-1;_currentCamera=null;renderStateStack.pop();if(renderStateStack.length>0){currentRenderState=renderStateStack[renderStateStack.length-1];}else{currentRenderState=null;}renderListStack.pop();if(renderListStack.length>0){currentRenderList=renderListStack[renderListStack.length-1];}else{currentRenderList=null;}};function projectObject(object,camera,groupOrder,sortObjects){if(object.visible===false)return;const visible=object.layers.test(camera.layers);if(visible){if(object.isGroup){groupOrder=object.renderOrder;}else if(object.isLOD){if(object.autoUpdate===true)object.update(camera);}else if(object.isLight){currentRenderState.pushLight(object);if(object.castShadow){currentRenderState.pushShadow(object);}}else if(object.isSprite){if(!object.frustumCulled||_frustum.intersectsSprite(object)){if(sortObjects){_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);}const geometry=objects.update(object);const material=object.material;if(material.visible){currentRenderList.push(object,geometry,material,groupOrder,_vector3.z,null);}}}else if(object.isMesh||object.isLine||object.isPoints){if(object.isSkinnedMesh){// update skeleton only once in a frame\nif(object.skeleton.frame!==info.render.frame){object.skeleton.update();object.skeleton.frame=info.render.frame;}}if(!object.frustumCulled||_frustum.intersectsObject(object)){if(sortObjects){_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);}const geometry=objects.update(object);const material=object.material;if(is_array(material)){const groups=geometry.groups;for(let i=0,l=groups.length;i<l;i++){const group=groups[i];const groupMaterial=material[group.materialIndex];if(groupMaterial&&groupMaterial.visible){currentRenderList.push(object,geometry,groupMaterial,groupOrder,_vector3.z,group);}}}else if(material.visible){currentRenderList.push(object,geometry,material,groupOrder,_vector3.z,null);}}}}const children=object.children;for(let i=0,l=children.length;i<l;i++){projectObject(children[i],camera,groupOrder,sortObjects);}}function renderScene(currentRenderList,scene,camera,viewport){const opaqueObjects=currentRenderList.opaque;const transmissiveObjects=currentRenderList.transmissive;const transparentObjects=currentRenderList.transparent;currentRenderState.setupLightsView(camera);if(transmissiveObjects.length>0)renderTransmissionPass(opaqueObjects,scene,camera);if(viewport)state.viewport(_currentViewport.copy(viewport));if(opaqueObjects.length>0)renderObjects(opaqueObjects,scene,camera);if(transmissiveObjects.length>0)renderObjects(transmissiveObjects,scene,camera);if(transparentObjects.length>0)renderObjects(transparentObjects,scene,camera);// Ensure depth buffer writing is enabled so it can be cleared on next render\nstate.buffers.depth.setTest(true);state.buffers.depth.setMask(true);state.buffers.color.setMask(true);state.setPolygonOffset(false);}function renderTransmissionPass(opaqueObjects,scene,camera){const isWebGL2=capabilities.isWebGL2;if(_transmissionRenderTarget===null){_transmissionRenderTarget=new WebGLRenderTarget(1,1,{generateMipmaps:true,type:extensions.has('EXT_color_buffer_half_float')?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:isWebGL2&&_antialias===true?4:0});}_this.getDrawingBufferSize(_vector2);if(isWebGL2){_transmissionRenderTarget.setSize(_vector2.x,_vector2.y);}else{_transmissionRenderTarget.setSize(three_module_floorPowerOfTwo(_vector2.x),three_module_floorPowerOfTwo(_vector2.y));}//\nconst currentRenderTarget=_this.getRenderTarget();_this.setRenderTarget(_transmissionRenderTarget);_this.clear();// Turn off the features which can affect the frag color for opaque objects pass.\n// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\nconst currentToneMapping=_this.toneMapping;_this.toneMapping=NoToneMapping;renderObjects(opaqueObjects,scene,camera);_this.toneMapping=currentToneMapping;textures.updateMultisampleRenderTarget(_transmissionRenderTarget);textures.updateRenderTargetMipmap(_transmissionRenderTarget);_this.setRenderTarget(currentRenderTarget);}function renderObjects(renderList,scene,camera){const overrideMaterial=scene.isScene===true?scene.overrideMaterial:null;for(let i=0,l=renderList.length;i<l;i++){const renderItem=renderList[i];const object=renderItem.object;const geometry=renderItem.geometry;const material=overrideMaterial===null?renderItem.material:overrideMaterial;const group=renderItem.group;if(object.layers.test(camera.layers)){renderObject(object,scene,camera,geometry,material,group);}}}function renderObject(object,scene,camera,geometry,material,group){object.onBeforeRender(_this,scene,camera,geometry,material,group);object.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse,object.matrixWorld);object.normalMatrix.getNormalMatrix(object.modelViewMatrix);material.onBeforeRender(_this,scene,camera,geometry,object,group);if(material.transparent===true&&material.side===DoubleSide){material.side=BackSide;material.needsUpdate=true;_this.renderBufferDirect(camera,scene,geometry,material,object,group);material.side=FrontSide;material.needsUpdate=true;_this.renderBufferDirect(camera,scene,geometry,material,object,group);material.side=DoubleSide;}else{_this.renderBufferDirect(camera,scene,geometry,material,object,group);}object.onAfterRender(_this,scene,camera,geometry,material,group);}function getProgram(material,scene,object){if(scene.isScene!==true)scene=_emptyScene;// scene could be a Mesh, Line, Points, ...\nconst materialProperties=properties.get(material);const lights=currentRenderState.state.lights;const shadowsArray=currentRenderState.state.shadowsArray;const lightsStateVersion=lights.state.version;const parameters=programCache.getParameters(material,lights.state,shadowsArray,scene,object);const programCacheKey=programCache.getProgramCacheKey(parameters);let programs=materialProperties.programs;// always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\nmaterialProperties.environment=material.isMeshStandardMaterial?scene.environment:null;materialProperties.fog=scene.fog;materialProperties.envMap=(material.isMeshStandardMaterial?cubeuvmaps:cubemaps).get(material.envMap||materialProperties.environment);if(programs===undefined){// new material\nmaterial.addEventListener('dispose',onMaterialDispose);programs=new map();materialProperties.programs=programs;}let program=programs.get(programCacheKey);if(program!==undefined){// early out if program and light state is identical\nif(materialProperties.currentProgram===program&&materialProperties.lightsStateVersion===lightsStateVersion){updateCommonMaterialProperties(material,parameters);return program;}}else{parameters.uniforms=programCache.getUniforms(material);material.onBuild(object,parameters,_this);material.onBeforeCompile(parameters,_this);program=programCache.acquireProgram(parameters,programCacheKey);programs.set(programCacheKey,program);materialProperties.uniforms=parameters.uniforms;}const uniforms=materialProperties.uniforms;if(!material.isShaderMaterial&&!material.isRawShaderMaterial||material.clipping===true){uniforms.clippingPlanes=clipping.uniform;}updateCommonMaterialProperties(material,parameters);// store the light setup it was created for\nmaterialProperties.needsLights=materialNeedsLights(material);materialProperties.lightsStateVersion=lightsStateVersion;if(materialProperties.needsLights){// wire up the material to this renderer's lighting state\nuniforms.ambientLightColor.value=lights.state.ambient;uniforms.lightProbe.value=lights.state.probe;uniforms.directionalLights.value=lights.state.directional;uniforms.directionalLightShadows.value=lights.state.directionalShadow;uniforms.spotLights.value=lights.state.spot;uniforms.spotLightShadows.value=lights.state.spotShadow;uniforms.rectAreaLights.value=lights.state.rectArea;uniforms.ltc_1.value=lights.state.rectAreaLTC1;uniforms.ltc_2.value=lights.state.rectAreaLTC2;uniforms.pointLights.value=lights.state.point;uniforms.pointLightShadows.value=lights.state.pointShadow;uniforms.hemisphereLights.value=lights.state.hemi;uniforms.directionalShadowMap.value=lights.state.directionalShadowMap;uniforms.directionalShadowMatrix.value=lights.state.directionalShadowMatrix;uniforms.spotShadowMap.value=lights.state.spotShadowMap;uniforms.spotLightMatrix.value=lights.state.spotLightMatrix;uniforms.spotLightMap.value=lights.state.spotLightMap;uniforms.pointShadowMap.value=lights.state.pointShadowMap;uniforms.pointShadowMatrix.value=lights.state.pointShadowMatrix;// TODO (abelnation): add area lights shadow info to uniforms\n}const progUniforms=program.getUniforms();const uniformsList=WebGLUniforms.seqWithValue(progUniforms.seq,uniforms);materialProperties.currentProgram=program;materialProperties.uniformsList=uniformsList;return program;}function updateCommonMaterialProperties(material,parameters){const materialProperties=properties.get(material);materialProperties.outputEncoding=parameters.outputEncoding;materialProperties.instancing=parameters.instancing;materialProperties.skinning=parameters.skinning;materialProperties.morphTargets=parameters.morphTargets;materialProperties.morphNormals=parameters.morphNormals;materialProperties.morphColors=parameters.morphColors;materialProperties.morphTargetsCount=parameters.morphTargetsCount;materialProperties.numClippingPlanes=parameters.numClippingPlanes;materialProperties.numIntersection=parameters.numClipIntersection;materialProperties.vertexAlphas=parameters.vertexAlphas;materialProperties.vertexTangents=parameters.vertexTangents;materialProperties.toneMapping=parameters.toneMapping;}function setProgram(camera,scene,geometry,material,object){if(scene.isScene!==true)scene=_emptyScene;// scene could be a Mesh, Line, Points, ...\ntextures.resetTextureUnits();const fog=scene.fog;const environment=material.isMeshStandardMaterial?scene.environment:null;const encoding=_currentRenderTarget===null?_this.outputEncoding:_currentRenderTarget.isXRRenderTarget===true?_currentRenderTarget.texture.encoding:LinearEncoding;const envMap=(material.isMeshStandardMaterial?cubeuvmaps:cubemaps).get(material.envMap||environment);const vertexAlphas=material.vertexColors===true&&!!geometry.attributes.color&&geometry.attributes.color.itemSize===4;const vertexTangents=!!material.normalMap&&!!geometry.attributes.tangent;const morphTargets=!!geometry.morphAttributes.position;const morphNormals=!!geometry.morphAttributes.normal;const morphColors=!!geometry.morphAttributes.color;const toneMapping=material.toneMapped?_this.toneMapping:NoToneMapping;const morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color;const morphTargetsCount=morphAttribute!==undefined?morphAttribute.length:0;const materialProperties=properties.get(material);const lights=currentRenderState.state.lights;if(_clippingEnabled===true){if(_localClippingEnabled===true||camera!==_currentCamera){const useCache=camera===_currentCamera&&material.id===_currentMaterialId;// we might want to call this function with some ClippingGroup\n// object instead of the material, once it becomes feasible\n// (#8465, #8379)\nclipping.setState(material,camera,useCache);}}//\nlet needsProgramChange=false;if(material.version===materialProperties.__version){if(materialProperties.needsLights&&materialProperties.lightsStateVersion!==lights.state.version){needsProgramChange=true;}else if(materialProperties.outputEncoding!==encoding){needsProgramChange=true;}else if(object.isInstancedMesh&&materialProperties.instancing===false){needsProgramChange=true;}else if(!object.isInstancedMesh&&materialProperties.instancing===true){needsProgramChange=true;}else if(object.isSkinnedMesh&&materialProperties.skinning===false){needsProgramChange=true;}else if(!object.isSkinnedMesh&&materialProperties.skinning===true){needsProgramChange=true;}else if(materialProperties.envMap!==envMap){needsProgramChange=true;}else if(material.fog===true&&materialProperties.fog!==fog){needsProgramChange=true;}else if(materialProperties.numClippingPlanes!==undefined&&(materialProperties.numClippingPlanes!==clipping.numPlanes||materialProperties.numIntersection!==clipping.numIntersection)){needsProgramChange=true;}else if(materialProperties.vertexAlphas!==vertexAlphas){needsProgramChange=true;}else if(materialProperties.vertexTangents!==vertexTangents){needsProgramChange=true;}else if(materialProperties.morphTargets!==morphTargets){needsProgramChange=true;}else if(materialProperties.morphNormals!==morphNormals){needsProgramChange=true;}else if(materialProperties.morphColors!==morphColors){needsProgramChange=true;}else if(materialProperties.toneMapping!==toneMapping){needsProgramChange=true;}else if(capabilities.isWebGL2===true&&materialProperties.morphTargetsCount!==morphTargetsCount){needsProgramChange=true;}}else{needsProgramChange=true;materialProperties.__version=material.version;}//\nlet program=materialProperties.currentProgram;if(needsProgramChange===true){program=getProgram(material,scene,object);}let refreshProgram=false;let refreshMaterial=false;let refreshLights=false;const p_uniforms=program.getUniforms(),m_uniforms=materialProperties.uniforms;if(state.useProgram(program.program)){refreshProgram=true;refreshMaterial=true;refreshLights=true;}if(material.id!==_currentMaterialId){_currentMaterialId=material.id;refreshMaterial=true;}if(refreshProgram||_currentCamera!==camera){p_uniforms.setValue(_gl,'projectionMatrix',camera.projectionMatrix);if(capabilities.logarithmicDepthBuffer){p_uniforms.setValue(_gl,'logDepthBufFC',2.0/(Math.log(camera.far+1.0)/Math.LN2));}if(_currentCamera!==camera){_currentCamera=camera;// lighting uniforms depend on the camera so enforce an update\n// now, in case this material supports lights - or later, when\n// the next material that does gets activated:\nrefreshMaterial=true;// set to true on material change\nrefreshLights=true;// remains set until update done\n}// load material specific uniforms\n// (shader material also gets them for the sake of genericity)\nif(material.isShaderMaterial||material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshStandardMaterial||material.envMap){const uCamPos=instance_map(p_uniforms).cameraPosition;if(uCamPos!==undefined){uCamPos.setValue(_gl,_vector3.setFromMatrixPosition(camera.matrixWorld));}}if(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial){p_uniforms.setValue(_gl,'isOrthographic',camera.isOrthographicCamera===true);}if(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial||material.isShadowMaterial||object.isSkinnedMesh){p_uniforms.setValue(_gl,'viewMatrix',camera.matrixWorldInverse);}}// skinning and morph target uniforms must be set even if material didn't change\n// auto-setting of texture unit for bone and morph texture must go before other textures\n// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\nif(object.isSkinnedMesh){p_uniforms.setOptional(_gl,object,'bindMatrix');p_uniforms.setOptional(_gl,object,'bindMatrixInverse');const skeleton=object.skeleton;if(skeleton){if(capabilities.floatVertexTextures){if(skeleton.boneTexture===null)skeleton.computeBoneTexture();p_uniforms.setValue(_gl,'boneTexture',skeleton.boneTexture,textures);p_uniforms.setValue(_gl,'boneTextureSize',skeleton.boneTextureSize);}else{console.warn('THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required.');}}}const morphAttributes=geometry.morphAttributes;if(morphAttributes.position!==undefined||morphAttributes.normal!==undefined||morphAttributes.color!==undefined&&capabilities.isWebGL2===true){morphtargets.update(object,geometry,material,program);}if(refreshMaterial||materialProperties.receiveShadow!==object.receiveShadow){materialProperties.receiveShadow=object.receiveShadow;p_uniforms.setValue(_gl,'receiveShadow',object.receiveShadow);}// https://github.com/mrdoob/three.js/pull/24467#issuecomment-1209031512\nif(material.isMeshGouraudMaterial&&material.envMap!==null){m_uniforms.envMap.value=envMap;m_uniforms.flipEnvMap.value=envMap.isCubeTexture&&envMap.isRenderTargetTexture===false?-1:1;}if(refreshMaterial){p_uniforms.setValue(_gl,'toneMappingExposure',_this.toneMappingExposure);if(materialProperties.needsLights){// the current material requires lighting info\n// note: all lighting uniforms are always set correctly\n// they simply reference the renderer's state for their\n// values\n//\n// use the current material's .needsUpdate flags to set\n// the GL state when required\nmarkUniformsLightsNeedsUpdate(m_uniforms,refreshLights);}// refresh uniforms common to several materials\nif(fog&&material.fog===true){materials.refreshFogUniforms(m_uniforms,fog);}materials.refreshMaterialUniforms(m_uniforms,material,_pixelRatio,_height,_transmissionRenderTarget);WebGLUniforms.upload(_gl,materialProperties.uniformsList,m_uniforms,textures);}if(material.isShaderMaterial&&material.uniformsNeedUpdate===true){WebGLUniforms.upload(_gl,materialProperties.uniformsList,m_uniforms,textures);material.uniformsNeedUpdate=false;}if(material.isSpriteMaterial){p_uniforms.setValue(_gl,'center',object.center);}// common matrices\np_uniforms.setValue(_gl,'modelViewMatrix',object.modelViewMatrix);p_uniforms.setValue(_gl,'normalMatrix',object.normalMatrix);p_uniforms.setValue(_gl,'modelMatrix',object.matrixWorld);// UBOs\nif(material.isShaderMaterial||material.isRawShaderMaterial){const groups=material.uniformsGroups;for(let i=0,l=groups.length;i<l;i++){if(capabilities.isWebGL2){const group=groups[i];uniformsGroups.update(group,program);bind(uniformsGroups).call(uniformsGroups,group,program);}else{console.warn('THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.');}}}return program;}// If uniforms are marked as clean, they don't need to be loaded to the GPU.\nfunction markUniformsLightsNeedsUpdate(uniforms,value){uniforms.ambientLightColor.needsUpdate=value;uniforms.lightProbe.needsUpdate=value;uniforms.directionalLights.needsUpdate=value;uniforms.directionalLightShadows.needsUpdate=value;uniforms.pointLights.needsUpdate=value;uniforms.pointLightShadows.needsUpdate=value;uniforms.spotLights.needsUpdate=value;uniforms.spotLightShadows.needsUpdate=value;uniforms.rectAreaLights.needsUpdate=value;uniforms.hemisphereLights.needsUpdate=value;}function materialNeedsLights(material){return material.isMeshLambertMaterial||material.isMeshToonMaterial||material.isMeshPhongMaterial||material.isMeshStandardMaterial||material.isShadowMaterial||material.isShaderMaterial&&material.lights===true;}this.getActiveCubeFace=function(){return _currentActiveCubeFace;};this.getActiveMipmapLevel=function(){return _currentActiveMipmapLevel;};this.getRenderTarget=function(){return _currentRenderTarget;};this.setRenderTargetTextures=function(renderTarget,colorTexture,depthTexture){properties.get(renderTarget.texture).__webglTexture=colorTexture;properties.get(renderTarget.depthTexture).__webglTexture=depthTexture;const renderTargetProperties=properties.get(renderTarget);renderTargetProperties.__hasExternalTextures=true;if(renderTargetProperties.__hasExternalTextures){renderTargetProperties.__autoAllocateDepthBuffer=depthTexture===undefined;if(!renderTargetProperties.__autoAllocateDepthBuffer){// The multisample_render_to_texture extension doesn't work properly if there\n// are midframe flushes and an external depth buffer. Disable use of the extension.\nif(extensions.has('WEBGL_multisampled_render_to_texture')===true){console.warn('THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided');renderTargetProperties.__useRenderToTexture=false;}}}};this.setRenderTargetFramebuffer=function(renderTarget,defaultFramebuffer){const renderTargetProperties=properties.get(renderTarget);renderTargetProperties.__webglFramebuffer=defaultFramebuffer;renderTargetProperties.__useDefaultFramebuffer=defaultFramebuffer===undefined;};this.setRenderTarget=function(renderTarget,activeCubeFace=0,activeMipmapLevel=0){_currentRenderTarget=renderTarget;_currentActiveCubeFace=activeCubeFace;_currentActiveMipmapLevel=activeMipmapLevel;let useDefaultFramebuffer=true;let framebuffer=null;let isCube=false;let isRenderTarget3D=false;if(renderTarget){const renderTargetProperties=properties.get(renderTarget);if(renderTargetProperties.__useDefaultFramebuffer!==undefined){// We need to make sure to rebind the framebuffer.\nstate.bindFramebuffer(36160,null);useDefaultFramebuffer=false;}else if(renderTargetProperties.__webglFramebuffer===undefined){textures.setupRenderTarget(renderTarget);}else if(renderTargetProperties.__hasExternalTextures){// Color and depth texture must be rebound in order for the swapchain to update.\ntextures.rebindTextures(renderTarget,properties.get(renderTarget.texture).__webglTexture,properties.get(renderTarget.depthTexture).__webglTexture);}const texture=renderTarget.texture;if(texture.isData3DTexture||texture.isDataArrayTexture||texture.isCompressedArrayTexture){isRenderTarget3D=true;}const __webglFramebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget){framebuffer=__webglFramebuffer[activeCubeFace];isCube=true;}else if(capabilities.isWebGL2&&renderTarget.samples>0&&textures.useMultisampledRTT(renderTarget)===false){framebuffer=properties.get(renderTarget).__webglMultisampledFramebuffer;}else{framebuffer=__webglFramebuffer;}_currentViewport.copy(renderTarget.viewport);_currentScissor.copy(renderTarget.scissor);_currentScissorTest=renderTarget.scissorTest;}else{_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor();_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor();_currentScissorTest=_scissorTest;}const framebufferBound=state.bindFramebuffer(36160,framebuffer);if(framebufferBound&&capabilities.drawBuffers&&useDefaultFramebuffer){state.drawBuffers(renderTarget,framebuffer);}state.viewport(_currentViewport);state.scissor(_currentScissor);state.setScissorTest(_currentScissorTest);if(isCube){const textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(36160,36064,34069+activeCubeFace,textureProperties.__webglTexture,activeMipmapLevel);}else if(isRenderTarget3D){const textureProperties=properties.get(renderTarget.texture);const layer=activeCubeFace||0;_gl.framebufferTextureLayer(36160,36064,textureProperties.__webglTexture,activeMipmapLevel||0,layer);}_currentMaterialId=-1;// reset current material to ensure correct uniform bindings\n};this.readRenderTargetPixels=function(renderTarget,x,y,width,height,buffer,activeCubeFaceIndex){if(!(renderTarget&&renderTarget.isWebGLRenderTarget)){console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.');return;}let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&activeCubeFaceIndex!==undefined){framebuffer=framebuffer[activeCubeFaceIndex];}if(framebuffer){state.bindFramebuffer(36160,framebuffer);try{const texture=renderTarget.texture;const textureFormat=texture.format;const textureType=texture.type;if(textureFormat!==RGBAFormat&&utils.convert(textureFormat)!==_gl.getParameter(35739)){console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.');return;}const halfFloatSupportedByExt=textureType===HalfFloatType&&(extensions.has('EXT_color_buffer_half_float')||capabilities.isWebGL2&&extensions.has('EXT_color_buffer_float'));if(textureType!==UnsignedByteType&&utils.convert(textureType)!==_gl.getParameter(35738)&&// Edge and Chrome Mac < 52 (#9513)\n!(textureType===FloatType&&(capabilities.isWebGL2||extensions.has('OES_texture_float')||extensions.has('WEBGL_color_buffer_float')))&&// Chrome Mac >= 52 and Firefox\n!halfFloatSupportedByExt){console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');return;}// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\nif(x>=0&&x<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height){_gl.readPixels(x,y,width,height,utils.convert(textureFormat),utils.convert(textureType),buffer);}}finally{// restore framebuffer of current render target if necessary\nconst framebuffer=_currentRenderTarget!==null?properties.get(_currentRenderTarget).__webglFramebuffer:null;state.bindFramebuffer(36160,framebuffer);}}};this.copyFramebufferToTexture=function(position,texture,level=0){const levelScale=Math.pow(2,-level);const width=Math.floor(texture.image.width*levelScale);const height=Math.floor(texture.image.height*levelScale);textures.setTexture2D(texture,0);_gl.copyTexSubImage2D(3553,level,0,0,position.x,position.y,width,height);state.unbindTexture();};this.copyTextureToTexture=function(position,srcTexture,dstTexture,level=0){const width=srcTexture.image.width;const height=srcTexture.image.height;const glFormat=utils.convert(dstTexture.format);const glType=utils.convert(dstTexture.type);textures.setTexture2D(dstTexture,0);// As another texture upload may have changed pixelStorei\n// parameters, make sure they are correct for the dstTexture\n_gl.pixelStorei(37440,dstTexture.flipY);_gl.pixelStorei(37441,dstTexture.premultiplyAlpha);_gl.pixelStorei(3317,dstTexture.unpackAlignment);if(srcTexture.isDataTexture){_gl.texSubImage2D(3553,level,position.x,position.y,width,height,glFormat,glType,srcTexture.image.data);}else{if(srcTexture.isCompressedTexture){_gl.compressedTexSubImage2D(3553,level,position.x,position.y,srcTexture.mipmaps[0].width,srcTexture.mipmaps[0].height,glFormat,srcTexture.mipmaps[0].data);}else{_gl.texSubImage2D(3553,level,position.x,position.y,glFormat,glType,srcTexture.image);}}// Generate mipmaps only when copying level 0\nif(level===0&&dstTexture.generateMipmaps)_gl.generateMipmap(3553);state.unbindTexture();};this.copyTextureToTexture3D=function(sourceBox,position,srcTexture,dstTexture,level=0){if(_this.isWebGL1Renderer){console.warn('THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.');return;}const width=sourceBox.max.x-sourceBox.min.x+1;const height=sourceBox.max.y-sourceBox.min.y+1;const depth=sourceBox.max.z-sourceBox.min.z+1;const glFormat=utils.convert(dstTexture.format);const glType=utils.convert(dstTexture.type);let glTarget;if(dstTexture.isData3DTexture){textures.setTexture3D(dstTexture,0);glTarget=32879;}else if(dstTexture.isDataArrayTexture){textures.setTexture2DArray(dstTexture,0);glTarget=35866;}else{console.warn('THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.');return;}_gl.pixelStorei(37440,dstTexture.flipY);_gl.pixelStorei(37441,dstTexture.premultiplyAlpha);_gl.pixelStorei(3317,dstTexture.unpackAlignment);const unpackRowLen=_gl.getParameter(3314);const unpackImageHeight=_gl.getParameter(32878);const unpackSkipPixels=_gl.getParameter(3316);const unpackSkipRows=_gl.getParameter(3315);const unpackSkipImages=_gl.getParameter(32877);const image=srcTexture.isCompressedTexture?srcTexture.mipmaps[0]:srcTexture.image;_gl.pixelStorei(3314,image.width);_gl.pixelStorei(32878,image.height);_gl.pixelStorei(3316,sourceBox.min.x);_gl.pixelStorei(3315,sourceBox.min.y);_gl.pixelStorei(32877,sourceBox.min.z);if(srcTexture.isDataTexture||srcTexture.isData3DTexture){_gl.texSubImage3D(glTarget,level,position.x,position.y,position.z,width,height,depth,glFormat,glType,image.data);}else{if(srcTexture.isCompressedArrayTexture){console.warn('THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.');_gl.compressedTexSubImage3D(glTarget,level,position.x,position.y,position.z,width,height,depth,glFormat,image.data);}else{_gl.texSubImage3D(glTarget,level,position.x,position.y,position.z,width,height,depth,glFormat,glType,image);}}_gl.pixelStorei(3314,unpackRowLen);_gl.pixelStorei(32878,unpackImageHeight);_gl.pixelStorei(3316,unpackSkipPixels);_gl.pixelStorei(3315,unpackSkipRows);_gl.pixelStorei(32877,unpackSkipImages);// Generate mipmaps only when copying level 0\nif(level===0&&dstTexture.generateMipmaps)_gl.generateMipmap(glTarget);state.unbindTexture();};this.initTexture=function(texture){if(texture.isCubeTexture){textures.setTextureCube(texture,0);}else if(texture.isData3DTexture){textures.setTexture3D(texture,0);}else if(texture.isDataArrayTexture||texture.isCompressedArrayTexture){textures.setTexture2DArray(texture,0);}else{textures.setTexture2D(texture,0);}state.unbindTexture();};this.resetState=function(){_currentActiveCubeFace=0;_currentActiveMipmapLevel=0;_currentRenderTarget=null;state.reset();bindingStates.reset();};if(typeof __THREE_DEVTOOLS__!=='undefined'){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe',{detail:this}));}}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=true;class FogExp2{constructor(color,density=0.00025){this.isFogExp2=true;this.name='';this.color=new Color(color);this.density=density;}clone(){return new FogExp2(this.color,this.density);}toJSON(){return{type:'FogExp2',color:this.color.getHex(),density:this.density};}}class Fog{constructor(color,near=1,far=1000){this.isFog=true;this.name='';this.color=new Color(color);this.near=near;this.far=far;}clone(){return new Fog(this.color,this.near,this.far);}toJSON(){return{type:'Fog',color:this.color.getHex(),near:this.near,far:this.far};}}class Scene extends (/* unused pure expression or super */ null && (Object3D)){constructor(){super();this.isScene=true;this.type='Scene';this.background=null;this.environment=null;this.fog=null;this.backgroundBlurriness=0;this.overrideMaterial=null;if(typeof __THREE_DEVTOOLS__!=='undefined'){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe',{detail:this}));}}copy(source,recursive){super.copy(source,recursive);if(source.background!==null)this.background=source.background.clone();if(source.environment!==null)this.environment=source.environment.clone();if(source.fog!==null)this.fog=source.fog.clone();this.backgroundBlurriness=source.backgroundBlurriness;if(source.overrideMaterial!==null)this.overrideMaterial=source.overrideMaterial.clone();this.matrixAutoUpdate=source.matrixAutoUpdate;return this;}toJSON(meta){const data=super.toJSON(meta);if(this.fog!==null)data.object.fog=this.fog.toJSON();if(this.backgroundBlurriness>0)data.backgroundBlurriness=this.backgroundBlurriness;return data;}// @deprecated\nget autoUpdate(){console.warn('THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.');return this.matrixWorldAutoUpdate;}set autoUpdate(value){console.warn('THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.');this.matrixWorldAutoUpdate=value;}}class InterleavedBuffer{constructor(array,stride){this.isInterleavedBuffer=true;this.array=array;this.stride=stride;this.count=array!==undefined?array.length/stride:0;this.usage=StaticDrawUsage;this.updateRange={offset:0,count:-1};this.version=0;this.uuid=three_module_generateUUID();}onUploadCallback(){}set needsUpdate(value){if(value===true)this.version++;}setUsage(value){this.usage=value;return this;}copy(source){this.array=new source.array.constructor(source.array);this.count=source.count;this.stride=source.stride;this.usage=source.usage;return this;}copyAt(index1,attribute,index2){index1*=this.stride;index2*=attribute.stride;for(let i=0,l=this.stride;i<l;i++){this.array[index1+i]=attribute.array[index2+i];}return this;}set(value,offset=0){this.array.set(value,offset);return this;}clone(data){if(data.arrayBuffers===undefined){data.arrayBuffers={};}if(this.array.buffer._uuid===undefined){this.array.buffer._uuid=three_module_generateUUID();}if(data.arrayBuffers[this.array.buffer._uuid]===undefined){var _context25;data.arrayBuffers[this.array.buffer._uuid]=_sliceInstanceProperty(_context25=this.array).call(_context25,0).buffer;}const array=new this.array.constructor(data.arrayBuffers[this.array.buffer._uuid]);const ib=new this.constructor(array,this.stride);ib.setUsage(this.usage);return ib;}onUpload(callback){this.onUploadCallback=callback;return this;}toJSON(data){if(data.arrayBuffers===undefined){data.arrayBuffers={};}// generate UUID for array buffer if necessary\nif(this.array.buffer._uuid===undefined){this.array.buffer._uuid=three_module_generateUUID();}if(data.arrayBuffers[this.array.buffer._uuid]===undefined){data.arrayBuffers[this.array.buffer._uuid]=_Array$from(new Uint32Array(this.array.buffer));}//\nreturn{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride};}}const _vector$6=/*@__PURE__*/new three_module_Vector3();class InterleavedBufferAttribute{constructor(interleavedBuffer,itemSize,offset,normalized=false){this.isInterleavedBufferAttribute=true;this.name='';this.data=interleavedBuffer;this.itemSize=itemSize;this.offset=offset;this.normalized=normalized===true;}get count(){return this.data.count;}get array(){return this.data.array;}set needsUpdate(value){this.data.needsUpdate=value;}applyMatrix4(m){for(let i=0,l=this.data.count;i<l;i++){_vector$6.fromBufferAttribute(this,i);_vector$6.applyMatrix4(m);this.setXYZ(i,_vector$6.x,_vector$6.y,_vector$6.z);}return this;}applyNormalMatrix(m){for(let i=0,l=this.count;i<l;i++){_vector$6.fromBufferAttribute(this,i);_vector$6.applyNormalMatrix(m);this.setXYZ(i,_vector$6.x,_vector$6.y,_vector$6.z);}return this;}transformDirection(m){for(let i=0,l=this.count;i<l;i++){_vector$6.fromBufferAttribute(this,i);_vector$6.transformDirection(m);this.setXYZ(i,_vector$6.x,_vector$6.y,_vector$6.z);}return this;}setX(index,x){if(this.normalized)x=three_module_normalize(x,this.array);this.data.array[index*this.data.stride+this.offset]=x;return this;}setY(index,y){if(this.normalized)y=three_module_normalize(y,this.array);this.data.array[index*this.data.stride+this.offset+1]=y;return this;}setZ(index,z){if(this.normalized)z=three_module_normalize(z,this.array);this.data.array[index*this.data.stride+this.offset+2]=z;return this;}setW(index,w){if(this.normalized)w=three_module_normalize(w,this.array);this.data.array[index*this.data.stride+this.offset+3]=w;return this;}getX(index){let x=this.data.array[index*this.data.stride+this.offset];if(this.normalized)x=three_module_denormalize(x,this.array);return x;}getY(index){let y=this.data.array[index*this.data.stride+this.offset+1];if(this.normalized)y=three_module_denormalize(y,this.array);return y;}getZ(index){let z=this.data.array[index*this.data.stride+this.offset+2];if(this.normalized)z=three_module_denormalize(z,this.array);return z;}getW(index){let w=this.data.array[index*this.data.stride+this.offset+3];if(this.normalized)w=three_module_denormalize(w,this.array);return w;}setXY(index,x,y){index=index*this.data.stride+this.offset;if(this.normalized){x=three_module_normalize(x,this.array);y=three_module_normalize(y,this.array);}this.data.array[index+0]=x;this.data.array[index+1]=y;return this;}setXYZ(index,x,y,z){index=index*this.data.stride+this.offset;if(this.normalized){x=three_module_normalize(x,this.array);y=three_module_normalize(y,this.array);z=three_module_normalize(z,this.array);}this.data.array[index+0]=x;this.data.array[index+1]=y;this.data.array[index+2]=z;return this;}setXYZW(index,x,y,z,w){index=index*this.data.stride+this.offset;if(this.normalized){x=three_module_normalize(x,this.array);y=three_module_normalize(y,this.array);z=three_module_normalize(z,this.array);w=three_module_normalize(w,this.array);}this.data.array[index+0]=x;this.data.array[index+1]=y;this.data.array[index+2]=z;this.data.array[index+3]=w;return this;}clone(data){if(data===undefined){console.log('THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.');const array=[];for(let i=0;i<this.count;i++){const index=i*this.data.stride+this.offset;for(let j=0;j<this.itemSize;j++){array.push(this.data.array[index+j]);}}return new BufferAttribute(new this.array.constructor(array),this.itemSize,this.normalized);}else{if(data.interleavedBuffers===undefined){data.interleavedBuffers={};}if(data.interleavedBuffers[this.data.uuid]===undefined){data.interleavedBuffers[this.data.uuid]=this.data.clone(data);}return new InterleavedBufferAttribute(data.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);}}toJSON(data){if(data===undefined){console.log('THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.');const array=[];for(let i=0;i<this.count;i++){const index=i*this.data.stride+this.offset;for(let j=0;j<this.itemSize;j++){array.push(this.data.array[index+j]);}}// deinterleave data and save it as an ordinary buffer attribute for now\nreturn{itemSize:this.itemSize,type:this.array.constructor.name,array:array,normalized:this.normalized};}else{// save as true interleaved attribtue\nif(data.interleavedBuffers===undefined){data.interleavedBuffers={};}if(data.interleavedBuffers[this.data.uuid]===undefined){data.interleavedBuffers[this.data.uuid]=this.data.toJSON(data);}return{isInterleavedBufferAttribute:true,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};}}}class SpriteMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isSpriteMaterial=true;this.type='SpriteMaterial';this.color=new Color(0xffffff);this.map=null;this.alphaMap=null;this.rotation=0;this.sizeAttenuation=true;this.transparent=true;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.map=_mapInstanceProperty(source);this.alphaMap=source.alphaMap;this.rotation=source.rotation;this.sizeAttenuation=source.sizeAttenuation;this.fog=source.fog;return this;}}let _geometry;const _intersectPoint=/*@__PURE__*/new three_module_Vector3();const _worldScale=/*@__PURE__*/new three_module_Vector3();const _mvPosition=/*@__PURE__*/new three_module_Vector3();const _alignedPosition=/*@__PURE__*/new Vector2();const _rotatedPosition=/*@__PURE__*/new Vector2();const _viewWorldMatrix=/*@__PURE__*/new Matrix4();const _vA=/*@__PURE__*/new three_module_Vector3();const _vB=/*@__PURE__*/new three_module_Vector3();const _vC=/*@__PURE__*/new three_module_Vector3();const _uvA=/*@__PURE__*/new Vector2();const _uvB=/*@__PURE__*/new Vector2();const _uvC=/*@__PURE__*/new Vector2();class Sprite extends (/* unused pure expression or super */ null && (Object3D)){constructor(material){super();this.isSprite=true;this.type='Sprite';if(_geometry===undefined){_geometry=new BufferGeometry();const float32Array=new Float32Array([-0.5,-0.5,0,0,0,0.5,-0.5,0,1,0,0.5,0.5,0,1,1,-0.5,0.5,0,0,1]);const interleavedBuffer=new InterleavedBuffer(float32Array,5);_geometry.setIndex([0,1,2,0,2,3]);_geometry.setAttribute('position',new InterleavedBufferAttribute(interleavedBuffer,3,0,false));_geometry.setAttribute('uv',new InterleavedBufferAttribute(interleavedBuffer,2,3,false));}this.geometry=_geometry;this.material=material!==undefined?material:new SpriteMaterial();this.center=new Vector2(0.5,0.5);}raycast(raycaster,intersects){if(raycaster.camera===null){console.error('THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.');}_worldScale.setFromMatrixScale(this.matrixWorld);_viewWorldMatrix.copy(raycaster.camera.matrixWorld);this.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse,this.matrixWorld);_mvPosition.setFromMatrixPosition(this.modelViewMatrix);if(raycaster.camera.isPerspectiveCamera&&this.material.sizeAttenuation===false){_worldScale.multiplyScalar(-_mvPosition.z);}const rotation=this.material.rotation;let sin,cos;if(rotation!==0){cos=Math.cos(rotation);sin=Math.sin(rotation);}const center=this.center;transformVertex(_vA.set(-0.5,-0.5,0),_mvPosition,center,_worldScale,sin,cos);transformVertex(_vB.set(0.5,-0.5,0),_mvPosition,center,_worldScale,sin,cos);transformVertex(_vC.set(0.5,0.5,0),_mvPosition,center,_worldScale,sin,cos);_uvA.set(0,0);_uvB.set(1,0);_uvC.set(1,1);// check first triangle\nlet intersect=raycaster.ray.intersectTriangle(_vA,_vB,_vC,false,_intersectPoint);if(intersect===null){// check second triangle\ntransformVertex(_vB.set(-0.5,0.5,0),_mvPosition,center,_worldScale,sin,cos);_uvB.set(0,1);intersect=raycaster.ray.intersectTriangle(_vA,_vC,_vB,false,_intersectPoint);if(intersect===null){return;}}const distance=raycaster.ray.origin.distanceTo(_intersectPoint);if(distance<raycaster.near||distance>raycaster.far)return;intersects.push({distance:distance,point:_intersectPoint.clone(),uv:three_module_Triangle.getUV(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2()),face:null,object:this});}copy(source,recursive){super.copy(source,recursive);if(source.center!==undefined)this.center.copy(source.center);this.material=source.material;return this;}}function transformVertex(vertexPosition,mvPosition,center,scale,sin,cos){// compute position in camera space\n_alignedPosition.subVectors(vertexPosition,center).addScalar(0.5).multiply(scale);// to check if rotation is not zero\nif(sin!==undefined){_rotatedPosition.x=cos*_alignedPosition.x-sin*_alignedPosition.y;_rotatedPosition.y=sin*_alignedPosition.x+cos*_alignedPosition.y;}else{_rotatedPosition.copy(_alignedPosition);}vertexPosition.copy(mvPosition);vertexPosition.x+=_rotatedPosition.x;vertexPosition.y+=_rotatedPosition.y;// transform to world space\nvertexPosition.applyMatrix4(_viewWorldMatrix);}const _v1$2=/*@__PURE__*/new three_module_Vector3();const _v2$1=/*@__PURE__*/new three_module_Vector3();class LOD extends (/* unused pure expression or super */ null && (Object3D)){constructor(){super();this._currentLevel=0;this.type='LOD';_Object$defineProperties(this,{levels:{enumerable:true,value:[]},isLOD:{value:true}});this.autoUpdate=true;}copy(source){super.copy(source,false);const levels=source.levels;for(let i=0,l=levels.length;i<l;i++){const level=levels[i];this.addLevel(level.object.clone(),level.distance);}this.autoUpdate=source.autoUpdate;return this;}addLevel(object,distance=0){distance=Math.abs(distance);const levels=this.levels;let l;for(l=0;l<levels.length;l++){if(distance<levels[l].distance){break;}}_spliceInstanceProperty(levels).call(levels,l,0,{distance:distance,object:object});this.add(object);return this;}getCurrentLevel(){return this._currentLevel;}getObjectForDistance(distance){const levels=this.levels;if(levels.length>0){let i,l;for(i=1,l=levels.length;i<l;i++){if(distance<levels[i].distance){break;}}return levels[i-1].object;}return null;}raycast(raycaster,intersects){const levels=this.levels;if(levels.length>0){_v1$2.setFromMatrixPosition(this.matrixWorld);const distance=raycaster.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(distance).raycast(raycaster,intersects);}}update(camera){const levels=this.levels;if(levels.length>1){_v1$2.setFromMatrixPosition(camera.matrixWorld);_v2$1.setFromMatrixPosition(this.matrixWorld);const distance=_v1$2.distanceTo(_v2$1)/camera.zoom;levels[0].object.visible=true;let i,l;for(i=1,l=levels.length;i<l;i++){if(distance>=levels[i].distance){levels[i-1].object.visible=false;levels[i].object.visible=true;}else{break;}}this._currentLevel=i-1;for(;i<l;i++){levels[i].object.visible=false;}}}toJSON(meta){const data=super.toJSON(meta);if(this.autoUpdate===false)data.object.autoUpdate=false;data.object.levels=[];const levels=this.levels;for(let i=0,l=levels.length;i<l;i++){const level=levels[i];data.object.levels.push({object:level.object.uuid,distance:level.distance});}return data;}}const _basePosition=/*@__PURE__*/new three_module_Vector3();const _skinIndex=/*@__PURE__*/new Vector4();const _skinWeight=/*@__PURE__*/new Vector4();const _vector$5=/*@__PURE__*/new three_module_Vector3();const _matrix=/*@__PURE__*/new Matrix4();class SkinnedMesh extends (/* unused pure expression or super */ null && (Mesh)){constructor(geometry,material){super(geometry,material);this.isSkinnedMesh=true;this.type='SkinnedMesh';this.bindMode='attached';this.bindMatrix=new Matrix4();this.bindMatrixInverse=new Matrix4();}copy(source,recursive){super.copy(source,recursive);this.bindMode=source.bindMode;this.bindMatrix.copy(source.bindMatrix);this.bindMatrixInverse.copy(source.bindMatrixInverse);this.skeleton=source.skeleton;return this;}bind(skeleton,bindMatrix){this.skeleton=skeleton;if(bindMatrix===undefined){this.updateMatrixWorld(true);this.skeleton.calculateInverses();bindMatrix=this.matrixWorld;}this.bindMatrix.copy(bindMatrix);this.bindMatrixInverse.copy(bindMatrix).invert();}pose(){this.skeleton.pose();}normalizeSkinWeights(){const vector=new Vector4();const skinWeight=this.geometry.attributes.skinWeight;for(let i=0,l=skinWeight.count;i<l;i++){vector.fromBufferAttribute(skinWeight,i);const scale=1.0/vector.manhattanLength();if(scale!==Infinity){vector.multiplyScalar(scale);}else{vector.set(1,0,0,0);// do something reasonable\n}skinWeight.setXYZW(i,vector.x,vector.y,vector.z,vector.w);}}updateMatrixWorld(force){super.updateMatrixWorld(force);if(this.bindMode==='attached'){this.bindMatrixInverse.copy(this.matrixWorld).invert();}else if(this.bindMode==='detached'){this.bindMatrixInverse.copy(this.bindMatrix).invert();}else{console.warn('THREE.SkinnedMesh: Unrecognized bindMode: '+this.bindMode);}}boneTransform(index,target){const skeleton=this.skeleton;const geometry=this.geometry;_skinIndex.fromBufferAttribute(geometry.attributes.skinIndex,index);_skinWeight.fromBufferAttribute(geometry.attributes.skinWeight,index);_basePosition.copy(target).applyMatrix4(this.bindMatrix);target.set(0,0,0);for(let i=0;i<4;i++){const weight=_skinWeight.getComponent(i);if(weight!==0){const boneIndex=_skinIndex.getComponent(i);_matrix.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld,skeleton.boneInverses[boneIndex]);target.addScaledVector(_vector$5.copy(_basePosition).applyMatrix4(_matrix),weight);}}return target.applyMatrix4(this.bindMatrixInverse);}}class Bone extends (/* unused pure expression or super */ null && (Object3D)){constructor(){super();this.isBone=true;this.type='Bone';}}class DataTexture extends (/* unused pure expression or super */ null && (Texture)){constructor(data=null,width=1,height=1,format,type,mapping,wrapS,wrapT,magFilter=NearestFilter,minFilter=NearestFilter,anisotropy,encoding){super(null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding);this.isDataTexture=true;this.image={data:data,width:width,height:height};this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1;}}const _offsetMatrix=/*@__PURE__*/new Matrix4();const _identityMatrix=/*@__PURE__*/new Matrix4();class Skeleton{constructor(bones=[],boneInverses=[]){this.uuid=three_module_generateUUID();this.bones=_sliceInstanceProperty(bones).call(bones,0);this.boneInverses=boneInverses;this.boneMatrices=null;this.boneTexture=null;this.boneTextureSize=0;this.frame=-1;this.init();}init(){const bones=this.bones;const boneInverses=this.boneInverses;this.boneMatrices=new Float32Array(bones.length*16);// calculate inverse bone matrices if necessary\nif(boneInverses.length===0){this.calculateInverses();}else{// handle special case\nif(bones.length!==boneInverses.length){console.warn('THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.');this.boneInverses=[];for(let i=0,il=this.bones.length;i<il;i++){this.boneInverses.push(new Matrix4());}}}}calculateInverses(){this.boneInverses.length=0;for(let i=0,il=this.bones.length;i<il;i++){const inverse=new Matrix4();if(this.bones[i]){inverse.copy(this.bones[i].matrixWorld).invert();}this.boneInverses.push(inverse);}}pose(){// recover the bind-time world matrices\nfor(let i=0,il=this.bones.length;i<il;i++){const bone=this.bones[i];if(bone){bone.matrixWorld.copy(this.boneInverses[i]).invert();}}// compute the local matrices, positions, rotations and scales\nfor(let i=0,il=this.bones.length;i<il;i++){const bone=this.bones[i];if(bone){if(bone.parent&&bone.parent.isBone){bone.matrix.copy(bone.parent.matrixWorld).invert();bone.matrix.multiply(bone.matrixWorld);}else{bone.matrix.copy(bone.matrixWorld);}bone.matrix.decompose(bone.position,bone.quaternion,bone.scale);}}}update(){const bones=this.bones;const boneInverses=this.boneInverses;const boneMatrices=this.boneMatrices;const boneTexture=this.boneTexture;// flatten bone matrices to array\nfor(let i=0,il=bones.length;i<il;i++){// compute the offset between the current and the original transform\nconst matrix=bones[i]?bones[i].matrixWorld:_identityMatrix;_offsetMatrix.multiplyMatrices(matrix,boneInverses[i]);_offsetMatrix.toArray(boneMatrices,i*16);}if(boneTexture!==null){boneTexture.needsUpdate=true;}}clone(){return new Skeleton(this.bones,this.boneInverses);}computeBoneTexture(){// layout (1 matrix = 4 pixels)\n// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)\n// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)\n// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)\n// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\nlet size=Math.sqrt(this.bones.length*4);// 4 pixels needed for 1 matrix\nsize=three_module_ceilPowerOfTwo(size);size=Math.max(size,4);const boneMatrices=new Float32Array(size*size*4);// 4 floats per RGBA pixel\nboneMatrices.set(this.boneMatrices);// copy current values\nconst boneTexture=new DataTexture(boneMatrices,size,size,RGBAFormat,FloatType);boneTexture.needsUpdate=true;this.boneMatrices=boneMatrices;this.boneTexture=boneTexture;this.boneTextureSize=size;return this;}getBoneByName(name){for(let i=0,il=this.bones.length;i<il;i++){const bone=this.bones[i];if(bone.name===name){return bone;}}return undefined;}dispose(){if(this.boneTexture!==null){this.boneTexture.dispose();this.boneTexture=null;}}fromJSON(json,bones){this.uuid=json.uuid;for(let i=0,l=json.bones.length;i<l;i++){const uuid=json.bones[i];let bone=bones[uuid];if(bone===undefined){console.warn('THREE.Skeleton: No bone found with UUID:',uuid);bone=new Bone();}this.bones.push(bone);this.boneInverses.push(new Matrix4().fromArray(json.boneInverses[i]));}this.init();return this;}toJSON(){const data={metadata:{version:4.5,type:'Skeleton',generator:'Skeleton.toJSON'},bones:[],boneInverses:[]};data.uuid=this.uuid;const bones=this.bones;const boneInverses=this.boneInverses;for(let i=0,l=bones.length;i<l;i++){const bone=bones[i];data.bones.push(bone.uuid);const boneInverse=boneInverses[i];data.boneInverses.push(boneInverse.toArray());}return data;}}class InstancedBufferAttribute extends (/* unused pure expression or super */ null && (BufferAttribute)){constructor(array,itemSize,normalized,meshPerAttribute=1){super(array,itemSize,normalized);this.isInstancedBufferAttribute=true;this.meshPerAttribute=meshPerAttribute;}copy(source){super.copy(source);this.meshPerAttribute=source.meshPerAttribute;return this;}toJSON(){const data=super.toJSON();data.meshPerAttribute=this.meshPerAttribute;data.isInstancedBufferAttribute=true;return data;}}const _instanceLocalMatrix=/*@__PURE__*/new Matrix4();const _instanceWorldMatrix=/*@__PURE__*/new Matrix4();const _instanceIntersects=(/* unused pure expression or super */ null && ([]));const _identity=/*@__PURE__*/new Matrix4();const _mesh=/*@__PURE__*/new Mesh();class InstancedMesh extends (/* unused pure expression or super */ null && (Mesh)){constructor(geometry,material,count){super(geometry,material);this.isInstancedMesh=true;this.instanceMatrix=new InstancedBufferAttribute(new Float32Array(count*16),16);this.instanceColor=null;this.count=count;this.frustumCulled=false;for(let i=0;i<count;i++){this.setMatrixAt(i,_identity);}}copy(source,recursive){super.copy(source,recursive);this.instanceMatrix.copy(source.instanceMatrix);if(source.instanceColor!==null)this.instanceColor=source.instanceColor.clone();this.count=source.count;return this;}getColorAt(index,color){color.fromArray(this.instanceColor.array,index*3);}getMatrixAt(index,matrix){matrix.fromArray(this.instanceMatrix.array,index*16);}raycast(raycaster,intersects){const matrixWorld=this.matrixWorld;const raycastTimes=this.count;_mesh.geometry=this.geometry;_mesh.material=this.material;if(_mesh.material===undefined)return;for(let instanceId=0;instanceId<raycastTimes;instanceId++){// calculate the world matrix for each instance\nthis.getMatrixAt(instanceId,_instanceLocalMatrix);_instanceWorldMatrix.multiplyMatrices(matrixWorld,_instanceLocalMatrix);// the mesh represents this single instance\n_mesh.matrixWorld=_instanceWorldMatrix;_mesh.raycast(raycaster,_instanceIntersects);// process the result of raycast\nfor(let i=0,l=_instanceIntersects.length;i<l;i++){const intersect=_instanceIntersects[i];intersect.instanceId=instanceId;intersect.object=this;intersects.push(intersect);}_instanceIntersects.length=0;}}setColorAt(index,color){if(this.instanceColor===null){this.instanceColor=new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count*3),3);}color.toArray(this.instanceColor.array,index*3);}setMatrixAt(index,matrix){matrix.toArray(this.instanceMatrix.array,index*16);}updateMorphTargets(){}dispose(){this.dispatchEvent({type:'dispose'});}}class LineBasicMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isLineBasicMaterial=true;this.type='LineBasicMaterial';this.color=new Color(0xffffff);this.linewidth=1;this.linecap='round';this.linejoin='round';this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.linewidth=source.linewidth;this.linecap=source.linecap;this.linejoin=source.linejoin;this.fog=source.fog;return this;}}const _start$1=/*@__PURE__*/new three_module_Vector3();const _end$1=/*@__PURE__*/new three_module_Vector3();const _inverseMatrix$1=/*@__PURE__*/new Matrix4();const _ray$1=/*@__PURE__*/new Ray();const _sphere$1=/*@__PURE__*/new Sphere();class Line extends (/* unused pure expression or super */ null && (Object3D)){constructor(geometry=new BufferGeometry(),material=new LineBasicMaterial()){super();this.isLine=true;this.type='Line';this.geometry=geometry;this.material=material;this.updateMorphTargets();}copy(source,recursive){super.copy(source,recursive);this.material=source.material;this.geometry=source.geometry;return this;}computeLineDistances(){const geometry=this.geometry;// we assume non-indexed geometry\nif(geometry.index===null){const positionAttribute=geometry.attributes.position;const lineDistances=[0];for(let i=1,l=positionAttribute.count;i<l;i++){_start$1.fromBufferAttribute(positionAttribute,i-1);_end$1.fromBufferAttribute(positionAttribute,i);lineDistances[i]=lineDistances[i-1];lineDistances[i]+=_start$1.distanceTo(_end$1);}geometry.setAttribute('lineDistance',new Float32BufferAttribute(lineDistances,1));}else{console.warn('THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.');}return this;}raycast(raycaster,intersects){const geometry=this.geometry;const matrixWorld=this.matrixWorld;const threshold=raycaster.params.Line.threshold;const drawRange=geometry.drawRange;// Checking boundingSphere distance to ray\nif(geometry.boundingSphere===null)geometry.computeBoundingSphere();_sphere$1.copy(geometry.boundingSphere);_sphere$1.applyMatrix4(matrixWorld);_sphere$1.radius+=threshold;if(raycaster.ray.intersectsSphere(_sphere$1)===false)return;//\n_inverseMatrix$1.copy(matrixWorld).invert();_ray$1.copy(raycaster.ray).applyMatrix4(_inverseMatrix$1);const localThreshold=threshold/((this.scale.x+this.scale.y+this.scale.z)/3);const localThresholdSq=localThreshold*localThreshold;const vStart=new three_module_Vector3();const vEnd=new three_module_Vector3();const interSegment=new three_module_Vector3();const interRay=new three_module_Vector3();const step=this.isLineSegments?2:1;const index=geometry.index;const attributes=geometry.attributes;const positionAttribute=attributes.position;if(index!==null){const start=Math.max(0,drawRange.start);const end=Math.min(index.count,drawRange.start+drawRange.count);for(let i=start,l=end-1;i<l;i+=step){const a=index.getX(i);const b=index.getX(i+1);vStart.fromBufferAttribute(positionAttribute,a);vEnd.fromBufferAttribute(positionAttribute,b);const distSq=_ray$1.distanceSqToSegment(vStart,vEnd,interRay,interSegment);if(distSq>localThresholdSq)continue;interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation\nconst distance=raycaster.ray.origin.distanceTo(interRay);if(distance<raycaster.near||distance>raycaster.far)continue;intersects.push({distance:distance,// What do we want? intersection point on the ray or on the segment??\n// point: raycaster.ray.at( distance ),\npoint:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this});}}else{const start=Math.max(0,drawRange.start);const end=Math.min(positionAttribute.count,drawRange.start+drawRange.count);for(let i=start,l=end-1;i<l;i+=step){vStart.fromBufferAttribute(positionAttribute,i);vEnd.fromBufferAttribute(positionAttribute,i+1);const distSq=_ray$1.distanceSqToSegment(vStart,vEnd,interRay,interSegment);if(distSq>localThresholdSq)continue;interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation\nconst distance=raycaster.ray.origin.distanceTo(interRay);if(distance<raycaster.near||distance>raycaster.far)continue;intersects.push({distance:distance,// What do we want? intersection point on the ray or on the segment??\n// point: raycaster.ray.at( distance ),\npoint:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this});}}}updateMorphTargets(){const geometry=this.geometry;const morphAttributes=geometry.morphAttributes;const keys=_Object$keys(morphAttributes);if(keys.length>0){const morphAttribute=morphAttributes[keys[0]];if(morphAttribute!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;m<ml;m++){const name=morphAttribute[m].name||String(m);this.morphTargetInfluences.push(0);this.morphTargetDictionary[name]=m;}}}}}const _start=/*@__PURE__*/new three_module_Vector3();const _end=/*@__PURE__*/new three_module_Vector3();class LineSegments extends (/* unused pure expression or super */ null && (Line)){constructor(geometry,material){super(geometry,material);this.isLineSegments=true;this.type='LineSegments';}computeLineDistances(){const geometry=this.geometry;// we assume non-indexed geometry\nif(geometry.index===null){const positionAttribute=geometry.attributes.position;const lineDistances=[];for(let i=0,l=positionAttribute.count;i<l;i+=2){_start.fromBufferAttribute(positionAttribute,i);_end.fromBufferAttribute(positionAttribute,i+1);lineDistances[i]=i===0?0:lineDistances[i-1];lineDistances[i+1]=lineDistances[i]+_start.distanceTo(_end);}geometry.setAttribute('lineDistance',new Float32BufferAttribute(lineDistances,1));}else{console.warn('THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.');}return this;}}class LineLoop extends (/* unused pure expression or super */ null && (Line)){constructor(geometry,material){super(geometry,material);this.isLineLoop=true;this.type='LineLoop';}}class PointsMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isPointsMaterial=true;this.type='PointsMaterial';this.color=new Color(0xffffff);this.map=null;this.alphaMap=null;this.size=1;this.sizeAttenuation=true;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.map=_mapInstanceProperty(source);this.alphaMap=source.alphaMap;this.size=source.size;this.sizeAttenuation=source.sizeAttenuation;this.fog=source.fog;return this;}}const _inverseMatrix=/*@__PURE__*/new Matrix4();const _ray=/*@__PURE__*/new Ray();const _sphere=/*@__PURE__*/new Sphere();const _position$2=/*@__PURE__*/new three_module_Vector3();class Points extends (/* unused pure expression or super */ null && (Object3D)){constructor(geometry=new BufferGeometry(),material=new PointsMaterial()){super();this.isPoints=true;this.type='Points';this.geometry=geometry;this.material=material;this.updateMorphTargets();}copy(source,recursive){super.copy(source,recursive);this.material=source.material;this.geometry=source.geometry;return this;}raycast(raycaster,intersects){const geometry=this.geometry;const matrixWorld=this.matrixWorld;const threshold=raycaster.params.Points.threshold;const drawRange=geometry.drawRange;// Checking boundingSphere distance to ray\nif(geometry.boundingSphere===null)geometry.computeBoundingSphere();_sphere.copy(geometry.boundingSphere);_sphere.applyMatrix4(matrixWorld);_sphere.radius+=threshold;if(raycaster.ray.intersectsSphere(_sphere)===false)return;//\n_inverseMatrix.copy(matrixWorld).invert();_ray.copy(raycaster.ray).applyMatrix4(_inverseMatrix);const localThreshold=threshold/((this.scale.x+this.scale.y+this.scale.z)/3);const localThresholdSq=localThreshold*localThreshold;const index=geometry.index;const attributes=geometry.attributes;const positionAttribute=attributes.position;if(index!==null){const start=Math.max(0,drawRange.start);const end=Math.min(index.count,drawRange.start+drawRange.count);for(let i=start,il=end;i<il;i++){const a=index.getX(i);_position$2.fromBufferAttribute(positionAttribute,a);testPoint(_position$2,a,localThresholdSq,matrixWorld,raycaster,intersects,this);}}else{const start=Math.max(0,drawRange.start);const end=Math.min(positionAttribute.count,drawRange.start+drawRange.count);for(let i=start,l=end;i<l;i++){_position$2.fromBufferAttribute(positionAttribute,i);testPoint(_position$2,i,localThresholdSq,matrixWorld,raycaster,intersects,this);}}}updateMorphTargets(){const geometry=this.geometry;const morphAttributes=geometry.morphAttributes;const keys=_Object$keys(morphAttributes);if(keys.length>0){const morphAttribute=morphAttributes[keys[0]];if(morphAttribute!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;m<ml;m++){const name=morphAttribute[m].name||String(m);this.morphTargetInfluences.push(0);this.morphTargetDictionary[name]=m;}}}}}function testPoint(point,index,localThresholdSq,matrixWorld,raycaster,intersects,object){const rayPointDistanceSq=_ray.distanceSqToPoint(point);if(rayPointDistanceSq<localThresholdSq){const intersectPoint=new three_module_Vector3();_ray.closestPointToPoint(point,intersectPoint);intersectPoint.applyMatrix4(matrixWorld);const distance=raycaster.ray.origin.distanceTo(intersectPoint);if(distance<raycaster.near||distance>raycaster.far)return;intersects.push({distance:distance,distanceToRay:Math.sqrt(rayPointDistanceSq),point:intersectPoint,index:index,face:null,object:object});}}class VideoTexture extends (/* unused pure expression or super */ null && (Texture)){constructor(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){super(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy);this.isVideoTexture=true;this.minFilter=minFilter!==undefined?minFilter:LinearFilter;this.magFilter=magFilter!==undefined?magFilter:LinearFilter;this.generateMipmaps=false;const scope=this;function updateVideo(){scope.needsUpdate=true;video.requestVideoFrameCallback(updateVideo);}if('requestVideoFrameCallback'in video){video.requestVideoFrameCallback(updateVideo);}}clone(){return new this.constructor(this.image).copy(this);}update(){const video=this.image;const hasVideoFrameCallback=('requestVideoFrameCallback'in video);if(hasVideoFrameCallback===false&&video.readyState>=video.HAVE_CURRENT_DATA){this.needsUpdate=true;}}}class FramebufferTexture extends (/* unused pure expression or super */ null && (Texture)){constructor(width,height,format){super({width,height});this.isFramebufferTexture=true;this.format=format;this.magFilter=NearestFilter;this.minFilter=NearestFilter;this.generateMipmaps=false;this.needsUpdate=true;}}class CompressedTexture extends (/* unused pure expression or super */ null && (Texture)){constructor(mipmaps,width,height,format,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,encoding){super(null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding);this.isCompressedTexture=true;this.image={width:width,height:height};this.mipmaps=mipmaps;// no flipping for cube textures\n// (also flipping doesn't work for compressed textures )\nthis.flipY=false;// can't generate mipmaps for compressed textures\n// mips must be embedded in DDS files\nthis.generateMipmaps=false;}}class CompressedArrayTexture extends (/* unused pure expression or super */ null && (CompressedTexture)){constructor(mipmaps,width,height,depth,format,type){super(mipmaps,width,height,format,type);this.isCompressedArrayTexture=true;this.image.depth=depth;this.wrapR=ClampToEdgeWrapping;}}class CanvasTexture extends (/* unused pure expression or super */ null && (Texture)){constructor(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){super(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy);this.isCanvasTexture=true;this.needsUpdate=true;}}/**\n * Extensible curve object.\n *\n * Some common of curve methods:\n * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )\n * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )\n * .getPoints(), .getSpacedPoints()\n * .getLength()\n * .updateArcLengths()\n *\n * This following curves inherit from THREE.Curve:\n *\n * -- 2D curves --\n * THREE.ArcCurve\n * THREE.CubicBezierCurve\n * THREE.EllipseCurve\n * THREE.LineCurve\n * THREE.QuadraticBezierCurve\n * THREE.SplineCurve\n *\n * -- 3D curves --\n * THREE.CatmullRomCurve3\n * THREE.CubicBezierCurve3\n * THREE.LineCurve3\n * THREE.QuadraticBezierCurve3\n *\n * A series of curves can be represented as a THREE.CurvePath.\n *\n **/class Curve{constructor(){this.type='Curve';this.arcLengthDivisions=200;}// Virtual base class method to overwrite and implement in subclasses\n//\t- t [0 .. 1]\ngetPoint(){console.warn('THREE.Curve: .getPoint() not implemented.');return null;}// Get point at relative position in curve according to arc length\n// - u [0 .. 1]\ngetPointAt(u,optionalTarget){const t=this.getUtoTmapping(u);return this.getPoint(t,optionalTarget);}// Get sequence of points using getPoint( t )\ngetPoints(divisions=5){const points=[];for(let d=0;d<=divisions;d++){points.push(this.getPoint(d/divisions));}return points;}// Get sequence of points using getPointAt( u )\ngetSpacedPoints(divisions=5){const points=[];for(let d=0;d<=divisions;d++){points.push(this.getPointAt(d/divisions));}return points;}// Get total curve arc length\ngetLength(){const lengths=this.getLengths();return lengths[lengths.length-1];}// Get list of cumulative segment lengths\ngetLengths(divisions=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===divisions+1&&!this.needsUpdate){return this.cacheArcLengths;}this.needsUpdate=false;const cache=[];let current,last=this.getPoint(0);let sum=0;cache.push(0);for(let p=1;p<=divisions;p++){current=this.getPoint(p/divisions);sum+=current.distanceTo(last);cache.push(sum);last=current;}this.cacheArcLengths=cache;return cache;// { sums: cache, sum: sum }; Sum is in the last element.\n}updateArcLengths(){this.needsUpdate=true;this.getLengths();}// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\ngetUtoTmapping(u,distance){const arcLengths=this.getLengths();let i=0;const il=arcLengths.length;let targetArcLength;// The targeted u distance value to get\nif(distance){targetArcLength=distance;}else{targetArcLength=u*arcLengths[il-1];}// binary search for the index with largest value smaller than target u distance\nlet low=0,high=il-1,comparison;while(low<=high){i=Math.floor(low+(high-low)/2);// less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\ncomparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(comparison>0){high=i-1;}else{high=i;break;// DONE\n}}i=high;if(arcLengths[i]===targetArcLength){return i/(il-1);}// we could get finer grain at lengths, or use simple interpolation between two points\nconst lengthBefore=arcLengths[i];const lengthAfter=arcLengths[i+1];const segmentLength=lengthAfter-lengthBefore;// determine where we are between the 'before' and 'after' points\nconst segmentFraction=(targetArcLength-lengthBefore)/segmentLength;// add that fractional amount to t\nconst t=(i+segmentFraction)/(il-1);return t;}// Returns a unit vector tangent at t\n// In case any sub curve does not implement its tangent derivation,\n// 2 points a small delta apart will be used to find its gradient\n// which seems to give a reasonable approximation\ngetTangent(t,optionalTarget){const delta=0.0001;let t1=t-delta;let t2=t+delta;// Capping in case of danger\nif(t1<0)t1=0;if(t2>1)t2=1;const pt1=this.getPoint(t1);const pt2=this.getPoint(t2);const tangent=optionalTarget||(pt1.isVector2?new Vector2():new three_module_Vector3());tangent.copy(pt2).sub(pt1).normalize();return tangent;}getTangentAt(u,optionalTarget){const t=this.getUtoTmapping(u);return this.getTangent(t,optionalTarget);}computeFrenetFrames(segments,closed){// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\nconst normal=new three_module_Vector3();const tangents=[];const normals=[];const binormals=[];const vec=new three_module_Vector3();const mat=new Matrix4();// compute the tangent vectors for each segment on the curve\nfor(let i=0;i<=segments;i++){const u=i/segments;tangents[i]=this.getTangentAt(u,new three_module_Vector3());}// select an initial normal vector perpendicular to the first tangent vector,\n// and in the direction of the minimum tangent xyz component\nnormals[0]=new three_module_Vector3();binormals[0]=new three_module_Vector3();let min=Number.MAX_VALUE;const tx=Math.abs(tangents[0].x);const ty=Math.abs(tangents[0].y);const tz=Math.abs(tangents[0].z);if(tx<=min){min=tx;normal.set(1,0,0);}if(ty<=min){min=ty;normal.set(0,1,0);}if(tz<=min){normal.set(0,0,1);}vec.crossVectors(tangents[0],normal).normalize();normals[0].crossVectors(tangents[0],vec);binormals[0].crossVectors(tangents[0],normals[0]);// compute the slowly-varying normal and binormal vectors for each segment on the curve\nfor(let i=1;i<=segments;i++){normals[i]=normals[i-1].clone();binormals[i]=binormals[i-1].clone();vec.crossVectors(tangents[i-1],tangents[i]);if(vec.length()>epsilon){vec.normalize();const theta=Math.acos(three_module_clamp(tangents[i-1].dot(tangents[i]),-1,1));// clamp for floating pt errors\nnormals[i].applyMatrix4(mat.makeRotationAxis(vec,theta));}binormals[i].crossVectors(tangents[i],normals[i]);}// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\nif(closed===true){let theta=Math.acos(three_module_clamp(normals[0].dot(normals[segments]),-1,1));theta/=segments;if(tangents[0].dot(vec.crossVectors(normals[0],normals[segments]))>0){theta=-theta;}for(let i=1;i<=segments;i++){// twist a little...\nnormals[i].applyMatrix4(mat.makeRotationAxis(tangents[i],theta*i));binormals[i].crossVectors(tangents[i],normals[i]);}}return{tangents:tangents,normals:normals,binormals:binormals};}clone(){return new this.constructor().copy(this);}copy(source){this.arcLengthDivisions=source.arcLengthDivisions;return this;}toJSON(){const data={metadata:{version:4.5,type:'Curve',generator:'Curve.toJSON'}};data.arcLengthDivisions=this.arcLengthDivisions;data.type=this.type;return data;}fromJSON(json){this.arcLengthDivisions=json.arcLengthDivisions;return this;}}class EllipseCurve extends Curve{constructor(aX=0,aY=0,xRadius=1,yRadius=1,aStartAngle=0,aEndAngle=Math.PI*2,aClockwise=false,aRotation=0){super();this.isEllipseCurve=true;this.type='EllipseCurve';this.aX=aX;this.aY=aY;this.xRadius=xRadius;this.yRadius=yRadius;this.aStartAngle=aStartAngle;this.aEndAngle=aEndAngle;this.aClockwise=aClockwise;this.aRotation=aRotation;}getPoint(t,optionalTarget){const point=optionalTarget||new Vector2();const twoPi=Math.PI*2;let deltaAngle=this.aEndAngle-this.aStartAngle;const samePoints=Math.abs(deltaAngle)<epsilon;// ensures that deltaAngle is 0 .. 2 PI\nwhile(deltaAngle<0)deltaAngle+=twoPi;while(deltaAngle>twoPi)deltaAngle-=twoPi;if(deltaAngle<epsilon){if(samePoints){deltaAngle=0;}else{deltaAngle=twoPi;}}if(this.aClockwise===true&&!samePoints){if(deltaAngle===twoPi){deltaAngle=-twoPi;}else{deltaAngle=deltaAngle-twoPi;}}const angle=this.aStartAngle+t*deltaAngle;let x=this.aX+this.xRadius*Math.cos(angle);let y=this.aY+this.yRadius*Math.sin(angle);if(this.aRotation!==0){const cos=Math.cos(this.aRotation);const sin=Math.sin(this.aRotation);const tx=x-this.aX;const ty=y-this.aY;// Rotate the point about the center of the ellipse.\nx=tx*cos-ty*sin+this.aX;y=tx*sin+ty*cos+this.aY;}return point.set(x,y);}copy(source){super.copy(source);this.aX=source.aX;this.aY=source.aY;this.xRadius=source.xRadius;this.yRadius=source.yRadius;this.aStartAngle=source.aStartAngle;this.aEndAngle=source.aEndAngle;this.aClockwise=source.aClockwise;this.aRotation=source.aRotation;return this;}toJSON(){const data=super.toJSON();data.aX=this.aX;data.aY=this.aY;data.xRadius=this.xRadius;data.yRadius=this.yRadius;data.aStartAngle=this.aStartAngle;data.aEndAngle=this.aEndAngle;data.aClockwise=this.aClockwise;data.aRotation=this.aRotation;return data;}fromJSON(json){super.fromJSON(json);this.aX=json.aX;this.aY=json.aY;this.xRadius=json.xRadius;this.yRadius=json.yRadius;this.aStartAngle=json.aStartAngle;this.aEndAngle=json.aEndAngle;this.aClockwise=json.aClockwise;this.aRotation=json.aRotation;return this;}}class ArcCurve extends EllipseCurve{constructor(aX,aY,aRadius,aStartAngle,aEndAngle,aClockwise){super(aX,aY,aRadius,aRadius,aStartAngle,aEndAngle,aClockwise);this.isArcCurve=true;this.type='ArcCurve';}}/**\n * Centripetal CatmullRom Curve - which is useful for avoiding\n * cusps and self-intersections in non-uniform catmull rom curves.\n * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n *\n * curve.type accepts centripetal(default), chordal and catmullrom\n * curve.tension is used for catmullrom which defaults to 0.5\n */ /*\nBased on an optimized c++ solution in\n - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n - http://ideone.com/NoEbVM\n\nThis CubicPoly class could be used for reusing some variables and calculations,\nbut for three.js curve use, it could be possible inlined and flatten into a single function call\nwhich can be placed in CurveUtils.\n*/function CubicPoly(){let c0=0,c1=0,c2=0,c3=0;/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */function init(x0,x1,t0,t1){c0=x0;c1=t0;c2=-3*x0+3*x1-2*t0-t1;c3=2*x0-2*x1+t0+t1;}return{initCatmullRom:function(x0,x1,x2,x3,tension){init(x1,x2,tension*(x2-x0),tension*(x3-x1));},initNonuniformCatmullRom:function(x0,x1,x2,x3,dt0,dt1,dt2){// compute tangents when parameterized in [t1,t2]\nlet t1=(x1-x0)/dt0-(x2-x0)/(dt0+dt1)+(x2-x1)/dt1;let t2=(x2-x1)/dt1-(x3-x1)/(dt1+dt2)+(x3-x2)/dt2;// rescale tangents for parametrization in [0,1]\nt1*=dt1;t2*=dt1;init(x1,x2,t1,t2);},calc:function(t){const t2=t*t;const t3=t2*t;return c0+c1*t+c2*t2+c3*t3;}};}//\nconst tmp=/*@__PURE__*/new three_module_Vector3();const px=/*@__PURE__*/new CubicPoly();const py=/*@__PURE__*/new CubicPoly();const pz=/*@__PURE__*/new CubicPoly();class CatmullRomCurve3 extends Curve{constructor(points=[],closed=false,curveType='centripetal',tension=0.5){super();this.isCatmullRomCurve3=true;this.type='CatmullRomCurve3';this.points=points;this.closed=closed;this.curveType=curveType;this.tension=tension;}getPoint(t,optionalTarget=new three_module_Vector3()){const point=optionalTarget;const points=this.points;const l=points.length;const p=(l-(this.closed?0:1))*t;let intPoint=Math.floor(p);let weight=p-intPoint;if(this.closed){intPoint+=intPoint>0?0:(Math.floor(Math.abs(intPoint)/l)+1)*l;}else if(weight===0&&intPoint===l-1){intPoint=l-2;weight=1;}let p0,p3;// 4 points (p1 & p2 defined below)\nif(this.closed||intPoint>0){p0=points[(intPoint-1)%l];}else{// extrapolate first point\ntmp.subVectors(points[0],points[1]).add(points[0]);p0=tmp;}const p1=points[intPoint%l];const p2=points[(intPoint+1)%l];if(this.closed||intPoint+2<l){p3=points[(intPoint+2)%l];}else{// extrapolate last point\ntmp.subVectors(points[l-1],points[l-2]).add(points[l-1]);p3=tmp;}if(this.curveType==='centripetal'||this.curveType==='chordal'){// init Centripetal / Chordal Catmull-Rom\nconst pow=this.curveType==='chordal'?0.5:0.25;let dt0=Math.pow(p0.distanceToSquared(p1),pow);let dt1=Math.pow(p1.distanceToSquared(p2),pow);let dt2=Math.pow(p2.distanceToSquared(p3),pow);// safety check for repeated points\nif(dt1<1e-4)dt1=1.0;if(dt0<1e-4)dt0=dt1;if(dt2<1e-4)dt2=dt1;px.initNonuniformCatmullRom(p0.x,p1.x,p2.x,p3.x,dt0,dt1,dt2);py.initNonuniformCatmullRom(p0.y,p1.y,p2.y,p3.y,dt0,dt1,dt2);pz.initNonuniformCatmullRom(p0.z,p1.z,p2.z,p3.z,dt0,dt1,dt2);}else if(this.curveType==='catmullrom'){px.initCatmullRom(p0.x,p1.x,p2.x,p3.x,this.tension);py.initCatmullRom(p0.y,p1.y,p2.y,p3.y,this.tension);pz.initCatmullRom(p0.z,p1.z,p2.z,p3.z,this.tension);}point.set(px.calc(weight),py.calc(weight),pz.calc(weight));return point;}copy(source){super.copy(source);this.points=[];for(let i=0,l=source.points.length;i<l;i++){const point=source.points[i];this.points.push(point.clone());}this.closed=source.closed;this.curveType=source.curveType;this.tension=source.tension;return this;}toJSON(){const data=super.toJSON();data.points=[];for(let i=0,l=this.points.length;i<l;i++){const point=this.points[i];data.points.push(point.toArray());}data.closed=this.closed;data.curveType=this.curveType;data.tension=this.tension;return data;}fromJSON(json){super.fromJSON(json);this.points=[];for(let i=0,l=json.points.length;i<l;i++){const point=json.points[i];this.points.push(new three_module_Vector3().fromArray(point));}this.closed=json.closed;this.curveType=json.curveType;this.tension=json.tension;return this;}}/**\n * Bezier Curves formulas obtained from\n * https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n */function CatmullRom(t,p0,p1,p2,p3){const v0=(p2-p0)*0.5;const v1=(p3-p1)*0.5;const t2=t*t;const t3=t*t2;return(2*p1-2*p2+v0+v1)*t3+(-3*p1+3*p2-2*v0-v1)*t2+v0*t+p1;}//\nfunction QuadraticBezierP0(t,p){const k=1-t;return k*k*p;}function QuadraticBezierP1(t,p){return 2*(1-t)*t*p;}function QuadraticBezierP2(t,p){return t*t*p;}function QuadraticBezier(t,p0,p1,p2){return QuadraticBezierP0(t,p0)+QuadraticBezierP1(t,p1)+QuadraticBezierP2(t,p2);}//\nfunction CubicBezierP0(t,p){const k=1-t;return k*k*k*p;}function CubicBezierP1(t,p){const k=1-t;return 3*k*k*t*p;}function CubicBezierP2(t,p){return 3*(1-t)*t*t*p;}function CubicBezierP3(t,p){return t*t*t*p;}function CubicBezier(t,p0,p1,p2,p3){return CubicBezierP0(t,p0)+CubicBezierP1(t,p1)+CubicBezierP2(t,p2)+CubicBezierP3(t,p3);}class CubicBezierCurve extends Curve{constructor(v0=new Vector2(),v1=new Vector2(),v2=new Vector2(),v3=new Vector2()){super();this.isCubicBezierCurve=true;this.type='CubicBezierCurve';this.v0=v0;this.v1=v1;this.v2=v2;this.v3=v3;}getPoint(t,optionalTarget=new Vector2()){const point=optionalTarget;const v0=this.v0,v1=this.v1,v2=this.v2,v3=this.v3;point.set(CubicBezier(t,v0.x,v1.x,v2.x,v3.x),CubicBezier(t,v0.y,v1.y,v2.y,v3.y));return point;}copy(source){super.copy(source);this.v0.copy(source.v0);this.v1.copy(source.v1);this.v2.copy(source.v2);this.v3.copy(source.v3);return this;}toJSON(){const data=super.toJSON();data.v0=this.v0.toArray();data.v1=this.v1.toArray();data.v2=this.v2.toArray();data.v3=this.v3.toArray();return data;}fromJSON(json){super.fromJSON(json);this.v0.fromArray(json.v0);this.v1.fromArray(json.v1);this.v2.fromArray(json.v2);this.v3.fromArray(json.v3);return this;}}class CubicBezierCurve3 extends Curve{constructor(v0=new three_module_Vector3(),v1=new three_module_Vector3(),v2=new three_module_Vector3(),v3=new three_module_Vector3()){super();this.isCubicBezierCurve3=true;this.type='CubicBezierCurve3';this.v0=v0;this.v1=v1;this.v2=v2;this.v3=v3;}getPoint(t,optionalTarget=new three_module_Vector3()){const point=optionalTarget;const v0=this.v0,v1=this.v1,v2=this.v2,v3=this.v3;point.set(CubicBezier(t,v0.x,v1.x,v2.x,v3.x),CubicBezier(t,v0.y,v1.y,v2.y,v3.y),CubicBezier(t,v0.z,v1.z,v2.z,v3.z));return point;}copy(source){super.copy(source);this.v0.copy(source.v0);this.v1.copy(source.v1);this.v2.copy(source.v2);this.v3.copy(source.v3);return this;}toJSON(){const data=super.toJSON();data.v0=this.v0.toArray();data.v1=this.v1.toArray();data.v2=this.v2.toArray();data.v3=this.v3.toArray();return data;}fromJSON(json){super.fromJSON(json);this.v0.fromArray(json.v0);this.v1.fromArray(json.v1);this.v2.fromArray(json.v2);this.v3.fromArray(json.v3);return this;}}class LineCurve extends Curve{constructor(v1=new Vector2(),v2=new Vector2()){super();this.isLineCurve=true;this.type='LineCurve';this.v1=v1;this.v2=v2;}getPoint(t,optionalTarget=new Vector2()){const point=optionalTarget;if(t===1){point.copy(this.v2);}else{point.copy(this.v2).sub(this.v1);point.multiplyScalar(t).add(this.v1);}return point;}// Line curve is linear, so we can overwrite default getPointAt\ngetPointAt(u,optionalTarget){return this.getPoint(u,optionalTarget);}getTangent(t,optionalTarget){const tangent=optionalTarget||new Vector2();tangent.copy(this.v2).sub(this.v1).normalize();return tangent;}copy(source){super.copy(source);this.v1.copy(source.v1);this.v2.copy(source.v2);return this;}toJSON(){const data=super.toJSON();data.v1=this.v1.toArray();data.v2=this.v2.toArray();return data;}fromJSON(json){super.fromJSON(json);this.v1.fromArray(json.v1);this.v2.fromArray(json.v2);return this;}}class LineCurve3 extends Curve{constructor(v1=new three_module_Vector3(),v2=new three_module_Vector3()){super();this.isLineCurve3=true;this.type='LineCurve3';this.v1=v1;this.v2=v2;}getPoint(t,optionalTarget=new three_module_Vector3()){const point=optionalTarget;if(t===1){point.copy(this.v2);}else{point.copy(this.v2).sub(this.v1);point.multiplyScalar(t).add(this.v1);}return point;}// Line curve is linear, so we can overwrite default getPointAt\ngetPointAt(u,optionalTarget){return this.getPoint(u,optionalTarget);}copy(source){super.copy(source);this.v1.copy(source.v1);this.v2.copy(source.v2);return this;}toJSON(){const data=super.toJSON();data.v1=this.v1.toArray();data.v2=this.v2.toArray();return data;}fromJSON(json){super.fromJSON(json);this.v1.fromArray(json.v1);this.v2.fromArray(json.v2);return this;}}class QuadraticBezierCurve extends Curve{constructor(v0=new Vector2(),v1=new Vector2(),v2=new Vector2()){super();this.isQuadraticBezierCurve=true;this.type='QuadraticBezierCurve';this.v0=v0;this.v1=v1;this.v2=v2;}getPoint(t,optionalTarget=new Vector2()){const point=optionalTarget;const v0=this.v0,v1=this.v1,v2=this.v2;point.set(QuadraticBezier(t,v0.x,v1.x,v2.x),QuadraticBezier(t,v0.y,v1.y,v2.y));return point;}copy(source){super.copy(source);this.v0.copy(source.v0);this.v1.copy(source.v1);this.v2.copy(source.v2);return this;}toJSON(){const data=super.toJSON();data.v0=this.v0.toArray();data.v1=this.v1.toArray();data.v2=this.v2.toArray();return data;}fromJSON(json){super.fromJSON(json);this.v0.fromArray(json.v0);this.v1.fromArray(json.v1);this.v2.fromArray(json.v2);return this;}}class QuadraticBezierCurve3 extends Curve{constructor(v0=new three_module_Vector3(),v1=new three_module_Vector3(),v2=new three_module_Vector3()){super();this.isQuadraticBezierCurve3=true;this.type='QuadraticBezierCurve3';this.v0=v0;this.v1=v1;this.v2=v2;}getPoint(t,optionalTarget=new three_module_Vector3()){const point=optionalTarget;const v0=this.v0,v1=this.v1,v2=this.v2;point.set(QuadraticBezier(t,v0.x,v1.x,v2.x),QuadraticBezier(t,v0.y,v1.y,v2.y),QuadraticBezier(t,v0.z,v1.z,v2.z));return point;}copy(source){super.copy(source);this.v0.copy(source.v0);this.v1.copy(source.v1);this.v2.copy(source.v2);return this;}toJSON(){const data=super.toJSON();data.v0=this.v0.toArray();data.v1=this.v1.toArray();data.v2=this.v2.toArray();return data;}fromJSON(json){super.fromJSON(json);this.v0.fromArray(json.v0);this.v1.fromArray(json.v1);this.v2.fromArray(json.v2);return this;}}class SplineCurve extends Curve{constructor(points=[]){super();this.isSplineCurve=true;this.type='SplineCurve';this.points=points;}getPoint(t,optionalTarget=new Vector2()){const point=optionalTarget;const points=this.points;const p=(points.length-1)*t;const intPoint=Math.floor(p);const weight=p-intPoint;const p0=points[intPoint===0?intPoint:intPoint-1];const p1=points[intPoint];const p2=points[intPoint>points.length-2?points.length-1:intPoint+1];const p3=points[intPoint>points.length-3?points.length-1:intPoint+2];point.set(CatmullRom(weight,p0.x,p1.x,p2.x,p3.x),CatmullRom(weight,p0.y,p1.y,p2.y,p3.y));return point;}copy(source){super.copy(source);this.points=[];for(let i=0,l=source.points.length;i<l;i++){const point=source.points[i];this.points.push(point.clone());}return this;}toJSON(){const data=super.toJSON();data.points=[];for(let i=0,l=this.points.length;i<l;i++){const point=this.points[i];data.points.push(point.toArray());}return data;}fromJSON(json){super.fromJSON(json);this.points=[];for(let i=0,l=json.points.length;i<l;i++){const point=json.points[i];this.points.push(new Vector2().fromArray(point));}return this;}}var Curves=/*#__PURE__*/freeze({__proto__:null,ArcCurve:ArcCurve,CatmullRomCurve3:CatmullRomCurve3,CubicBezierCurve:CubicBezierCurve,CubicBezierCurve3:CubicBezierCurve3,EllipseCurve:EllipseCurve,LineCurve:LineCurve,LineCurve3:LineCurve3,QuadraticBezierCurve:QuadraticBezierCurve,QuadraticBezierCurve3:QuadraticBezierCurve3,SplineCurve:SplineCurve});/**************************************************************\n *\tCurved Path - a curve path is simply a array of connected\n * curves, but retains the api of a curve\n **************************************************************/class CurvePath extends Curve{constructor(){super();this.type='CurvePath';this.curves=[];this.autoClose=false;// Automatically closes the path\n}add(curve){this.curves.push(curve);}closePath(){// Add a line curve if start and end of lines are not connected\nconst startPoint=this.curves[0].getPoint(0);const endPoint=this.curves[this.curves.length-1].getPoint(1);if(!startPoint.equals(endPoint)){this.curves.push(new LineCurve(endPoint,startPoint));}}// To get accurate point with reference to\n// entire path distance at time t,\n// following has to be done:\n// 1. Length of each sub path have to be known\n// 2. Locate and identify type of curve\n// 3. Get t for the curve\n// 4. Return curve.getPointAt(t')\ngetPoint(t,optionalTarget){const d=t*this.getLength();const curveLengths=this.getCurveLengths();let i=0;// To think about boundaries points.\nwhile(i<curveLengths.length){if(curveLengths[i]>=d){const diff=curveLengths[i]-d;const curve=this.curves[i];const segmentLength=curve.getLength();const u=segmentLength===0?0:1-diff/segmentLength;return curve.getPointAt(u,optionalTarget);}i++;}return null;// loop where sum != 0, sum > d , sum+1 <d\n}// We cannot use the default THREE.Curve getPoint() with getLength() because in\n// THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath\n// getPoint() depends on getLength\ngetLength(){const lens=this.getCurveLengths();return lens[lens.length-1];}// cacheLengths must be recalculated.\nupdateArcLengths(){this.needsUpdate=true;this.cacheLengths=null;this.getCurveLengths();}// Compute lengths and cache them\n// We cannot overwrite getLengths() because UtoT mapping uses it.\ngetCurveLengths(){// We use cache values if curves and cache array are same length\nif(this.cacheLengths&&this.cacheLengths.length===this.curves.length){return this.cacheLengths;}// Get length of sub-curve\n// Push sums into cached array\nconst lengths=[];let sums=0;for(let i=0,l=this.curves.length;i<l;i++){sums+=this.curves[i].getLength();lengths.push(sums);}this.cacheLengths=lengths;return lengths;}getSpacedPoints(divisions=40){const points=[];for(let i=0;i<=divisions;i++){points.push(this.getPoint(i/divisions));}if(this.autoClose){points.push(points[0]);}return points;}getPoints(divisions=12){const points=[];let last;for(let i=0,curves=this.curves;i<curves.length;i++){const curve=curves[i];const resolution=curve.isEllipseCurve?divisions*2:curve.isLineCurve||curve.isLineCurve3?1:curve.isSplineCurve?divisions*curve.points.length:divisions;const pts=curve.getPoints(resolution);for(let j=0;j<pts.length;j++){const point=pts[j];if(last&&last.equals(point))continue;// ensures no consecutive points are duplicates\npoints.push(point);last=point;}}if(this.autoClose&&points.length>1&&!points[points.length-1].equals(points[0])){points.push(points[0]);}return points;}copy(source){super.copy(source);this.curves=[];for(let i=0,l=source.curves.length;i<l;i++){const curve=source.curves[i];this.curves.push(curve.clone());}this.autoClose=source.autoClose;return this;}toJSON(){const data=super.toJSON();data.autoClose=this.autoClose;data.curves=[];for(let i=0,l=this.curves.length;i<l;i++){const curve=this.curves[i];data.curves.push(curve.toJSON());}return data;}fromJSON(json){super.fromJSON(json);this.autoClose=json.autoClose;this.curves=[];for(let i=0,l=json.curves.length;i<l;i++){const curve=json.curves[i];this.curves.push(new Curves[curve.type]().fromJSON(curve));}return this;}}class Path extends CurvePath{constructor(points){super();this.type='Path';this.currentPoint=new Vector2();if(points){this.setFromPoints(points);}}setFromPoints(points){this.moveTo(points[0].x,points[0].y);for(let i=1,l=points.length;i<l;i++){this.lineTo(points[i].x,points[i].y);}return this;}moveTo(x,y){this.currentPoint.set(x,y);// TODO consider referencing vectors instead of copying?\nreturn this;}lineTo(x,y){const curve=new LineCurve(this.currentPoint.clone(),new Vector2(x,y));this.curves.push(curve);this.currentPoint.set(x,y);return this;}quadraticCurveTo(aCPx,aCPy,aX,aY){const curve=new QuadraticBezierCurve(this.currentPoint.clone(),new Vector2(aCPx,aCPy),new Vector2(aX,aY));this.curves.push(curve);this.currentPoint.set(aX,aY);return this;}bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY){const curve=new CubicBezierCurve(this.currentPoint.clone(),new Vector2(aCP1x,aCP1y),new Vector2(aCP2x,aCP2y),new Vector2(aX,aY));this.curves.push(curve);this.currentPoint.set(aX,aY);return this;}splineThru(pts/*Array of Vector*/){var _context26;const npts=concat(_context26=[this.currentPoint.clone()]).call(_context26,pts);const curve=new SplineCurve(npts);this.curves.push(curve);this.currentPoint.copy(pts[pts.length-1]);return this;}arc(aX,aY,aRadius,aStartAngle,aEndAngle,aClockwise){const x0=this.currentPoint.x;const y0=this.currentPoint.y;this.absarc(aX+x0,aY+y0,aRadius,aStartAngle,aEndAngle,aClockwise);return this;}absarc(aX,aY,aRadius,aStartAngle,aEndAngle,aClockwise){this.absellipse(aX,aY,aRadius,aRadius,aStartAngle,aEndAngle,aClockwise);return this;}ellipse(aX,aY,xRadius,yRadius,aStartAngle,aEndAngle,aClockwise,aRotation){const x0=this.currentPoint.x;const y0=this.currentPoint.y;this.absellipse(aX+x0,aY+y0,xRadius,yRadius,aStartAngle,aEndAngle,aClockwise,aRotation);return this;}absellipse(aX,aY,xRadius,yRadius,aStartAngle,aEndAngle,aClockwise,aRotation){const curve=new EllipseCurve(aX,aY,xRadius,yRadius,aStartAngle,aEndAngle,aClockwise,aRotation);if(this.curves.length>0){// if a previous curve is present, attempt to join\nconst firstPoint=curve.getPoint(0);if(!firstPoint.equals(this.currentPoint)){this.lineTo(firstPoint.x,firstPoint.y);}}this.curves.push(curve);const lastPoint=curve.getPoint(1);this.currentPoint.copy(lastPoint);return this;}copy(source){super.copy(source);this.currentPoint.copy(source.currentPoint);return this;}toJSON(){const data=super.toJSON();data.currentPoint=this.currentPoint.toArray();return data;}fromJSON(json){super.fromJSON(json);this.currentPoint.fromArray(json.currentPoint);return this;}}class LatheGeometry extends BufferGeometry{constructor(points=[new Vector2(0,-0.5),new Vector2(0.5,0),new Vector2(0,0.5)],segments=12,phiStart=0,phiLength=Math.PI*2){super();this.type='LatheGeometry';this.parameters={points:points,segments:segments,phiStart:phiStart,phiLength:phiLength};segments=Math.floor(segments);// clamp phiLength so it's in range of [ 0, 2PI ]\nphiLength=three_module_clamp(phiLength,0,Math.PI*2);// buffers\nconst indices=[];const vertices=[];const uvs=[];const initNormals=[];const normals=[];// helper variables\nconst inverseSegments=1.0/segments;const vertex=new three_module_Vector3();const uv=new Vector2();const normal=new three_module_Vector3();const curNormal=new three_module_Vector3();const prevNormal=new three_module_Vector3();let dx=0;let dy=0;// pre-compute normals for initial \"meridian\"\nfor(let j=0;j<=points.length-1;j++){switch(j){case 0:// special handling for 1st vertex on path\ndx=points[j+1].x-points[j].x;dy=points[j+1].y-points[j].y;normal.x=dy*1.0;normal.y=-dx;normal.z=dy*0.0;prevNormal.copy(normal);normal.normalize();initNormals.push(normal.x,normal.y,normal.z);break;case points.length-1:// special handling for last Vertex on path\ninitNormals.push(prevNormal.x,prevNormal.y,prevNormal.z);break;default:// default handling for all vertices in between\ndx=points[j+1].x-points[j].x;dy=points[j+1].y-points[j].y;normal.x=dy*1.0;normal.y=-dx;normal.z=dy*0.0;curNormal.copy(normal);normal.x+=prevNormal.x;normal.y+=prevNormal.y;normal.z+=prevNormal.z;normal.normalize();initNormals.push(normal.x,normal.y,normal.z);prevNormal.copy(curNormal);}}// generate vertices, uvs and normals\nfor(let i=0;i<=segments;i++){const phi=phiStart+i*inverseSegments*phiLength;const sin=Math.sin(phi);const cos=Math.cos(phi);for(let j=0;j<=points.length-1;j++){// vertex\nvertex.x=points[j].x*sin;vertex.y=points[j].y;vertex.z=points[j].x*cos;vertices.push(vertex.x,vertex.y,vertex.z);// uv\nuv.x=i/segments;uv.y=j/(points.length-1);uvs.push(uv.x,uv.y);// normal\nconst x=initNormals[3*j+0]*sin;const y=initNormals[3*j+1];const z=initNormals[3*j+0]*cos;normals.push(x,y,z);}}// indices\nfor(let i=0;i<segments;i++){for(let j=0;j<points.length-1;j++){const base=j+i*points.length;const a=base;const b=base+points.length;const c=base+points.length+1;const d=base+1;// faces\nindices.push(a,b,d);indices.push(c,d,b);}}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));this.setAttribute('normal',new Float32BufferAttribute(normals,3));}static fromJSON(data){return new LatheGeometry(data.points,data.segments,data.phiStart,data.phiLength);}}class CapsuleGeometry extends LatheGeometry{constructor(radius=1,length=1,capSegments=4,radialSegments=8){const path=new Path();path.absarc(0,-length/2,radius,Math.PI*1.5,0);path.absarc(0,length/2,radius,0,Math.PI*0.5);super(path.getPoints(capSegments),radialSegments);this.type='CapsuleGeometry';this.parameters={radius:radius,height:length,capSegments:capSegments,radialSegments:radialSegments};}static fromJSON(data){return new CapsuleGeometry(data.radius,data.length,data.capSegments,data.radialSegments);}}class CircleGeometry extends BufferGeometry{constructor(radius=1,segments=8,thetaStart=0,thetaLength=Math.PI*2){super();this.type='CircleGeometry';this.parameters={radius:radius,segments:segments,thetaStart:thetaStart,thetaLength:thetaLength};segments=Math.max(3,segments);// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// helper variables\nconst vertex=new three_module_Vector3();const uv=new Vector2();// center point\nvertices.push(0,0,0);normals.push(0,0,1);uvs.push(0.5,0.5);for(let s=0,i=3;s<=segments;s++,i+=3){const segment=thetaStart+s/segments*thetaLength;// vertex\nvertex.x=radius*Math.cos(segment);vertex.y=radius*Math.sin(segment);vertices.push(vertex.x,vertex.y,vertex.z);// normal\nnormals.push(0,0,1);// uvs\nuv.x=(vertices[i]/radius+1)/2;uv.y=(vertices[i+1]/radius+1)/2;uvs.push(uv.x,uv.y);}// indices\nfor(let i=1;i<=segments;i++){indices.push(i,i+1,0);}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));}static fromJSON(data){return new CircleGeometry(data.radius,data.segments,data.thetaStart,data.thetaLength);}}class CylinderGeometry extends BufferGeometry{constructor(radiusTop=1,radiusBottom=1,height=1,radialSegments=8,heightSegments=1,openEnded=false,thetaStart=0,thetaLength=Math.PI*2){super();this.type='CylinderGeometry';this.parameters={radiusTop:radiusTop,radiusBottom:radiusBottom,height:height,radialSegments:radialSegments,heightSegments:heightSegments,openEnded:openEnded,thetaStart:thetaStart,thetaLength:thetaLength};const scope=this;radialSegments=Math.floor(radialSegments);heightSegments=Math.floor(heightSegments);// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// helper variables\nlet index=0;const indexArray=[];const halfHeight=height/2;let groupStart=0;// generate geometry\ngenerateTorso();if(openEnded===false){if(radiusTop>0)generateCap(true);if(radiusBottom>0)generateCap(false);}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));function generateTorso(){const normal=new three_module_Vector3();const vertex=new three_module_Vector3();let groupCount=0;// this will be used to calculate the normal\nconst slope=(radiusBottom-radiusTop)/height;// generate vertices, normals and uvs\nfor(let y=0;y<=heightSegments;y++){const indexRow=[];const v=y/heightSegments;// calculate the radius of the current row\nconst radius=v*(radiusBottom-radiusTop)+radiusTop;for(let x=0;x<=radialSegments;x++){const u=x/radialSegments;const theta=u*thetaLength+thetaStart;const sinTheta=Math.sin(theta);const cosTheta=Math.cos(theta);// vertex\nvertex.x=radius*sinTheta;vertex.y=-v*height+halfHeight;vertex.z=radius*cosTheta;vertices.push(vertex.x,vertex.y,vertex.z);// normal\nnormal.set(sinTheta,slope,cosTheta).normalize();normals.push(normal.x,normal.y,normal.z);// uv\nuvs.push(u,1-v);// save index of vertex in respective row\nindexRow.push(index++);}// now save vertices of the row in our index array\nindexArray.push(indexRow);}// generate indices\nfor(let x=0;x<radialSegments;x++){for(let y=0;y<heightSegments;y++){// we use the index array to access the correct indices\nconst a=indexArray[y][x];const b=indexArray[y+1][x];const c=indexArray[y+1][x+1];const d=indexArray[y][x+1];// faces\nindices.push(a,b,d);indices.push(b,c,d);// update group counter\ngroupCount+=6;}}// add a group to the geometry. this will ensure multi material support\nscope.addGroup(groupStart,groupCount,0);// calculate new start value for groups\ngroupStart+=groupCount;}function generateCap(top){// save the index of the first center vertex\nconst centerIndexStart=index;const uv=new Vector2();const vertex=new three_module_Vector3();let groupCount=0;const radius=top===true?radiusTop:radiusBottom;const sign=top===true?1:-1;// first we generate the center vertex data of the cap.\n// because the geometry needs one set of uvs per face,\n// we must generate a center vertex per face/segment\nfor(let x=1;x<=radialSegments;x++){// vertex\nvertices.push(0,halfHeight*sign,0);// normal\nnormals.push(0,sign,0);// uv\nuvs.push(0.5,0.5);// increase index\nindex++;}// save the index of the last center vertex\nconst centerIndexEnd=index;// now we generate the surrounding vertices, normals and uvs\nfor(let x=0;x<=radialSegments;x++){const u=x/radialSegments;const theta=u*thetaLength+thetaStart;const cosTheta=Math.cos(theta);const sinTheta=Math.sin(theta);// vertex\nvertex.x=radius*sinTheta;vertex.y=halfHeight*sign;vertex.z=radius*cosTheta;vertices.push(vertex.x,vertex.y,vertex.z);// normal\nnormals.push(0,sign,0);// uv\nuv.x=cosTheta*0.5+0.5;uv.y=sinTheta*0.5*sign+0.5;uvs.push(uv.x,uv.y);// increase index\nindex++;}// generate indices\nfor(let x=0;x<radialSegments;x++){const c=centerIndexStart+x;const i=centerIndexEnd+x;if(top===true){// face top\nindices.push(i,i+1,c);}else{// face bottom\nindices.push(i+1,i,c);}groupCount+=3;}// add a group to the geometry. this will ensure multi material support\nscope.addGroup(groupStart,groupCount,top===true?1:2);// calculate new start value for groups\ngroupStart+=groupCount;}}static fromJSON(data){return new CylinderGeometry(data.radiusTop,data.radiusBottom,data.height,data.radialSegments,data.heightSegments,data.openEnded,data.thetaStart,data.thetaLength);}}class ConeGeometry extends CylinderGeometry{constructor(radius=1,height=1,radialSegments=8,heightSegments=1,openEnded=false,thetaStart=0,thetaLength=Math.PI*2){super(0,radius,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength);this.type='ConeGeometry';this.parameters={radius:radius,height:height,radialSegments:radialSegments,heightSegments:heightSegments,openEnded:openEnded,thetaStart:thetaStart,thetaLength:thetaLength};}static fromJSON(data){return new ConeGeometry(data.radius,data.height,data.radialSegments,data.heightSegments,data.openEnded,data.thetaStart,data.thetaLength);}}class PolyhedronGeometry extends BufferGeometry{constructor(vertices=[],indices=[],radius=1,detail=0){super();this.type='PolyhedronGeometry';this.parameters={vertices:vertices,indices:indices,radius:radius,detail:detail};// default buffer data\nconst vertexBuffer=[];const uvBuffer=[];// the subdivision creates the vertex buffer data\nsubdivide(detail);// all vertices should lie on a conceptual sphere with a given radius\napplyRadius(radius);// finally, create the uv data\ngenerateUVs();// build non-indexed geometry\nthis.setAttribute('position',new Float32BufferAttribute(vertexBuffer,3));this.setAttribute('normal',new Float32BufferAttribute(slice(vertexBuffer).call(vertexBuffer),3));this.setAttribute('uv',new Float32BufferAttribute(uvBuffer,2));if(detail===0){this.computeVertexNormals();// flat normals\n}else{this.normalizeNormals();// smooth normals\n}// helper functions\nfunction subdivide(detail){const a=new three_module_Vector3();const b=new three_module_Vector3();const c=new three_module_Vector3();// iterate over all faces and apply a subdivison with the given detail value\nfor(let i=0;i<indices.length;i+=3){// get the vertices of the face\ngetVertexByIndex(indices[i+0],a);getVertexByIndex(indices[i+1],b);getVertexByIndex(indices[i+2],c);// perform subdivision\nsubdivideFace(a,b,c,detail);}}function subdivideFace(a,b,c,detail){const cols=detail+1;// we use this multidimensional array as a data structure for creating the subdivision\nconst v=[];// construct all of the vertices for this subdivision\nfor(let i=0;i<=cols;i++){v[i]=[];const aj=a.clone().lerp(c,i/cols);const bj=b.clone().lerp(c,i/cols);const rows=cols-i;for(let j=0;j<=rows;j++){if(j===0&&i===cols){v[i][j]=aj;}else{v[i][j]=aj.clone().lerp(bj,j/rows);}}}// construct all of the faces\nfor(let i=0;i<cols;i++){for(let j=0;j<2*(cols-i)-1;j++){const k=Math.floor(j/2);if(j%2===0){pushVertex(v[i][k+1]);pushVertex(v[i+1][k]);pushVertex(v[i][k]);}else{pushVertex(v[i][k+1]);pushVertex(v[i+1][k+1]);pushVertex(v[i+1][k]);}}}}function applyRadius(radius){const vertex=new three_module_Vector3();// iterate over the entire buffer and apply the radius to each vertex\nfor(let i=0;i<vertexBuffer.length;i+=3){vertex.x=vertexBuffer[i+0];vertex.y=vertexBuffer[i+1];vertex.z=vertexBuffer[i+2];vertex.normalize().multiplyScalar(radius);vertexBuffer[i+0]=vertex.x;vertexBuffer[i+1]=vertex.y;vertexBuffer[i+2]=vertex.z;}}function generateUVs(){const vertex=new three_module_Vector3();for(let i=0;i<vertexBuffer.length;i+=3){vertex.x=vertexBuffer[i+0];vertex.y=vertexBuffer[i+1];vertex.z=vertexBuffer[i+2];const u=azimuth(vertex)/2/Math.PI+0.5;const v=inclination(vertex)/Math.PI+0.5;uvBuffer.push(u,1-v);}correctUVs();correctSeam();}function correctSeam(){// handle case when face straddles the seam, see #3269\nfor(let i=0;i<uvBuffer.length;i+=6){// uv data of a single face\nconst x0=uvBuffer[i+0];const x1=uvBuffer[i+2];const x2=uvBuffer[i+4];const max=Math.max(x0,x1,x2);const min=Math.min(x0,x1,x2);// 0.9 is somewhat arbitrary\nif(max>0.9&&min<0.1){if(x0<0.2)uvBuffer[i+0]+=1;if(x1<0.2)uvBuffer[i+2]+=1;if(x2<0.2)uvBuffer[i+4]+=1;}}}function pushVertex(vertex){vertexBuffer.push(vertex.x,vertex.y,vertex.z);}function getVertexByIndex(index,vertex){const stride=index*3;vertex.x=vertices[stride+0];vertex.y=vertices[stride+1];vertex.z=vertices[stride+2];}function correctUVs(){const a=new three_module_Vector3();const b=new three_module_Vector3();const c=new three_module_Vector3();const centroid=new three_module_Vector3();const uvA=new Vector2();const uvB=new Vector2();const uvC=new Vector2();for(let i=0,j=0;i<vertexBuffer.length;i+=9,j+=6){a.set(vertexBuffer[i+0],vertexBuffer[i+1],vertexBuffer[i+2]);b.set(vertexBuffer[i+3],vertexBuffer[i+4],vertexBuffer[i+5]);c.set(vertexBuffer[i+6],vertexBuffer[i+7],vertexBuffer[i+8]);uvA.set(uvBuffer[j+0],uvBuffer[j+1]);uvB.set(uvBuffer[j+2],uvBuffer[j+3]);uvC.set(uvBuffer[j+4],uvBuffer[j+5]);centroid.copy(a).add(b).add(c).divideScalar(3);const azi=azimuth(centroid);correctUV(uvA,j+0,a,azi);correctUV(uvB,j+2,b,azi);correctUV(uvC,j+4,c,azi);}}function correctUV(uv,stride,vector,azimuth){if(azimuth<0&&uv.x===1){uvBuffer[stride]=uv.x-1;}if(vector.x===0&&vector.z===0){uvBuffer[stride]=azimuth/2/Math.PI+0.5;}}// Angle around the Y axis, counter-clockwise when looking from above.\nfunction azimuth(vector){return Math.atan2(vector.z,-vector.x);}// Angle above the XZ plane.\nfunction inclination(vector){return Math.atan2(-vector.y,Math.sqrt(vector.x*vector.x+vector.z*vector.z));}}static fromJSON(data){return new PolyhedronGeometry(data.vertices,data.indices,data.radius,data.details);}}class DodecahedronGeometry extends PolyhedronGeometry{constructor(radius=1,detail=0){const t=(1+Math.sqrt(5))/2;const r=1/t;const vertices=[// (±1, ±1, ±1)\n-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,// (0, ±1/φ, ±φ)\n0,-r,-t,0,-r,t,0,r,-t,0,r,t,// (±1/φ, ±φ, 0)\n-r,-t,0,-r,t,0,r,-t,0,r,t,0,// (±φ, 0, ±1/φ)\n-t,0,-r,t,0,-r,-t,0,r,t,0,r];const indices=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(vertices,indices,radius,detail);this.type='DodecahedronGeometry';this.parameters={radius:radius,detail:detail};}static fromJSON(data){return new DodecahedronGeometry(data.radius,data.detail);}}const three_module_v0=/*@__PURE__*/new three_module_Vector3();const _v1$1=/*@__PURE__*/new three_module_Vector3();const _normal=/*@__PURE__*/new three_module_Vector3();const _triangle=/*@__PURE__*/new three_module_Triangle();class EdgesGeometry extends BufferGeometry{constructor(geometry=null,thresholdAngle=1){super();this.type='EdgesGeometry';this.parameters={geometry:geometry,thresholdAngle:thresholdAngle};if(geometry!==null){const precisionPoints=4;const precision=Math.pow(10,precisionPoints);const thresholdDot=Math.cos(three_module_DEG2RAD*thresholdAngle);const indexAttr=geometry.getIndex();const positionAttr=geometry.getAttribute('position');const indexCount=indexAttr?indexAttr.count:positionAttr.count;const indexArr=[0,0,0];const vertKeys=['a','b','c'];const hashes=new Array(3);const edgeData={};const vertices=[];for(let i=0;i<indexCount;i+=3){if(indexAttr){indexArr[0]=indexAttr.getX(i);indexArr[1]=indexAttr.getX(i+1);indexArr[2]=indexAttr.getX(i+2);}else{indexArr[0]=i;indexArr[1]=i+1;indexArr[2]=i+2;}const{a,b,c}=_triangle;a.fromBufferAttribute(positionAttr,indexArr[0]);b.fromBufferAttribute(positionAttr,indexArr[1]);c.fromBufferAttribute(positionAttr,indexArr[2]);_triangle.getNormal(_normal);// create hashes for the edge from the vertices\nhashes[0]=`${Math.round(a.x*precision)},${Math.round(a.y*precision)},${Math.round(a.z*precision)}`;hashes[1]=`${Math.round(b.x*precision)},${Math.round(b.y*precision)},${Math.round(b.z*precision)}`;hashes[2]=`${Math.round(c.x*precision)},${Math.round(c.y*precision)},${Math.round(c.z*precision)}`;// skip degenerate triangles\nif(hashes[0]===hashes[1]||hashes[1]===hashes[2]||hashes[2]===hashes[0]){continue;}// iterate over every edge\nfor(let j=0;j<3;j++){// get the first and next vertex making up the edge\nconst jNext=(j+1)%3;const vecHash0=hashes[j];const vecHash1=hashes[jNext];const v0=_triangle[vertKeys[j]];const v1=_triangle[vertKeys[jNext]];const hash=`${vecHash0}_${vecHash1}`;const reverseHash=`${vecHash1}_${vecHash0}`;if(reverseHash in edgeData&&edgeData[reverseHash]){// if we found a sibling edge add it into the vertex array if\n// it meets the angle threshold and delete the edge from the map.\nif(_normal.dot(edgeData[reverseHash].normal)<=thresholdDot){vertices.push(v0.x,v0.y,v0.z);vertices.push(v1.x,v1.y,v1.z);}edgeData[reverseHash]=null;}else if(!(hash in edgeData)){// if we've already got an edge here then skip adding a new one\nedgeData[hash]={index0:indexArr[j],index1:indexArr[jNext],normal:_normal.clone()};}}}// iterate over all remaining, unmatched edges and add them to the vertex array\nfor(const key in edgeData){if(edgeData[key]){const{index0,index1}=edgeData[key];three_module_v0.fromBufferAttribute(positionAttr,index0);_v1$1.fromBufferAttribute(positionAttr,index1);vertices.push(three_module_v0.x,three_module_v0.y,three_module_v0.z);vertices.push(_v1$1.x,_v1$1.y,_v1$1.z);}}this.setAttribute('position',new Float32BufferAttribute(vertices,3));}}}class Shape extends Path{constructor(points){super(points);this.uuid=three_module_generateUUID();this.type='Shape';this.holes=[];}getPointsHoles(divisions){const holesPts=[];for(let i=0,l=this.holes.length;i<l;i++){holesPts[i]=this.holes[i].getPoints(divisions);}return holesPts;}// get points of shape and holes (keypoints based on segments parameter)\nextractPoints(divisions){return{shape:this.getPoints(divisions),holes:this.getPointsHoles(divisions)};}copy(source){super.copy(source);this.holes=[];for(let i=0,l=source.holes.length;i<l;i++){const hole=source.holes[i];this.holes.push(hole.clone());}return this;}toJSON(){const data=super.toJSON();data.uuid=this.uuid;data.holes=[];for(let i=0,l=this.holes.length;i<l;i++){const hole=this.holes[i];data.holes.push(hole.toJSON());}return data;}fromJSON(json){super.fromJSON(json);this.uuid=json.uuid;this.holes=[];for(let i=0,l=json.holes.length;i<l;i++){const hole=json.holes[i];this.holes.push(new Path().fromJSON(hole));}return this;}}/**\n * Port from https://github.com/mapbox/earcut (v2.2.4)\n */const Earcut={triangulate:function(data,holeIndices,dim=2){const hasHoles=holeIndices&&holeIndices.length;const outerLen=hasHoles?holeIndices[0]*dim:data.length;let outerNode=linkedList(data,0,outerLen,dim,true);const triangles=[];if(!outerNode||outerNode.next===outerNode.prev)return triangles;let minX,minY,maxX,maxY,x,y,invSize;if(hasHoles)outerNode=eliminateHoles(data,holeIndices,outerNode,dim);// if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\nif(data.length>80*dim){minX=maxX=data[0];minY=maxY=data[1];for(let i=dim;i<outerLen;i+=dim){x=data[i];y=data[i+1];if(x<minX)minX=x;if(y<minY)minY=y;if(x>maxX)maxX=x;if(y>maxY)maxY=y;}// minX, minY and invSize are later used to transform coords into integers for z-order calculation\ninvSize=Math.max(maxX-minX,maxY-minY);invSize=invSize!==0?32767/invSize:0;}earcutLinked(outerNode,triangles,dim,minX,minY,invSize,0);return triangles;}};// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data,start,end,dim,clockwise){let i,last;if(clockwise===signedArea(data,start,end,dim)>0){for(i=start;i<end;i+=dim)last=insertNode(i,data[i],data[i+1],last);}else{for(i=end-dim;i>=start;i-=dim)last=insertNode(i,data[i],data[i+1],last);}if(last&&equals(last,last.next)){removeNode(last);last=last.next;}return last;}// eliminate colinear or duplicate points\nfunction filterPoints(start,end){if(!start)return start;if(!end)end=start;let p=start,again;do{again=false;if(!p.steiner&&(equals(p,p.next)||three_module_area(p.prev,p,p.next)===0)){removeNode(p);p=end=p.prev;if(p===p.next)break;again=true;}else{p=p.next;}}while(again||p!==end);return end;}// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear,triangles,dim,minX,minY,invSize,pass){if(!ear)return;// interlink polygon nodes in z-order\nif(!pass&&invSize)indexCurve(ear,minX,minY,invSize);let stop=ear,prev,next;// iterate through ears, slicing them one by one\nwhile(ear.prev!==ear.next){prev=ear.prev;next=ear.next;if(invSize?isEarHashed(ear,minX,minY,invSize):isEar(ear)){// cut off the triangle\ntriangles.push(prev.i/dim|0);triangles.push(ear.i/dim|0);triangles.push(next.i/dim|0);removeNode(ear);// skipping the next vertex leads to less sliver triangles\near=next.next;stop=next.next;continue;}ear=next;// if we looped through the whole remaining polygon and can't find any more ears\nif(ear===stop){// try filtering points and slicing again\nif(!pass){earcutLinked(filterPoints(ear),triangles,dim,minX,minY,invSize,1);// if this didn't work, try curing all small self-intersections locally\n}else if(pass===1){ear=cureLocalIntersections(filterPoints(ear),triangles,dim);earcutLinked(ear,triangles,dim,minX,minY,invSize,2);// as a last resort, try splitting the remaining polygon into two\n}else if(pass===2){splitEarcut(ear,triangles,dim,minX,minY,invSize);}break;}}}// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear){const a=ear.prev,b=ear,c=ear.next;if(three_module_area(a,b,c)>=0)return false;// reflex, can't be an ear\n// now make sure we don't have other points inside the potential ear\nconst ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y;// triangle bbox; min & max are calculated like this for speed\nconst x0=ax<bx?ax<cx?ax:cx:bx<cx?bx:cx,y0=ay<by?ay<cy?ay:cy:by<cy?by:cy,x1=ax>bx?ax>cx?ax:cx:bx>cx?bx:cx,y1=ay>by?ay>cy?ay:cy:by>cy?by:cy;let p=c.next;while(p!==a){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&three_module_area(p.prev,p,p.next)>=0)return false;p=p.next;}return true;}function isEarHashed(ear,minX,minY,invSize){const a=ear.prev,b=ear,c=ear.next;if(three_module_area(a,b,c)>=0)return false;// reflex, can't be an ear\nconst ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y;// triangle bbox; min & max are calculated like this for speed\nconst x0=ax<bx?ax<cx?ax:cx:bx<cx?bx:cx,y0=ay<by?ay<cy?ay:cy:by<cy?by:cy,x1=ax>bx?ax>cx?ax:cx:bx>cx?bx:cx,y1=ay>by?ay>cy?ay:cy:by>cy?by:cy;// z-order range for the current triangle bbox;\nconst minZ=zOrder(x0,y0,minX,minY,invSize),maxZ=zOrder(x1,y1,minX,minY,invSize);let p=ear.prevZ,n=ear.nextZ;// look for points inside the triangle in both directions\nwhile(p&&p.z>=minZ&&n&&n.z<=maxZ){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&three_module_area(p.prev,p,p.next)>=0)return false;p=p.prevZ;if(n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,n.x,n.y)&&three_module_area(n.prev,n,n.next)>=0)return false;n=n.nextZ;}// look for remaining points in decreasing z-order\nwhile(p&&p.z>=minZ){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&three_module_area(p.prev,p,p.next)>=0)return false;p=p.prevZ;}// look for remaining points in increasing z-order\nwhile(n&&n.z<=maxZ){if(n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,n.x,n.y)&&three_module_area(n.prev,n,n.next)>=0)return false;n=n.nextZ;}return true;}// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start,triangles,dim){let p=start;do{const a=p.prev,b=p.next.next;if(!equals(a,b)&&intersects(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)){triangles.push(a.i/dim|0);triangles.push(p.i/dim|0);triangles.push(b.i/dim|0);// remove two nodes involved\nremoveNode(p);removeNode(p.next);p=start=b;}p=p.next;}while(p!==start);return filterPoints(p);}// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start,triangles,dim,minX,minY,invSize){// look for a valid diagonal that divides the polygon into two\nlet a=start;do{let b=a.next.next;while(b!==a.prev){if(a.i!==b.i&&isValidDiagonal(a,b)){// split the polygon in two by the diagonal\nlet c=splitPolygon(a,b);// filter colinear points around the cuts\na=filterPoints(a,a.next);c=filterPoints(c,c.next);// run earcut on each half\nearcutLinked(a,triangles,dim,minX,minY,invSize,0);earcutLinked(c,triangles,dim,minX,minY,invSize,0);return;}b=b.next;}a=a.next;}while(a!==start);}// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data,holeIndices,outerNode,dim){const queue=[];let i,len,start,end,list;for(i=0,len=holeIndices.length;i<len;i++){start=holeIndices[i]*dim;end=i<len-1?holeIndices[i+1]*dim:data.length;list=linkedList(data,start,end,dim,false);if(list===list.next)list.steiner=true;queue.push(getLeftmost(list));}instance_sort(queue).call(queue,compareX);// process holes from left to right\nfor(i=0;i<queue.length;i++){outerNode=eliminateHole(queue[i],outerNode);}return outerNode;}function compareX(a,b){return a.x-b.x;}// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole(hole,outerNode){const bridge=findHoleBridge(hole,outerNode);if(!bridge){return outerNode;}const bridgeReverse=splitPolygon(bridge,hole);// filter collinear points around the cuts\nfilterPoints(bridgeReverse,bridgeReverse.next);return filterPoints(bridge,bridge.next);}// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole,outerNode){let p=outerNode,qx=-Infinity,m;const hx=hole.x,hy=hole.y;// find a segment intersected by a ray from the hole's leftmost point to the left;\n// segment's endpoint with lesser x will be potential connection point\ndo{if(hy<=p.y&&hy>=p.next.y&&p.next.y!==p.y){const x=p.x+(hy-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(x<=hx&&x>qx){qx=x;m=p.x<p.next.x?p:p.next;if(x===hx)return m;// hole touches outer segment; pick leftmost endpoint\n}}p=p.next;}while(p!==outerNode);if(!m)return null;// look for points inside the triangle of hole point, segment intersection and endpoint;\n// if there are no points found, we have a valid connection;\n// otherwise choose the point of the minimum angle with the ray as connection point\nconst stop=m,mx=m.x,my=m.y;let tanMin=Infinity,tan;p=m;do{if(hx>=p.x&&p.x>=mx&&hx!==p.x&&pointInTriangle(hy<my?hx:qx,hy,mx,my,hy<my?qx:hx,hy,p.x,p.y)){tan=Math.abs(hy-p.y)/(hx-p.x);// tangential\nif(locallyInside(p,hole)&&(tan<tanMin||tan===tanMin&&(p.x>m.x||p.x===m.x&&sectorContainsSector(m,p)))){m=p;tanMin=tan;}}p=p.next;}while(p!==stop);return m;}// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m,p){return three_module_area(m.prev,m,p.prev)<0&&three_module_area(p.next,m,m.next)<0;}// interlink polygon nodes in z-order\nfunction indexCurve(start,minX,minY,invSize){let p=start;do{if(p.z===0)p.z=zOrder(p.x,p.y,minX,minY,invSize);p.prevZ=p.prev;p.nextZ=p.next;p=p.next;}while(p!==start);p.prevZ.nextZ=null;p.prevZ=null;sortLinked(p);}// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list){let i,p,q,e,tail,numMerges,pSize,qSize,inSize=1;do{p=list;list=null;tail=null;numMerges=0;while(p){numMerges++;q=p;pSize=0;for(i=0;i<inSize;i++){pSize++;q=q.nextZ;if(!q)break;}qSize=inSize;while(pSize>0||qSize>0&&q){if(pSize!==0&&(qSize===0||!q||p.z<=q.z)){e=p;p=p.nextZ;pSize--;}else{e=q;q=q.nextZ;qSize--;}if(tail)tail.nextZ=e;else list=e;e.prevZ=tail;tail=e;}p=q;}tail.nextZ=null;inSize*=2;}while(numMerges>1);return list;}// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x,y,minX,minY,invSize){// coords are transformed into non-negative 15-bit integer range\nx=(x-minX)*invSize|0;y=(y-minY)*invSize|0;x=(x|x<<8)&0x00FF00FF;x=(x|x<<4)&0x0F0F0F0F;x=(x|x<<2)&0x33333333;x=(x|x<<1)&0x55555555;y=(y|y<<8)&0x00FF00FF;y=(y|y<<4)&0x0F0F0F0F;y=(y|y<<2)&0x33333333;y=(y|y<<1)&0x55555555;return x|y<<1;}// find the leftmost node of a polygon ring\nfunction getLeftmost(start){let p=start,leftmost=start;do{if(p.x<leftmost.x||p.x===leftmost.x&&p.y<leftmost.y)leftmost=p;p=p.next;}while(p!==start);return leftmost;}// check if a point lies within a convex triangle\nfunction pointInTriangle(ax,ay,bx,by,cx,cy,px,py){return(cx-px)*(ay-py)>=(ax-px)*(cy-py)&&(ax-px)*(by-py)>=(bx-px)*(ay-py)&&(bx-px)*(cy-py)>=(cx-px)*(by-py);}// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!intersectsPolygon(a,b)&&(// dones't intersect other edges\nlocallyInside(a,b)&&locallyInside(b,a)&&middleInside(a,b)&&(// locally visible\nthree_module_area(a.prev,a,b.prev)||three_module_area(a,b.prev,b))||// does not create opposite-facing sectors\nequals(a,b)&&three_module_area(a.prev,a,a.next)>0&&three_module_area(b.prev,b,b.next)>0);// special zero-length case\n}// signed area of a triangle\nfunction three_module_area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y);}// check if two points are equal\nfunction equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y;}// check if two segments intersect\nfunction intersects(p1,q1,p2,q2){const o1=three_module_sign(three_module_area(p1,q1,p2));const o2=three_module_sign(three_module_area(p1,q1,q2));const o3=three_module_sign(three_module_area(p2,q2,p1));const o4=three_module_sign(three_module_area(p2,q2,q1));if(o1!==o2&&o3!==o4)return true;// general case\nif(o1===0&&onSegment(p1,p2,q1))return true;// p1, q1 and p2 are collinear and p2 lies on p1q1\nif(o2===0&&onSegment(p1,q2,q1))return true;// p1, q1 and q2 are collinear and q2 lies on p1q1\nif(o3===0&&onSegment(p2,p1,q2))return true;// p2, q2 and p1 are collinear and p1 lies on p2q2\nif(o4===0&&onSegment(p2,q1,q2))return true;// p2, q2 and q1 are collinear and q1 lies on p2q2\nreturn false;}// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p,q,r){return q.x<=Math.max(p.x,r.x)&&q.x>=Math.min(p.x,r.x)&&q.y<=Math.max(p.y,r.y)&&q.y>=Math.min(p.y,r.y);}function three_module_sign(num){return num>0?1:num<0?-1:0;}// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a,b){let p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects(p,p.next,a,b))return true;p=p.next;}while(p!==a);return false;}// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a,b){return three_module_area(a.prev,a,a.next)<0?three_module_area(a,b,a.next)>=0&&three_module_area(a,a.prev,b)>=0:three_module_area(a,b,a.prev)<0||three_module_area(a,a.next,b)<0;}// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a,b){let p=a,inside=false;const px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{if(p.y>py!==p.next.y>py&&p.next.y!==p.y&&px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x)inside=!inside;p=p.next;}while(p!==a);return inside;}// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a,b){const a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;a.next=b;b.prev=a;a2.next=an;an.prev=a2;b2.next=a2;a2.prev=b2;bp.next=b2;b2.prev=bp;return b2;}// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i,x,y,last){const p=new Node(i,x,y);if(!last){p.prev=p;p.next=p;}else{p.next=last.next;p.prev=last;last.next.prev=p;last.next=p;}return p;}function removeNode(p){p.next.prev=p.prev;p.prev.next=p.next;if(p.prevZ)p.prevZ.nextZ=p.nextZ;if(p.nextZ)p.nextZ.prevZ=p.prevZ;}function Node(i,x,y){// vertex index in coordinates array\nthis.i=i;// vertex coordinates\nthis.x=x;this.y=y;// previous and next vertex nodes in a polygon ring\nthis.prev=null;this.next=null;// z-order curve value\nthis.z=0;// previous and next nodes in z-order\nthis.prevZ=null;this.nextZ=null;// indicates whether this is a steiner point\nthis.steiner=false;}function signedArea(data,start,end,dim){let sum=0;for(let i=start,j=end-dim;i<end;i+=dim){sum+=(data[j]-data[i])*(data[i+1]+data[j+1]);j=i;}return sum;}class ShapeUtils{// calculate area of the contour polygon\nstatic area(contour){const n=contour.length;let a=0.0;for(let p=n-1,q=0;q<n;p=q++){a+=contour[p].x*contour[q].y-contour[q].x*contour[p].y;}return a*0.5;}static isClockWise(pts){return ShapeUtils.area(pts)<0;}static triangulateShape(contour,holes){const vertices=[];// flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\nconst holeIndices=[];// array of hole indices\nconst faces=[];// final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\nremoveDupEndPts(contour);addContour(vertices,contour);//\nlet holeIndex=contour.length;for_each(holes).call(holes,removeDupEndPts);for(let i=0;i<holes.length;i++){holeIndices.push(holeIndex);holeIndex+=holes[i].length;addContour(vertices,holes[i]);}//\nconst triangles=Earcut.triangulate(vertices,holeIndices);//\nfor(let i=0;i<triangles.length;i+=3){faces.push(slice(triangles).call(triangles,i,i+3));}return faces;}}function removeDupEndPts(points){const l=points.length;if(l>2&&points[l-1].equals(points[0])){points.pop();}}function addContour(vertices,contour){for(let i=0;i<contour.length;i++){vertices.push(contour[i].x);vertices.push(contour[i].y);}}/**\n * Creates extruded geometry from a path shape.\n *\n * parameters = {\n *\n * curveSegments: <int>, // number of points on the curves\n * steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n * depth: <float>, // Depth to extrude the shape\n *\n * bevelEnabled: <bool>, // turn on bevel\n * bevelThickness: <float>, // how deep into the original shape bevel goes\n * bevelSize: <float>, // how far from shape outline (including bevelOffset) is bevel\n * bevelOffset: <float>, // how far from shape outline does bevel start\n * bevelSegments: <int>, // number of bevel layers\n *\n * extrudePath: <THREE.Curve> // curve to extrude shape along\n *\n * UVGenerator: <Object> // object that provides UV generator functions\n *\n * }\n */class ExtrudeGeometry extends BufferGeometry{constructor(shapes=new Shape([new Vector2(0.5,0.5),new Vector2(-0.5,0.5),new Vector2(-0.5,-0.5),new Vector2(0.5,-0.5)]),options={}){super();this.type='ExtrudeGeometry';this.parameters={shapes:shapes,options:options};shapes=is_array(shapes)?shapes:[shapes];const scope=this;const verticesArray=[];const uvArray=[];for(let i=0,l=shapes.length;i<l;i++){const shape=shapes[i];addShape(shape);}// build geometry\nthis.setAttribute('position',new Float32BufferAttribute(verticesArray,3));this.setAttribute('uv',new Float32BufferAttribute(uvArray,2));this.computeVertexNormals();// functions\nfunction addShape(shape){const placeholder=[];// options\nconst curveSegments=options.curveSegments!==undefined?options.curveSegments:12;const steps=options.steps!==undefined?options.steps:1;const depth=options.depth!==undefined?options.depth:1;let bevelEnabled=options.bevelEnabled!==undefined?options.bevelEnabled:true;let bevelThickness=options.bevelThickness!==undefined?options.bevelThickness:0.2;let bevelSize=options.bevelSize!==undefined?options.bevelSize:bevelThickness-0.1;let bevelOffset=options.bevelOffset!==undefined?options.bevelOffset:0;let bevelSegments=options.bevelSegments!==undefined?options.bevelSegments:3;const extrudePath=options.extrudePath;const uvgen=options.UVGenerator!==undefined?options.UVGenerator:WorldUVGenerator;//\nlet extrudePts,extrudeByPath=false;let splineTube,binormal,normal,position2;if(extrudePath){extrudePts=extrudePath.getSpacedPoints(steps);extrudeByPath=true;bevelEnabled=false;// bevels not supported for path extrusion\n// SETUP TNB variables\n// TODO1 - have a .isClosed in spline?\nsplineTube=extrudePath.computeFrenetFrames(steps,false);// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\nbinormal=new three_module_Vector3();normal=new three_module_Vector3();position2=new three_module_Vector3();}// Safeguards if bevels are not enabled\nif(!bevelEnabled){bevelSegments=0;bevelThickness=0;bevelSize=0;bevelOffset=0;}// Variables initialization\nconst shapePoints=shape.extractPoints(curveSegments);let vertices=shapePoints.shape;const holes=shapePoints.holes;const reverse=!ShapeUtils.isClockWise(vertices);if(reverse){vertices=instance_reverse(vertices).call(vertices);// Maybe we should also check if holes are in the opposite direction, just to be safe ...\nfor(let h=0,hl=holes.length;h<hl;h++){const ahole=holes[h];if(ShapeUtils.isClockWise(ahole)){holes[h]=instance_reverse(ahole).call(ahole);}}}const faces=ShapeUtils.triangulateShape(vertices,holes);/* Vertices */const contour=vertices;// vertices has all points but contour has only points of circumference\nfor(let h=0,hl=holes.length;h<hl;h++){const ahole=holes[h];vertices=concat(vertices).call(vertices,ahole);}function scalePt2(pt,vec,size){if(!vec)console.error('THREE.ExtrudeGeometry: vec does not exist');return vec.clone().multiplyScalar(size).add(pt);}const vlen=vertices.length,flen=faces.length;// Find directions for point movement\nfunction getBevelVec(inPt,inPrev,inNext){// computes for inPt the corresponding point inPt' on a new contour\n// shifted by 1 unit (length of normalized vector) to the left\n// if we walk along contour clockwise, this new contour is outside the old one\n//\n// inPt' is the intersection of the two lines parallel to the two\n// adjacent edges of inPt at a distance of 1 unit on the left side.\nlet v_trans_x,v_trans_y,shrink_by;// resulting translation vector for inPt\n// good reading for geometry algorithms (here: line-line intersection)\n// http://geomalgorithms.com/a05-_intersect-1.html\nconst v_prev_x=inPt.x-inPrev.x,v_prev_y=inPt.y-inPrev.y;const v_next_x=inNext.x-inPt.x,v_next_y=inNext.y-inPt.y;const v_prev_lensq=v_prev_x*v_prev_x+v_prev_y*v_prev_y;// check for collinear edges\nconst collinear0=v_prev_x*v_next_y-v_prev_y*v_next_x;if(Math.abs(collinear0)>epsilon){// not collinear\n// length of vectors for normalizing\nconst v_prev_len=Math.sqrt(v_prev_lensq);const v_next_len=Math.sqrt(v_next_x*v_next_x+v_next_y*v_next_y);// shift adjacent points by unit vectors to the left\nconst ptPrevShift_x=inPrev.x-v_prev_y/v_prev_len;const ptPrevShift_y=inPrev.y+v_prev_x/v_prev_len;const ptNextShift_x=inNext.x-v_next_y/v_next_len;const ptNextShift_y=inNext.y+v_next_x/v_next_len;// scaling factor for v_prev to intersection point\nconst sf=((ptNextShift_x-ptPrevShift_x)*v_next_y-(ptNextShift_y-ptPrevShift_y)*v_next_x)/(v_prev_x*v_next_y-v_prev_y*v_next_x);// vector from inPt to intersection point\nv_trans_x=ptPrevShift_x+v_prev_x*sf-inPt.x;v_trans_y=ptPrevShift_y+v_prev_y*sf-inPt.y;// Don't normalize!, otherwise sharp corners become ugly\n// but prevent crazy spikes\nconst v_trans_lensq=v_trans_x*v_trans_x+v_trans_y*v_trans_y;if(v_trans_lensq<=2){return new Vector2(v_trans_x,v_trans_y);}else{shrink_by=Math.sqrt(v_trans_lensq/2);}}else{// handle special case of collinear edges\nlet direction_eq=false;// assumes: opposite\nif(v_prev_x>epsilon){if(v_next_x>epsilon){direction_eq=true;}}else{if(v_prev_x<-epsilon){if(v_next_x<-epsilon){direction_eq=true;}}else{if(sign(v_prev_y)===sign(v_next_y)){direction_eq=true;}}}if(direction_eq){// console.log(\"Warning: lines are a straight sequence\");\nv_trans_x=-v_prev_y;v_trans_y=v_prev_x;shrink_by=Math.sqrt(v_prev_lensq);}else{// console.log(\"Warning: lines are a straight spike\");\nv_trans_x=v_prev_x;v_trans_y=v_prev_y;shrink_by=Math.sqrt(v_prev_lensq/2);}}return new Vector2(v_trans_x/shrink_by,v_trans_y/shrink_by);}const contourMovements=[];for(let i=0,il=contour.length,j=il-1,k=i+1;i<il;i++,j++,k++){if(j===il)j=0;if(k===il)k=0;// (j)---(i)---(k)\n// console.log('i,j,k', i, j , k)\ncontourMovements[i]=getBevelVec(contour[i],contour[j],contour[k]);}const holesMovements=[];let oneHoleMovements,verticesMovements=concat(contourMovements).call(contourMovements);for(let h=0,hl=holes.length;h<hl;h++){const ahole=holes[h];oneHoleMovements=[];for(let i=0,il=ahole.length,j=il-1,k=i+1;i<il;i++,j++,k++){if(j===il)j=0;if(k===il)k=0;// (j)---(i)---(k)\noneHoleMovements[i]=getBevelVec(ahole[i],ahole[j],ahole[k]);}holesMovements.push(oneHoleMovements);verticesMovements=concat(verticesMovements).call(verticesMovements,oneHoleMovements);}// Loop bevelSegments, 1 for the front, 1 for the back\nfor(let b=0;b<bevelSegments;b++){//for ( b = bevelSegments; b > 0; b -- ) {\nconst t=b/bevelSegments;const z=bevelThickness*Math.cos(t*Math.PI/2);const bs=bevelSize*Math.sin(t*Math.PI/2)+bevelOffset;// contract shape\nfor(let i=0,il=contour.length;i<il;i++){const vert=scalePt2(contour[i],contourMovements[i],bs);v(vert.x,vert.y,-z);}// expand holes\nfor(let h=0,hl=holes.length;h<hl;h++){const ahole=holes[h];oneHoleMovements=holesMovements[h];for(let i=0,il=ahole.length;i<il;i++){const vert=scalePt2(ahole[i],oneHoleMovements[i],bs);v(vert.x,vert.y,-z);}}}const bs=bevelSize+bevelOffset;// Back facing vertices\nfor(let i=0;i<vlen;i++){const vert=bevelEnabled?scalePt2(vertices[i],verticesMovements[i],bs):vertices[i];if(!extrudeByPath){v(vert.x,vert.y,0);}else{// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\nnormal.copy(splineTube.normals[0]).multiplyScalar(vert.x);binormal.copy(splineTube.binormals[0]).multiplyScalar(vert.y);position2.copy(extrudePts[0]).add(normal).add(binormal);v(position2.x,position2.y,position2.z);}}// Add stepped vertices...\n// Including front facing vertices\nfor(let s=1;s<=steps;s++){for(let i=0;i<vlen;i++){const vert=bevelEnabled?scalePt2(vertices[i],verticesMovements[i],bs):vertices[i];if(!extrudeByPath){v(vert.x,vert.y,depth/steps*s);}else{// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\nnormal.copy(splineTube.normals[s]).multiplyScalar(vert.x);binormal.copy(splineTube.binormals[s]).multiplyScalar(vert.y);position2.copy(extrudePts[s]).add(normal).add(binormal);v(position2.x,position2.y,position2.z);}}}// Add bevel segments planes\n//for ( b = 1; b <= bevelSegments; b ++ ) {\nfor(let b=bevelSegments-1;b>=0;b--){const t=b/bevelSegments;const z=bevelThickness*Math.cos(t*Math.PI/2);const bs=bevelSize*Math.sin(t*Math.PI/2)+bevelOffset;// contract shape\nfor(let i=0,il=contour.length;i<il;i++){const vert=scalePt2(contour[i],contourMovements[i],bs);v(vert.x,vert.y,depth+z);}// expand holes\nfor(let h=0,hl=holes.length;h<hl;h++){const ahole=holes[h];oneHoleMovements=holesMovements[h];for(let i=0,il=ahole.length;i<il;i++){const vert=scalePt2(ahole[i],oneHoleMovements[i],bs);if(!extrudeByPath){v(vert.x,vert.y,depth+z);}else{v(vert.x,vert.y+extrudePts[steps-1].y,extrudePts[steps-1].x+z);}}}}/* Faces */ // Top and bottom faces\nbuildLidFaces();// Sides faces\nbuildSideFaces();///// Internal functions\nfunction buildLidFaces(){const start=verticesArray.length/3;if(bevelEnabled){let layer=0;// steps + 1\nlet offset=vlen*layer;// Bottom faces\nfor(let i=0;i<flen;i++){const face=faces[i];f3(face[2]+offset,face[1]+offset,face[0]+offset);}layer=steps+bevelSegments*2;offset=vlen*layer;// Top faces\nfor(let i=0;i<flen;i++){const face=faces[i];f3(face[0]+offset,face[1]+offset,face[2]+offset);}}else{// Bottom faces\nfor(let i=0;i<flen;i++){const face=faces[i];f3(face[2],face[1],face[0]);}// Top faces\nfor(let i=0;i<flen;i++){const face=faces[i];f3(face[0]+vlen*steps,face[1]+vlen*steps,face[2]+vlen*steps);}}scope.addGroup(start,verticesArray.length/3-start,0);}// Create faces for the z-sides of the shape\nfunction buildSideFaces(){const start=verticesArray.length/3;let layeroffset=0;sidewalls(contour,layeroffset);layeroffset+=contour.length;for(let h=0,hl=holes.length;h<hl;h++){const ahole=holes[h];sidewalls(ahole,layeroffset);//, true\nlayeroffset+=ahole.length;}scope.addGroup(start,verticesArray.length/3-start,1);}function sidewalls(contour,layeroffset){let i=contour.length;while(--i>=0){const j=i;let k=i-1;if(k<0)k=contour.length-1;//console.log('b', i,j, i-1, k,vertices.length);\nfor(let s=0,sl=steps+bevelSegments*2;s<sl;s++){const slen1=vlen*s;const slen2=vlen*(s+1);const a=layeroffset+j+slen1,b=layeroffset+k+slen1,c=layeroffset+k+slen2,d=layeroffset+j+slen2;f4(a,b,c,d);}}}function v(x,y,z){placeholder.push(x);placeholder.push(y);placeholder.push(z);}function f3(a,b,c){addVertex(a);addVertex(b);addVertex(c);const nextIndex=verticesArray.length/3;const uvs=uvgen.generateTopUV(scope,verticesArray,nextIndex-3,nextIndex-2,nextIndex-1);addUV(uvs[0]);addUV(uvs[1]);addUV(uvs[2]);}function f4(a,b,c,d){addVertex(a);addVertex(b);addVertex(d);addVertex(b);addVertex(c);addVertex(d);const nextIndex=verticesArray.length/3;const uvs=uvgen.generateSideWallUV(scope,verticesArray,nextIndex-6,nextIndex-3,nextIndex-2,nextIndex-1);addUV(uvs[0]);addUV(uvs[1]);addUV(uvs[3]);addUV(uvs[1]);addUV(uvs[2]);addUV(uvs[3]);}function addVertex(index){verticesArray.push(placeholder[index*3+0]);verticesArray.push(placeholder[index*3+1]);verticesArray.push(placeholder[index*3+2]);}function addUV(vector2){uvArray.push(vector2.x);uvArray.push(vector2.y);}}}toJSON(){const data=super.toJSON();const shapes=this.parameters.shapes;const options=this.parameters.options;return toJSON$1(shapes,options,data);}static fromJSON(data,shapes){const geometryShapes=[];for(let j=0,jl=data.shapes.length;j<jl;j++){const shape=shapes[data.shapes[j]];geometryShapes.push(shape);}const extrudePath=data.options.extrudePath;if(extrudePath!==undefined){data.options.extrudePath=new Curves[extrudePath.type]().fromJSON(extrudePath);}return new ExtrudeGeometry(geometryShapes,data.options);}}const WorldUVGenerator={generateTopUV:function(geometry,vertices,indexA,indexB,indexC){const a_x=vertices[indexA*3];const a_y=vertices[indexA*3+1];const b_x=vertices[indexB*3];const b_y=vertices[indexB*3+1];const c_x=vertices[indexC*3];const c_y=vertices[indexC*3+1];return[new Vector2(a_x,a_y),new Vector2(b_x,b_y),new Vector2(c_x,c_y)];},generateSideWallUV:function(geometry,vertices,indexA,indexB,indexC,indexD){const a_x=vertices[indexA*3];const a_y=vertices[indexA*3+1];const a_z=vertices[indexA*3+2];const b_x=vertices[indexB*3];const b_y=vertices[indexB*3+1];const b_z=vertices[indexB*3+2];const c_x=vertices[indexC*3];const c_y=vertices[indexC*3+1];const c_z=vertices[indexC*3+2];const d_x=vertices[indexD*3];const d_y=vertices[indexD*3+1];const d_z=vertices[indexD*3+2];if(Math.abs(a_y-b_y)<Math.abs(a_x-b_x)){return[new Vector2(a_x,1-a_z),new Vector2(b_x,1-b_z),new Vector2(c_x,1-c_z),new Vector2(d_x,1-d_z)];}else{return[new Vector2(a_y,1-a_z),new Vector2(b_y,1-b_z),new Vector2(c_y,1-c_z),new Vector2(d_y,1-d_z)];}}};function toJSON$1(shapes,options,data){data.shapes=[];if(is_array(shapes)){for(let i=0,l=shapes.length;i<l;i++){const shape=shapes[i];data.shapes.push(shape.uuid);}}else{data.shapes.push(shapes.uuid);}data.options=object_assign({},options);if(options.extrudePath!==undefined)data.options.extrudePath=options.extrudePath.toJSON();return data;}class IcosahedronGeometry extends PolyhedronGeometry{constructor(radius=1,detail=0){const t=(1+Math.sqrt(5))/2;const vertices=[-1,t,0,1,t,0,-1,-t,0,1,-t,0,0,-1,t,0,1,t,0,-1,-t,0,1,-t,t,0,-1,t,0,1,-t,0,-1,-t,0,1];const indices=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(vertices,indices,radius,detail);this.type='IcosahedronGeometry';this.parameters={radius:radius,detail:detail};}static fromJSON(data){return new IcosahedronGeometry(data.radius,data.detail);}}class OctahedronGeometry extends PolyhedronGeometry{constructor(radius=1,detail=0){const vertices=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1];const indices=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(vertices,indices,radius,detail);this.type='OctahedronGeometry';this.parameters={radius:radius,detail:detail};}static fromJSON(data){return new OctahedronGeometry(data.radius,data.detail);}}class RingGeometry extends BufferGeometry{constructor(innerRadius=0.5,outerRadius=1,thetaSegments=8,phiSegments=1,thetaStart=0,thetaLength=Math.PI*2){super();this.type='RingGeometry';this.parameters={innerRadius:innerRadius,outerRadius:outerRadius,thetaSegments:thetaSegments,phiSegments:phiSegments,thetaStart:thetaStart,thetaLength:thetaLength};thetaSegments=Math.max(3,thetaSegments);phiSegments=Math.max(1,phiSegments);// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// some helper variables\nlet radius=innerRadius;const radiusStep=(outerRadius-innerRadius)/phiSegments;const vertex=new three_module_Vector3();const uv=new Vector2();// generate vertices, normals and uvs\nfor(let j=0;j<=phiSegments;j++){for(let i=0;i<=thetaSegments;i++){// values are generate from the inside of the ring to the outside\nconst segment=thetaStart+i/thetaSegments*thetaLength;// vertex\nvertex.x=radius*Math.cos(segment);vertex.y=radius*Math.sin(segment);vertices.push(vertex.x,vertex.y,vertex.z);// normal\nnormals.push(0,0,1);// uv\nuv.x=(vertex.x/outerRadius+1)/2;uv.y=(vertex.y/outerRadius+1)/2;uvs.push(uv.x,uv.y);}// increase the radius for next row of vertices\nradius+=radiusStep;}// indices\nfor(let j=0;j<phiSegments;j++){const thetaSegmentLevel=j*(thetaSegments+1);for(let i=0;i<thetaSegments;i++){const segment=i+thetaSegmentLevel;const a=segment;const b=segment+thetaSegments+1;const c=segment+thetaSegments+2;const d=segment+1;// faces\nindices.push(a,b,d);indices.push(b,c,d);}}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));}static fromJSON(data){return new RingGeometry(data.innerRadius,data.outerRadius,data.thetaSegments,data.phiSegments,data.thetaStart,data.thetaLength);}}class ShapeGeometry extends BufferGeometry{constructor(shapes=new Shape([new Vector2(0,0.5),new Vector2(-0.5,-0.5),new Vector2(0.5,-0.5)]),curveSegments=12){super();this.type='ShapeGeometry';this.parameters={shapes:shapes,curveSegments:curveSegments};// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// helper variables\nlet groupStart=0;let groupCount=0;// allow single and array values for \"shapes\" parameter\nif(is_array(shapes)===false){addShape(shapes);}else{for(let i=0;i<shapes.length;i++){addShape(shapes[i]);this.addGroup(groupStart,groupCount,i);// enables MultiMaterial support\ngroupStart+=groupCount;groupCount=0;}}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));// helper functions\nfunction addShape(shape){const indexOffset=vertices.length/3;const points=shape.extractPoints(curveSegments);let shapeVertices=points.shape;const shapeHoles=points.holes;// check direction of vertices\nif(ShapeUtils.isClockWise(shapeVertices)===false){shapeVertices=instance_reverse(shapeVertices).call(shapeVertices);}for(let i=0,l=shapeHoles.length;i<l;i++){const shapeHole=shapeHoles[i];if(ShapeUtils.isClockWise(shapeHole)===true){shapeHoles[i]=instance_reverse(shapeHole).call(shapeHole);}}const faces=ShapeUtils.triangulateShape(shapeVertices,shapeHoles);// join vertices of inner and outer paths to a single array\nfor(let i=0,l=shapeHoles.length;i<l;i++){const shapeHole=shapeHoles[i];shapeVertices=concat(shapeVertices).call(shapeVertices,shapeHole);}// vertices, normals, uvs\nfor(let i=0,l=shapeVertices.length;i<l;i++){const vertex=shapeVertices[i];vertices.push(vertex.x,vertex.y,0);normals.push(0,0,1);uvs.push(vertex.x,vertex.y);// world uvs\n}// incides\nfor(let i=0,l=faces.length;i<l;i++){const face=faces[i];const a=face[0]+indexOffset;const b=face[1]+indexOffset;const c=face[2]+indexOffset;indices.push(a,b,c);groupCount+=3;}}}toJSON(){const data=super.toJSON();const shapes=this.parameters.shapes;return toJSON(shapes,data);}static fromJSON(data,shapes){const geometryShapes=[];for(let j=0,jl=data.shapes.length;j<jl;j++){const shape=shapes[data.shapes[j]];geometryShapes.push(shape);}return new ShapeGeometry(geometryShapes,data.curveSegments);}}function toJSON(shapes,data){data.shapes=[];if(is_array(shapes)){for(let i=0,l=shapes.length;i<l;i++){const shape=shapes[i];data.shapes.push(shape.uuid);}}else{data.shapes.push(shapes.uuid);}return data;}class SphereGeometry extends BufferGeometry{constructor(radius=1,widthSegments=32,heightSegments=16,phiStart=0,phiLength=Math.PI*2,thetaStart=0,thetaLength=Math.PI){super();this.type='SphereGeometry';this.parameters={radius:radius,widthSegments:widthSegments,heightSegments:heightSegments,phiStart:phiStart,phiLength:phiLength,thetaStart:thetaStart,thetaLength:thetaLength};widthSegments=Math.max(3,Math.floor(widthSegments));heightSegments=Math.max(2,Math.floor(heightSegments));const thetaEnd=Math.min(thetaStart+thetaLength,Math.PI);let index=0;const grid=[];const vertex=new three_module_Vector3();const normal=new three_module_Vector3();// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// generate vertices, normals and uvs\nfor(let iy=0;iy<=heightSegments;iy++){const verticesRow=[];const v=iy/heightSegments;// special case for the poles\nlet uOffset=0;if(iy==0&&thetaStart==0){uOffset=0.5/widthSegments;}else if(iy==heightSegments&&thetaEnd==Math.PI){uOffset=-0.5/widthSegments;}for(let ix=0;ix<=widthSegments;ix++){const u=ix/widthSegments;// vertex\nvertex.x=-radius*Math.cos(phiStart+u*phiLength)*Math.sin(thetaStart+v*thetaLength);vertex.y=radius*Math.cos(thetaStart+v*thetaLength);vertex.z=radius*Math.sin(phiStart+u*phiLength)*Math.sin(thetaStart+v*thetaLength);vertices.push(vertex.x,vertex.y,vertex.z);// normal\nnormal.copy(vertex).normalize();normals.push(normal.x,normal.y,normal.z);// uv\nuvs.push(u+uOffset,1-v);verticesRow.push(index++);}grid.push(verticesRow);}// indices\nfor(let iy=0;iy<heightSegments;iy++){for(let ix=0;ix<widthSegments;ix++){const a=grid[iy][ix+1];const b=grid[iy][ix];const c=grid[iy+1][ix];const d=grid[iy+1][ix+1];if(iy!==0||thetaStart>0)indices.push(a,b,d);if(iy!==heightSegments-1||thetaEnd<Math.PI)indices.push(b,c,d);}}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));}static fromJSON(data){return new SphereGeometry(data.radius,data.widthSegments,data.heightSegments,data.phiStart,data.phiLength,data.thetaStart,data.thetaLength);}}class TetrahedronGeometry extends PolyhedronGeometry{constructor(radius=1,detail=0){const vertices=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1];const indices=[2,1,0,0,3,2,1,3,0,2,3,1];super(vertices,indices,radius,detail);this.type='TetrahedronGeometry';this.parameters={radius:radius,detail:detail};}static fromJSON(data){return new TetrahedronGeometry(data.radius,data.detail);}}class TorusGeometry extends BufferGeometry{constructor(radius=1,tube=0.4,radialSegments=8,tubularSegments=6,arc=Math.PI*2){super();this.type='TorusGeometry';this.parameters={radius:radius,tube:tube,radialSegments:radialSegments,tubularSegments:tubularSegments,arc:arc};radialSegments=Math.floor(radialSegments);tubularSegments=Math.floor(tubularSegments);// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// helper variables\nconst center=new three_module_Vector3();const vertex=new three_module_Vector3();const normal=new three_module_Vector3();// generate vertices, normals and uvs\nfor(let j=0;j<=radialSegments;j++){for(let i=0;i<=tubularSegments;i++){const u=i/tubularSegments*arc;const v=j/radialSegments*Math.PI*2;// vertex\nvertex.x=(radius+tube*Math.cos(v))*Math.cos(u);vertex.y=(radius+tube*Math.cos(v))*Math.sin(u);vertex.z=tube*Math.sin(v);vertices.push(vertex.x,vertex.y,vertex.z);// normal\ncenter.x=radius*Math.cos(u);center.y=radius*Math.sin(u);normal.subVectors(vertex,center).normalize();normals.push(normal.x,normal.y,normal.z);// uv\nuvs.push(i/tubularSegments);uvs.push(j/radialSegments);}}// generate indices\nfor(let j=1;j<=radialSegments;j++){for(let i=1;i<=tubularSegments;i++){// indices\nconst a=(tubularSegments+1)*j+i-1;const b=(tubularSegments+1)*(j-1)+i-1;const c=(tubularSegments+1)*(j-1)+i;const d=(tubularSegments+1)*j+i;// faces\nindices.push(a,b,d);indices.push(b,c,d);}}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));}static fromJSON(data){return new TorusGeometry(data.radius,data.tube,data.radialSegments,data.tubularSegments,data.arc);}}class TorusKnotGeometry extends BufferGeometry{constructor(radius=1,tube=0.4,tubularSegments=64,radialSegments=8,p=2,q=3){super();this.type='TorusKnotGeometry';this.parameters={radius:radius,tube:tube,tubularSegments:tubularSegments,radialSegments:radialSegments,p:p,q:q};tubularSegments=Math.floor(tubularSegments);radialSegments=Math.floor(radialSegments);// buffers\nconst indices=[];const vertices=[];const normals=[];const uvs=[];// helper variables\nconst vertex=new three_module_Vector3();const normal=new three_module_Vector3();const P1=new three_module_Vector3();const P2=new three_module_Vector3();const B=new three_module_Vector3();const T=new three_module_Vector3();const N=new three_module_Vector3();// generate vertices, normals and uvs\nfor(let i=0;i<=tubularSegments;++i){// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segment\nconst u=i/tubularSegments*p*Math.PI*2;// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\ncalculatePositionOnCurve(u,p,q,radius,P1);calculatePositionOnCurve(u+0.01,p,q,radius,P2);// calculate orthonormal basis\nT.subVectors(P2,P1);N.addVectors(P2,P1);B.crossVectors(T,N);N.crossVectors(B,T);// normalize B, N. T can be ignored, we don't use it\nB.normalize();N.normalize();for(let j=0;j<=radialSegments;++j){// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\nconst v=j/radialSegments*Math.PI*2;const cx=-tube*Math.cos(v);const cy=tube*Math.sin(v);// now calculate the final vertex position.\n// first we orient the extrusion with our basis vectors, then we add it to the current position on the curve\nvertex.x=P1.x+(cx*N.x+cy*B.x);vertex.y=P1.y+(cx*N.y+cy*B.y);vertex.z=P1.z+(cx*N.z+cy*B.z);vertices.push(vertex.x,vertex.y,vertex.z);// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\nnormal.subVectors(vertex,P1).normalize();normals.push(normal.x,normal.y,normal.z);// uv\nuvs.push(i/tubularSegments);uvs.push(j/radialSegments);}}// generate indices\nfor(let j=1;j<=tubularSegments;j++){for(let i=1;i<=radialSegments;i++){// indices\nconst a=(radialSegments+1)*(j-1)+(i-1);const b=(radialSegments+1)*j+(i-1);const c=(radialSegments+1)*j+i;const d=(radialSegments+1)*(j-1)+i;// faces\nindices.push(a,b,d);indices.push(b,c,d);}}// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));// this function calculates the current position on the torus curve\nfunction calculatePositionOnCurve(u,p,q,radius,position){const cu=Math.cos(u);const su=Math.sin(u);const quOverP=q/p*u;const cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}}static fromJSON(data){return new TorusKnotGeometry(data.radius,data.tube,data.tubularSegments,data.radialSegments,data.p,data.q);}}class TubeGeometry extends BufferGeometry{constructor(path=new QuadraticBezierCurve3(new three_module_Vector3(-1,-1,0),new three_module_Vector3(-1,1,0),new three_module_Vector3(1,1,0)),tubularSegments=64,radius=1,radialSegments=8,closed=false){super();this.type='TubeGeometry';this.parameters={path:path,tubularSegments:tubularSegments,radius:radius,radialSegments:radialSegments,closed:closed};const frames=path.computeFrenetFrames(tubularSegments,closed);// expose internals\nthis.tangents=frames.tangents;this.normals=frames.normals;this.binormals=frames.binormals;// helper variables\nconst vertex=new three_module_Vector3();const normal=new three_module_Vector3();const uv=new Vector2();let P=new three_module_Vector3();// buffer\nconst vertices=[];const normals=[];const uvs=[];const indices=[];// create buffer data\ngenerateBufferData();// build geometry\nthis.setIndex(indices);this.setAttribute('position',new Float32BufferAttribute(vertices,3));this.setAttribute('normal',new Float32BufferAttribute(normals,3));this.setAttribute('uv',new Float32BufferAttribute(uvs,2));// functions\nfunction generateBufferData(){for(let i=0;i<tubularSegments;i++){generateSegment(i);}// if the geometry is not closed, generate the last row of vertices and normals\n// at the regular position on the given path\n//\n// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\ngenerateSegment(closed===false?tubularSegments:0);// uvs are generated in a separate function.\n// this makes it easy compute correct values for closed geometries\ngenerateUVs();// finally create faces\ngenerateIndices();}function generateSegment(i){// we use getPointAt to sample evenly distributed points from the given path\nP=path.getPointAt(i/tubularSegments,P);// retrieve corresponding normal and binormal\nconst N=frames.normals[i];const B=frames.binormals[i];// generate normals and vertices for the current segment\nfor(let j=0;j<=radialSegments;j++){const v=j/radialSegments*Math.PI*2;const sin=Math.sin(v);const cos=-Math.cos(v);// normal\nnormal.x=cos*N.x+sin*B.x;normal.y=cos*N.y+sin*B.y;normal.z=cos*N.z+sin*B.z;normal.normalize();normals.push(normal.x,normal.y,normal.z);// vertex\nvertex.x=P.x+radius*normal.x;vertex.y=P.y+radius*normal.y;vertex.z=P.z+radius*normal.z;vertices.push(vertex.x,vertex.y,vertex.z);}}function generateIndices(){for(let j=1;j<=tubularSegments;j++){for(let i=1;i<=radialSegments;i++){const a=(radialSegments+1)*(j-1)+(i-1);const b=(radialSegments+1)*j+(i-1);const c=(radialSegments+1)*j+i;const d=(radialSegments+1)*(j-1)+i;// faces\nindices.push(a,b,d);indices.push(b,c,d);}}}function generateUVs(){for(let i=0;i<=tubularSegments;i++){for(let j=0;j<=radialSegments;j++){uv.x=i/tubularSegments;uv.y=j/radialSegments;uvs.push(uv.x,uv.y);}}}}toJSON(){const data=super.toJSON();data.path=this.parameters.path.toJSON();return data;}static fromJSON(data){// This only works for built-in curves (e.g. CatmullRomCurve3).\n// User defined curves or instances of CurvePath will not be deserialized.\nreturn new TubeGeometry(new Curves[data.path.type]().fromJSON(data.path),data.tubularSegments,data.radius,data.radialSegments,data.closed);}}class WireframeGeometry extends BufferGeometry{constructor(geometry=null){super();this.type='WireframeGeometry';this.parameters={geometry:geometry};if(geometry!==null){// buffer\nconst vertices=[];const edges=new core_js_set();// helper variables\nconst start=new three_module_Vector3();const end=new three_module_Vector3();if(geometry.index!==null){// indexed BufferGeometry\nconst position=geometry.attributes.position;const indices=geometry.index;let groups=geometry.groups;if(groups.length===0){groups=[{start:0,count:indices.count,materialIndex:0}];}// create a data structure that contains all edges without duplicates\nfor(let o=0,ol=groups.length;o<ol;++o){const group=groups[o];const groupStart=group.start;const groupCount=group.count;for(let i=groupStart,l=groupStart+groupCount;i<l;i+=3){for(let j=0;j<3;j++){const index1=indices.getX(i+j);const index2=indices.getX(i+(j+1)%3);start.fromBufferAttribute(position,index1);end.fromBufferAttribute(position,index2);if(isUniqueEdge(start,end,edges)===true){vertices.push(start.x,start.y,start.z);vertices.push(end.x,end.y,end.z);}}}}}else{// non-indexed BufferGeometry\nconst position=geometry.attributes.position;for(let i=0,l=position.count/3;i<l;i++){for(let j=0;j<3;j++){// three edges per triangle, an edge is represented as (index1, index2)\n// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\nconst index1=3*i+j;const index2=3*i+(j+1)%3;start.fromBufferAttribute(position,index1);end.fromBufferAttribute(position,index2);if(isUniqueEdge(start,end,edges)===true){vertices.push(start.x,start.y,start.z);vertices.push(end.x,end.y,end.z);}}}}// build geometry\nthis.setAttribute('position',new Float32BufferAttribute(vertices,3));}}}function isUniqueEdge(start,end,edges){const hash1=`${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;const hash2=`${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`;// coincident edge\nif(edges.has(hash1)===true||edges.has(hash2)===true){return false;}else{edges.add(hash1);edges.add(hash2);return true;}}var Geometries=/*#__PURE__*/freeze({__proto__:null,BoxGeometry:BoxGeometry,CapsuleGeometry:CapsuleGeometry,CircleGeometry:CircleGeometry,ConeGeometry:ConeGeometry,CylinderGeometry:CylinderGeometry,DodecahedronGeometry:DodecahedronGeometry,EdgesGeometry:EdgesGeometry,ExtrudeGeometry:ExtrudeGeometry,IcosahedronGeometry:IcosahedronGeometry,LatheGeometry:LatheGeometry,OctahedronGeometry:OctahedronGeometry,PlaneGeometry:PlaneGeometry,PolyhedronGeometry:PolyhedronGeometry,RingGeometry:RingGeometry,ShapeGeometry:ShapeGeometry,SphereGeometry:SphereGeometry,TetrahedronGeometry:TetrahedronGeometry,TorusGeometry:TorusGeometry,TorusKnotGeometry:TorusKnotGeometry,TubeGeometry:TubeGeometry,WireframeGeometry:WireframeGeometry});class ShadowMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isShadowMaterial=true;this.type='ShadowMaterial';this.color=new Color(0x000000);this.transparent=true;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.fog=source.fog;return this;}}class RawShaderMaterial extends (/* unused pure expression or super */ null && (ShaderMaterial)){constructor(parameters){super(parameters);this.isRawShaderMaterial=true;this.type='RawShaderMaterial';}}class MeshStandardMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isMeshStandardMaterial=true;this.defines={'STANDARD':''};this.type='MeshStandardMaterial';this.color=new Color(0xffffff);// diffuse\nthis.roughness=1.0;this.metalness=0.0;this.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=TangentSpaceNormalMap;this.normalScale=new Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.roughnessMap=null;this.metalnessMap=null;this.alphaMap=null;this.envMap=null;this.envMapIntensity=1.0;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.flatShading=false;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.defines={'STANDARD':''};this.color.copy(source.color);this.roughness=source.roughness;this.metalness=source.metalness;this.map=_mapInstanceProperty(source);this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalMapType=source.normalMapType;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.roughnessMap=source.roughnessMap;this.metalnessMap=source.metalnessMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.envMapIntensity=source.envMapIntensity;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.flatShading=source.flatShading;this.fog=source.fog;return this;}}class MeshPhysicalMaterial extends (/* unused pure expression or super */ null && (MeshStandardMaterial)){constructor(parameters){super();this.isMeshPhysicalMaterial=true;this.defines={'STANDARD':'','PHYSICAL':''};this.type='MeshPhysicalMaterial';this.clearcoatMap=null;this.clearcoatRoughness=0.0;this.clearcoatRoughnessMap=null;this.clearcoatNormalScale=new Vector2(1,1);this.clearcoatNormalMap=null;this.ior=1.5;_Object$defineProperty(this,'reflectivity',{get:function(){return three_module_clamp(2.5*(this.ior-1)/(this.ior+1),0,1);},set:function(reflectivity){this.ior=(1+0.4*reflectivity)/(1-0.4*reflectivity);}});this.iridescenceMap=null;this.iridescenceIOR=1.3;this.iridescenceThicknessRange=[100,400];this.iridescenceThicknessMap=null;this.sheenColor=new Color(0x000000);this.sheenColorMap=null;this.sheenRoughness=1.0;this.sheenRoughnessMap=null;this.transmissionMap=null;this.thickness=0;this.thicknessMap=null;this.attenuationDistance=Infinity;this.attenuationColor=new Color(1,1,1);this.specularIntensity=1.0;this.specularIntensityMap=null;this.specularColor=new Color(1,1,1);this.specularColorMap=null;this._sheen=0.0;this._clearcoat=0;this._iridescence=0;this._transmission=0;this.setValues(parameters);}get sheen(){return this._sheen;}set sheen(value){if(this._sheen>0!==value>0){this.version++;}this._sheen=value;}get clearcoat(){return this._clearcoat;}set clearcoat(value){if(this._clearcoat>0!==value>0){this.version++;}this._clearcoat=value;}get iridescence(){return this._iridescence;}set iridescence(value){if(this._iridescence>0!==value>0){this.version++;}this._iridescence=value;}get transmission(){return this._transmission;}set transmission(value){if(this._transmission>0!==value>0){this.version++;}this._transmission=value;}copy(source){super.copy(source);this.defines={'STANDARD':'','PHYSICAL':''};this.clearcoat=source.clearcoat;this.clearcoatMap=source.clearcoatMap;this.clearcoatRoughness=source.clearcoatRoughness;this.clearcoatRoughnessMap=source.clearcoatRoughnessMap;this.clearcoatNormalMap=source.clearcoatNormalMap;this.clearcoatNormalScale.copy(source.clearcoatNormalScale);this.ior=source.ior;this.iridescence=source.iridescence;this.iridescenceMap=source.iridescenceMap;this.iridescenceIOR=source.iridescenceIOR;this.iridescenceThicknessRange=[...source.iridescenceThicknessRange];this.iridescenceThicknessMap=source.iridescenceThicknessMap;this.sheen=source.sheen;this.sheenColor.copy(source.sheenColor);this.sheenColorMap=source.sheenColorMap;this.sheenRoughness=source.sheenRoughness;this.sheenRoughnessMap=source.sheenRoughnessMap;this.transmission=source.transmission;this.transmissionMap=source.transmissionMap;this.thickness=source.thickness;this.thicknessMap=source.thicknessMap;this.attenuationDistance=source.attenuationDistance;this.attenuationColor.copy(source.attenuationColor);this.specularIntensity=source.specularIntensity;this.specularIntensityMap=source.specularIntensityMap;this.specularColor.copy(source.specularColor);this.specularColorMap=source.specularColorMap;return this;}}class MeshPhongMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isMeshPhongMaterial=true;this.type='MeshPhongMaterial';this.color=new Color(0xffffff);// diffuse\nthis.specular=new Color(0x111111);this.shininess=30;this.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=TangentSpaceNormalMap;this.normalScale=new Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.flatShading=false;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.specular.copy(source.specular);this.shininess=source.shininess;this.map=_mapInstanceProperty(source);this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalMapType=source.normalMapType;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.specularMap=source.specularMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.combine=source.combine;this.reflectivity=source.reflectivity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.flatShading=source.flatShading;this.fog=source.fog;return this;}}class MeshToonMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isMeshToonMaterial=true;this.defines={'TOON':''};this.type='MeshToonMaterial';this.color=new Color(0xffffff);this.map=null;this.gradientMap=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=TangentSpaceNormalMap;this.normalScale=new Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.alphaMap=null;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.map=_mapInstanceProperty(source);this.gradientMap=source.gradientMap;this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalMapType=source.normalMapType;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.alphaMap=source.alphaMap;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.fog=source.fog;return this;}}class MeshNormalMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isMeshNormalMaterial=true;this.type='MeshNormalMaterial';this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=TangentSpaceNormalMap;this.normalScale=new Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=false;this.wireframeLinewidth=1;this.flatShading=false;this.setValues(parameters);}copy(source){super.copy(source);this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalMapType=source.normalMapType;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.flatShading=source.flatShading;return this;}}class MeshLambertMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isMeshLambertMaterial=true;this.type='MeshLambertMaterial';this.color=new Color(0xffffff);// diffuse\nthis.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=TangentSpaceNormalMap;this.normalScale=new Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.flatShading=false;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.color.copy(source.color);this.map=_mapInstanceProperty(source);this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalMapType=source.normalMapType;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.specularMap=source.specularMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.combine=source.combine;this.reflectivity=source.reflectivity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.flatShading=source.flatShading;this.fog=source.fog;return this;}}class MeshMatcapMaterial extends (/* unused pure expression or super */ null && (Material)){constructor(parameters){super();this.isMeshMatcapMaterial=true;this.defines={'MATCAP':''};this.type='MeshMatcapMaterial';this.color=new Color(0xffffff);// diffuse\nthis.matcap=null;this.map=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=TangentSpaceNormalMap;this.normalScale=new Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.alphaMap=null;this.flatShading=false;this.fog=true;this.setValues(parameters);}copy(source){super.copy(source);this.defines={'MATCAP':''};this.color.copy(source.color);this.matcap=source.matcap;this.map=_mapInstanceProperty(source);this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalMapType=source.normalMapType;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.alphaMap=source.alphaMap;this.flatShading=source.flatShading;this.fog=source.fog;return this;}}class LineDashedMaterial extends (/* unused pure expression or super */ null && (LineBasicMaterial)){constructor(parameters){super();this.isLineDashedMaterial=true;this.type='LineDashedMaterial';this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(parameters);}copy(source){super.copy(source);this.scale=source.scale;this.dashSize=source.dashSize;this.gapSize=source.gapSize;return this;}}// same as Array.prototype.slice, but also works on typed arrays\nfunction arraySlice(array,from,to){if(isTypedArray(array)){// in ios9 array.subarray(from, undefined) will return empty array\n// but array.subarray(from) or array.subarray(from, len) is correct\nreturn new array.constructor(array.subarray(from,to!==undefined?to:array.length));}return slice(array).call(array,from,to);}// converts an array to a specific type\nfunction convertArray(array,type,forceClone){if(!array||// let 'undefined' and 'null' pass\n!forceClone&&array.constructor===type)return array;if(typeof type.BYTES_PER_ELEMENT==='number'){return new type(array);// create typed array\n}return slice(Array.prototype).call(array);// create Array\n}function isTypedArray(object){return ArrayBuffer.isView(object)&&!(object instanceof DataView);}// returns an array by which times and values can be sorted\nfunction getKeyframeOrder(times){function compareTime(i,j){return times[i]-times[j];}const n=times.length;const result=new Array(n);for(let i=0;i!==n;++i)result[i]=i;instance_sort(result).call(result,compareTime);return result;}// uses the array previously returned by 'getKeyframeOrder' to sort data\nfunction sortedArray(values,stride,order){const nValues=values.length;const result=new values.constructor(nValues);for(let i=0,dstOffset=0;dstOffset!==nValues;++i){const srcOffset=order[i]*stride;for(let j=0;j!==stride;++j){result[dstOffset++]=values[srcOffset+j];}}return result;}// function for parsing AOS keyframe formats\nfunction flattenJSON(jsonKeys,times,values,valuePropertyName){let i=1,key=jsonKeys[0];while(key!==undefined&&key[valuePropertyName]===undefined){key=jsonKeys[i++];}if(key===undefined)return;// no data\nlet value=key[valuePropertyName];if(value===undefined)return;// no data\nif(is_array(value)){do{value=key[valuePropertyName];if(value!==undefined){times.push(key.time);values.push.apply(values,value);// push all elements\n}key=jsonKeys[i++];}while(key!==undefined);}else if(value.toArray!==undefined){// ...assume THREE.Math-ish\ndo{value=key[valuePropertyName];if(value!==undefined){times.push(key.time);value.toArray(values,values.length);}key=jsonKeys[i++];}while(key!==undefined);}else{// otherwise push as-is\ndo{value=key[valuePropertyName];if(value!==undefined){times.push(key.time);values.push(value);}key=jsonKeys[i++];}while(key!==undefined);}}function subclip(sourceClip,name,startFrame,endFrame,fps=30){const clip=sourceClip.clone();clip.name=name;const tracks=[];for(let i=0;i<clip.tracks.length;++i){const track=clip.tracks[i];const valueSize=track.getValueSize();const times=[];const values=[];for(let j=0;j<track.times.length;++j){const frame=track.times[j]*fps;if(frame<startFrame||frame>=endFrame)continue;times.push(track.times[j]);for(let k=0;k<valueSize;++k){values.push(instance_values(track)[j*valueSize+k]);}}if(times.length===0)continue;track.times=convertArray(times,track.times.constructor);track.values=convertArray(values,instance_values(track).constructor);tracks.push(track);}clip.tracks=tracks;// find minimum .times value across all tracks in the trimmed clip\nlet minStartTime=Infinity;for(let i=0;i<clip.tracks.length;++i){if(minStartTime>clip.tracks[i].times[0]){minStartTime=clip.tracks[i].times[0];}}// shift all tracks such that clip begins at t=0\nfor(let i=0;i<clip.tracks.length;++i){clip.tracks[i].shift(-1*minStartTime);}clip.resetDuration();return clip;}function makeClipAdditive(targetClip,referenceFrame=0,referenceClip=targetClip,fps=30){if(fps<=0)fps=30;const numTracks=referenceClip.tracks.length;const referenceTime=referenceFrame/fps;// Make each track's values relative to the values at the reference frame\nfor(let i=0;i<numTracks;++i){var _context27;const referenceTrack=referenceClip.tracks[i];const referenceTrackType=referenceTrack.ValueTypeName;// Skip this track if it's non-numeric\nif(referenceTrackType==='bool'||referenceTrackType==='string')continue;// Find the track in the target clip whose name and type matches the reference track\nconst targetTrack=find(_context27=targetClip.tracks).call(_context27,function(track){return track.name===referenceTrack.name&&track.ValueTypeName===referenceTrackType;});if(targetTrack===undefined)continue;let referenceOffset=0;const referenceValueSize=referenceTrack.getValueSize();if(referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline){referenceOffset=referenceValueSize/3;}let targetOffset=0;const targetValueSize=targetTrack.getValueSize();if(targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline){targetOffset=targetValueSize/3;}const lastIndex=referenceTrack.times.length-1;let referenceValue;// Find the value to subtract out of the track\nif(referenceTime<=referenceTrack.times[0]){// Reference frame is earlier than the first keyframe, so just use the first keyframe\nconst startIndex=referenceOffset;const endIndex=referenceValueSize-referenceOffset;referenceValue=arraySlice(instance_values(referenceTrack),startIndex,endIndex);}else if(referenceTime>=referenceTrack.times[lastIndex]){// Reference frame is after the last keyframe, so just use the last keyframe\nconst startIndex=lastIndex*referenceValueSize+referenceOffset;const endIndex=startIndex+referenceValueSize-referenceOffset;referenceValue=arraySlice(instance_values(referenceTrack),startIndex,endIndex);}else{// Interpolate to the reference value\nconst interpolant=referenceTrack.createInterpolant();const startIndex=referenceOffset;const endIndex=referenceValueSize-referenceOffset;interpolant.evaluate(referenceTime);referenceValue=arraySlice(interpolant.resultBuffer,startIndex,endIndex);}// Conjugate the quaternion\nif(referenceTrackType==='quaternion'){const referenceQuat=new three_module_Quaternion().fromArray(referenceValue).normalize().conjugate();referenceQuat.toArray(referenceValue);}// Subtract the reference value from all of the track values\nconst numTimes=targetTrack.times.length;for(let j=0;j<numTimes;++j){const valueStart=j*targetValueSize+targetOffset;if(referenceTrackType==='quaternion'){// Multiply the conjugate for quaternion track types\nthree_module_Quaternion.multiplyQuaternionsFlat(instance_values(targetTrack),valueStart,referenceValue,0,instance_values(targetTrack),valueStart);}else{const valueEnd=targetValueSize-targetOffset*2;// Subtract each value for all other numeric track types\nfor(let k=0;k<valueEnd;++k){instance_values(targetTrack)[valueStart+k]-=referenceValue[k];}}}}targetClip.blendMode=AdditiveAnimationBlendMode;return targetClip;}var AnimationUtils=/*#__PURE__*/freeze({__proto__:null,arraySlice:arraySlice,convertArray:convertArray,isTypedArray:isTypedArray,getKeyframeOrder:getKeyframeOrder,sortedArray:sortedArray,flattenJSON:flattenJSON,subclip:subclip,makeClipAdditive:makeClipAdditive});/**\n * Abstract base class of interpolants over parametric samples.\n *\n * The parameter domain is one dimensional, typically the time or a path\n * along a curve defined by the data.\n *\n * The sample values can have any dimensionality and derived classes may\n * apply special interpretations to the data.\n *\n * This class provides the interval seek in a Template Method, deferring\n * the actual interpolation to derived classes.\n *\n * Time complexity is O(1) for linear access crossing at most two points\n * and O(log N) for random access, where N is the number of positions.\n *\n * References:\n *\n * \t\thttp://www.oodesign.com/template-method-pattern.html\n *\n */class Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){this.parameterPositions=parameterPositions;this._cachedIndex=0;this.resultBuffer=resultBuffer!==undefined?resultBuffer:new sampleValues.constructor(sampleSize);this.sampleValues=sampleValues;this.valueSize=sampleSize;this.settings=null;this.DefaultSettings_={};}evaluate(t){const pp=this.parameterPositions;let i1=this._cachedIndex,t1=pp[i1],t0=pp[i1-1];validate_interval:{seek:{let right;linear_scan:{//- See http://jsperf.com/comparison-to-undefined/3\n//- slower code:\n//-\n//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\nforward_scan:if(!(t<t1)){for(let giveUpAt=i1+2;;){if(t1===undefined){if(t<t0)break forward_scan;// after end\ni1=pp.length;this._cachedIndex=i1;return this.copySampleValue_(i1-1);}if(i1===giveUpAt)break;// this loop\nt0=t1;t1=pp[++i1];if(t<t1){// we have arrived at the sought interval\nbreak seek;}}// prepare binary search on the right side of the index\nright=pp.length;break linear_scan;}//- slower code:\n//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\nif(!(t>=t0)){// looping?\nconst t1global=pp[1];if(t<t1global){i1=2;// + 1, using the scan for the details\nt0=t1global;}// linear reverse scan\nfor(let giveUpAt=i1-2;;){if(t0===undefined){// before start\nthis._cachedIndex=0;return this.copySampleValue_(0);}if(i1===giveUpAt)break;// this loop\nt1=t0;t0=pp[--i1-1];if(t>=t0){// we have arrived at the sought interval\nbreak seek;}}// prepare binary search on the left side of the index\nright=i1;i1=0;break linear_scan;}// the interval is valid\nbreak validate_interval;}// linear scan\n// binary search\nwhile(i1<right){const mid=i1+right>>>1;if(t<pp[mid]){right=mid;}else{i1=mid+1;}}t1=pp[i1];t0=pp[i1-1];// check boundary cases, again\nif(t0===undefined){this._cachedIndex=0;return this.copySampleValue_(0);}if(t1===undefined){i1=pp.length;this._cachedIndex=i1;return this.copySampleValue_(i1-1);}}// seek\nthis._cachedIndex=i1;this.intervalChanged_(i1,t0,t1);}// validate_interval\nreturn this.interpolate_(i1,t0,t,t1);}getSettings_(){return this.settings||this.DefaultSettings_;}copySampleValue_(index){// copies a sample value to the result buffer\nconst result=this.resultBuffer,values=this.sampleValues,stride=this.valueSize,offset=index*stride;for(let i=0;i!==stride;++i){result[i]=values[offset+i];}return result;}// Template methods for derived classes:\ninterpolate_(){throw new Error('call to abstract method');// implementations shall return this.resultBuffer\n}intervalChanged_(){// empty\n}}/**\n * Fast and simple cubic spline interpolant.\n *\n * It was derived from a Hermitian construction setting the first derivative\n * at each sample position to the linear slope between neighboring positions\n * over their parameter interval.\n */class CubicInterpolant extends Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){super(parameterPositions,sampleValues,sampleSize,resultBuffer);this._weightPrev=-0;this._offsetPrev=-0;this._weightNext=-0;this._offsetNext=-0;this.DefaultSettings_={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};}intervalChanged_(i1,t0,t1){const pp=this.parameterPositions;let iPrev=i1-2,iNext=i1+1,tPrev=pp[iPrev],tNext=pp[iNext];if(tPrev===undefined){switch(this.getSettings_().endingStart){case ZeroSlopeEnding:// f'(t0) = 0\niPrev=i1;tPrev=2*t0-t1;break;case WrapAroundEnding:// use the other end of the curve\niPrev=pp.length-2;tPrev=t0+pp[iPrev]-pp[iPrev+1];break;default:// ZeroCurvatureEnding\n// f''(t0) = 0 a.k.a. Natural Spline\niPrev=i1;tPrev=t1;}}if(tNext===undefined){switch(this.getSettings_().endingEnd){case ZeroSlopeEnding:// f'(tN) = 0\niNext=i1;tNext=2*t1-t0;break;case WrapAroundEnding:// use the other end of the curve\niNext=1;tNext=t1+pp[1]-pp[0];break;default:// ZeroCurvatureEnding\n// f''(tN) = 0, a.k.a. Natural Spline\niNext=i1-1;tNext=t0;}}const halfDt=(t1-t0)*0.5,stride=this.valueSize;this._weightPrev=halfDt/(t0-tPrev);this._weightNext=halfDt/(tNext-t1);this._offsetPrev=iPrev*stride;this._offsetNext=iNext*stride;}interpolate_(i1,t0,t,t1){const result=this.resultBuffer,values=this.sampleValues,stride=this.valueSize,o1=i1*stride,o0=o1-stride,oP=this._offsetPrev,oN=this._offsetNext,wP=this._weightPrev,wN=this._weightNext,p=(t-t0)/(t1-t0),pp=p*p,ppp=pp*p;// evaluate polynomials\nconst sP=-wP*ppp+2*wP*pp-wP*p;const s0=(1+wP)*ppp+(-1.5-2*wP)*pp+(-0.5+wP)*p+1;const s1=(-1-wN)*ppp+(1.5+wN)*pp+0.5*p;const sN=wN*ppp-wN*pp;// combine data linearly\nfor(let i=0;i!==stride;++i){result[i]=sP*values[oP+i]+s0*values[o0+i]+s1*values[o1+i]+sN*values[oN+i];}return result;}}class LinearInterpolant extends Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){super(parameterPositions,sampleValues,sampleSize,resultBuffer);}interpolate_(i1,t0,t,t1){const result=this.resultBuffer,values=this.sampleValues,stride=this.valueSize,offset1=i1*stride,offset0=offset1-stride,weight1=(t-t0)/(t1-t0),weight0=1-weight1;for(let i=0;i!==stride;++i){result[i]=values[offset0+i]*weight0+values[offset1+i]*weight1;}return result;}}/**\n *\n * Interpolant that evaluates to the sample value at the position preceding\n * the parameter.\n */class DiscreteInterpolant extends Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){super(parameterPositions,sampleValues,sampleSize,resultBuffer);}interpolate_(i1/*, t0, t, t1 */){return this.copySampleValue_(i1-1);}}class KeyframeTrack{constructor(name,times,values,interpolation){if(name===undefined)throw new Error('THREE.KeyframeTrack: track name is undefined');if(times===undefined||times.length===0)throw new Error('THREE.KeyframeTrack: no keyframes in track named '+name);this.name=name;this.times=convertArray(times,this.TimeBufferType);this.values=convertArray(values,this.ValueBufferType);this.setInterpolation(interpolation||this.DefaultInterpolation);}// Serialization (in static context, because of constructor invocation\n// and automatic invocation of .toJSON):\nstatic toJSON(track){const trackType=track.constructor;let json;// derived classes can define a static toJSON method\nif(trackType.toJSON!==this.toJSON){json=trackType.toJSON(track);}else{// by default, we assume the data can be serialized as-is\njson={'name':track.name,'times':convertArray(track.times,Array),'values':convertArray(instance_values(track),Array)};const interpolation=track.getInterpolation();if(interpolation!==track.DefaultInterpolation){json.interpolation=interpolation;}}json.type=track.ValueTypeName;// mandatory\nreturn json;}InterpolantFactoryMethodDiscrete(result){return new DiscreteInterpolant(this.times,instance_values(this),this.getValueSize(),result);}InterpolantFactoryMethodLinear(result){return new LinearInterpolant(this.times,instance_values(this),this.getValueSize(),result);}InterpolantFactoryMethodSmooth(result){return new CubicInterpolant(this.times,instance_values(this),this.getValueSize(),result);}setInterpolation(interpolation){let factoryMethod;switch(interpolation){case InterpolateDiscrete:factoryMethod=this.InterpolantFactoryMethodDiscrete;break;case InterpolateLinear:factoryMethod=this.InterpolantFactoryMethodLinear;break;case InterpolateSmooth:factoryMethod=this.InterpolantFactoryMethodSmooth;break;}if(factoryMethod===undefined){const message='unsupported interpolation for '+this.ValueTypeName+' keyframe track named '+this.name;if(this.createInterpolant===undefined){// fall back to default, unless the default itself is messed up\nif(interpolation!==this.DefaultInterpolation){this.setInterpolation(this.DefaultInterpolation);}else{throw new Error(message);// fatal, in this case\n}}console.warn('THREE.KeyframeTrack:',message);return this;}this.createInterpolant=factoryMethod;return this;}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return InterpolateSmooth;}}getValueSize(){return instance_values(this).length/this.times.length;}// move all keyframes either forwards or backwards in time\nshift(timeOffset){if(timeOffset!==0.0){const times=this.times;for(let i=0,n=times.length;i!==n;++i){times[i]+=timeOffset;}}return this;}// scale all keyframe times by a factor (useful for frame <-> seconds conversions)\nscale(timeScale){if(timeScale!==1.0){const times=this.times;for(let i=0,n=times.length;i!==n;++i){times[i]*=timeScale;}}return this;}// removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\ntrim(startTime,endTime){const times=this.times,nKeys=times.length;let from=0,to=nKeys-1;while(from!==nKeys&&times[from]<startTime){++from;}while(to!==-1&&times[to]>endTime){--to;}++to;// inclusive -> exclusive bound\nif(from!==0||to!==nKeys){// empty tracks are forbidden, so keep at least one keyframe\nif(from>=to){to=Math.max(to,1);from=to-1;}const stride=this.getValueSize();this.times=arraySlice(times,from,to);this.values=arraySlice(instance_values(this),from*stride,to*stride);}return this;}// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\nvalidate(){let valid=true;const valueSize=this.getValueSize();if(valueSize-Math.floor(valueSize)!==0){console.error('THREE.KeyframeTrack: Invalid value size in track.',this);valid=false;}const times=this.times,values=instance_values(this),nKeys=times.length;if(nKeys===0){console.error('THREE.KeyframeTrack: Track is empty.',this);valid=false;}let prevTime=null;for(let i=0;i!==nKeys;i++){const currTime=times[i];if(typeof currTime==='number'&&isNaN(currTime)){console.error('THREE.KeyframeTrack: Time is not a valid number.',this,i,currTime);valid=false;break;}if(prevTime!==null&&prevTime>currTime){console.error('THREE.KeyframeTrack: Out of order keys.',this,i,currTime,prevTime);valid=false;break;}prevTime=currTime;}if(values!==undefined){if(isTypedArray(values)){for(let i=0,n=values.length;i!==n;++i){const value=values[i];if(isNaN(value)){console.error('THREE.KeyframeTrack: Value is not a valid number.',this,i,value);valid=false;break;}}}}return valid;}// removes equivalent sequential keys as common in morph target sequences\n// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --\x3e (0,0,1,1,0,0)\noptimize(){// times or values may be shared with other tracks, so overwriting is unsafe\nconst times=arraySlice(this.times),values=arraySlice(instance_values(this)),stride=this.getValueSize(),smoothInterpolation=this.getInterpolation()===InterpolateSmooth,lastIndex=times.length-1;let writeIndex=1;for(let i=1;i<lastIndex;++i){let keep=false;const time=times[i];const timeNext=times[i+1];// remove adjacent keyframes scheduled at the same time\nif(time!==timeNext&&(i!==1||time!==times[0])){if(!smoothInterpolation){// remove unnecessary keyframes same as their neighbors\nconst offset=i*stride,offsetP=offset-stride,offsetN=offset+stride;for(let j=0;j!==stride;++j){const value=values[offset+j];if(value!==values[offsetP+j]||value!==values[offsetN+j]){keep=true;break;}}}else{keep=true;}}// in-place compaction\nif(keep){if(i!==writeIndex){times[writeIndex]=times[i];const readOffset=i*stride,writeOffset=writeIndex*stride;for(let j=0;j!==stride;++j){values[writeOffset+j]=values[readOffset+j];}}++writeIndex;}}// flush last keyframe (compaction looks ahead)\nif(lastIndex>0){times[writeIndex]=times[lastIndex];for(let readOffset=lastIndex*stride,writeOffset=writeIndex*stride,j=0;j!==stride;++j){values[writeOffset+j]=values[readOffset+j];}++writeIndex;}if(writeIndex!==times.length){this.times=arraySlice(times,0,writeIndex);this.values=arraySlice(values,0,writeIndex*stride);}else{this.times=times;this.values=values;}return this;}clone(){const times=arraySlice(this.times,0);const values=arraySlice(instance_values(this),0);const TypedKeyframeTrack=this.constructor;const track=new TypedKeyframeTrack(this.name,times,values);// Interpolant argument to constructor is not saved, so copy the factory method directly.\ntrack.createInterpolant=this.createInterpolant;return track;}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;/**\n * A Track of Boolean keyframe values.\n */class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName='bool';BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=undefined;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=undefined;/**\n * A Track of keyframe values that represent color.\n */class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName='color';/**\n * A Track of numeric keyframe values.\n */class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName='number';/**\n * Spherical linear unit quaternion interpolant.\n */class QuaternionLinearInterpolant extends Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){super(parameterPositions,sampleValues,sampleSize,resultBuffer);}interpolate_(i1,t0,t,t1){const result=this.resultBuffer,values=this.sampleValues,stride=this.valueSize,alpha=(t-t0)/(t1-t0);let offset=i1*stride;for(let end=offset+stride;offset!==end;offset+=4){three_module_Quaternion.slerpFlat(result,0,values,offset-stride,values,offset,alpha);}return result;}}/**\n * A Track of quaternion keyframe values.\n */class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(result){return new QuaternionLinearInterpolant(this.times,instance_values(this),this.getValueSize(),result);}}QuaternionKeyframeTrack.prototype.ValueTypeName='quaternion';// ValueBufferType is inherited\nQuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=undefined;/**\n * A Track that interpolates Strings\n */class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName='string';StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=undefined;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=undefined;/**\n * A Track of vectored keyframe values.\n */class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName='vector';class AnimationClip{constructor(name,duration=-1,tracks,blendMode=NormalAnimationBlendMode){this.name=name;this.tracks=tracks;this.duration=duration;this.blendMode=blendMode;this.uuid=three_module_generateUUID();// this means it should figure out its duration by scanning the tracks\nif(this.duration<0){this.resetDuration();}}static parse(json){const tracks=[],jsonTracks=json.tracks,frameTime=1.0/(json.fps||1.0);for(let i=0,n=jsonTracks.length;i!==n;++i){tracks.push(parseKeyframeTrack(jsonTracks[i]).scale(frameTime));}const clip=new this(json.name,json.duration,tracks,json.blendMode);clip.uuid=json.uuid;return clip;}static toJSON(clip){const tracks=[],clipTracks=clip.tracks;const json={'name':clip.name,'duration':clip.duration,'tracks':tracks,'uuid':clip.uuid,'blendMode':clip.blendMode};for(let i=0,n=clipTracks.length;i!==n;++i){tracks.push(KeyframeTrack.toJSON(clipTracks[i]));}return json;}static CreateFromMorphTargetSequence(name,morphTargetSequence,fps,noLoop){const numMorphTargets=morphTargetSequence.length;const tracks=[];for(let i=0;i<numMorphTargets;i++){let times=[];let values=[];times.push((i+numMorphTargets-1)%numMorphTargets,i,(i+1)%numMorphTargets);values.push(0,1,0);const order=getKeyframeOrder(times);times=sortedArray(times,1,order);values=sortedArray(values,1,order);// if there is a key at the first frame, duplicate it as the\n// last frame as well for perfect loop.\nif(!noLoop&&times[0]===0){times.push(numMorphTargets);values.push(values[0]);}tracks.push(new NumberKeyframeTrack('.morphTargetInfluences['+morphTargetSequence[i].name+']',times,values).scale(1.0/fps));}return new this(name,-1,tracks);}static findByName(objectOrClipArray,name){let clipArray=objectOrClipArray;if(!_Array$isArray(objectOrClipArray)){const o=objectOrClipArray;clipArray=o.geometry&&o.geometry.animations||o.animations;}for(let i=0;i<clipArray.length;i++){if(clipArray[i].name===name){return clipArray[i];}}return null;}static CreateClipsFromMorphTargetSequences(morphTargets,fps,noLoop){const animationToMorphTargets={};// tested with https://regex101.com/ on trick sequences\n// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\nconst pattern=/^([\\w-]*?)([\\d]+)$/;// sort morph target names into animation groups based\n// patterns like Walk_001, Walk_002, Run_001, Run_002\nfor(let i=0,il=morphTargets.length;i<il;i++){const morphTarget=morphTargets[i];const parts=morphTarget.name.match(pattern);if(parts&&parts.length>1){const name=parts[1];let animationMorphTargets=animationToMorphTargets[name];if(!animationMorphTargets){animationToMorphTargets[name]=animationMorphTargets=[];}animationMorphTargets.push(morphTarget);}}const clips=[];for(const name in animationToMorphTargets){clips.push(this.CreateFromMorphTargetSequence(name,animationToMorphTargets[name],fps,noLoop));}return clips;}// parse the animation.hierarchy format\nstatic parseAnimation(animation,bones){if(!animation){console.error('THREE.AnimationClip: No animation in JSONLoader data.');return null;}const addNonemptyTrack=function(trackType,trackName,animationKeys,propertyName,destTracks){// only return track if there are actually keys.\nif(animationKeys.length!==0){const times=[];const values=[];flattenJSON(animationKeys,times,values,propertyName);// empty keys are filtered out, so check again\nif(times.length!==0){destTracks.push(new trackType(trackName,times,values));}}};const tracks=[];const clipName=animation.name||'default';const fps=animation.fps||30;const blendMode=animation.blendMode;// automatic length determination in AnimationClip.\nlet duration=animation.length||-1;const hierarchyTracks=animation.hierarchy||[];for(let h=0;h<hierarchyTracks.length;h++){const animationKeys=_keysInstanceProperty(hierarchyTracks[h]);// skip empty tracks\nif(!animationKeys||animationKeys.length===0)continue;// process morph targets\nif(animationKeys[0].morphTargets){// figure out all morph targets used in this track\nconst morphTargetNames={};let k;for(k=0;k<animationKeys.length;k++){if(animationKeys[k].morphTargets){for(let m=0;m<animationKeys[k].morphTargets.length;m++){morphTargetNames[animationKeys[k].morphTargets[m]]=-1;}}}// create a track for each morph target with all zero\n// morphTargetInfluences except for the keys in which\n// the morphTarget is named.\nfor(const morphTargetName in morphTargetNames){const times=[];const values=[];for(let m=0;m!==animationKeys[k].morphTargets.length;++m){const animationKey=animationKeys[k];times.push(animationKey.time);values.push(animationKey.morphTarget===morphTargetName?1:0);}tracks.push(new NumberKeyframeTrack('.morphTargetInfluence['+morphTargetName+']',times,values));}duration=morphTargetNames.length*fps;}else{// ...assume skeletal animation\nconst boneName='.bones['+bones[h].name+']';addNonemptyTrack(VectorKeyframeTrack,boneName+'.position',animationKeys,'pos',tracks);addNonemptyTrack(QuaternionKeyframeTrack,boneName+'.quaternion',animationKeys,'rot',tracks);addNonemptyTrack(VectorKeyframeTrack,boneName+'.scale',animationKeys,'scl',tracks);}}if(tracks.length===0){return null;}const clip=new this(clipName,duration,tracks,blendMode);return clip;}resetDuration(){const tracks=this.tracks;let duration=0;for(let i=0,n=tracks.length;i!==n;++i){const track=this.tracks[i];duration=Math.max(duration,track.times[track.times.length-1]);}this.duration=duration;return this;}trim(){for(let i=0;i<this.tracks.length;i++){var _context28;_trimInstanceProperty(_context28=this.tracks[i]).call(_context28,0,this.duration);}return this;}validate(){let valid=true;for(let i=0;i<this.tracks.length;i++){valid=valid&&this.tracks[i].validate();}return valid;}optimize(){for(let i=0;i<this.tracks.length;i++){this.tracks[i].optimize();}return this;}clone(){const tracks=[];for(let i=0;i<this.tracks.length;i++){tracks.push(this.tracks[i].clone());}return new this.constructor(this.name,this.duration,tracks,this.blendMode);}toJSON(){return this.constructor.toJSON(this);}}function getTrackTypeForValueTypeName(typeName){switch(typeName.toLowerCase()){case'scalar':case'double':case'float':case'number':case'integer':return NumberKeyframeTrack;case'vector':case'vector2':case'vector3':case'vector4':return VectorKeyframeTrack;case'color':return ColorKeyframeTrack;case'quaternion':return QuaternionKeyframeTrack;case'bool':case'boolean':return BooleanKeyframeTrack;case'string':return StringKeyframeTrack;}throw new Error('THREE.KeyframeTrack: Unsupported typeName: '+typeName);}function parseKeyframeTrack(json){if(json.type===undefined){throw new Error('THREE.KeyframeTrack: track type undefined, can not parse');}const trackType=getTrackTypeForValueTypeName(json.type);if(json.times===undefined){const times=[],values=[];flattenJSON(_keysInstanceProperty(json),times,values,'value');json.times=times;json.values=values;}// derived classes can define a static parse method\nif(trackType.parse!==undefined){return trackType.parse(json);}else{// by default, we assume a constructor compatible with the base\nreturn new trackType(json.name,json.times,_valuesInstanceProperty(json),json.interpolation);}}const Cache={enabled:false,files:{},add:function(key,file){if(this.enabled===false)return;// console.log( 'THREE.Cache', 'Adding key:', key );\nthis.files[key]=file;},get:function(key){if(this.enabled===false)return;// console.log( 'THREE.Cache', 'Checking key:', key );\nreturn this.files[key];},remove:function(key){delete this.files[key];},clear:function(){this.files={};}};class LoadingManager{constructor(onLoad,onProgress,onError){const scope=this;let isLoading=false;let itemsLoaded=0;let itemsTotal=0;let urlModifier=undefined;const handlers=[];// Refer to #5689 for the reason why we don't set .onStart\n// in the constructor\nthis.onStart=undefined;this.onLoad=onLoad;this.onProgress=onProgress;this.onError=onError;this.itemStart=function(url){itemsTotal++;if(isLoading===false){if(scope.onStart!==undefined){scope.onStart(url,itemsLoaded,itemsTotal);}}isLoading=true;};this.itemEnd=function(url){itemsLoaded++;if(scope.onProgress!==undefined){scope.onProgress(url,itemsLoaded,itemsTotal);}if(itemsLoaded===itemsTotal){isLoading=false;if(scope.onLoad!==undefined){scope.onLoad();}}};this.itemError=function(url){if(scope.onError!==undefined){scope.onError(url);}};this.resolveURL=function(url){if(urlModifier){return urlModifier(url);}return url;};this.setURLModifier=function(transform){urlModifier=transform;return this;};this.addHandler=function(regex,loader){handlers.push(regex,loader);return this;};this.removeHandler=function(regex){const index=index_of(handlers).call(handlers,regex);if(index!==-1){splice(handlers).call(handlers,index,2);}return this;};this.getHandler=function(file){for(let i=0,l=handlers.length;i<l;i+=2){const regex=handlers[i];const loader=handlers[i+1];if(regex.global)regex.lastIndex=0;// see #17920\nif(regex.test(file)){return loader;}}return null;};}}const DefaultLoadingManager=/*@__PURE__*/new LoadingManager();class Loader{constructor(manager){this.manager=manager!==undefined?manager:DefaultLoadingManager;this.crossOrigin='anonymous';this.withCredentials=false;this.path='';this.resourcePath='';this.requestHeader={};}load(){}loadAsync(url,onProgress){const scope=this;return new _Promise(function(resolve,reject){scope.load(url,resolve,onProgress,reject);});}parse(){}setCrossOrigin(crossOrigin){this.crossOrigin=crossOrigin;return this;}setWithCredentials(value){this.withCredentials=value;return this;}setPath(path){this.path=path;return this;}setResourcePath(resourcePath){this.resourcePath=resourcePath;return this;}setRequestHeader(requestHeader){this.requestHeader=requestHeader;return this;}}const loading={};class HttpError extends Error{constructor(message,response){super(message);this.response=response;}}class FileLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){if(url===undefined)url='';if(this.path!==undefined)url=this.path+url;url=this.manager.resolveURL(url);const cached=Cache.get(url);if(cached!==undefined){this.manager.itemStart(url);_setTimeout(()=>{if(onLoad)onLoad(cached);this.manager.itemEnd(url);},0);return cached;}// Check if request is duplicate\nif(loading[url]!==undefined){loading[url].push({onLoad:onLoad,onProgress:onProgress,onError:onError});return;}// Initialise array for duplicate requests\nloading[url]=[];loading[url].push({onLoad:onLoad,onProgress:onProgress,onError:onError});// create request\nconst req=new Request(url,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?'include':'same-origin'// An abort controller could be added within a future PR\n});// record states ( avoid data race )\nconst mimeType=this.mimeType;const responseType=this.responseType;// start the fetch\nfetch(req).then(response=>{if(response.status===200||response.status===0){// Some browsers return HTTP Status 0 when using non-http protocol\n// e.g. 'file://' or 'data://'. Handle as success.\nif(response.status===0){console.warn('THREE.FileLoader: HTTP Status 0 received.');}// Workaround: Checking if response.body === undefined for Alipay browser #23548\nif(typeof ReadableStream==='undefined'||response.body===undefined||response.body.getReader===undefined){return response;}const callbacks=loading[url];const reader=response.body.getReader();const contentLength=response.headers.get('Content-Length');const total=contentLength?_parseInt(contentLength):0;const lengthComputable=total!==0;let loaded=0;// periodically read data into the new stream tracking while download progress\nconst stream=new ReadableStream({start(controller){readData();function readData(){reader.read().then(({done,value})=>{if(done){controller.close();}else{loaded+=value.byteLength;const event=new ProgressEvent('progress',{lengthComputable,loaded,total});for(let i=0,il=callbacks.length;i<il;i++){const callback=callbacks[i];if(callback.onProgress)callback.onProgress(event);}controller.enqueue(value);readData();}});}}});return new Response(stream);}else{throw new HttpError(`fetch for \"${response.url}\" responded with ${response.status}: ${response.statusText}`,response);}}).then(response=>{switch(responseType){case'arraybuffer':return response.arrayBuffer();case'blob':return response.blob();case'document':return response.text().then(text=>{const parser=new DOMParser();return parser.parseFromString(text,mimeType);});case'json':return response.json();default:if(mimeType===undefined){return response.text();}else{// sniff encoding\nconst re=/charset=\"?([^;\"\\s]*)\"?/i;const exec=re.exec(mimeType);const label=exec&&exec[1]?exec[1].toLowerCase():undefined;const decoder=new TextDecoder(label);return response.arrayBuffer().then(ab=>decoder.decode(ab));}}}).then(data=>{// Add to cache only on HTTP success, so that we do not cache\n// error response bodies as proper responses to requests.\nCache.add(url,data);const callbacks=loading[url];delete loading[url];for(let i=0,il=callbacks.length;i<il;i++){const callback=callbacks[i];if(callback.onLoad)callback.onLoad(data);}}).catch(err=>{// Abort errors and other errors are handled the same\nconst callbacks=loading[url];if(callbacks===undefined){// When onLoad was called and url was deleted in `loading`\nthis.manager.itemError(url);throw err;}delete loading[url];for(let i=0,il=callbacks.length;i<il;i++){const callback=callbacks[i];if(callback.onError)callback.onError(err);}this.manager.itemError(url);}).finally(()=>{this.manager.itemEnd(url);});this.manager.itemStart(url);}setResponseType(value){this.responseType=value;return this;}setMimeType(value){this.mimeType=value;return this;}}class AnimationLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const scope=this;const loader=new FileLoader(this.manager);loader.setPath(this.path);loader.setRequestHeader(this.requestHeader);loader.setWithCredentials(this.withCredentials);loader.load(url,function(text){try{onLoad(scope.parse(JSON.parse(text)));}catch(e){if(onError){onError(e);}else{console.error(e);}scope.manager.itemError(url);}},onProgress,onError);}parse(json){const animations=[];for(let i=0;i<json.length;i++){const clip=AnimationClip.parse(json[i]);animations.push(clip);}return animations;}}/**\n * Abstract Base class to block based textures loader (dds, pvr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */class CompressedTextureLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const scope=this;const images=[];const texture=new CompressedTexture();const loader=new FileLoader(this.manager);loader.setPath(this.path);loader.setResponseType('arraybuffer');loader.setRequestHeader(this.requestHeader);loader.setWithCredentials(scope.withCredentials);let loaded=0;function loadTexture(i){loader.load(url[i],function(buffer){const texDatas=scope.parse(buffer,true);images[i]={width:texDatas.width,height:texDatas.height,format:texDatas.format,mipmaps:texDatas.mipmaps};loaded+=1;if(loaded===6){if(texDatas.mipmapCount===1)texture.minFilter=LinearFilter;texture.image=images;texture.format=texDatas.format;texture.needsUpdate=true;if(onLoad)onLoad(texture);}},onProgress,onError);}if(_Array$isArray(url)){for(let i=0,il=url.length;i<il;++i){loadTexture(i);}}else{// compressed cubemap texture stored in a single DDS file\nloader.load(url,function(buffer){const texDatas=scope.parse(buffer,true);if(texDatas.isCubemap){const faces=texDatas.mipmaps.length/texDatas.mipmapCount;for(let f=0;f<faces;f++){images[f]={mipmaps:[]};for(let i=0;i<texDatas.mipmapCount;i++){images[f].mipmaps.push(texDatas.mipmaps[f*texDatas.mipmapCount+i]);images[f].format=texDatas.format;images[f].width=texDatas.width;images[f].height=texDatas.height;}}texture.image=images;}else{texture.image.width=texDatas.width;texture.image.height=texDatas.height;texture.mipmaps=texDatas.mipmaps;}if(texDatas.mipmapCount===1){texture.minFilter=LinearFilter;}texture.format=texDatas.format;texture.needsUpdate=true;if(onLoad)onLoad(texture);},onProgress,onError);}return texture;}}class ImageLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){if(this.path!==undefined)url=this.path+url;url=this.manager.resolveURL(url);const scope=this;const cached=Cache.get(url);if(cached!==undefined){scope.manager.itemStart(url);_setTimeout(function(){if(onLoad)onLoad(cached);scope.manager.itemEnd(url);},0);return cached;}const image=createElementNS('img');function onImageLoad(){removeEventListeners();Cache.add(url,this);if(onLoad)onLoad(this);scope.manager.itemEnd(url);}function onImageError(event){removeEventListeners();if(onError)onError(event);scope.manager.itemError(url);scope.manager.itemEnd(url);}function removeEventListeners(){image.removeEventListener('load',onImageLoad,false);image.removeEventListener('error',onImageError,false);}image.addEventListener('load',onImageLoad,false);image.addEventListener('error',onImageError,false);if(_sliceInstanceProperty(url).call(url,0,5)!=='data:'){if(this.crossOrigin!==undefined)image.crossOrigin=this.crossOrigin;}scope.manager.itemStart(url);image.src=url;return image;}}class CubeTextureLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(urls,onLoad,onProgress,onError){const texture=new CubeTexture();const loader=new ImageLoader(this.manager);loader.setCrossOrigin(this.crossOrigin);loader.setPath(this.path);let loaded=0;function loadTexture(i){loader.load(urls[i],function(image){texture.images[i]=image;loaded++;if(loaded===6){texture.needsUpdate=true;if(onLoad)onLoad(texture);}},undefined,onError);}for(let i=0;i<urls.length;++i){loadTexture(i);}return texture;}}/**\n * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */class DataTextureLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const scope=this;const texture=new DataTexture();const loader=new FileLoader(this.manager);loader.setResponseType('arraybuffer');loader.setRequestHeader(this.requestHeader);loader.setPath(this.path);loader.setWithCredentials(scope.withCredentials);loader.load(url,function(buffer){const texData=scope.parse(buffer);if(!texData)return;if(texData.image!==undefined){texture.image=texData.image;}else if(texData.data!==undefined){texture.image.width=texData.width;texture.image.height=texData.height;texture.image.data=texData.data;}texture.wrapS=texData.wrapS!==undefined?texData.wrapS:ClampToEdgeWrapping;texture.wrapT=texData.wrapT!==undefined?texData.wrapT:ClampToEdgeWrapping;texture.magFilter=texData.magFilter!==undefined?texData.magFilter:LinearFilter;texture.minFilter=texData.minFilter!==undefined?texData.minFilter:LinearFilter;texture.anisotropy=texData.anisotropy!==undefined?texData.anisotropy:1;if(texData.encoding!==undefined){texture.encoding=texData.encoding;}if(texData.flipY!==undefined){texture.flipY=texData.flipY;}if(texData.format!==undefined){texture.format=texData.format;}if(texData.type!==undefined){texture.type=texData.type;}if(texData.mipmaps!==undefined){texture.mipmaps=texData.mipmaps;texture.minFilter=LinearMipmapLinearFilter;// presumably...\n}if(texData.mipmapCount===1){texture.minFilter=LinearFilter;}if(texData.generateMipmaps!==undefined){texture.generateMipmaps=texData.generateMipmaps;}texture.needsUpdate=true;if(onLoad)onLoad(texture,texData);},onProgress,onError);return texture;}}class TextureLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const texture=new Texture();const loader=new ImageLoader(this.manager);loader.setCrossOrigin(this.crossOrigin);loader.setPath(this.path);loader.load(url,function(image){texture.image=image;texture.needsUpdate=true;if(onLoad!==undefined){onLoad(texture);}},onProgress,onError);return texture;}}class Light extends (/* unused pure expression or super */ null && (Object3D)){constructor(color,intensity=1){super();this.isLight=true;this.type='Light';this.color=new Color(color);this.intensity=intensity;}dispose(){// Empty here in base class; some subclasses override.\n}copy(source,recursive){super.copy(source,recursive);this.color.copy(source.color);this.intensity=source.intensity;return this;}toJSON(meta){const data=super.toJSON(meta);data.object.color=this.color.getHex();data.object.intensity=this.intensity;if(this.groundColor!==undefined)data.object.groundColor=this.groundColor.getHex();if(this.distance!==undefined)data.object.distance=this.distance;if(this.angle!==undefined)data.object.angle=this.angle;if(this.decay!==undefined)data.object.decay=this.decay;if(this.penumbra!==undefined)data.object.penumbra=this.penumbra;if(this.shadow!==undefined)data.object.shadow=this.shadow.toJSON();return data;}}class HemisphereLight extends (/* unused pure expression or super */ null && (Light)){constructor(skyColor,groundColor,intensity){super(skyColor,intensity);this.isHemisphereLight=true;this.type='HemisphereLight';this.position.copy(Object3D.DefaultUp);this.updateMatrix();this.groundColor=new Color(groundColor);}copy(source,recursive){super.copy(source,recursive);this.groundColor.copy(source.groundColor);return this;}}const _projScreenMatrix$1=/*@__PURE__*/new Matrix4();const _lightPositionWorld$1=/*@__PURE__*/new three_module_Vector3();const _lookTarget$1=/*@__PURE__*/new three_module_Vector3();class LightShadow{constructor(camera){this.camera=camera;this.bias=0;this.normalBias=0;this.radius=1;this.blurSamples=8;this.mapSize=new Vector2(512,512);this.map=null;this.mapPass=null;this.matrix=new Matrix4();this.autoUpdate=true;this.needsUpdate=false;this._frustum=new Frustum();this._frameExtents=new Vector2(1,1);this._viewportCount=1;this._viewports=[new Vector4(0,0,1,1)];}getViewportCount(){return this._viewportCount;}getFrustum(){return this._frustum;}updateMatrices(light){const shadowCamera=this.camera;const shadowMatrix=this.matrix;_lightPositionWorld$1.setFromMatrixPosition(light.matrixWorld);shadowCamera.position.copy(_lightPositionWorld$1);_lookTarget$1.setFromMatrixPosition(light.target.matrixWorld);shadowCamera.lookAt(_lookTarget$1);shadowCamera.updateMatrixWorld();_projScreenMatrix$1.multiplyMatrices(shadowCamera.projectionMatrix,shadowCamera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(_projScreenMatrix$1);shadowMatrix.set(0.5,0.0,0.0,0.5,0.0,0.5,0.0,0.5,0.0,0.0,0.5,0.5,0.0,0.0,0.0,1.0);shadowMatrix.multiply(_projScreenMatrix$1);}getViewport(viewportIndex){return this._viewports[viewportIndex];}getFrameExtents(){return this._frameExtents;}dispose(){if(_mapInstanceProperty(this)){_mapInstanceProperty(this).dispose();}if(this.mapPass){this.mapPass.dispose();}}copy(source){this.camera=source.camera.clone();this.bias=source.bias;this.radius=source.radius;this.mapSize.copy(source.mapSize);return this;}clone(){return new this.constructor().copy(this);}toJSON(){const object={};if(this.bias!==0)object.bias=this.bias;if(this.normalBias!==0)object.normalBias=this.normalBias;if(this.radius!==1)object.radius=this.radius;if(this.mapSize.x!==512||this.mapSize.y!==512)object.mapSize=this.mapSize.toArray();object.camera=this.camera.toJSON(false).object;delete object.camera.matrix;return object;}}class SpotLightShadow extends (/* unused pure expression or super */ null && (LightShadow)){constructor(){super(new PerspectiveCamera(50,1,0.5,500));this.isSpotLightShadow=true;this.focus=1;}updateMatrices(light){const camera=this.camera;const fov=three_module_RAD2DEG*2*light.angle*this.focus;const aspect=this.mapSize.width/this.mapSize.height;const far=light.distance||camera.far;if(fov!==camera.fov||aspect!==camera.aspect||far!==camera.far){camera.fov=fov;camera.aspect=aspect;camera.far=far;camera.updateProjectionMatrix();}super.updateMatrices(light);}copy(source){super.copy(source);this.focus=source.focus;return this;}}class SpotLight extends (/* unused pure expression or super */ null && (Light)){constructor(color,intensity,distance=0,angle=Math.PI/3,penumbra=0,decay=1){super(color,intensity);this.isSpotLight=true;this.type='SpotLight';this.position.copy(Object3D.DefaultUp);this.updateMatrix();this.target=new Object3D();this.distance=distance;this.angle=angle;this.penumbra=penumbra;this.decay=decay;// for physically correct lights, should be 2.\nthis.map=null;this.shadow=new SpotLightShadow();}get power(){// compute the light's luminous power (in lumens) from its intensity (in candela)\n// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\nreturn this.intensity*Math.PI;}set power(power){// set the light's intensity (in candela) from the desired luminous power (in lumens)\nthis.intensity=power/Math.PI;}dispose(){this.shadow.dispose();}copy(source,recursive){super.copy(source,recursive);this.distance=source.distance;this.angle=source.angle;this.penumbra=source.penumbra;this.decay=source.decay;this.target=source.target.clone();this.shadow=source.shadow.clone();return this;}}const _projScreenMatrix=/*@__PURE__*/new Matrix4();const _lightPositionWorld=/*@__PURE__*/new three_module_Vector3();const _lookTarget=/*@__PURE__*/new three_module_Vector3();class PointLightShadow extends (/* unused pure expression or super */ null && (LightShadow)){constructor(){super(new PerspectiveCamera(90,1,0.5,500));this.isPointLightShadow=true;this._frameExtents=new Vector2(4,2);this._viewportCount=6;this._viewports=[// These viewports map a cube-map onto a 2D texture with the\n// following orientation:\n//\n// xzXZ\n// y Y\n//\n// X - Positive x direction\n// x - Negative x direction\n// Y - Positive y direction\n// y - Negative y direction\n// Z - Positive z direction\n// z - Negative z direction\n// positive X\nnew Vector4(2,1,1,1),// negative X\nnew Vector4(0,1,1,1),// positive Z\nnew Vector4(3,1,1,1),// negative Z\nnew Vector4(1,1,1,1),// positive Y\nnew Vector4(3,0,1,1),// negative Y\nnew Vector4(1,0,1,1)];this._cubeDirections=[new three_module_Vector3(1,0,0),new three_module_Vector3(-1,0,0),new three_module_Vector3(0,0,1),new three_module_Vector3(0,0,-1),new three_module_Vector3(0,1,0),new three_module_Vector3(0,-1,0)];this._cubeUps=[new three_module_Vector3(0,1,0),new three_module_Vector3(0,1,0),new three_module_Vector3(0,1,0),new three_module_Vector3(0,1,0),new three_module_Vector3(0,0,1),new three_module_Vector3(0,0,-1)];}updateMatrices(light,viewportIndex=0){const camera=this.camera;const shadowMatrix=this.matrix;const far=light.distance||camera.far;if(far!==camera.far){camera.far=far;camera.updateProjectionMatrix();}_lightPositionWorld.setFromMatrixPosition(light.matrixWorld);camera.position.copy(_lightPositionWorld);_lookTarget.copy(camera.position);_lookTarget.add(this._cubeDirections[viewportIndex]);camera.up.copy(this._cubeUps[viewportIndex]);camera.lookAt(_lookTarget);camera.updateMatrixWorld();shadowMatrix.makeTranslation(-_lightPositionWorld.x,-_lightPositionWorld.y,-_lightPositionWorld.z);_projScreenMatrix.multiplyMatrices(camera.projectionMatrix,camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(_projScreenMatrix);}}class PointLight extends (/* unused pure expression or super */ null && (Light)){constructor(color,intensity,distance=0,decay=1){super(color,intensity);this.isPointLight=true;this.type='PointLight';this.distance=distance;this.decay=decay;// for physically correct lights, should be 2.\nthis.shadow=new PointLightShadow();}get power(){// compute the light's luminous power (in lumens) from its intensity (in candela)\n// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\nreturn this.intensity*4*Math.PI;}set power(power){// set the light's intensity (in candela) from the desired luminous power (in lumens)\nthis.intensity=power/(4*Math.PI);}dispose(){this.shadow.dispose();}copy(source,recursive){super.copy(source,recursive);this.distance=source.distance;this.decay=source.decay;this.shadow=source.shadow.clone();return this;}}class DirectionalLightShadow extends (/* unused pure expression or super */ null && (LightShadow)){constructor(){super(new OrthographicCamera(-5,5,5,-5,0.5,500));this.isDirectionalLightShadow=true;}}class DirectionalLight extends (/* unused pure expression or super */ null && (Light)){constructor(color,intensity){super(color,intensity);this.isDirectionalLight=true;this.type='DirectionalLight';this.position.copy(Object3D.DefaultUp);this.updateMatrix();this.target=new Object3D();this.shadow=new DirectionalLightShadow();}dispose(){this.shadow.dispose();}copy(source){super.copy(source);this.target=source.target.clone();this.shadow=source.shadow.clone();return this;}}class AmbientLight extends (/* unused pure expression or super */ null && (Light)){constructor(color,intensity){super(color,intensity);this.isAmbientLight=true;this.type='AmbientLight';}}class RectAreaLight extends (/* unused pure expression or super */ null && (Light)){constructor(color,intensity,width=10,height=10){super(color,intensity);this.isRectAreaLight=true;this.type='RectAreaLight';this.width=width;this.height=height;}get power(){// compute the light's luminous power (in lumens) from its intensity (in nits)\nreturn this.intensity*this.width*this.height*Math.PI;}set power(power){// set the light's intensity (in nits) from the desired luminous power (in lumens)\nthis.intensity=power/(this.width*this.height*Math.PI);}copy(source){super.copy(source);this.width=source.width;this.height=source.height;return this;}toJSON(meta){const data=super.toJSON(meta);data.object.width=this.width;data.object.height=this.height;return data;}}/**\n * Primary reference:\n * https://graphics.stanford.edu/papers/envmap/envmap.pdf\n *\n * Secondary reference:\n * https://www.ppsloan.org/publications/StupidSH36.pdf\n */ // 3-band SH defined by 9 coefficients\nclass SphericalHarmonics3{constructor(){this.isSphericalHarmonics3=true;this.coefficients=[];for(let i=0;i<9;i++){this.coefficients.push(new three_module_Vector3());}}set(coefficients){for(let i=0;i<9;i++){this.coefficients[i].copy(coefficients[i]);}return this;}zero(){for(let i=0;i<9;i++){this.coefficients[i].set(0,0,0);}return this;}// get the radiance in the direction of the normal\n// target is a Vector3\ngetAt(normal,target){// normal is assumed to be unit length\nconst x=normal.x,y=normal.y,z=normal.z;const coeff=this.coefficients;// band 0\ntarget.copy(coeff[0]).multiplyScalar(0.282095);// band 1\ntarget.addScaledVector(coeff[1],0.488603*y);target.addScaledVector(coeff[2],0.488603*z);target.addScaledVector(coeff[3],0.488603*x);// band 2\ntarget.addScaledVector(coeff[4],1.092548*(x*y));target.addScaledVector(coeff[5],1.092548*(y*z));target.addScaledVector(coeff[6],0.315392*(3.0*z*z-1.0));target.addScaledVector(coeff[7],1.092548*(x*z));target.addScaledVector(coeff[8],0.546274*(x*x-y*y));return target;}// get the irradiance (radiance convolved with cosine lobe) in the direction of the normal\n// target is a Vector3\n// https://graphics.stanford.edu/papers/envmap/envmap.pdf\ngetIrradianceAt(normal,target){// normal is assumed to be unit length\nconst x=normal.x,y=normal.y,z=normal.z;const coeff=this.coefficients;// band 0\ntarget.copy(coeff[0]).multiplyScalar(0.886227);// π * 0.282095\n// band 1\ntarget.addScaledVector(coeff[1],2.0*0.511664*y);// ( 2 * π / 3 ) * 0.488603\ntarget.addScaledVector(coeff[2],2.0*0.511664*z);target.addScaledVector(coeff[3],2.0*0.511664*x);// band 2\ntarget.addScaledVector(coeff[4],2.0*0.429043*x*y);// ( π / 4 ) * 1.092548\ntarget.addScaledVector(coeff[5],2.0*0.429043*y*z);target.addScaledVector(coeff[6],0.743125*z*z-0.247708);// ( π / 4 ) * 0.315392 * 3\ntarget.addScaledVector(coeff[7],2.0*0.429043*x*z);target.addScaledVector(coeff[8],0.429043*(x*x-y*y));// ( π / 4 ) * 0.546274\nreturn target;}add(sh){for(let i=0;i<9;i++){this.coefficients[i].add(sh.coefficients[i]);}return this;}addScaledSH(sh,s){for(let i=0;i<9;i++){this.coefficients[i].addScaledVector(sh.coefficients[i],s);}return this;}scale(s){for(let i=0;i<9;i++){this.coefficients[i].multiplyScalar(s);}return this;}lerp(sh,alpha){for(let i=0;i<9;i++){this.coefficients[i].lerp(sh.coefficients[i],alpha);}return this;}equals(sh){for(let i=0;i<9;i++){if(!this.coefficients[i].equals(sh.coefficients[i])){return false;}}return true;}copy(sh){return this.set(sh.coefficients);}clone(){return new this.constructor().copy(this);}fromArray(array,offset=0){const coefficients=this.coefficients;for(let i=0;i<9;i++){coefficients[i].fromArray(array,offset+i*3);}return this;}toArray(array=[],offset=0){const coefficients=this.coefficients;for(let i=0;i<9;i++){coefficients[i].toArray(array,offset+i*3);}return array;}// evaluate the basis functions\n// shBasis is an Array[ 9 ]\nstatic getBasisAt(normal,shBasis){// normal is assumed to be unit length\nconst x=normal.x,y=normal.y,z=normal.z;// band 0\nshBasis[0]=0.282095;// band 1\nshBasis[1]=0.488603*y;shBasis[2]=0.488603*z;shBasis[3]=0.488603*x;// band 2\nshBasis[4]=1.092548*x*y;shBasis[5]=1.092548*y*z;shBasis[6]=0.315392*(3*z*z-1);shBasis[7]=1.092548*x*z;shBasis[8]=0.546274*(x*x-y*y);}}class LightProbe extends (/* unused pure expression or super */ null && (Light)){constructor(sh=new SphericalHarmonics3(),intensity=1){super(undefined,intensity);this.isLightProbe=true;this.sh=sh;}copy(source){super.copy(source);this.sh.copy(source.sh);return this;}fromJSON(json){this.intensity=json.intensity;// TODO: Move this bit to Light.fromJSON();\nthis.sh.fromArray(json.sh);return this;}toJSON(meta){const data=super.toJSON(meta);data.object.sh=this.sh.toArray();return data;}}class MaterialLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);this.textures={};}load(url,onLoad,onProgress,onError){const scope=this;const loader=new FileLoader(scope.manager);loader.setPath(scope.path);loader.setRequestHeader(scope.requestHeader);loader.setWithCredentials(scope.withCredentials);loader.load(url,function(text){try{onLoad(scope.parse(JSON.parse(text)));}catch(e){if(onError){onError(e);}else{console.error(e);}scope.manager.itemError(url);}},onProgress,onError);}parse(json){const textures=this.textures;function getTexture(name){if(textures[name]===undefined){console.warn('THREE.MaterialLoader: Undefined texture',name);}return textures[name];}const material=MaterialLoader.createMaterialFromType(json.type);if(json.uuid!==undefined)material.uuid=json.uuid;if(json.name!==undefined)material.name=json.name;if(json.color!==undefined&&material.color!==undefined)material.color.setHex(json.color);if(json.roughness!==undefined)material.roughness=json.roughness;if(json.metalness!==undefined)material.metalness=json.metalness;if(json.sheen!==undefined)material.sheen=json.sheen;if(json.sheenColor!==undefined)material.sheenColor=new Color().setHex(json.sheenColor);if(json.sheenRoughness!==undefined)material.sheenRoughness=json.sheenRoughness;if(json.emissive!==undefined&&material.emissive!==undefined)material.emissive.setHex(json.emissive);if(json.specular!==undefined&&material.specular!==undefined)material.specular.setHex(json.specular);if(json.specularIntensity!==undefined)material.specularIntensity=json.specularIntensity;if(json.specularColor!==undefined&&material.specularColor!==undefined)material.specularColor.setHex(json.specularColor);if(json.shininess!==undefined)material.shininess=json.shininess;if(json.clearcoat!==undefined)material.clearcoat=json.clearcoat;if(json.clearcoatRoughness!==undefined)material.clearcoatRoughness=json.clearcoatRoughness;if(json.iridescence!==undefined)material.iridescence=json.iridescence;if(json.iridescenceIOR!==undefined)material.iridescenceIOR=json.iridescenceIOR;if(json.iridescenceThicknessRange!==undefined)material.iridescenceThicknessRange=json.iridescenceThicknessRange;if(json.transmission!==undefined)material.transmission=json.transmission;if(json.thickness!==undefined)material.thickness=json.thickness;if(json.attenuationDistance!==undefined)material.attenuationDistance=json.attenuationDistance;if(json.attenuationColor!==undefined&&material.attenuationColor!==undefined)material.attenuationColor.setHex(json.attenuationColor);if(json.fog!==undefined)material.fog=json.fog;if(json.flatShading!==undefined)material.flatShading=json.flatShading;if(json.blending!==undefined)material.blending=json.blending;if(json.combine!==undefined)material.combine=json.combine;if(json.side!==undefined)material.side=json.side;if(json.shadowSide!==undefined)material.shadowSide=json.shadowSide;if(json.opacity!==undefined)material.opacity=json.opacity;if(json.transparent!==undefined)material.transparent=json.transparent;if(json.alphaTest!==undefined)material.alphaTest=json.alphaTest;if(json.depthTest!==undefined)material.depthTest=json.depthTest;if(json.depthWrite!==undefined)material.depthWrite=json.depthWrite;if(json.colorWrite!==undefined)material.colorWrite=json.colorWrite;if(json.stencilWrite!==undefined)material.stencilWrite=json.stencilWrite;if(json.stencilWriteMask!==undefined)material.stencilWriteMask=json.stencilWriteMask;if(json.stencilFunc!==undefined)material.stencilFunc=json.stencilFunc;if(json.stencilRef!==undefined)material.stencilRef=json.stencilRef;if(json.stencilFuncMask!==undefined)material.stencilFuncMask=json.stencilFuncMask;if(json.stencilFail!==undefined)material.stencilFail=json.stencilFail;if(json.stencilZFail!==undefined)material.stencilZFail=json.stencilZFail;if(json.stencilZPass!==undefined)material.stencilZPass=json.stencilZPass;if(json.wireframe!==undefined)material.wireframe=json.wireframe;if(json.wireframeLinewidth!==undefined)material.wireframeLinewidth=json.wireframeLinewidth;if(json.wireframeLinecap!==undefined)material.wireframeLinecap=json.wireframeLinecap;if(json.wireframeLinejoin!==undefined)material.wireframeLinejoin=json.wireframeLinejoin;if(json.rotation!==undefined)material.rotation=json.rotation;if(json.linewidth!==1)material.linewidth=json.linewidth;if(json.dashSize!==undefined)material.dashSize=json.dashSize;if(json.gapSize!==undefined)material.gapSize=json.gapSize;if(json.scale!==undefined)material.scale=json.scale;if(json.polygonOffset!==undefined)material.polygonOffset=json.polygonOffset;if(json.polygonOffsetFactor!==undefined)material.polygonOffsetFactor=json.polygonOffsetFactor;if(json.polygonOffsetUnits!==undefined)material.polygonOffsetUnits=json.polygonOffsetUnits;if(json.dithering!==undefined)material.dithering=json.dithering;if(json.alphaToCoverage!==undefined)material.alphaToCoverage=json.alphaToCoverage;if(json.premultipliedAlpha!==undefined)material.premultipliedAlpha=json.premultipliedAlpha;if(json.visible!==undefined)material.visible=json.visible;if(json.toneMapped!==undefined)material.toneMapped=json.toneMapped;if(json.userData!==undefined)material.userData=json.userData;if(json.vertexColors!==undefined){if(typeof json.vertexColors==='number'){material.vertexColors=json.vertexColors>0?true:false;}else{material.vertexColors=json.vertexColors;}}// Shader Material\nif(json.uniforms!==undefined){for(const name in json.uniforms){const uniform=json.uniforms[name];material.uniforms[name]={};switch(uniform.type){case't':material.uniforms[name].value=getTexture(uniform.value);break;case'c':material.uniforms[name].value=new Color().setHex(uniform.value);break;case'v2':material.uniforms[name].value=new Vector2().fromArray(uniform.value);break;case'v3':material.uniforms[name].value=new three_module_Vector3().fromArray(uniform.value);break;case'v4':material.uniforms[name].value=new Vector4().fromArray(uniform.value);break;case'm3':material.uniforms[name].value=new Matrix3().fromArray(uniform.value);break;case'm4':material.uniforms[name].value=new Matrix4().fromArray(uniform.value);break;default:material.uniforms[name].value=uniform.value;}}}if(json.defines!==undefined)material.defines=json.defines;if(json.vertexShader!==undefined)material.vertexShader=json.vertexShader;if(json.fragmentShader!==undefined)material.fragmentShader=json.fragmentShader;if(json.glslVersion!==undefined)material.glslVersion=json.glslVersion;if(json.extensions!==undefined){for(const key in json.extensions){material.extensions[key]=json.extensions[key];}}// for PointsMaterial\nif(json.size!==undefined)material.size=json.size;if(json.sizeAttenuation!==undefined)material.sizeAttenuation=json.sizeAttenuation;// maps\nif(_mapInstanceProperty(json)!==undefined)material.map=getTexture(_mapInstanceProperty(json));if(json.matcap!==undefined)material.matcap=getTexture(json.matcap);if(json.alphaMap!==undefined)material.alphaMap=getTexture(json.alphaMap);if(json.bumpMap!==undefined)material.bumpMap=getTexture(json.bumpMap);if(json.bumpScale!==undefined)material.bumpScale=json.bumpScale;if(json.normalMap!==undefined)material.normalMap=getTexture(json.normalMap);if(json.normalMapType!==undefined)material.normalMapType=json.normalMapType;if(json.normalScale!==undefined){let normalScale=json.normalScale;if(_Array$isArray(normalScale)===false){// Blender exporter used to export a scalar. See #7459\nnormalScale=[normalScale,normalScale];}material.normalScale=new Vector2().fromArray(normalScale);}if(json.displacementMap!==undefined)material.displacementMap=getTexture(json.displacementMap);if(json.displacementScale!==undefined)material.displacementScale=json.displacementScale;if(json.displacementBias!==undefined)material.displacementBias=json.displacementBias;if(json.roughnessMap!==undefined)material.roughnessMap=getTexture(json.roughnessMap);if(json.metalnessMap!==undefined)material.metalnessMap=getTexture(json.metalnessMap);if(json.emissiveMap!==undefined)material.emissiveMap=getTexture(json.emissiveMap);if(json.emissiveIntensity!==undefined)material.emissiveIntensity=json.emissiveIntensity;if(json.specularMap!==undefined)material.specularMap=getTexture(json.specularMap);if(json.specularIntensityMap!==undefined)material.specularIntensityMap=getTexture(json.specularIntensityMap);if(json.specularColorMap!==undefined)material.specularColorMap=getTexture(json.specularColorMap);if(json.envMap!==undefined)material.envMap=getTexture(json.envMap);if(json.envMapIntensity!==undefined)material.envMapIntensity=json.envMapIntensity;if(json.reflectivity!==undefined)material.reflectivity=json.reflectivity;if(json.refractionRatio!==undefined)material.refractionRatio=json.refractionRatio;if(json.lightMap!==undefined)material.lightMap=getTexture(json.lightMap);if(json.lightMapIntensity!==undefined)material.lightMapIntensity=json.lightMapIntensity;if(json.aoMap!==undefined)material.aoMap=getTexture(json.aoMap);if(json.aoMapIntensity!==undefined)material.aoMapIntensity=json.aoMapIntensity;if(json.gradientMap!==undefined)material.gradientMap=getTexture(json.gradientMap);if(json.clearcoatMap!==undefined)material.clearcoatMap=getTexture(json.clearcoatMap);if(json.clearcoatRoughnessMap!==undefined)material.clearcoatRoughnessMap=getTexture(json.clearcoatRoughnessMap);if(json.clearcoatNormalMap!==undefined)material.clearcoatNormalMap=getTexture(json.clearcoatNormalMap);if(json.clearcoatNormalScale!==undefined)material.clearcoatNormalScale=new Vector2().fromArray(json.clearcoatNormalScale);if(json.iridescenceMap!==undefined)material.iridescenceMap=getTexture(json.iridescenceMap);if(json.iridescenceThicknessMap!==undefined)material.iridescenceThicknessMap=getTexture(json.iridescenceThicknessMap);if(json.transmissionMap!==undefined)material.transmissionMap=getTexture(json.transmissionMap);if(json.thicknessMap!==undefined)material.thicknessMap=getTexture(json.thicknessMap);if(json.sheenColorMap!==undefined)material.sheenColorMap=getTexture(json.sheenColorMap);if(json.sheenRoughnessMap!==undefined)material.sheenRoughnessMap=getTexture(json.sheenRoughnessMap);return material;}setTextures(value){this.textures=value;return this;}static createMaterialFromType(type){const materialLib={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new materialLib[type]();}}class LoaderUtils{static decodeText(array){if(typeof TextDecoder!=='undefined'){return new TextDecoder().decode(array);}// Avoid the String.fromCharCode.apply(null, array) shortcut, which\n// throws a \"maximum call stack size exceeded\" error for large arrays.\nlet s='';for(let i=0,il=array.length;i<il;i++){// Implicitly assumes little-endian.\ns+=String.fromCharCode(array[i]);}try{// merges multi-byte utf-8 characters.\nreturn decodeURIComponent(escape(s));}catch(e){// see #16358\nreturn s;}}static extractUrlBase(url){const index=_lastIndexOfInstanceProperty(url).call(url,'/');if(index===-1)return'./';return _sliceInstanceProperty(url).call(url,0,index+1);}static resolveURL(url,path){// Invalid URL\nif(typeof url!=='string'||url==='')return'';// Host Relative URL\nif(/^https?:\\/\\//i.test(path)&&/^\\//.test(url)){path=path.replace(/(^https?:\\/\\/[^\\/]+).*/i,'$1');}// Absolute URL http://,https://,//\nif(/^(https?:)?\\/\\//i.test(url))return url;// Data URI\nif(/^data:.*,.*$/i.test(url))return url;// Blob URL\nif(/^blob:.*$/i.test(url))return url;// Relative URL\nreturn path+url;}}class InstancedBufferGeometry extends (/* unused pure expression or super */ null && (BufferGeometry)){constructor(){super();this.isInstancedBufferGeometry=true;this.type='InstancedBufferGeometry';this.instanceCount=Infinity;}copy(source){super.copy(source);this.instanceCount=source.instanceCount;return this;}clone(){return new this.constructor().copy(this);}toJSON(){const data=super.toJSON(this);data.instanceCount=this.instanceCount;data.isInstancedBufferGeometry=true;return data;}}class BufferGeometryLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const scope=this;const loader=new FileLoader(scope.manager);loader.setPath(scope.path);loader.setRequestHeader(scope.requestHeader);loader.setWithCredentials(scope.withCredentials);loader.load(url,function(text){try{onLoad(scope.parse(JSON.parse(text)));}catch(e){if(onError){onError(e);}else{console.error(e);}scope.manager.itemError(url);}},onProgress,onError);}parse(json){const interleavedBufferMap={};const arrayBufferMap={};function getInterleavedBuffer(json,uuid){if(interleavedBufferMap[uuid]!==undefined)return interleavedBufferMap[uuid];const interleavedBuffers=json.interleavedBuffers;const interleavedBuffer=interleavedBuffers[uuid];const buffer=getArrayBuffer(json,interleavedBuffer.buffer);const array=getTypedArray(interleavedBuffer.type,buffer);const ib=new InterleavedBuffer(array,interleavedBuffer.stride);ib.uuid=interleavedBuffer.uuid;interleavedBufferMap[uuid]=ib;return ib;}function getArrayBuffer(json,uuid){if(arrayBufferMap[uuid]!==undefined)return arrayBufferMap[uuid];const arrayBuffers=json.arrayBuffers;const arrayBuffer=arrayBuffers[uuid];const ab=new Uint32Array(arrayBuffer).buffer;arrayBufferMap[uuid]=ab;return ab;}const geometry=json.isInstancedBufferGeometry?new InstancedBufferGeometry():new BufferGeometry();const index=json.data.index;if(index!==undefined){const typedArray=getTypedArray(index.type,index.array);geometry.setIndex(new BufferAttribute(typedArray,1));}const attributes=json.data.attributes;for(const key in attributes){const attribute=attributes[key];let bufferAttribute;if(attribute.isInterleavedBufferAttribute){const interleavedBuffer=getInterleavedBuffer(json.data,attribute.data);bufferAttribute=new InterleavedBufferAttribute(interleavedBuffer,attribute.itemSize,attribute.offset,attribute.normalized);}else{const typedArray=getTypedArray(attribute.type,attribute.array);const bufferAttributeConstr=attribute.isInstancedBufferAttribute?InstancedBufferAttribute:BufferAttribute;bufferAttribute=new bufferAttributeConstr(typedArray,attribute.itemSize,attribute.normalized);}if(attribute.name!==undefined)bufferAttribute.name=attribute.name;if(attribute.usage!==undefined)bufferAttribute.setUsage(attribute.usage);if(attribute.updateRange!==undefined){bufferAttribute.updateRange.offset=attribute.updateRange.offset;bufferAttribute.updateRange.count=attribute.updateRange.count;}geometry.setAttribute(key,bufferAttribute);}const morphAttributes=json.data.morphAttributes;if(morphAttributes){for(const key in morphAttributes){const attributeArray=morphAttributes[key];const array=[];for(let i=0,il=attributeArray.length;i<il;i++){const attribute=attributeArray[i];let bufferAttribute;if(attribute.isInterleavedBufferAttribute){const interleavedBuffer=getInterleavedBuffer(json.data,attribute.data);bufferAttribute=new InterleavedBufferAttribute(interleavedBuffer,attribute.itemSize,attribute.offset,attribute.normalized);}else{const typedArray=getTypedArray(attribute.type,attribute.array);bufferAttribute=new BufferAttribute(typedArray,attribute.itemSize,attribute.normalized);}if(attribute.name!==undefined)bufferAttribute.name=attribute.name;array.push(bufferAttribute);}geometry.morphAttributes[key]=array;}}const morphTargetsRelative=json.data.morphTargetsRelative;if(morphTargetsRelative){geometry.morphTargetsRelative=true;}const groups=json.data.groups||json.data.drawcalls||json.data.offsets;if(groups!==undefined){for(let i=0,n=groups.length;i!==n;++i){const group=groups[i];geometry.addGroup(group.start,group.count,group.materialIndex);}}const boundingSphere=json.data.boundingSphere;if(boundingSphere!==undefined){const center=new three_module_Vector3();if(boundingSphere.center!==undefined){center.fromArray(boundingSphere.center);}geometry.boundingSphere=new Sphere(center,boundingSphere.radius);}if(json.name)geometry.name=json.name;if(json.userData)geometry.userData=json.userData;return geometry;}}class ObjectLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const scope=this;const path=this.path===''?LoaderUtils.extractUrlBase(url):this.path;this.resourcePath=this.resourcePath||path;const loader=new FileLoader(this.manager);loader.setPath(this.path);loader.setRequestHeader(this.requestHeader);loader.setWithCredentials(this.withCredentials);loader.load(url,function(text){let json=null;try{json=JSON.parse(text);}catch(error){if(onError!==undefined)onError(error);console.error('THREE:ObjectLoader: Can\\'t parse '+url+'.',error.message);return;}const metadata=json.metadata;if(metadata===undefined||metadata.type===undefined||metadata.type.toLowerCase()==='geometry'){console.error('THREE.ObjectLoader: Can\\'t load '+url);return;}scope.parse(json,onLoad);},onProgress,onError);}loadAsync(url,onProgress){try{const _this3=this;const scope=_this3;const path=_this3.path===''?LoaderUtils.extractUrlBase(url):_this3.path;_this3.resourcePath=_this3.resourcePath||path;const loader=new FileLoader(_this3.manager);loader.setPath(_this3.path);loader.setRequestHeader(_this3.requestHeader);loader.setWithCredentials(_this3.withCredentials);return _Promise.resolve(loader.loadAsync(url,onProgress)).then(function(text){const json=JSON.parse(text);const metadata=json.metadata;if(metadata===undefined||metadata.type===undefined||metadata.type.toLowerCase()==='geometry'){throw new Error('THREE.ObjectLoader: Can\\'t load '+url);}return _Promise.resolve(scope.parseAsync(json));});}catch(e){return _Promise.reject(e);}}parse(json,onLoad){const animations=this.parseAnimations(json.animations);const shapes=this.parseShapes(json.shapes);const geometries=this.parseGeometries(json.geometries,shapes);const images=this.parseImages(json.images,function(){if(onLoad!==undefined)onLoad(object);});const textures=this.parseTextures(json.textures,images);const materials=this.parseMaterials(json.materials,textures);const object=this.parseObject(json.object,geometries,materials,textures,animations);const skeletons=this.parseSkeletons(json.skeletons,object);this.bindSkeletons(object,skeletons);//\nif(onLoad!==undefined){let hasImages=false;for(const uuid in images){if(images[uuid].data instanceof HTMLImageElement){hasImages=true;break;}}if(hasImages===false)onLoad(object);}return object;}parseAsync(json){try{const _this4=this;const animations=_this4.parseAnimations(json.animations);const shapes=_this4.parseShapes(json.shapes);const geometries=_this4.parseGeometries(json.geometries,shapes);return _Promise.resolve(_this4.parseImagesAsync(json.images)).then(function(images){const textures=_this4.parseTextures(json.textures,images);const materials=_this4.parseMaterials(json.materials,textures);const object=_this4.parseObject(json.object,geometries,materials,textures,animations);const skeletons=_this4.parseSkeletons(json.skeletons,object);_this4.bindSkeletons(object,skeletons);return object;});}catch(e){return _Promise.reject(e);}}parseShapes(json){const shapes={};if(json!==undefined){for(let i=0,l=json.length;i<l;i++){const shape=new Shape().fromJSON(json[i]);shapes[shape.uuid]=shape;}}return shapes;}parseSkeletons(json,object){const skeletons={};const bones={};// generate bone lookup table\nobject.traverse(function(child){if(child.isBone)bones[child.uuid]=child;});// create skeletons\nif(json!==undefined){for(let i=0,l=json.length;i<l;i++){const skeleton=new Skeleton().fromJSON(json[i],bones);skeletons[skeleton.uuid]=skeleton;}}return skeletons;}parseGeometries(json,shapes){const geometries={};if(json!==undefined){const bufferGeometryLoader=new BufferGeometryLoader();for(let i=0,l=json.length;i<l;i++){let geometry;const data=json[i];switch(data.type){case'BufferGeometry':case'InstancedBufferGeometry':geometry=bufferGeometryLoader.parse(data);break;default:if(data.type in Geometries){geometry=Geometries[data.type].fromJSON(data,shapes);}else{console.warn(`THREE.ObjectLoader: Unsupported geometry type \"${data.type}\"`);}}geometry.uuid=data.uuid;if(data.name!==undefined)geometry.name=data.name;if(geometry.isBufferGeometry===true&&data.userData!==undefined)geometry.userData=data.userData;geometries[data.uuid]=geometry;}}return geometries;}parseMaterials(json,textures){const cache={};// MultiMaterial\nconst materials={};if(json!==undefined){const loader=new MaterialLoader();loader.setTextures(textures);for(let i=0,l=json.length;i<l;i++){const data=json[i];if(cache[data.uuid]===undefined){cache[data.uuid]=loader.parse(data);}materials[data.uuid]=cache[data.uuid];}}return materials;}parseAnimations(json){const animations={};if(json!==undefined){for(let i=0;i<json.length;i++){const data=json[i];const clip=AnimationClip.parse(data);animations[clip.uuid]=clip;}}return animations;}parseImages(json,onLoad){const scope=this;const images={};let loader;function loadImage(url){scope.manager.itemStart(url);return loader.load(url,function(){scope.manager.itemEnd(url);},undefined,function(){scope.manager.itemError(url);scope.manager.itemEnd(url);});}function deserializeImage(image){if(typeof image==='string'){const url=image;const path=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(url)?url:scope.resourcePath+url;return loadImage(path);}else{if(image.data){return{data:getTypedArray(image.type,image.data),width:image.width,height:image.height};}else{return null;}}}if(json!==undefined&&json.length>0){const manager=new LoadingManager(onLoad);loader=new ImageLoader(manager);loader.setCrossOrigin(this.crossOrigin);for(let i=0,il=json.length;i<il;i++){const image=json[i];const url=image.url;if(_Array$isArray(url)){// load array of images e.g CubeTexture\nconst imageArray=[];for(let j=0,jl=url.length;j<jl;j++){const currentUrl=url[j];const deserializedImage=deserializeImage(currentUrl);if(deserializedImage!==null){if(deserializedImage instanceof HTMLImageElement){imageArray.push(deserializedImage);}else{// special case: handle array of data textures for cube textures\nimageArray.push(new DataTexture(deserializedImage.data,deserializedImage.width,deserializedImage.height));}}}images[image.uuid]=new Source(imageArray);}else{// load single image\nconst deserializedImage=deserializeImage(image.url);images[image.uuid]=new Source(deserializedImage);}}}return images;}parseImagesAsync(json){try{const _this5=this;const deserializeImage=function(image){try{if(typeof image==='string'){const url=image;const path=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(url)?url:scope.resourcePath+url;return _Promise.resolve(loader.loadAsync(path));}else{if(image.data){return _Promise.resolve({data:getTypedArray(image.type,image.data),width:image.width,height:image.height});}else{return _Promise.resolve(null);}}}catch(e){return _Promise.reject(e);}};const scope=_this5;const images={};let loader;const _temp7=function(){if(json!==undefined&&json.length>0){loader=new ImageLoader(_this5.manager);loader.setCrossOrigin(_this5.crossOrigin);let i=0,il=json.length;return _for(function(){return i<il;},function(){return i++;},function(){const image=json[i];const url=image.url;const _temp6=function(){if(_Array$isArray(url)){function _temp5(){images[image.uuid]=new Source(imageArray);}// load array of images e.g CubeTexture\nconst imageArray=[];let j=0,jl=url.length;const _temp4=_for(function(){return j<jl;},function(){return j++;},function(){const currentUrl=url[j];return _Promise.resolve(deserializeImage(currentUrl)).then(function(deserializedImage){if(deserializedImage!==null){if(deserializedImage instanceof HTMLImageElement){imageArray.push(deserializedImage);}else{// special case: handle array of data textures for cube textures\nimageArray.push(new DataTexture(deserializedImage.data,deserializedImage.width,deserializedImage.height));}}});});return _temp4&&_temp4.then?_temp4.then(_temp5):_temp5(_temp4);}else{// load single image\nreturn _Promise.resolve(deserializeImage(image.url)).then(function(deserializedImage){images[image.uuid]=new Source(deserializedImage);});}}();if(_temp6&&_temp6.then)return _temp6.then(function(){});});}}();return _Promise.resolve(_temp7&&_temp7.then?_temp7.then(function(){return images;}):images);}catch(e){return _Promise.reject(e);}}parseTextures(json,images){function parseConstant(value,type){if(typeof value==='number')return value;console.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.',value);return type[value];}const textures={};if(json!==undefined){for(let i=0,l=json.length;i<l;i++){const data=json[i];if(data.image===undefined){console.warn('THREE.ObjectLoader: No \"image\" specified for',data.uuid);}if(images[data.image]===undefined){console.warn('THREE.ObjectLoader: Undefined image',data.image);}const source=images[data.image];const image=source.data;let texture;if(_Array$isArray(image)){texture=new CubeTexture();if(image.length===6)texture.needsUpdate=true;}else{if(image&&image.data){texture=new DataTexture();}else{texture=new Texture();}if(image)texture.needsUpdate=true;// textures can have undefined image data\n}texture.source=source;texture.uuid=data.uuid;if(data.name!==undefined)texture.name=data.name;if(data.mapping!==undefined)texture.mapping=parseConstant(data.mapping,TEXTURE_MAPPING);if(data.offset!==undefined)texture.offset.fromArray(data.offset);if(_repeatInstanceProperty(data)!==undefined)_repeatInstanceProperty(texture).fromArray(_repeatInstanceProperty(data));if(data.center!==undefined)texture.center.fromArray(data.center);if(data.rotation!==undefined)texture.rotation=data.rotation;if(data.wrap!==undefined){texture.wrapS=parseConstant(data.wrap[0],TEXTURE_WRAPPING);texture.wrapT=parseConstant(data.wrap[1],TEXTURE_WRAPPING);}if(data.format!==undefined)texture.format=data.format;if(data.type!==undefined)texture.type=data.type;if(data.encoding!==undefined)texture.encoding=data.encoding;if(data.minFilter!==undefined)texture.minFilter=parseConstant(data.minFilter,TEXTURE_FILTER);if(data.magFilter!==undefined)texture.magFilter=parseConstant(data.magFilter,TEXTURE_FILTER);if(data.anisotropy!==undefined)texture.anisotropy=data.anisotropy;if(data.flipY!==undefined)texture.flipY=data.flipY;if(data.premultiplyAlpha!==undefined)texture.premultiplyAlpha=data.premultiplyAlpha;if(data.unpackAlignment!==undefined)texture.unpackAlignment=data.unpackAlignment;if(data.userData!==undefined)texture.userData=data.userData;textures[data.uuid]=texture;}}return textures;}parseObject(data,geometries,materials,textures,animations){let object;function getGeometry(name){if(geometries[name]===undefined){console.warn('THREE.ObjectLoader: Undefined geometry',name);}return geometries[name];}function getMaterial(name){if(name===undefined)return undefined;if(_Array$isArray(name)){const array=[];for(let i=0,l=name.length;i<l;i++){const uuid=name[i];if(materials[uuid]===undefined){console.warn('THREE.ObjectLoader: Undefined material',uuid);}array.push(materials[uuid]);}return array;}if(materials[name]===undefined){console.warn('THREE.ObjectLoader: Undefined material',name);}return materials[name];}function getTexture(uuid){if(textures[uuid]===undefined){console.warn('THREE.ObjectLoader: Undefined texture',uuid);}return textures[uuid];}let geometry,material;switch(data.type){case'Scene':object=new Scene();if(data.background!==undefined){if(_Number$isInteger(data.background)){object.background=new Color(data.background);}else{object.background=getTexture(data.background);}}if(data.environment!==undefined){object.environment=getTexture(data.environment);}if(data.fog!==undefined){if(data.fog.type==='Fog'){object.fog=new Fog(data.fog.color,data.fog.near,data.fog.far);}else if(data.fog.type==='FogExp2'){object.fog=new FogExp2(data.fog.color,data.fog.density);}}if(data.backgroundBlurriness!==undefined)object.backgroundBlurriness=data.backgroundBlurriness;break;case'PerspectiveCamera':object=new PerspectiveCamera(data.fov,data.aspect,data.near,data.far);if(data.focus!==undefined)object.focus=data.focus;if(data.zoom!==undefined)object.zoom=data.zoom;if(data.filmGauge!==undefined)object.filmGauge=data.filmGauge;if(data.filmOffset!==undefined)object.filmOffset=data.filmOffset;if(data.view!==undefined)object.view=_Object$assign({},data.view);break;case'OrthographicCamera':object=new OrthographicCamera(data.left,data.right,data.top,data.bottom,data.near,data.far);if(data.zoom!==undefined)object.zoom=data.zoom;if(data.view!==undefined)object.view=_Object$assign({},data.view);break;case'AmbientLight':object=new AmbientLight(data.color,data.intensity);break;case'DirectionalLight':object=new DirectionalLight(data.color,data.intensity);break;case'PointLight':object=new PointLight(data.color,data.intensity,data.distance,data.decay);break;case'RectAreaLight':object=new RectAreaLight(data.color,data.intensity,data.width,data.height);break;case'SpotLight':object=new SpotLight(data.color,data.intensity,data.distance,data.angle,data.penumbra,data.decay);break;case'HemisphereLight':object=new HemisphereLight(data.color,data.groundColor,data.intensity);break;case'LightProbe':object=new LightProbe().fromJSON(data);break;case'SkinnedMesh':geometry=getGeometry(data.geometry);material=getMaterial(data.material);object=new SkinnedMesh(geometry,material);if(data.bindMode!==undefined)object.bindMode=data.bindMode;if(data.bindMatrix!==undefined)object.bindMatrix.fromArray(data.bindMatrix);if(data.skeleton!==undefined)object.skeleton=data.skeleton;break;case'Mesh':geometry=getGeometry(data.geometry);material=getMaterial(data.material);object=new Mesh(geometry,material);break;case'InstancedMesh':geometry=getGeometry(data.geometry);material=getMaterial(data.material);const count=data.count;const instanceMatrix=data.instanceMatrix;const instanceColor=data.instanceColor;object=new InstancedMesh(geometry,material,count);object.instanceMatrix=new InstancedBufferAttribute(new Float32Array(instanceMatrix.array),16);if(instanceColor!==undefined)object.instanceColor=new InstancedBufferAttribute(new Float32Array(instanceColor.array),instanceColor.itemSize);break;case'LOD':object=new LOD();break;case'Line':object=new Line(getGeometry(data.geometry),getMaterial(data.material));break;case'LineLoop':object=new LineLoop(getGeometry(data.geometry),getMaterial(data.material));break;case'LineSegments':object=new LineSegments(getGeometry(data.geometry),getMaterial(data.material));break;case'PointCloud':case'Points':object=new Points(getGeometry(data.geometry),getMaterial(data.material));break;case'Sprite':object=new Sprite(getMaterial(data.material));break;case'Group':object=new Group();break;case'Bone':object=new Bone();break;default:object=new Object3D();}object.uuid=data.uuid;if(data.name!==undefined)object.name=data.name;if(data.matrix!==undefined){object.matrix.fromArray(data.matrix);if(data.matrixAutoUpdate!==undefined)object.matrixAutoUpdate=data.matrixAutoUpdate;if(object.matrixAutoUpdate)object.matrix.decompose(object.position,object.quaternion,object.scale);}else{if(data.position!==undefined)object.position.fromArray(data.position);if(data.rotation!==undefined)object.rotation.fromArray(data.rotation);if(data.quaternion!==undefined)object.quaternion.fromArray(data.quaternion);if(data.scale!==undefined)object.scale.fromArray(data.scale);}if(data.castShadow!==undefined)object.castShadow=data.castShadow;if(data.receiveShadow!==undefined)object.receiveShadow=data.receiveShadow;if(data.shadow){if(data.shadow.bias!==undefined)object.shadow.bias=data.shadow.bias;if(data.shadow.normalBias!==undefined)object.shadow.normalBias=data.shadow.normalBias;if(data.shadow.radius!==undefined)object.shadow.radius=data.shadow.radius;if(data.shadow.mapSize!==undefined)object.shadow.mapSize.fromArray(data.shadow.mapSize);if(data.shadow.camera!==undefined)object.shadow.camera=this.parseObject(data.shadow.camera);}if(data.visible!==undefined)object.visible=data.visible;if(data.frustumCulled!==undefined)object.frustumCulled=data.frustumCulled;if(data.renderOrder!==undefined)object.renderOrder=data.renderOrder;if(data.userData!==undefined)object.userData=data.userData;if(data.layers!==undefined)object.layers.mask=data.layers;if(data.children!==undefined){const children=data.children;for(let i=0;i<children.length;i++){object.add(this.parseObject(children[i],geometries,materials,textures,animations));}}if(data.animations!==undefined){const objectAnimations=data.animations;for(let i=0;i<objectAnimations.length;i++){const uuid=objectAnimations[i];object.animations.push(animations[uuid]);}}if(data.type==='LOD'){if(data.autoUpdate!==undefined)object.autoUpdate=data.autoUpdate;const levels=data.levels;for(let l=0;l<levels.length;l++){const level=levels[l];const child=object.getObjectByProperty('uuid',level.object);if(child!==undefined){object.addLevel(child,level.distance);}}}return object;}bindSkeletons(object,skeletons){if(_Object$keys(skeletons).length===0)return;object.traverse(function(child){if(child.isSkinnedMesh===true&&child.skeleton!==undefined){const skeleton=skeletons[child.skeleton];if(skeleton===undefined){console.warn('THREE.ObjectLoader: No skeleton found with UUID:',child.skeleton);}else{_bindInstanceProperty(child).call(child,skeleton,child.bindMatrix);}}});}}const TEXTURE_MAPPING={UVMapping:UVMapping,CubeReflectionMapping:CubeReflectionMapping,CubeRefractionMapping:CubeRefractionMapping,EquirectangularReflectionMapping:EquirectangularReflectionMapping,EquirectangularRefractionMapping:EquirectangularRefractionMapping,CubeUVReflectionMapping:CubeUVReflectionMapping};const TEXTURE_WRAPPING={RepeatWrapping:RepeatWrapping,ClampToEdgeWrapping:ClampToEdgeWrapping,MirroredRepeatWrapping:MirroredRepeatWrapping};const TEXTURE_FILTER={NearestFilter:NearestFilter,NearestMipmapNearestFilter:NearestMipmapNearestFilter,NearestMipmapLinearFilter:NearestMipmapLinearFilter,LinearFilter:LinearFilter,LinearMipmapNearestFilter:LinearMipmapNearestFilter,LinearMipmapLinearFilter:LinearMipmapLinearFilter};class ImageBitmapLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);this.isImageBitmapLoader=true;if(typeof createImageBitmap==='undefined'){console.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.');}if(typeof fetch==='undefined'){console.warn('THREE.ImageBitmapLoader: fetch() not supported.');}this.options={premultiplyAlpha:'none'};}setOptions(options){this.options=options;return this;}load(url,onLoad,onProgress,onError){if(url===undefined)url='';if(this.path!==undefined)url=this.path+url;url=this.manager.resolveURL(url);const scope=this;const cached=Cache.get(url);if(cached!==undefined){scope.manager.itemStart(url);_setTimeout(function(){if(onLoad)onLoad(cached);scope.manager.itemEnd(url);},0);return cached;}const fetchOptions={};fetchOptions.credentials=this.crossOrigin==='anonymous'?'same-origin':'include';fetchOptions.headers=this.requestHeader;fetch(url,fetchOptions).then(function(res){return res.blob();}).then(function(blob){return createImageBitmap(blob,_Object$assign(scope.options,{colorSpaceConversion:'none'}));}).then(function(imageBitmap){Cache.add(url,imageBitmap);if(onLoad)onLoad(imageBitmap);scope.manager.itemEnd(url);}).catch(function(e){if(onError)onError(e);scope.manager.itemError(url);scope.manager.itemEnd(url);});scope.manager.itemStart(url);}}let _context;class AudioContext{static getContext(){if(_context===undefined){_context=new(window.AudioContext||window.webkitAudioContext)();}return _context;}static setContext(value){_context=value;}}class AudioLoader extends (/* unused pure expression or super */ null && (Loader)){constructor(manager){super(manager);}load(url,onLoad,onProgress,onError){const scope=this;const loader=new FileLoader(this.manager);loader.setResponseType('arraybuffer');loader.setPath(this.path);loader.setRequestHeader(this.requestHeader);loader.setWithCredentials(this.withCredentials);loader.load(url,function(buffer){try{// Create a copy of the buffer. The `decodeAudioData` method\n// detaches the buffer when complete, preventing reuse.\nconst bufferCopy=_sliceInstanceProperty(buffer).call(buffer,0);const context=AudioContext.getContext();context.decodeAudioData(bufferCopy,function(audioBuffer){onLoad(audioBuffer);});}catch(e){if(onError){onError(e);}else{console.error(e);}scope.manager.itemError(url);}},onProgress,onError);}}class HemisphereLightProbe extends (/* unused pure expression or super */ null && (LightProbe)){constructor(skyColor,groundColor,intensity=1){super(undefined,intensity);this.isHemisphereLightProbe=true;const color1=new Color().set(skyColor);const color2=new Color().set(groundColor);const sky=new three_module_Vector3(color1.r,color1.g,color1.b);const ground=new three_module_Vector3(color2.r,color2.g,color2.b);// without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI );\nconst c0=Math.sqrt(Math.PI);const c1=c0*Math.sqrt(0.75);this.sh.coefficients[0].copy(sky).add(ground).multiplyScalar(c0);this.sh.coefficients[1].copy(sky).sub(ground).multiplyScalar(c1);}}class AmbientLightProbe extends (/* unused pure expression or super */ null && (LightProbe)){constructor(color,intensity=1){super(undefined,intensity);this.isAmbientLightProbe=true;const color1=new Color().set(color);// without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );\nthis.sh.coefficients[0].set(color1.r,color1.g,color1.b).multiplyScalar(2*Math.sqrt(Math.PI));}}const _eyeRight=/*@__PURE__*/new Matrix4();const _eyeLeft=/*@__PURE__*/new Matrix4();const _projectionMatrix=/*@__PURE__*/new Matrix4();class StereoCamera{constructor(){this.type='StereoCamera';this.aspect=1;this.eyeSep=0.064;this.cameraL=new PerspectiveCamera();this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=false;this.cameraR=new PerspectiveCamera();this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=false;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null};}update(camera){const cache=this._cache;const needsUpdate=cache.focus!==camera.focus||cache.fov!==camera.fov||cache.aspect!==camera.aspect*this.aspect||cache.near!==camera.near||cache.far!==camera.far||cache.zoom!==camera.zoom||cache.eyeSep!==this.eyeSep;if(needsUpdate){cache.focus=camera.focus;cache.fov=camera.fov;cache.aspect=camera.aspect*this.aspect;cache.near=camera.near;cache.far=camera.far;cache.zoom=camera.zoom;cache.eyeSep=this.eyeSep;// Off-axis stereoscopic effect based on\n// http://paulbourke.net/stereographics/stereorender/\n_projectionMatrix.copy(camera.projectionMatrix);const eyeSepHalf=cache.eyeSep/2;const eyeSepOnProjection=eyeSepHalf*cache.near/cache.focus;const ymax=cache.near*Math.tan(three_module_DEG2RAD*cache.fov*0.5)/cache.zoom;let xmin,xmax;// translate xOffset\n_eyeLeft.elements[12]=-eyeSepHalf;_eyeRight.elements[12]=eyeSepHalf;// for left eye\nxmin=-ymax*cache.aspect+eyeSepOnProjection;xmax=ymax*cache.aspect+eyeSepOnProjection;_projectionMatrix.elements[0]=2*cache.near/(xmax-xmin);_projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin);this.cameraL.projectionMatrix.copy(_projectionMatrix);// for right eye\nxmin=-ymax*cache.aspect-eyeSepOnProjection;xmax=ymax*cache.aspect-eyeSepOnProjection;_projectionMatrix.elements[0]=2*cache.near/(xmax-xmin);_projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin);this.cameraR.projectionMatrix.copy(_projectionMatrix);}this.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(_eyeLeft);this.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(_eyeRight);}}class Clock{constructor(autoStart=true){this.autoStart=autoStart;this.startTime=0;this.oldTime=0;this.elapsedTime=0;this.running=false;}start(){this.startTime=now();this.oldTime=this.startTime;this.elapsedTime=0;this.running=true;}stop(){this.getElapsedTime();this.running=false;this.autoStart=false;}getElapsedTime(){this.getDelta();return this.elapsedTime;}getDelta(){let diff=0;if(this.autoStart&&!this.running){this.start();return 0;}if(this.running){const newTime=now();diff=(newTime-this.oldTime)/1000;this.oldTime=newTime;this.elapsedTime+=diff;}return diff;}}function now(){return(typeof performance==='undefined'?Date:performance).now();// see #10732\n}const _position$1=/*@__PURE__*/new three_module_Vector3();const _quaternion$1=/*@__PURE__*/new three_module_Quaternion();const _scale$1=/*@__PURE__*/new three_module_Vector3();const _orientation$1=/*@__PURE__*/new three_module_Vector3();class AudioListener extends (/* unused pure expression or super */ null && (Object3D)){constructor(){super();this.type='AudioListener';this.context=AudioContext.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;// private\nthis._clock=new Clock();}getInput(){return this.gain;}removeFilter(){if(_filterInstanceProperty(this)!==null){this.gain.disconnect(_filterInstanceProperty(this));_filterInstanceProperty(this).disconnect(this.context.destination);this.gain.connect(this.context.destination);this.filter=null;}return this;}getFilter(){return _filterInstanceProperty(this);}setFilter(value){if(_filterInstanceProperty(this)!==null){this.gain.disconnect(_filterInstanceProperty(this));_filterInstanceProperty(this).disconnect(this.context.destination);}else{this.gain.disconnect(this.context.destination);}this.filter=value;this.gain.connect(_filterInstanceProperty(this));_filterInstanceProperty(this).connect(this.context.destination);return this;}getMasterVolume(){return this.gain.gain.value;}setMasterVolume(value){this.gain.gain.setTargetAtTime(value,this.context.currentTime,0.01);return this;}updateMatrixWorld(force){super.updateMatrixWorld(force);const listener=this.context.listener;const up=this.up;this.timeDelta=this._clock.getDelta();this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1);_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1);if(listener.positionX){// code path for Chrome (see #14393)\nconst endTime=this.context.currentTime+this.timeDelta;listener.positionX.linearRampToValueAtTime(_position$1.x,endTime);listener.positionY.linearRampToValueAtTime(_position$1.y,endTime);listener.positionZ.linearRampToValueAtTime(_position$1.z,endTime);listener.forwardX.linearRampToValueAtTime(_orientation$1.x,endTime);listener.forwardY.linearRampToValueAtTime(_orientation$1.y,endTime);listener.forwardZ.linearRampToValueAtTime(_orientation$1.z,endTime);listener.upX.linearRampToValueAtTime(up.x,endTime);listener.upY.linearRampToValueAtTime(up.y,endTime);listener.upZ.linearRampToValueAtTime(up.z,endTime);}else{listener.setPosition(_position$1.x,_position$1.y,_position$1.z);listener.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,up.x,up.y,up.z);}}}class Audio extends (/* unused pure expression or super */ null && (Object3D)){constructor(listener){super();this.type='Audio';this.listener=listener;this.context=listener.context;this.gain=this.context.createGain();this.gain.connect(listener.getInput());this.autoplay=false;this.buffer=null;this.detune=0;this.loop=false;this.loopStart=0;this.loopEnd=0;this.offset=0;this.duration=undefined;this.playbackRate=1;this.isPlaying=false;this.hasPlaybackControl=true;this.source=null;this.sourceType='empty';this._startedAt=0;this._progress=0;this._connected=false;this.filters=[];}getOutput(){return this.gain;}setNodeSource(audioNode){this.hasPlaybackControl=false;this.sourceType='audioNode';this.source=audioNode;this.connect();return this;}setMediaElementSource(mediaElement){this.hasPlaybackControl=false;this.sourceType='mediaNode';this.source=this.context.createMediaElementSource(mediaElement);this.connect();return this;}setMediaStreamSource(mediaStream){this.hasPlaybackControl=false;this.sourceType='mediaStreamNode';this.source=this.context.createMediaStreamSource(mediaStream);this.connect();return this;}setBuffer(audioBuffer){this.buffer=audioBuffer;this.sourceType='buffer';if(this.autoplay)this.play();return this;}play(delay=0){var _context29;if(this.isPlaying===true){console.warn('THREE.Audio: Audio is already playing.');return;}if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}this._startedAt=this.context.currentTime+delay;const source=this.context.createBufferSource();source.buffer=this.buffer;source.loop=this.loop;source.loopStart=this.loopStart;source.loopEnd=this.loopEnd;source.onended=_bindInstanceProperty(_context29=this.onEnded).call(_context29,this);source.start(this._startedAt,this._progress+this.offset,this.duration);this.isPlaying=true;this.source=source;this.setDetune(this.detune);this.setPlaybackRate(this.playbackRate);return this.connect();}pause(){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}if(this.isPlaying===true){// update current progress\nthis._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate;if(this.loop===true){// ensure _progress does not exceed duration with looped audios\nthis._progress=this._progress%(this.duration||this.buffer.duration);}this.source.stop();this.source.onended=null;this.isPlaying=false;}return this;}stop(){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}this._progress=0;this.source.stop();this.source.onended=null;this.isPlaying=false;return this;}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let i=1,l=this.filters.length;i<l;i++){this.filters[i-1].connect(this.filters[i]);}this.filters[this.filters.length-1].connect(this.getOutput());}else{this.source.connect(this.getOutput());}this._connected=true;return this;}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let i=1,l=this.filters.length;i<l;i++){this.filters[i-1].disconnect(this.filters[i]);}this.filters[this.filters.length-1].disconnect(this.getOutput());}else{this.source.disconnect(this.getOutput());}this._connected=false;return this;}getFilters(){return this.filters;}setFilters(value){if(!value)value=[];if(this._connected===true){this.disconnect();this.filters=_sliceInstanceProperty(value).call(value);this.connect();}else{this.filters=_sliceInstanceProperty(value).call(value);}return this;}setDetune(value){this.detune=value;if(this.source.detune===undefined)return;// only set detune when available\nif(this.isPlaying===true){this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,0.01);}return this;}getDetune(){return this.detune;}getFilter(){return this.getFilters()[0];}setFilter(filter){return this.setFilters(filter?[filter]:[]);}setPlaybackRate(value){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}this.playbackRate=value;if(this.isPlaying===true){this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,0.01);}return this;}getPlaybackRate(){return this.playbackRate;}onEnded(){this.isPlaying=false;}getLoop(){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return false;}return this.loop;}setLoop(value){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}this.loop=value;if(this.isPlaying===true){this.source.loop=this.loop;}return this;}setLoopStart(value){this.loopStart=value;return this;}setLoopEnd(value){this.loopEnd=value;return this;}getVolume(){return this.gain.gain.value;}setVolume(value){this.gain.gain.setTargetAtTime(value,this.context.currentTime,0.01);return this;}}const _position=/*@__PURE__*/new three_module_Vector3();const three_module_quaternion=/*@__PURE__*/new three_module_Quaternion();const _scale=/*@__PURE__*/new three_module_Vector3();const _orientation=/*@__PURE__*/new three_module_Vector3();class PositionalAudio extends (/* unused pure expression or super */ null && (Audio)){constructor(listener){super(listener);this.panner=this.context.createPanner();this.panner.panningModel='HRTF';this.panner.connect(this.gain);}disconnect(){super.disconnect();this.panner.disconnect(this.gain);}getOutput(){return this.panner;}getRefDistance(){return this.panner.refDistance;}setRefDistance(value){this.panner.refDistance=value;return this;}getRolloffFactor(){return this.panner.rolloffFactor;}setRolloffFactor(value){this.panner.rolloffFactor=value;return this;}getDistanceModel(){return this.panner.distanceModel;}setDistanceModel(value){this.panner.distanceModel=value;return this;}getMaxDistance(){return this.panner.maxDistance;}setMaxDistance(value){this.panner.maxDistance=value;return this;}setDirectionalCone(coneInnerAngle,coneOuterAngle,coneOuterGain){this.panner.coneInnerAngle=coneInnerAngle;this.panner.coneOuterAngle=coneOuterAngle;this.panner.coneOuterGain=coneOuterGain;return this;}updateMatrixWorld(force){super.updateMatrixWorld(force);if(this.hasPlaybackControl===true&&this.isPlaying===false)return;this.matrixWorld.decompose(_position,three_module_quaternion,_scale);_orientation.set(0,0,1).applyQuaternion(three_module_quaternion);const panner=this.panner;if(panner.positionX){// code path for Chrome and Firefox (see #14393)\nconst endTime=this.context.currentTime+this.listener.timeDelta;panner.positionX.linearRampToValueAtTime(_position.x,endTime);panner.positionY.linearRampToValueAtTime(_position.y,endTime);panner.positionZ.linearRampToValueAtTime(_position.z,endTime);panner.orientationX.linearRampToValueAtTime(_orientation.x,endTime);panner.orientationY.linearRampToValueAtTime(_orientation.y,endTime);panner.orientationZ.linearRampToValueAtTime(_orientation.z,endTime);}else{panner.setPosition(_position.x,_position.y,_position.z);panner.setOrientation(_orientation.x,_orientation.y,_orientation.z);}}}class AudioAnalyser{constructor(audio,fftSize=2048){this.analyser=audio.context.createAnalyser();this.analyser.fftSize=fftSize;this.data=new Uint8Array(this.analyser.frequencyBinCount);audio.getOutput().connect(this.analyser);}getFrequencyData(){this.analyser.getByteFrequencyData(this.data);return this.data;}getAverageFrequency(){let value=0;const data=this.getFrequencyData();for(let i=0;i<data.length;i++){value+=data[i];}return value/data.length;}}class PropertyMixer{constructor(binding,typeName,valueSize){this.binding=binding;this.valueSize=valueSize;let mixFunction,mixFunctionAdditive,setIdentity;// buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n//\n// interpolators can use .buffer as their .result\n// the data then goes to 'incoming'\n//\n// 'accu0' and 'accu1' are used frame-interleaved for\n// the cumulative result and are compared to detect\n// changes\n//\n// 'orig' stores the original state of the property\n//\n// 'add' is used for additive cumulative results\n//\n// 'work' is optional and is only present for quaternion types. It is used\n// to store intermediate quaternion multiplication results\nswitch(typeName){case'quaternion':mixFunction=this._slerp;mixFunctionAdditive=this._slerpAdditive;setIdentity=this._setAdditiveIdentityQuaternion;this.buffer=new Float64Array(valueSize*6);this._workIndex=5;break;case'string':case'bool':mixFunction=this._select;// Use the regular mix function and for additive on these types,\n// additive is not relevant for non-numeric types\nmixFunctionAdditive=this._select;setIdentity=this._setAdditiveIdentityOther;this.buffer=new Array(valueSize*5);break;default:mixFunction=this._lerp;mixFunctionAdditive=this._lerpAdditive;setIdentity=this._setAdditiveIdentityNumeric;this.buffer=new Float64Array(valueSize*5);}this._mixBufferRegion=mixFunction;this._mixBufferRegionAdditive=mixFunctionAdditive;this._setIdentity=setIdentity;this._origIndex=3;this._addIndex=4;this.cumulativeWeight=0;this.cumulativeWeightAdditive=0;this.useCount=0;this.referenceCount=0;}// accumulate data in the 'incoming' region into 'accu<i>'\naccumulate(accuIndex,weight){// note: happily accumulating nothing when weight = 0, the caller knows\n// the weight and shouldn't have made the call in the first place\nconst buffer=this.buffer,stride=this.valueSize,offset=accuIndex*stride+stride;let currentWeight=this.cumulativeWeight;if(currentWeight===0){// accuN := incoming * weight\nfor(let i=0;i!==stride;++i){buffer[offset+i]=buffer[i];}currentWeight=weight;}else{// accuN := accuN + incoming * weight\ncurrentWeight+=weight;const mix=weight/currentWeight;this._mixBufferRegion(buffer,offset,0,mix,stride);}this.cumulativeWeight=currentWeight;}// accumulate data in the 'incoming' region into 'add'\naccumulateAdditive(weight){const buffer=this.buffer,stride=this.valueSize,offset=stride*this._addIndex;if(this.cumulativeWeightAdditive===0){// add = identity\nthis._setIdentity();}// add := add + incoming * weight\nthis._mixBufferRegionAdditive(buffer,offset,0,weight,stride);this.cumulativeWeightAdditive+=weight;}// apply the state of 'accu<i>' to the binding when accus differ\napply(accuIndex){const stride=this.valueSize,buffer=this.buffer,offset=accuIndex*stride+stride,weight=this.cumulativeWeight,weightAdditive=this.cumulativeWeightAdditive,binding=this.binding;this.cumulativeWeight=0;this.cumulativeWeightAdditive=0;if(weight<1){// accuN := accuN + original * ( 1 - cumulativeWeight )\nconst originalValueOffset=stride*this._origIndex;this._mixBufferRegion(buffer,offset,originalValueOffset,1-weight,stride);}if(weightAdditive>0){// accuN := accuN + additive accuN\nthis._mixBufferRegionAdditive(buffer,offset,this._addIndex*stride,1,stride);}for(let i=stride,e=stride+stride;i!==e;++i){if(buffer[i]!==buffer[i+stride]){// value has changed -> update scene graph\nbinding.setValue(buffer,offset);break;}}}// remember the state of the bound property and copy it to both accus\nsaveOriginalState(){const binding=this.binding;const buffer=this.buffer,stride=this.valueSize,originalValueOffset=stride*this._origIndex;binding.getValue(buffer,originalValueOffset);// accu[0..1] := orig -- initially detect changes against the original\nfor(let i=stride,e=originalValueOffset;i!==e;++i){buffer[i]=buffer[originalValueOffset+i%stride];}// Add to identity for additive\nthis._setIdentity();this.cumulativeWeight=0;this.cumulativeWeightAdditive=0;}// apply the state previously taken via 'saveOriginalState' to the binding\nrestoreOriginalState(){const originalValueOffset=this.valueSize*3;this.binding.setValue(this.buffer,originalValueOffset);}_setAdditiveIdentityNumeric(){const startIndex=this._addIndex*this.valueSize;const endIndex=startIndex+this.valueSize;for(let i=startIndex;i<endIndex;i++){this.buffer[i]=0;}}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric();this.buffer[this._addIndex*this.valueSize+3]=1;}_setAdditiveIdentityOther(){const startIndex=this._origIndex*this.valueSize;const targetIndex=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++){this.buffer[targetIndex+i]=this.buffer[startIndex+i];}}// mix functions\n_select(buffer,dstOffset,srcOffset,t,stride){if(t>=0.5){for(let i=0;i!==stride;++i){buffer[dstOffset+i]=buffer[srcOffset+i];}}}_slerp(buffer,dstOffset,srcOffset,t){three_module_Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,srcOffset,t);}_slerpAdditive(buffer,dstOffset,srcOffset,t,stride){const workOffset=this._workIndex*stride;// Store result in intermediate buffer offset\nthree_module_Quaternion.multiplyQuaternionsFlat(buffer,workOffset,buffer,dstOffset,buffer,srcOffset);// Slerp to the intermediate result\nthree_module_Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,workOffset,t);}_lerp(buffer,dstOffset,srcOffset,t,stride){const s=1-t;for(let i=0;i!==stride;++i){const j=dstOffset+i;buffer[j]=buffer[j]*s+buffer[srcOffset+i]*t;}}_lerpAdditive(buffer,dstOffset,srcOffset,t,stride){for(let i=0;i!==stride;++i){const j=dstOffset+i;buffer[j]=buffer[j]+buffer[srcOffset+i]*t;}}}// Characters [].:/ are reserved for track binding syntax.\nconst _RESERVED_CHARS_RE='\\\\[\\\\]\\\\.:\\\\/';const _reservedRe=new RegExp('['+_RESERVED_CHARS_RE+']','g');// Attempts to allow node names from any language. ES5's `\\w` regexp matches\n// only latin characters, and the unicode \\p{L} is not yet supported. So\n// instead, we exclude reserved characters and match everything else.\nconst _wordChar='[^'+_RESERVED_CHARS_RE+']';const _wordCharOrDot='[^'+_RESERVED_CHARS_RE.replace('\\\\.','')+']';// Parent directories, delimited by '/' or ':'. Currently unused, but must\n// be matched to parse the rest of the track name.\nconst _directoryRe=/*@__PURE__*/ /((?:WC+[\\/:])*)/.source.replace('WC',_wordChar);// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\nconst _nodeRe=/*@__PURE__*/ /(WCOD+)?/.source.replace('WCOD',_wordCharOrDot);// Object on target node, and accessor. May not contain reserved\n// characters. Accessor may contain any character except closing bracket.\nconst _objectRe=/*@__PURE__*/ /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace('WC',_wordChar);// Property and accessor. May not contain reserved characters. Accessor may\n// contain any non-bracket characters.\nconst _propertyRe=/*@__PURE__*/ /\\.(WC+)(?:\\[(.+)\\])?/.source.replace('WC',_wordChar);const _trackRe=new RegExp(''+'^'+_directoryRe+_nodeRe+_objectRe+_propertyRe+'$');const _supportedObjectNames=['material','materials','bones','map'];class Composite{constructor(targetGroup,path,optionalParsedPath){const parsedPath=optionalParsedPath||PropertyBinding.parseTrackName(path);this._targetGroup=targetGroup;this._bindings=targetGroup.subscribe_(path,parsedPath);}getValue(array,offset){var _context30;bind(_context30=this).call(_context30);// bind all binding\nconst firstValidIndex=this._targetGroup.nCachedObjects_,binding=this._bindings[firstValidIndex];// and only call .getValue on the first\nif(binding!==undefined)binding.getValue(array,offset);}setValue(array,offset){const bindings=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=bindings.length;i!==n;++i){bindings[i].setValue(array,offset);}}bind(){const bindings=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=bindings.length;i!==n;++i){var _context31;bind(_context31=bindings[i]).call(_context31);}}unbind(){const bindings=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=bindings.length;i!==n;++i){bindings[i].unbind();}}}// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\nclass PropertyBinding{constructor(rootNode,path,parsedPath){this.path=path;this.parsedPath=parsedPath||PropertyBinding.parseTrackName(path);this.node=PropertyBinding.findNode(rootNode,this.parsedPath.nodeName)||rootNode;this.rootNode=rootNode;// initial state of these methods that calls 'bind'\nthis.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound;}static create(root,path,parsedPath){if(!(root&&root.isAnimationObjectGroup)){return new PropertyBinding(root,path,parsedPath);}else{return new PropertyBinding.Composite(root,path,parsedPath);}}/**\n\t * Replaces spaces with underscores and removes unsupported characters from\n\t * node names, to ensure compatibility with parseTrackName().\n\t *\n\t * @param {string} name Node name to be sanitized.\n\t * @return {string}\n\t */static sanitizeNodeName(name){return name.replace(/\\s/g,'_').replace(_reservedRe,'');}static parseTrackName(trackName){var _context32;const matches=_trackRe.exec(trackName);if(matches===null){throw new Error('PropertyBinding: Cannot parse trackName: '+trackName);}const results={// directoryName: matches[ 1 ], // (tschw) currently unused\nnodeName:matches[2],objectName:matches[3],objectIndex:matches[4],propertyName:matches[5],// required\npropertyIndex:matches[6]};const lastDot=results.nodeName&&last_index_of(_context32=results.nodeName).call(_context32,'.');if(lastDot!==undefined&&lastDot!==-1){const objectName=results.nodeName.substring(lastDot+1);// Object names must be checked against an allowlist. Otherwise, there\n// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n// 'bar' could be the objectName, or part of a nodeName (which can\n// include '.' characters).\nif(index_of(_supportedObjectNames).call(_supportedObjectNames,objectName)!==-1){results.nodeName=results.nodeName.substring(0,lastDot);results.objectName=objectName;}}if(results.propertyName===null||results.propertyName.length===0){throw new Error('PropertyBinding: can not parse propertyName from trackName: '+trackName);}return results;}static findNode(root,nodeName){if(nodeName===undefined||nodeName===''||nodeName==='.'||nodeName===-1||nodeName===root.name||nodeName===root.uuid){return root;}// search into skeleton bones.\nif(root.skeleton){const bone=root.skeleton.getBoneByName(nodeName);if(bone!==undefined){return bone;}}// search into node subtree.\nif(root.children){const searchNodeSubtree=function(children){for(let i=0;i<children.length;i++){const childNode=children[i];if(childNode.name===nodeName||childNode.uuid===nodeName){return childNode;}const result=searchNodeSubtree(childNode.children);if(result)return result;}return null;};const subTreeNode=searchNodeSubtree(root.children);if(subTreeNode){return subTreeNode;}}return null;}// these are used to \"bind\" a nonexistent property\n_getValue_unavailable(){}_setValue_unavailable(){}// Getters\n_getValue_direct(buffer,offset){buffer[offset]=this.targetObject[this.propertyName];}_getValue_array(buffer,offset){const source=this.resolvedProperty;for(let i=0,n=source.length;i!==n;++i){buffer[offset++]=source[i];}}_getValue_arrayElement(buffer,offset){buffer[offset]=this.resolvedProperty[this.propertyIndex];}_getValue_toArray(buffer,offset){this.resolvedProperty.toArray(buffer,offset);}// Direct\n_setValue_direct(buffer,offset){this.targetObject[this.propertyName]=buffer[offset];}_setValue_direct_setNeedsUpdate(buffer,offset){this.targetObject[this.propertyName]=buffer[offset];this.targetObject.needsUpdate=true;}_setValue_direct_setMatrixWorldNeedsUpdate(buffer,offset){this.targetObject[this.propertyName]=buffer[offset];this.targetObject.matrixWorldNeedsUpdate=true;}// EntireArray\n_setValue_array(buffer,offset){const dest=this.resolvedProperty;for(let i=0,n=dest.length;i!==n;++i){dest[i]=buffer[offset++];}}_setValue_array_setNeedsUpdate(buffer,offset){const dest=this.resolvedProperty;for(let i=0,n=dest.length;i!==n;++i){dest[i]=buffer[offset++];}this.targetObject.needsUpdate=true;}_setValue_array_setMatrixWorldNeedsUpdate(buffer,offset){const dest=this.resolvedProperty;for(let i=0,n=dest.length;i!==n;++i){dest[i]=buffer[offset++];}this.targetObject.matrixWorldNeedsUpdate=true;}// ArrayElement\n_setValue_arrayElement(buffer,offset){this.resolvedProperty[this.propertyIndex]=buffer[offset];}_setValue_arrayElement_setNeedsUpdate(buffer,offset){this.resolvedProperty[this.propertyIndex]=buffer[offset];this.targetObject.needsUpdate=true;}_setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer,offset){this.resolvedProperty[this.propertyIndex]=buffer[offset];this.targetObject.matrixWorldNeedsUpdate=true;}// HasToFromArray\n_setValue_fromArray(buffer,offset){this.resolvedProperty.fromArray(buffer,offset);}_setValue_fromArray_setNeedsUpdate(buffer,offset){this.resolvedProperty.fromArray(buffer,offset);this.targetObject.needsUpdate=true;}_setValue_fromArray_setMatrixWorldNeedsUpdate(buffer,offset){this.resolvedProperty.fromArray(buffer,offset);this.targetObject.matrixWorldNeedsUpdate=true;}_getValue_unbound(targetArray,offset){var _context33;bind(_context33=this).call(_context33);this.getValue(targetArray,offset);}_setValue_unbound(sourceArray,offset){var _context34;bind(_context34=this).call(_context34);this.setValue(sourceArray,offset);}// create getter / setter pair for a property in the scene graph\nbind(){let targetObject=this.node;const parsedPath=this.parsedPath;const objectName=parsedPath.objectName;const propertyName=parsedPath.propertyName;let propertyIndex=parsedPath.propertyIndex;if(!targetObject){targetObject=PropertyBinding.findNode(this.rootNode,parsedPath.nodeName)||this.rootNode;this.node=targetObject;}// set fail state so we can just 'return' on error\nthis.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;// ensure there is a value node\nif(!targetObject){console.error('THREE.PropertyBinding: Trying to update node for track: '+this.path+' but it wasn\\'t found.');return;}if(objectName){let objectIndex=parsedPath.objectIndex;// special cases were we need to reach deeper into the hierarchy to get the face materials....\nswitch(objectName){case'materials':if(!targetObject.material){console.error('THREE.PropertyBinding: Can not bind to material as node does not have a material.',this);return;}if(!targetObject.material.materials){console.error('THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.',this);return;}targetObject=targetObject.material.materials;break;case'bones':if(!targetObject.skeleton){console.error('THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.',this);return;}// potential future optimization: skip this if propertyIndex is already an integer\n// and convert the integer string to a true integer.\ntargetObject=targetObject.skeleton.bones;// support resolving morphTarget names into indices.\nfor(let i=0;i<targetObject.length;i++){if(targetObject[i].name===objectIndex){objectIndex=i;break;}}break;case'map':if('map'in targetObject){targetObject=instance_map(targetObject);break;}if(!targetObject.material){console.error('THREE.PropertyBinding: Can not bind to material as node does not have a material.',this);return;}if(!instance_map(targetObject.material)){console.error('THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.',this);return;}targetObject=instance_map(targetObject.material);break;default:if(targetObject[objectName]===undefined){console.error('THREE.PropertyBinding: Can not bind to objectName of node undefined.',this);return;}targetObject=targetObject[objectName];}if(objectIndex!==undefined){if(targetObject[objectIndex]===undefined){console.error('THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.',this,targetObject);return;}targetObject=targetObject[objectIndex];}}// resolve property\nconst nodeProperty=targetObject[propertyName];if(nodeProperty===undefined){const nodeName=parsedPath.nodeName;console.error('THREE.PropertyBinding: Trying to update property for track: '+nodeName+'.'+propertyName+' but it wasn\\'t found.',targetObject);return;}// determine versioning scheme\nlet versioning=this.Versioning.None;this.targetObject=targetObject;if(targetObject.needsUpdate!==undefined){// material\nversioning=this.Versioning.NeedsUpdate;}else if(targetObject.matrixWorldNeedsUpdate!==undefined){// node transform\nversioning=this.Versioning.MatrixWorldNeedsUpdate;}// determine how the property gets bound\nlet bindingType=this.BindingType.Direct;if(propertyIndex!==undefined){// access a sub element of the property array (only primitives are supported right now)\nif(propertyName==='morphTargetInfluences'){// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n// support resolving morphTarget names into indices.\nif(!targetObject.geometry){console.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.',this);return;}if(!targetObject.geometry.morphAttributes){console.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.',this);return;}if(targetObject.morphTargetDictionary[propertyIndex]!==undefined){propertyIndex=targetObject.morphTargetDictionary[propertyIndex];}}bindingType=this.BindingType.ArrayElement;this.resolvedProperty=nodeProperty;this.propertyIndex=propertyIndex;}else if(nodeProperty.fromArray!==undefined&&nodeProperty.toArray!==undefined){// must use copy for Object3D.Euler/Quaternion\nbindingType=this.BindingType.HasFromToArray;this.resolvedProperty=nodeProperty;}else if(is_array(nodeProperty)){bindingType=this.BindingType.EntireArray;this.resolvedProperty=nodeProperty;}else{this.propertyName=propertyName;}// select getter / setter\nthis.getValue=this.GetterByBindingType[bindingType];this.setValue=this.SetterByBindingTypeAndVersioning[bindingType][versioning];}unbind(){this.node=null;// back to the prototype version of getValue / setValue\n// note: avoiding to mutate the shape of 'this' via 'delete'\nthis.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound;}}PropertyBinding.Composite=Composite;PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray];PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[// Direct\nPropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[// EntireArray\nPropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[// ArrayElement\nPropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[// HasToFromArray\nPropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];/**\n *\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * - Add objects you would otherwise pass as 'root' to the\n * constructor or the .clipAction method of AnimationMixer.\n *\n * - Instead pass this object as 'root'.\n *\n * - You can also add and remove objects later when the mixer\n * is running.\n *\n * Note:\n *\n * Objects of this class appear as one object to the mixer,\n * so cache control of the individual objects must be done\n * on the group.\n *\n * Limitation:\n *\n * - The animated properties must be compatible among the\n * all objects in the group.\n *\n * - A single property can either be controlled through a\n * target group or directly, but not both.\n */class AnimationObjectGroup{constructor(){this.isAnimationObjectGroup=true;this.uuid=three_module_generateUUID();// cached objects followed by the active ones\nthis._objects=_sliceInstanceProperty(Array.prototype).call(arguments);this.nCachedObjects_=0;// threshold\n// note: read by PropertyBinding.Composite\nconst indices={};this._indicesByUUID=indices;// for bookkeeping\nfor(let i=0,n=arguments.length;i!==n;++i){indices[arguments[i].uuid]=i;}this._paths=[];// inside: string\nthis._parsedPaths=[];// inside: { we don't care, here }\nthis._bindings=[];// inside: Array< PropertyBinding >\nthis._bindingsIndicesByPath={};// inside: indices in these arrays\nconst scope=this;this.stats={objects:{get total(){return scope._objects.length;},get inUse(){return this.total-scope.nCachedObjects_;}},get bindingsPerObject(){return scope._bindings.length;}};}add(){const objects=this._objects,indicesByUUID=this._indicesByUUID,paths=this._paths,parsedPaths=this._parsedPaths,bindings=this._bindings,nBindings=bindings.length;let knownObject=undefined,nObjects=objects.length,nCachedObjects=this.nCachedObjects_;for(let i=0,n=arguments.length;i!==n;++i){const object=arguments[i],uuid=object.uuid;let index=indicesByUUID[uuid];if(index===undefined){// unknown object -> add it to the ACTIVE region\nindex=nObjects++;indicesByUUID[uuid]=index;objects.push(object);// accounting is done, now do the same for all bindings\nfor(let j=0,m=nBindings;j!==m;++j){bindings[j].push(new PropertyBinding(object,paths[j],parsedPaths[j]));}}else if(index<nCachedObjects){knownObject=objects[index];// move existing object to the ACTIVE region\nconst firstActiveIndex=--nCachedObjects,lastCachedObject=objects[firstActiveIndex];indicesByUUID[lastCachedObject.uuid]=index;objects[index]=lastCachedObject;indicesByUUID[uuid]=firstActiveIndex;objects[firstActiveIndex]=object;// accounting is done, now do the same for all bindings\nfor(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j],lastCached=bindingsForPath[firstActiveIndex];let binding=bindingsForPath[index];bindingsForPath[index]=lastCached;if(binding===undefined){// since we do not bother to create new bindings\n// for objects that are cached, the binding may\n// or may not exist\nbinding=new PropertyBinding(object,paths[j],parsedPaths[j]);}bindingsForPath[firstActiveIndex]=binding;}}else if(objects[index]!==knownObject){console.error('THREE.AnimationObjectGroup: Different objects with the same UUID '+'detected. Clean the caches or recreate your infrastructure when reloading scenes.');}// else the object is already where we want it to be\n}// for arguments\nthis.nCachedObjects_=nCachedObjects;}remove(){const objects=this._objects,indicesByUUID=this._indicesByUUID,bindings=this._bindings,nBindings=bindings.length;let nCachedObjects=this.nCachedObjects_;for(let i=0,n=arguments.length;i!==n;++i){const object=arguments[i],uuid=object.uuid,index=indicesByUUID[uuid];if(index!==undefined&&index>=nCachedObjects){// move existing object into the CACHED region\nconst lastCachedIndex=nCachedObjects++,firstActiveObject=objects[lastCachedIndex];indicesByUUID[firstActiveObject.uuid]=index;objects[index]=firstActiveObject;indicesByUUID[uuid]=lastCachedIndex;objects[lastCachedIndex]=object;// accounting is done, now do the same for all bindings\nfor(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j],firstActive=bindingsForPath[lastCachedIndex],binding=bindingsForPath[index];bindingsForPath[index]=firstActive;bindingsForPath[lastCachedIndex]=binding;}}}// for arguments\nthis.nCachedObjects_=nCachedObjects;}// remove & forget\nuncache(){const objects=this._objects,indicesByUUID=this._indicesByUUID,bindings=this._bindings,nBindings=bindings.length;let nCachedObjects=this.nCachedObjects_,nObjects=objects.length;for(let i=0,n=arguments.length;i!==n;++i){const object=arguments[i],uuid=object.uuid,index=indicesByUUID[uuid];if(index!==undefined){delete indicesByUUID[uuid];if(index<nCachedObjects){// object is cached, shrink the CACHED region\nconst firstActiveIndex=--nCachedObjects,lastCachedObject=objects[firstActiveIndex],lastIndex=--nObjects,lastObject=objects[lastIndex];// last cached object takes this object's place\nindicesByUUID[lastCachedObject.uuid]=index;objects[index]=lastCachedObject;// last object goes to the activated slot and pop\nindicesByUUID[lastObject.uuid]=firstActiveIndex;objects[firstActiveIndex]=lastObject;objects.pop();// accounting is done, now do the same for all bindings\nfor(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j],lastCached=bindingsForPath[firstActiveIndex],last=bindingsForPath[lastIndex];bindingsForPath[index]=lastCached;bindingsForPath[firstActiveIndex]=last;bindingsForPath.pop();}}else{// object is active, just swap with the last and pop\nconst lastIndex=--nObjects,lastObject=objects[lastIndex];if(lastIndex>0){indicesByUUID[lastObject.uuid]=index;}objects[index]=lastObject;objects.pop();// accounting is done, now do the same for all bindings\nfor(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j];bindingsForPath[index]=bindingsForPath[lastIndex];bindingsForPath.pop();}}// cached or active\n}// if object is known\n}// for arguments\nthis.nCachedObjects_=nCachedObjects;}// Internal interface used by befriended PropertyBinding.Composite:\nsubscribe_(path,parsedPath){// returns an array of bindings for the given path that is changed\n// according to the contained objects in the group\nconst indicesByPath=this._bindingsIndicesByPath;let index=indicesByPath[path];const bindings=this._bindings;if(index!==undefined)return bindings[index];const paths=this._paths,parsedPaths=this._parsedPaths,objects=this._objects,nObjects=objects.length,nCachedObjects=this.nCachedObjects_,bindingsForPath=new Array(nObjects);index=bindings.length;indicesByPath[path]=index;paths.push(path);parsedPaths.push(parsedPath);bindings.push(bindingsForPath);for(let i=nCachedObjects,n=objects.length;i!==n;++i){const object=objects[i];bindingsForPath[i]=new PropertyBinding(object,path,parsedPath);}return bindingsForPath;}unsubscribe_(path){// tells the group to forget about a property path and no longer\n// update the array previously obtained with 'subscribe_'\nconst indicesByPath=this._bindingsIndicesByPath,index=indicesByPath[path];if(index!==undefined){const paths=this._paths,parsedPaths=this._parsedPaths,bindings=this._bindings,lastBindingsIndex=bindings.length-1,lastBindings=bindings[lastBindingsIndex],lastBindingsPath=path[lastBindingsIndex];indicesByPath[lastBindingsPath]=index;bindings[index]=lastBindings;bindings.pop();parsedPaths[index]=parsedPaths[lastBindingsIndex];parsedPaths.pop();paths[index]=paths[lastBindingsIndex];paths.pop();}}}class AnimationAction{constructor(mixer,clip,localRoot=null,blendMode=clip.blendMode){this._mixer=mixer;this._clip=clip;this._localRoot=localRoot;this.blendMode=blendMode;const tracks=clip.tracks,nTracks=tracks.length,interpolants=new Array(nTracks);const interpolantSettings={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let i=0;i!==nTracks;++i){const interpolant=tracks[i].createInterpolant(null);interpolants[i]=interpolant;interpolant.settings=interpolantSettings;}this._interpolantSettings=interpolantSettings;this._interpolants=interpolants;// bound by the mixer\n// inside: PropertyMixer (managed by the mixer)\nthis._propertyBindings=new Array(nTracks);this._cacheIndex=null;// for the memory manager\nthis._byClipCacheIndex=null;// for the memory manager\nthis._timeScaleInterpolant=null;this._weightInterpolant=null;this.loop=LoopRepeat;this._loopCount=-1;// global mixer time when the action is to be started\n// it's set back to 'null' upon start of the action\nthis._startTime=null;// scaled local time of the action\n// gets clamped or wrapped to 0..clip.duration according to loop\nthis.time=0;this.timeScale=1;this._effectiveTimeScale=1;this.weight=1;this._effectiveWeight=1;this.repetitions=Infinity;// no. of repetitions when looping\nthis.paused=false;// true -> zero effective time scale\nthis.enabled=true;// false -> zero effective weight\nthis.clampWhenFinished=false;// keep feeding the last frame?\nthis.zeroSlopeAtStart=true;// for smooth interpolation w/o separate\nthis.zeroSlopeAtEnd=true;// clips for start, loop and end\n}// State & Scheduling\nplay(){this._mixer._activateAction(this);return this;}stop(){this._mixer._deactivateAction(this);return this.reset();}reset(){this.paused=false;this.enabled=true;this.time=0;// restart clip\nthis._loopCount=-1;// forget previous loops\nthis._startTime=null;// forget scheduling\nreturn this.stopFading().stopWarping();}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this);}// return true when play has been called\nisScheduled(){return this._mixer._isActiveAction(this);}startAt(time){this._startTime=time;return this;}setLoop(mode,repetitions){this.loop=mode;this.repetitions=repetitions;return this;}// Weight\n// set the weight stopping any scheduled fading\n// although .enabled = false yields an effective weight of zero, this\n// method does *not* change .enabled, because it would be confusing\nsetEffectiveWeight(weight){this.weight=weight;// note: same logic as when updated at runtime\nthis._effectiveWeight=this.enabled?weight:0;return this.stopFading();}// return the weight considering fading and .enabled\ngetEffectiveWeight(){return this._effectiveWeight;}fadeIn(duration){return this._scheduleFading(duration,0,1);}fadeOut(duration){return this._scheduleFading(duration,1,0);}crossFadeFrom(fadeOutAction,duration,warp){fadeOutAction.fadeOut(duration);this.fadeIn(duration);if(warp){const fadeInDuration=this._clip.duration,fadeOutDuration=fadeOutAction._clip.duration,startEndRatio=fadeOutDuration/fadeInDuration,endStartRatio=fadeInDuration/fadeOutDuration;fadeOutAction.warp(1.0,startEndRatio,duration);this.warp(endStartRatio,1.0,duration);}return this;}crossFadeTo(fadeInAction,duration,warp){return fadeInAction.crossFadeFrom(this,duration,warp);}stopFading(){const weightInterpolant=this._weightInterpolant;if(weightInterpolant!==null){this._weightInterpolant=null;this._mixer._takeBackControlInterpolant(weightInterpolant);}return this;}// Time Scale Control\n// set the time scale stopping any scheduled warping\n// although .paused = true yields an effective time scale of zero, this\n// method does *not* change .paused, because it would be confusing\nsetEffectiveTimeScale(timeScale){this.timeScale=timeScale;this._effectiveTimeScale=this.paused?0:timeScale;return this.stopWarping();}// return the time scale considering warping and .paused\ngetEffectiveTimeScale(){return this._effectiveTimeScale;}setDuration(duration){this.timeScale=this._clip.duration/duration;return this.stopWarping();}syncWith(action){this.time=action.time;this.timeScale=action.timeScale;return this.stopWarping();}halt(duration){return this.warp(this._effectiveTimeScale,0,duration);}warp(startTimeScale,endTimeScale,duration){const mixer=this._mixer,now=mixer.time,timeScale=this.timeScale;let interpolant=this._timeScaleInterpolant;if(interpolant===null){interpolant=mixer._lendControlInterpolant();this._timeScaleInterpolant=interpolant;}const times=interpolant.parameterPositions,values=interpolant.sampleValues;times[0]=now;times[1]=now+duration;values[0]=startTimeScale/timeScale;values[1]=endTimeScale/timeScale;return this;}stopWarping(){const timeScaleInterpolant=this._timeScaleInterpolant;if(timeScaleInterpolant!==null){this._timeScaleInterpolant=null;this._mixer._takeBackControlInterpolant(timeScaleInterpolant);}return this;}// Object Accessors\ngetMixer(){return this._mixer;}getClip(){return this._clip;}getRoot(){return this._localRoot||this._mixer._root;}// Interna\n_update(time,deltaTime,timeDirection,accuIndex){// called by the mixer\nif(!this.enabled){// call ._updateWeight() to update ._effectiveWeight\nthis._updateWeight(time);return;}const startTime=this._startTime;if(startTime!==null){// check for scheduled start of action\nconst timeRunning=(time-startTime)*timeDirection;if(timeRunning<0||timeDirection===0){deltaTime=0;}else{this._startTime=null;// unschedule\ndeltaTime=timeDirection*timeRunning;}}// apply time scale and advance time\ndeltaTime*=this._updateTimeScale(time);const clipTime=this._updateTime(deltaTime);// note: _updateTime may disable the action resulting in\n// an effective weight of 0\nconst weight=this._updateWeight(time);if(weight>0){const interpolants=this._interpolants;const propertyMixers=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let j=0,m=interpolants.length;j!==m;++j){interpolants[j].evaluate(clipTime);propertyMixers[j].accumulateAdditive(weight);}break;case NormalAnimationBlendMode:default:for(let j=0,m=interpolants.length;j!==m;++j){interpolants[j].evaluate(clipTime);propertyMixers[j].accumulate(accuIndex,weight);}}}}_updateWeight(time){let weight=0;if(this.enabled){weight=this.weight;const interpolant=this._weightInterpolant;if(interpolant!==null){const interpolantValue=interpolant.evaluate(time)[0];weight*=interpolantValue;if(time>interpolant.parameterPositions[1]){this.stopFading();if(interpolantValue===0){// faded out, disable\nthis.enabled=false;}}}}this._effectiveWeight=weight;return weight;}_updateTimeScale(time){let timeScale=0;if(!this.paused){timeScale=this.timeScale;const interpolant=this._timeScaleInterpolant;if(interpolant!==null){const interpolantValue=interpolant.evaluate(time)[0];timeScale*=interpolantValue;if(time>interpolant.parameterPositions[1]){this.stopWarping();if(timeScale===0){// motion has halted, pause\nthis.paused=true;}else{// warp done - apply final time scale\nthis.timeScale=timeScale;}}}}this._effectiveTimeScale=timeScale;return timeScale;}_updateTime(deltaTime){const duration=this._clip.duration;const loop=this.loop;let time=this.time+deltaTime;let loopCount=this._loopCount;const pingPong=loop===LoopPingPong;if(deltaTime===0){if(loopCount===-1)return time;return pingPong&&(loopCount&1)===1?duration-time:time;}if(loop===LoopOnce){if(loopCount===-1){// just started\nthis._loopCount=0;this._setEndings(true,true,false);}handle_stop:{if(time>=duration){time=duration;}else if(time<0){time=0;}else{this.time=time;break handle_stop;}if(this.clampWhenFinished)this.paused=true;else this.enabled=false;this.time=time;this._mixer.dispatchEvent({type:'finished',action:this,direction:deltaTime<0?-1:1});}}else{// repetitive Repeat or PingPong\nif(loopCount===-1){// just started\nif(deltaTime>=0){loopCount=0;this._setEndings(true,this.repetitions===0,pingPong);}else{// when looping in reverse direction, the initial\n// transition through zero counts as a repetition,\n// so leave loopCount at -1\nthis._setEndings(this.repetitions===0,true,pingPong);}}if(time>=duration||time<0){// wrap around\nconst loopDelta=Math.floor(time/duration);// signed\ntime-=duration*loopDelta;loopCount+=Math.abs(loopDelta);const pending=this.repetitions-loopCount;if(pending<=0){// have to stop (switch state, clamp time, fire event)\nif(this.clampWhenFinished)this.paused=true;else this.enabled=false;time=deltaTime>0?duration:0;this.time=time;this._mixer.dispatchEvent({type:'finished',action:this,direction:deltaTime>0?1:-1});}else{// keep running\nif(pending===1){// entering the last round\nconst atStart=deltaTime<0;this._setEndings(atStart,!atStart,pingPong);}else{this._setEndings(false,false,pingPong);}this._loopCount=loopCount;this.time=time;this._mixer.dispatchEvent({type:'loop',action:this,loopDelta:loopDelta});}}else{this.time=time;}if(pingPong&&(loopCount&1)===1){// invert time for the \"pong round\"\nreturn duration-time;}}return time;}_setEndings(atStart,atEnd,pingPong){const settings=this._interpolantSettings;if(pingPong){settings.endingStart=ZeroSlopeEnding;settings.endingEnd=ZeroSlopeEnding;}else{// assuming for LoopOnce atStart == atEnd == true\nif(atStart){settings.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding;}else{settings.endingStart=WrapAroundEnding;}if(atEnd){settings.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding;}else{settings.endingEnd=WrapAroundEnding;}}}_scheduleFading(duration,weightNow,weightThen){const mixer=this._mixer,now=mixer.time;let interpolant=this._weightInterpolant;if(interpolant===null){interpolant=mixer._lendControlInterpolant();this._weightInterpolant=interpolant;}const times=interpolant.parameterPositions,values=interpolant.sampleValues;times[0]=now;values[0]=weightNow;times[1]=now+duration;values[1]=weightThen;return this;}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends (/* unused pure expression or super */ null && (EventDispatcher)){constructor(root){super();this._root=root;this._initMemoryManager();this._accuIndex=0;this.time=0;this.timeScale=1.0;}_bindAction(action,prototypeAction){const root=action._localRoot||this._root,tracks=action._clip.tracks,nTracks=tracks.length,bindings=action._propertyBindings,interpolants=action._interpolants,rootUuid=root.uuid,bindingsByRoot=this._bindingsByRootAndName;let bindingsByName=bindingsByRoot[rootUuid];if(bindingsByName===undefined){bindingsByName={};bindingsByRoot[rootUuid]=bindingsByName;}for(let i=0;i!==nTracks;++i){const track=tracks[i],trackName=track.name;let binding=bindingsByName[trackName];if(binding!==undefined){++binding.referenceCount;bindings[i]=binding;}else{binding=bindings[i];if(binding!==undefined){// existing binding, make sure the cache knows\nif(binding._cacheIndex===null){++binding.referenceCount;this._addInactiveBinding(binding,rootUuid,trackName);}continue;}const path=prototypeAction&&prototypeAction._propertyBindings[i].binding.parsedPath;binding=new PropertyMixer(PropertyBinding.create(root,trackName,path),track.ValueTypeName,track.getValueSize());++binding.referenceCount;this._addInactiveBinding(binding,rootUuid,trackName);bindings[i]=binding;}interpolants[i].resultBuffer=binding.buffer;}}_activateAction(action){if(!this._isActiveAction(action)){if(action._cacheIndex===null){// this action has been forgotten by the cache, but the user\n// appears to be still using it -> rebind\nconst rootUuid=(action._localRoot||this._root).uuid,clipUuid=action._clip.uuid,actionsForClip=this._actionsByClip[clipUuid];this._bindAction(action,actionsForClip&&actionsForClip.knownActions[0]);this._addInactiveAction(action,clipUuid,rootUuid);}const bindings=action._propertyBindings;// increment reference counts / sort out state\nfor(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];if(binding.useCount++===0){this._lendBinding(binding);binding.saveOriginalState();}}this._lendAction(action);}}_deactivateAction(action){if(this._isActiveAction(action)){const bindings=action._propertyBindings;// decrement reference counts / sort out state\nfor(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];if(--binding.useCount===0){binding.restoreOriginalState();this._takeBackBinding(binding);}}this._takeBackAction(action);}}// Memory manager\n_initMemoryManager(){this._actions=[];// 'nActiveActions' followed by inactive ones\nthis._nActiveActions=0;this._actionsByClip={};// inside:\n// {\n// \tknownActions: Array< AnimationAction > - used as prototypes\n// \tactionByRoot: AnimationAction - lookup\n// }\nthis._bindings=[];// 'nActiveBindings' followed by inactive ones\nthis._nActiveBindings=0;this._bindingsByRootAndName={};// inside: Map< name, PropertyMixer >\nthis._controlInterpolants=[];// same game as above\nthis._nActiveControlInterpolants=0;const scope=this;this.stats={actions:{get total(){return scope._actions.length;},get inUse(){return scope._nActiveActions;}},bindings:{get total(){return scope._bindings.length;},get inUse(){return scope._nActiveBindings;}},controlInterpolants:{get total(){return scope._controlInterpolants.length;},get inUse(){return scope._nActiveControlInterpolants;}}};}// Memory management for AnimationAction objects\n_isActiveAction(action){const index=action._cacheIndex;return index!==null&&index<this._nActiveActions;}_addInactiveAction(action,clipUuid,rootUuid){const actions=this._actions,actionsByClip=this._actionsByClip;let actionsForClip=actionsByClip[clipUuid];if(actionsForClip===undefined){actionsForClip={knownActions:[action],actionByRoot:{}};action._byClipCacheIndex=0;actionsByClip[clipUuid]=actionsForClip;}else{const knownActions=actionsForClip.knownActions;action._byClipCacheIndex=knownActions.length;knownActions.push(action);}action._cacheIndex=actions.length;actions.push(action);actionsForClip.actionByRoot[rootUuid]=action;}_removeInactiveAction(action){const actions=this._actions,lastInactiveAction=actions[actions.length-1],cacheIndex=action._cacheIndex;lastInactiveAction._cacheIndex=cacheIndex;actions[cacheIndex]=lastInactiveAction;actions.pop();action._cacheIndex=null;const clipUuid=action._clip.uuid,actionsByClip=this._actionsByClip,actionsForClip=actionsByClip[clipUuid],knownActionsForClip=actionsForClip.knownActions,lastKnownAction=knownActionsForClip[knownActionsForClip.length-1],byClipCacheIndex=action._byClipCacheIndex;lastKnownAction._byClipCacheIndex=byClipCacheIndex;knownActionsForClip[byClipCacheIndex]=lastKnownAction;knownActionsForClip.pop();action._byClipCacheIndex=null;const actionByRoot=actionsForClip.actionByRoot,rootUuid=(action._localRoot||this._root).uuid;delete actionByRoot[rootUuid];if(knownActionsForClip.length===0){delete actionsByClip[clipUuid];}this._removeInactiveBindingsForAction(action);}_removeInactiveBindingsForAction(action){const bindings=action._propertyBindings;for(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];if(--binding.referenceCount===0){this._removeInactiveBinding(binding);}}}_lendAction(action){// [ active actions | inactive actions ]\n// [ active actions >| inactive actions ]\n// s a\n// <-swap->\n// a s\nconst actions=this._actions,prevIndex=action._cacheIndex,lastActiveIndex=this._nActiveActions++,firstInactiveAction=actions[lastActiveIndex];action._cacheIndex=lastActiveIndex;actions[lastActiveIndex]=action;firstInactiveAction._cacheIndex=prevIndex;actions[prevIndex]=firstInactiveAction;}_takeBackAction(action){// [ active actions | inactive actions ]\n// [ active actions |< inactive actions ]\n// a s\n// <-swap->\n// s a\nconst actions=this._actions,prevIndex=action._cacheIndex,firstInactiveIndex=--this._nActiveActions,lastActiveAction=actions[firstInactiveIndex];action._cacheIndex=firstInactiveIndex;actions[firstInactiveIndex]=action;lastActiveAction._cacheIndex=prevIndex;actions[prevIndex]=lastActiveAction;}// Memory management for PropertyMixer objects\n_addInactiveBinding(binding,rootUuid,trackName){const bindingsByRoot=this._bindingsByRootAndName,bindings=this._bindings;let bindingByName=bindingsByRoot[rootUuid];if(bindingByName===undefined){bindingByName={};bindingsByRoot[rootUuid]=bindingByName;}bindingByName[trackName]=binding;binding._cacheIndex=bindings.length;bindings.push(binding);}_removeInactiveBinding(binding){const bindings=this._bindings,propBinding=binding.binding,rootUuid=propBinding.rootNode.uuid,trackName=propBinding.path,bindingsByRoot=this._bindingsByRootAndName,bindingByName=bindingsByRoot[rootUuid],lastInactiveBinding=bindings[bindings.length-1],cacheIndex=binding._cacheIndex;lastInactiveBinding._cacheIndex=cacheIndex;bindings[cacheIndex]=lastInactiveBinding;bindings.pop();delete bindingByName[trackName];if(_Object$keys(bindingByName).length===0){delete bindingsByRoot[rootUuid];}}_lendBinding(binding){const bindings=this._bindings,prevIndex=binding._cacheIndex,lastActiveIndex=this._nActiveBindings++,firstInactiveBinding=bindings[lastActiveIndex];binding._cacheIndex=lastActiveIndex;bindings[lastActiveIndex]=binding;firstInactiveBinding._cacheIndex=prevIndex;bindings[prevIndex]=firstInactiveBinding;}_takeBackBinding(binding){const bindings=this._bindings,prevIndex=binding._cacheIndex,firstInactiveIndex=--this._nActiveBindings,lastActiveBinding=bindings[firstInactiveIndex];binding._cacheIndex=firstInactiveIndex;bindings[firstInactiveIndex]=binding;lastActiveBinding._cacheIndex=prevIndex;bindings[prevIndex]=lastActiveBinding;}// Memory management of Interpolants for weight and time scale\n_lendControlInterpolant(){const interpolants=this._controlInterpolants,lastActiveIndex=this._nActiveControlInterpolants++;let interpolant=interpolants[lastActiveIndex];if(interpolant===undefined){interpolant=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,_controlInterpolantsResultBuffer);interpolant.__cacheIndex=lastActiveIndex;interpolants[lastActiveIndex]=interpolant;}return interpolant;}_takeBackControlInterpolant(interpolant){const interpolants=this._controlInterpolants,prevIndex=interpolant.__cacheIndex,firstInactiveIndex=--this._nActiveControlInterpolants,lastActiveInterpolant=interpolants[firstInactiveIndex];interpolant.__cacheIndex=firstInactiveIndex;interpolants[firstInactiveIndex]=interpolant;lastActiveInterpolant.__cacheIndex=prevIndex;interpolants[prevIndex]=lastActiveInterpolant;}// return an action for a clip optionally using a custom root target\n// object (this method allocates a lot of dynamic memory in case a\n// previously unknown clip/root combination is specified)\nclipAction(clip,optionalRoot,blendMode){const root=optionalRoot||this._root,rootUuid=root.uuid;let clipObject=typeof clip==='string'?AnimationClip.findByName(root,clip):clip;const clipUuid=clipObject!==null?clipObject.uuid:clip;const actionsForClip=this._actionsByClip[clipUuid];let prototypeAction=null;if(blendMode===undefined){if(clipObject!==null){blendMode=clipObject.blendMode;}else{blendMode=NormalAnimationBlendMode;}}if(actionsForClip!==undefined){const existingAction=actionsForClip.actionByRoot[rootUuid];if(existingAction!==undefined&&existingAction.blendMode===blendMode){return existingAction;}// we know the clip, so we don't have to parse all\n// the bindings again but can just copy\nprototypeAction=actionsForClip.knownActions[0];// also, take the clip from the prototype action\nif(clipObject===null)clipObject=prototypeAction._clip;}// clip must be known when specified via string\nif(clipObject===null)return null;// allocate all resources required to run it\nconst newAction=new AnimationAction(this,clipObject,optionalRoot,blendMode);this._bindAction(newAction,prototypeAction);// and make the action known to the memory manager\nthis._addInactiveAction(newAction,clipUuid,rootUuid);return newAction;}// get an existing action\nexistingAction(clip,optionalRoot){const root=optionalRoot||this._root,rootUuid=root.uuid,clipObject=typeof clip==='string'?AnimationClip.findByName(root,clip):clip,clipUuid=clipObject?clipObject.uuid:clip,actionsForClip=this._actionsByClip[clipUuid];if(actionsForClip!==undefined){return actionsForClip.actionByRoot[rootUuid]||null;}return null;}// deactivates all previously scheduled actions\nstopAllAction(){const actions=this._actions,nActions=this._nActiveActions;for(let i=nActions-1;i>=0;--i){actions[i].stop();}return this;}// advance the time and update apply the animation\nupdate(deltaTime){deltaTime*=this.timeScale;const actions=this._actions,nActions=this._nActiveActions,time=this.time+=deltaTime,timeDirection=_Math$sign(deltaTime),accuIndex=this._accuIndex^=1;// run active actions\nfor(let i=0;i!==nActions;++i){const action=actions[i];action._update(time,deltaTime,timeDirection,accuIndex);}// update scene graph\nconst bindings=this._bindings,nBindings=this._nActiveBindings;for(let i=0;i!==nBindings;++i){bindings[i].apply(accuIndex);}return this;}// Allows you to seek to a specific time in an animation.\nsetTime(timeInSeconds){this.time=0;// Zero out time attribute for AnimationMixer object;\nfor(let i=0;i<this._actions.length;i++){this._actions[i].time=0;// Zero out time attribute for all associated AnimationAction objects.\n}return this.update(timeInSeconds);// Update used to set exact time. Returns \"this\" AnimationMixer object.\n}// return this mixer's root target object\ngetRoot(){return this._root;}// free all resources specific to a particular clip\nuncacheClip(clip){const actions=this._actions,clipUuid=clip.uuid,actionsByClip=this._actionsByClip,actionsForClip=actionsByClip[clipUuid];if(actionsForClip!==undefined){// note: just calling _removeInactiveAction would mess up the\n// iteration state and also require updating the state we can\n// just throw away\nconst actionsToRemove=actionsForClip.knownActions;for(let i=0,n=actionsToRemove.length;i!==n;++i){const action=actionsToRemove[i];this._deactivateAction(action);const cacheIndex=action._cacheIndex,lastInactiveAction=actions[actions.length-1];action._cacheIndex=null;action._byClipCacheIndex=null;lastInactiveAction._cacheIndex=cacheIndex;actions[cacheIndex]=lastInactiveAction;actions.pop();this._removeInactiveBindingsForAction(action);}delete actionsByClip[clipUuid];}}// free all resources specific to a particular root target object\nuncacheRoot(root){const rootUuid=root.uuid,actionsByClip=this._actionsByClip;for(const clipUuid in actionsByClip){const actionByRoot=actionsByClip[clipUuid].actionByRoot,action=actionByRoot[rootUuid];if(action!==undefined){this._deactivateAction(action);this._removeInactiveAction(action);}}const bindingsByRoot=this._bindingsByRootAndName,bindingByName=bindingsByRoot[rootUuid];if(bindingByName!==undefined){for(const trackName in bindingByName){const binding=bindingByName[trackName];binding.restoreOriginalState();this._removeInactiveBinding(binding);}}}// remove a targeted clip from the cache\nuncacheAction(clip,optionalRoot){const action=this.existingAction(clip,optionalRoot);if(action!==null){this._deactivateAction(action);this._removeInactiveAction(action);}}}class Uniform{constructor(value){this.value=value;}clone(){return new Uniform(this.value.clone===undefined?this.value:this.value.clone());}}let id=0;class UniformsGroup extends (/* unused pure expression or super */ null && (EventDispatcher)){constructor(){super();this.isUniformsGroup=true;_Object$defineProperty(this,'id',{value:id++});this.name='';this.usage=StaticDrawUsage;this.uniforms=[];}add(uniform){this.uniforms.push(uniform);return this;}remove(uniform){var _context35,_context36;const index=_indexOfInstanceProperty(_context35=this.uniforms).call(_context35,uniform);if(index!==-1)_spliceInstanceProperty(_context36=this.uniforms).call(_context36,index,1);return this;}setName(name){this.name=name;return this;}setUsage(value){this.usage=value;return this;}dispose(){this.dispatchEvent({type:'dispose'});return this;}copy(source){this.name=source.name;this.usage=source.usage;const uniformsSource=source.uniforms;this.uniforms.length=0;for(let i=0,l=uniformsSource.length;i<l;i++){this.uniforms.push(uniformsSource[i].clone());}return this;}clone(){return new this.constructor().copy(this);}}class InstancedInterleavedBuffer extends (/* unused pure expression or super */ null && (InterleavedBuffer)){constructor(array,stride,meshPerAttribute=1){super(array,stride);this.isInstancedInterleavedBuffer=true;this.meshPerAttribute=meshPerAttribute;}copy(source){super.copy(source);this.meshPerAttribute=source.meshPerAttribute;return this;}clone(data){const ib=super.clone(data);ib.meshPerAttribute=this.meshPerAttribute;return ib;}toJSON(data){const json=super.toJSON(data);json.isInstancedInterleavedBuffer=true;json.meshPerAttribute=this.meshPerAttribute;return json;}}class GLBufferAttribute{constructor(buffer,type,itemSize,elementSize,count){this.isGLBufferAttribute=true;this.buffer=buffer;this.type=type;this.itemSize=itemSize;this.elementSize=elementSize;this.count=count;this.version=0;}set needsUpdate(value){if(value===true)this.version++;}setBuffer(buffer){this.buffer=buffer;return this;}setType(type,elementSize){this.type=type;this.elementSize=elementSize;return this;}setItemSize(itemSize){this.itemSize=itemSize;return this;}setCount(count){this.count=count;return this;}}class Raycaster{constructor(origin,direction,near=0,far=Infinity){this.ray=new Ray(origin,direction);// direction is assumed to be normalized (for accurate distance calculations)\nthis.near=near;this.far=far;this.camera=null;this.layers=new Layers();this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}};}set(origin,direction){// direction is assumed to be normalized (for accurate distance calculations)\nthis.ray.set(origin,direction);}setFromCamera(coords,camera){if(camera.isPerspectiveCamera){this.ray.origin.setFromMatrixPosition(camera.matrixWorld);this.ray.direction.set(coords.x,coords.y,0.5).unproject(camera).sub(this.ray.origin).normalize();this.camera=camera;}else if(camera.isOrthographicCamera){this.ray.origin.set(coords.x,coords.y,(camera.near+camera.far)/(camera.near-camera.far)).unproject(camera);// set origin in plane of camera\nthis.ray.direction.set(0,0,-1).transformDirection(camera.matrixWorld);this.camera=camera;}else{console.error('THREE.Raycaster: Unsupported camera type: '+camera.type);}}intersectObject(object,recursive=true,intersects=[]){intersectObject(object,this,intersects,recursive);_sortInstanceProperty(intersects).call(intersects,ascSort);return intersects;}intersectObjects(objects,recursive=true,intersects=[]){for(let i=0,l=objects.length;i<l;i++){intersectObject(objects[i],this,intersects,recursive);}_sortInstanceProperty(intersects).call(intersects,ascSort);return intersects;}}function ascSort(a,b){return a.distance-b.distance;}function intersectObject(object,raycaster,intersects,recursive){if(object.layers.test(raycaster.layers)){object.raycast(raycaster,intersects);}if(recursive===true){const children=object.children;for(let i=0,l=children.length;i<l;i++){intersectObject(children[i],raycaster,intersects,true);}}}/**\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n *\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\n * The azimuthal angle (theta) is measured from the positive z-axis.\n */class Spherical{constructor(radius=1,phi=0,theta=0){this.radius=radius;this.phi=phi;// polar angle\nthis.theta=theta;// azimuthal angle\nreturn this;}set(radius,phi,theta){this.radius=radius;this.phi=phi;this.theta=theta;return this;}copy(other){this.radius=other.radius;this.phi=other.phi;this.theta=other.theta;return this;}// restrict phi to be between EPS and PI-EPS\nmakeSafe(){const EPS=0.000001;this.phi=Math.max(EPS,Math.min(Math.PI-EPS,this.phi));return this;}setFromVector3(v){return this.setFromCartesianCoords(v.x,v.y,v.z);}setFromCartesianCoords(x,y,z){this.radius=Math.sqrt(x*x+y*y+z*z);if(this.radius===0){this.theta=0;this.phi=0;}else{this.theta=Math.atan2(x,z);this.phi=Math.acos(three_module_clamp(y/this.radius,-1,1));}return this;}clone(){return new this.constructor().copy(this);}}/**\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\n */class Cylindrical{constructor(radius=1,theta=0,y=0){this.radius=radius;// distance from the origin to a point in the x-z plane\nthis.theta=theta;// counterclockwise angle in the x-z plane measured in radians from the positive z-axis\nthis.y=y;// height above the x-z plane\nreturn this;}set(radius,theta,y){this.radius=radius;this.theta=theta;this.y=y;return this;}copy(other){this.radius=other.radius;this.theta=other.theta;this.y=other.y;return this;}setFromVector3(v){return this.setFromCartesianCoords(v.x,v.y,v.z);}setFromCartesianCoords(x,y,z){this.radius=Math.sqrt(x*x+z*z);this.theta=Math.atan2(x,z);this.y=y;return this;}clone(){return new this.constructor().copy(this);}}const _vector$4=/*@__PURE__*/new Vector2();class Box2{constructor(min=new Vector2(+Infinity,+Infinity),max=new Vector2(-Infinity,-Infinity)){this.isBox2=true;this.min=min;this.max=max;}set(min,max){this.min.copy(min);this.max.copy(max);return this;}setFromPoints(points){this.makeEmpty();for(let i=0,il=points.length;i<il;i++){this.expandByPoint(points[i]);}return this;}setFromCenterAndSize(center,size){const halfSize=_vector$4.copy(size).multiplyScalar(0.5);this.min.copy(center).sub(halfSize);this.max.copy(center).add(halfSize);return this;}clone(){return new this.constructor().copy(this);}copy(box){this.min.copy(box.min);this.max.copy(box.max);return this;}makeEmpty(){this.min.x=this.min.y=+Infinity;this.max.x=this.max.y=-Infinity;return this;}isEmpty(){// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\nreturn this.max.x<this.min.x||this.max.y<this.min.y;}getCenter(target){return this.isEmpty()?target.set(0,0):target.addVectors(this.min,this.max).multiplyScalar(0.5);}getSize(target){return this.isEmpty()?target.set(0,0):target.subVectors(this.max,this.min);}expandByPoint(point){this.min.min(point);this.max.max(point);return this;}expandByVector(vector){this.min.sub(vector);this.max.add(vector);return this;}expandByScalar(scalar){this.min.addScalar(-scalar);this.max.addScalar(scalar);return this;}containsPoint(point){return point.x<this.min.x||point.x>this.max.x||point.y<this.min.y||point.y>this.max.y?false:true;}containsBox(box){return this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y;}getParameter(point,target){// This can potentially have a divide by zero if the box\n// has a size dimension of 0.\nreturn target.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y));}intersectsBox(box){// using 4 splitting planes to rule out intersections\nreturn box.max.x<this.min.x||box.min.x>this.max.x||box.max.y<this.min.y||box.min.y>this.max.y?false:true;}clampPoint(point,target){return target.copy(point).clamp(this.min,this.max);}distanceToPoint(point){const clampedPoint=_vector$4.copy(point).clamp(this.min,this.max);return clampedPoint.sub(point).length();}intersect(box){this.min.max(box.min);this.max.min(box.max);return this;}union(box){this.min.min(box.min);this.max.max(box.max);return this;}translate(offset){this.min.add(offset);this.max.add(offset);return this;}equals(box){return box.min.equals(this.min)&&box.max.equals(this.max);}}const _startP=/*@__PURE__*/new three_module_Vector3();const _startEnd=/*@__PURE__*/new three_module_Vector3();class Line3{constructor(start=new three_module_Vector3(),end=new three_module_Vector3()){this.start=start;this.end=end;}set(start,end){this.start.copy(start);this.end.copy(end);return this;}copy(line){this.start.copy(line.start);this.end.copy(line.end);return this;}getCenter(target){return target.addVectors(this.start,this.end).multiplyScalar(0.5);}delta(target){return target.subVectors(this.end,this.start);}distanceSq(){return this.start.distanceToSquared(this.end);}distance(){return this.start.distanceTo(this.end);}at(t,target){return this.delta(target).multiplyScalar(t).add(this.start);}closestPointToPointParameter(point,clampToLine){_startP.subVectors(point,this.start);_startEnd.subVectors(this.end,this.start);const startEnd2=_startEnd.dot(_startEnd);const startEnd_startP=_startEnd.dot(_startP);let t=startEnd_startP/startEnd2;if(clampToLine){t=three_module_clamp(t,0,1);}return t;}closestPointToPoint(point,clampToLine,target){const t=this.closestPointToPointParameter(point,clampToLine);return this.delta(target).multiplyScalar(t).add(this.start);}applyMatrix4(matrix){this.start.applyMatrix4(matrix);this.end.applyMatrix4(matrix);return this;}equals(line){return line.start.equals(this.start)&&line.end.equals(this.end);}clone(){return new this.constructor().copy(this);}}const _vector$3=/*@__PURE__*/new three_module_Vector3();class SpotLightHelper extends (/* unused pure expression or super */ null && (Object3D)){constructor(light,color){super();this.light=light;this.light.updateMatrixWorld();this.matrix=light.matrixWorld;this.matrixAutoUpdate=false;this.color=color;const geometry=new BufferGeometry();const positions=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let i=0,j=1,l=32;i<l;i++,j++){const p1=i/l*Math.PI*2;const p2=j/l*Math.PI*2;positions.push(Math.cos(p1),Math.sin(p1),1,Math.cos(p2),Math.sin(p2),1);}geometry.setAttribute('position',new Float32BufferAttribute(positions,3));const material=new LineBasicMaterial({fog:false,toneMapped:false});this.cone=new LineSegments(geometry,material);this.add(this.cone);this.update();}dispose(){this.cone.geometry.dispose();this.cone.material.dispose();}update(){this.light.updateMatrixWorld();const coneLength=this.light.distance?this.light.distance:1000;const coneWidth=coneLength*Math.tan(this.light.angle);this.cone.scale.set(coneWidth,coneWidth,coneLength);_vector$3.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(_vector$3);if(this.color!==undefined){this.cone.material.color.set(this.color);}else{this.cone.material.color.copy(this.light.color);}}}const _vector$2=/*@__PURE__*/new three_module_Vector3();const _boneMatrix=/*@__PURE__*/new Matrix4();const _matrixWorldInv=/*@__PURE__*/new Matrix4();class SkeletonHelper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(object){const bones=getBoneList(object);const geometry=new BufferGeometry();const vertices=[];const colors=[];const color1=new Color(0,0,1);const color2=new Color(0,1,0);for(let i=0;i<bones.length;i++){const bone=bones[i];if(bone.parent&&bone.parent.isBone){vertices.push(0,0,0);vertices.push(0,0,0);colors.push(color1.r,color1.g,color1.b);colors.push(color2.r,color2.g,color2.b);}}geometry.setAttribute('position',new Float32BufferAttribute(vertices,3));geometry.setAttribute('color',new Float32BufferAttribute(colors,3));const material=new LineBasicMaterial({vertexColors:true,depthTest:false,depthWrite:false,toneMapped:false,transparent:true});super(geometry,material);this.isSkeletonHelper=true;this.type='SkeletonHelper';this.root=object;this.bones=bones;this.matrix=object.matrixWorld;this.matrixAutoUpdate=false;}updateMatrixWorld(force){const bones=this.bones;const geometry=this.geometry;const position=geometry.getAttribute('position');_matrixWorldInv.copy(this.root.matrixWorld).invert();for(let i=0,j=0;i<bones.length;i++){const bone=bones[i];if(bone.parent&&bone.parent.isBone){_boneMatrix.multiplyMatrices(_matrixWorldInv,bone.matrixWorld);_vector$2.setFromMatrixPosition(_boneMatrix);position.setXYZ(j,_vector$2.x,_vector$2.y,_vector$2.z);_boneMatrix.multiplyMatrices(_matrixWorldInv,bone.parent.matrixWorld);_vector$2.setFromMatrixPosition(_boneMatrix);position.setXYZ(j+1,_vector$2.x,_vector$2.y,_vector$2.z);j+=2;}}geometry.getAttribute('position').needsUpdate=true;super.updateMatrixWorld(force);}dispose(){this.geometry.dispose();this.material.dispose();}}function getBoneList(object){const boneList=[];if(object.isBone===true){boneList.push(object);}for(let i=0;i<object.children.length;i++){boneList.push.apply(boneList,getBoneList(object.children[i]));}return boneList;}class PointLightHelper extends (/* unused pure expression or super */ null && (Mesh)){constructor(light,sphereSize,color){const geometry=new SphereGeometry(sphereSize,4,2);const material=new MeshBasicMaterial({wireframe:true,fog:false,toneMapped:false});super(geometry,material);this.light=light;this.light.updateMatrixWorld();this.color=color;this.type='PointLightHelper';this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=false;this.update();/*\n\t// TODO: delete this comment?\n\tconst distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );\n\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\tconst d = light.distance;\n\n\tif ( d === 0.0 ) {\n\n\t\tthis.lightDistance.visible = false;\n\n\t} else {\n\n\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t}\n\n\tthis.add( this.lightDistance );\n\t*/}dispose(){this.geometry.dispose();this.material.dispose();}update(){if(this.color!==undefined){this.material.color.set(this.color);}else{this.material.color.copy(this.light.color);}/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/}}const _vector$1=/*@__PURE__*/new three_module_Vector3();const _color1=/*@__PURE__*/new Color();const _color2=/*@__PURE__*/new Color();class HemisphereLightHelper extends (/* unused pure expression or super */ null && (Object3D)){constructor(light,size,color){super();this.light=light;this.light.updateMatrixWorld();this.matrix=light.matrixWorld;this.matrixAutoUpdate=false;this.color=color;const geometry=new OctahedronGeometry(size);geometry.rotateY(Math.PI*0.5);this.material=new MeshBasicMaterial({wireframe:true,fog:false,toneMapped:false});if(this.color===undefined)this.material.vertexColors=true;const position=geometry.getAttribute('position');const colors=new Float32Array(position.count*3);geometry.setAttribute('color',new BufferAttribute(colors,3));this.add(new Mesh(geometry,this.material));this.update();}dispose(){this.children[0].geometry.dispose();this.children[0].material.dispose();}update(){const mesh=this.children[0];if(this.color!==undefined){this.material.color.set(this.color);}else{const colors=mesh.geometry.getAttribute('color');_color1.copy(this.light.color);_color2.copy(this.light.groundColor);for(let i=0,l=colors.count;i<l;i++){const color=i<l/2?_color1:_color2;colors.setXYZ(i,color.r,color.g,color.b);}colors.needsUpdate=true;}mesh.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate());}}class GridHelper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(size=10,divisions=10,color1=0x444444,color2=0x888888){color1=new Color(color1);color2=new Color(color2);const center=divisions/2;const step=size/divisions;const halfSize=size/2;const vertices=[],colors=[];for(let i=0,j=0,k=-halfSize;i<=divisions;i++,k+=step){vertices.push(-halfSize,0,k,halfSize,0,k);vertices.push(k,0,-halfSize,k,0,halfSize);const color=i===center?color1:color2;color.toArray(colors,j);j+=3;color.toArray(colors,j);j+=3;color.toArray(colors,j);j+=3;color.toArray(colors,j);j+=3;}const geometry=new BufferGeometry();geometry.setAttribute('position',new Float32BufferAttribute(vertices,3));geometry.setAttribute('color',new Float32BufferAttribute(colors,3));const material=new LineBasicMaterial({vertexColors:true,toneMapped:false});super(geometry,material);this.type='GridHelper';}dispose(){this.geometry.dispose();this.material.dispose();}}class PolarGridHelper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(radius=10,sectors=16,rings=8,divisions=64,color1=0x444444,color2=0x888888){color1=new Color(color1);color2=new Color(color2);const vertices=[];const colors=[];// create the sectors\nif(sectors>1){for(let i=0;i<sectors;i++){const v=i/sectors*(Math.PI*2);const x=Math.sin(v)*radius;const z=Math.cos(v)*radius;vertices.push(0,0,0);vertices.push(x,0,z);const color=i&1?color1:color2;colors.push(color.r,color.g,color.b);colors.push(color.r,color.g,color.b);}}// create the rings\nfor(let i=0;i<rings;i++){const color=i&1?color1:color2;const r=radius-radius/rings*i;for(let j=0;j<divisions;j++){// first vertex\nlet v=j/divisions*(Math.PI*2);let x=Math.sin(v)*r;let z=Math.cos(v)*r;vertices.push(x,0,z);colors.push(color.r,color.g,color.b);// second vertex\nv=(j+1)/divisions*(Math.PI*2);x=Math.sin(v)*r;z=Math.cos(v)*r;vertices.push(x,0,z);colors.push(color.r,color.g,color.b);}}const geometry=new BufferGeometry();geometry.setAttribute('position',new Float32BufferAttribute(vertices,3));geometry.setAttribute('color',new Float32BufferAttribute(colors,3));const material=new LineBasicMaterial({vertexColors:true,toneMapped:false});super(geometry,material);this.type='PolarGridHelper';}dispose(){this.geometry.dispose();this.material.dispose();}}const three_module_v1=/*@__PURE__*/new three_module_Vector3();const three_module_v2=/*@__PURE__*/new three_module_Vector3();const three_module_v3=/*@__PURE__*/new three_module_Vector3();class DirectionalLightHelper extends (/* unused pure expression or super */ null && (Object3D)){constructor(light,size,color){super();this.light=light;this.light.updateMatrixWorld();this.matrix=light.matrixWorld;this.matrixAutoUpdate=false;this.color=color;if(size===undefined)size=1;let geometry=new BufferGeometry();geometry.setAttribute('position',new Float32BufferAttribute([-size,size,0,size,size,0,size,-size,0,-size,-size,0,-size,size,0],3));const material=new LineBasicMaterial({fog:false,toneMapped:false});this.lightPlane=new Line(geometry,material);this.add(this.lightPlane);geometry=new BufferGeometry();geometry.setAttribute('position',new Float32BufferAttribute([0,0,0,0,0,1],3));this.targetLine=new Line(geometry,material);this.add(this.targetLine);this.update();}dispose(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose();}update(){three_module_v1.setFromMatrixPosition(this.light.matrixWorld);three_module_v2.setFromMatrixPosition(this.light.target.matrixWorld);three_module_v3.subVectors(three_module_v2,three_module_v1);this.lightPlane.lookAt(three_module_v2);if(this.color!==undefined){this.lightPlane.material.color.set(this.color);this.targetLine.material.color.set(this.color);}else{this.lightPlane.material.color.copy(this.light.color);this.targetLine.material.color.copy(this.light.color);}this.targetLine.lookAt(three_module_v2);this.targetLine.scale.z=three_module_v3.length();}}const three_module_vector=/*@__PURE__*/new three_module_Vector3();const _camera=/*@__PURE__*/new Camera();/**\n *\t- shows frustum, line of sight and up of the camera\n *\t- suitable for fast updates\n * \t- based on frustum visualization in lightgl.js shadowmap example\n *\t\thttps://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html\n */class CameraHelper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(camera){const geometry=new BufferGeometry();const material=new LineBasicMaterial({color:0xffffff,vertexColors:true,toneMapped:false});const vertices=[];const colors=[];const pointMap={};// near\naddLine('n1','n2');addLine('n2','n4');addLine('n4','n3');addLine('n3','n1');// far\naddLine('f1','f2');addLine('f2','f4');addLine('f4','f3');addLine('f3','f1');// sides\naddLine('n1','f1');addLine('n2','f2');addLine('n3','f3');addLine('n4','f4');// cone\naddLine('p','n1');addLine('p','n2');addLine('p','n3');addLine('p','n4');// up\naddLine('u1','u2');addLine('u2','u3');addLine('u3','u1');// target\naddLine('c','t');addLine('p','c');// cross\naddLine('cn1','cn2');addLine('cn3','cn4');addLine('cf1','cf2');addLine('cf3','cf4');function addLine(a,b){addPoint(a);addPoint(b);}function addPoint(id){vertices.push(0,0,0);colors.push(0,0,0);if(pointMap[id]===undefined){pointMap[id]=[];}pointMap[id].push(vertices.length/3-1);}geometry.setAttribute('position',new Float32BufferAttribute(vertices,3));geometry.setAttribute('color',new Float32BufferAttribute(colors,3));super(geometry,material);this.type='CameraHelper';this.camera=camera;if(this.camera.updateProjectionMatrix)this.camera.updateProjectionMatrix();this.matrix=camera.matrixWorld;this.matrixAutoUpdate=false;this.pointMap=pointMap;this.update();// colors\nconst colorFrustum=new Color(0xffaa00);const colorCone=new Color(0xff0000);const colorUp=new Color(0x00aaff);const colorTarget=new Color(0xffffff);const colorCross=new Color(0x333333);this.setColors(colorFrustum,colorCone,colorUp,colorTarget,colorCross);}setColors(frustum,cone,up,target,cross){const geometry=this.geometry;const colorAttribute=geometry.getAttribute('color');// near\ncolorAttribute.setXYZ(0,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(1,frustum.r,frustum.g,frustum.b);// n1, n2\ncolorAttribute.setXYZ(2,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(3,frustum.r,frustum.g,frustum.b);// n2, n4\ncolorAttribute.setXYZ(4,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(5,frustum.r,frustum.g,frustum.b);// n4, n3\ncolorAttribute.setXYZ(6,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(7,frustum.r,frustum.g,frustum.b);// n3, n1\n// far\ncolorAttribute.setXYZ(8,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(9,frustum.r,frustum.g,frustum.b);// f1, f2\ncolorAttribute.setXYZ(10,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(11,frustum.r,frustum.g,frustum.b);// f2, f4\ncolorAttribute.setXYZ(12,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(13,frustum.r,frustum.g,frustum.b);// f4, f3\ncolorAttribute.setXYZ(14,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(15,frustum.r,frustum.g,frustum.b);// f3, f1\n// sides\ncolorAttribute.setXYZ(16,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(17,frustum.r,frustum.g,frustum.b);// n1, f1\ncolorAttribute.setXYZ(18,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(19,frustum.r,frustum.g,frustum.b);// n2, f2\ncolorAttribute.setXYZ(20,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(21,frustum.r,frustum.g,frustum.b);// n3, f3\ncolorAttribute.setXYZ(22,frustum.r,frustum.g,frustum.b);colorAttribute.setXYZ(23,frustum.r,frustum.g,frustum.b);// n4, f4\n// cone\ncolorAttribute.setXYZ(24,cone.r,cone.g,cone.b);colorAttribute.setXYZ(25,cone.r,cone.g,cone.b);// p, n1\ncolorAttribute.setXYZ(26,cone.r,cone.g,cone.b);colorAttribute.setXYZ(27,cone.r,cone.g,cone.b);// p, n2\ncolorAttribute.setXYZ(28,cone.r,cone.g,cone.b);colorAttribute.setXYZ(29,cone.r,cone.g,cone.b);// p, n3\ncolorAttribute.setXYZ(30,cone.r,cone.g,cone.b);colorAttribute.setXYZ(31,cone.r,cone.g,cone.b);// p, n4\n// up\ncolorAttribute.setXYZ(32,up.r,up.g,up.b);colorAttribute.setXYZ(33,up.r,up.g,up.b);// u1, u2\ncolorAttribute.setXYZ(34,up.r,up.g,up.b);colorAttribute.setXYZ(35,up.r,up.g,up.b);// u2, u3\ncolorAttribute.setXYZ(36,up.r,up.g,up.b);colorAttribute.setXYZ(37,up.r,up.g,up.b);// u3, u1\n// target\ncolorAttribute.setXYZ(38,target.r,target.g,target.b);colorAttribute.setXYZ(39,target.r,target.g,target.b);// c, t\ncolorAttribute.setXYZ(40,cross.r,cross.g,cross.b);colorAttribute.setXYZ(41,cross.r,cross.g,cross.b);// p, c\n// cross\ncolorAttribute.setXYZ(42,cross.r,cross.g,cross.b);colorAttribute.setXYZ(43,cross.r,cross.g,cross.b);// cn1, cn2\ncolorAttribute.setXYZ(44,cross.r,cross.g,cross.b);colorAttribute.setXYZ(45,cross.r,cross.g,cross.b);// cn3, cn4\ncolorAttribute.setXYZ(46,cross.r,cross.g,cross.b);colorAttribute.setXYZ(47,cross.r,cross.g,cross.b);// cf1, cf2\ncolorAttribute.setXYZ(48,cross.r,cross.g,cross.b);colorAttribute.setXYZ(49,cross.r,cross.g,cross.b);// cf3, cf4\ncolorAttribute.needsUpdate=true;}update(){const geometry=this.geometry;const pointMap=this.pointMap;const w=1,h=1;// we need just camera projection matrix inverse\n// world matrix must be identity\n_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);// center / target\nsetPoint('c',pointMap,geometry,_camera,0,0,-1);setPoint('t',pointMap,geometry,_camera,0,0,1);// near\nsetPoint('n1',pointMap,geometry,_camera,-w,-h,-1);setPoint('n2',pointMap,geometry,_camera,w,-h,-1);setPoint('n3',pointMap,geometry,_camera,-w,h,-1);setPoint('n4',pointMap,geometry,_camera,w,h,-1);// far\nsetPoint('f1',pointMap,geometry,_camera,-w,-h,1);setPoint('f2',pointMap,geometry,_camera,w,-h,1);setPoint('f3',pointMap,geometry,_camera,-w,h,1);setPoint('f4',pointMap,geometry,_camera,w,h,1);// up\nsetPoint('u1',pointMap,geometry,_camera,w*0.7,h*1.1,-1);setPoint('u2',pointMap,geometry,_camera,-w*0.7,h*1.1,-1);setPoint('u3',pointMap,geometry,_camera,0,h*2,-1);// cross\nsetPoint('cf1',pointMap,geometry,_camera,-w,0,1);setPoint('cf2',pointMap,geometry,_camera,w,0,1);setPoint('cf3',pointMap,geometry,_camera,0,-h,1);setPoint('cf4',pointMap,geometry,_camera,0,h,1);setPoint('cn1',pointMap,geometry,_camera,-w,0,-1);setPoint('cn2',pointMap,geometry,_camera,w,0,-1);setPoint('cn3',pointMap,geometry,_camera,0,-h,-1);setPoint('cn4',pointMap,geometry,_camera,0,h,-1);geometry.getAttribute('position').needsUpdate=true;}dispose(){this.geometry.dispose();this.material.dispose();}}function setPoint(point,pointMap,geometry,camera,x,y,z){three_module_vector.set(x,y,z).unproject(camera);const points=pointMap[point];if(points!==undefined){const position=geometry.getAttribute('position');for(let i=0,l=points.length;i<l;i++){position.setXYZ(points[i],three_module_vector.x,three_module_vector.y,three_module_vector.z);}}}const _box=/*@__PURE__*/new Box3();class BoxHelper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(object,color=0xffff00){const indices=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);const positions=new Float32Array(8*3);const geometry=new BufferGeometry();geometry.setIndex(new BufferAttribute(indices,1));geometry.setAttribute('position',new BufferAttribute(positions,3));super(geometry,new LineBasicMaterial({color:color,toneMapped:false}));this.object=object;this.type='BoxHelper';this.matrixAutoUpdate=false;this.update();}update(object){if(object!==undefined){console.warn('THREE.BoxHelper: .update() has no longer arguments.');}if(this.object!==undefined){_box.setFromObject(this.object);}if(_box.isEmpty())return;const min=_box.min;const max=_box.max;/*\n\t\t\t5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/const position=this.geometry.attributes.position;const array=position.array;array[0]=max.x;array[1]=max.y;array[2]=max.z;array[3]=min.x;array[4]=max.y;array[5]=max.z;array[6]=min.x;array[7]=min.y;array[8]=max.z;array[9]=max.x;array[10]=min.y;array[11]=max.z;array[12]=max.x;array[13]=max.y;array[14]=min.z;array[15]=min.x;array[16]=max.y;array[17]=min.z;array[18]=min.x;array[19]=min.y;array[20]=min.z;array[21]=max.x;array[22]=min.y;array[23]=min.z;position.needsUpdate=true;this.geometry.computeBoundingSphere();}setFromObject(object){this.object=object;this.update();return this;}copy(source,recursive){super.copy(source,recursive);this.object=source.object;return this;}dispose(){this.geometry.dispose();this.material.dispose();}}class Box3Helper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(box,color=0xffff00){const indices=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);const positions=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1];const geometry=new BufferGeometry();geometry.setIndex(new BufferAttribute(indices,1));geometry.setAttribute('position',new Float32BufferAttribute(positions,3));super(geometry,new LineBasicMaterial({color:color,toneMapped:false}));this.box=box;this.type='Box3Helper';this.geometry.computeBoundingSphere();}updateMatrixWorld(force){const box=this.box;if(box.isEmpty())return;box.getCenter(this.position);box.getSize(this.scale);this.scale.multiplyScalar(0.5);super.updateMatrixWorld(force);}dispose(){this.geometry.dispose();this.material.dispose();}}class PlaneHelper extends (/* unused pure expression or super */ null && (Line)){constructor(plane,size=1,hex=0xffff00){const color=hex;const positions=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0];const geometry=new BufferGeometry();geometry.setAttribute('position',new Float32BufferAttribute(positions,3));geometry.computeBoundingSphere();super(geometry,new LineBasicMaterial({color:color,toneMapped:false}));this.type='PlaneHelper';this.plane=plane;this.size=size;const positions2=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0];const geometry2=new BufferGeometry();geometry2.setAttribute('position',new Float32BufferAttribute(positions2,3));geometry2.computeBoundingSphere();this.add(new Mesh(geometry2,new MeshBasicMaterial({color:color,opacity:0.2,transparent:true,depthWrite:false,toneMapped:false})));}updateMatrixWorld(force){this.position.set(0,0,0);this.scale.set(0.5*this.size,0.5*this.size,1);this.lookAt(this.plane.normal);this.translateZ(-this.plane.constant);super.updateMatrixWorld(force);}dispose(){this.geometry.dispose();this.material.dispose();this.children[0].geometry.dispose();this.children[0].material.dispose();}}const _axis=/*@__PURE__*/new three_module_Vector3();let _lineGeometry,_coneGeometry;class ArrowHelper extends (/* unused pure expression or super */ null && (Object3D)){// dir is assumed to be normalized\nconstructor(dir=new three_module_Vector3(0,0,1),origin=new three_module_Vector3(0,0,0),length=1,color=0xffff00,headLength=length*0.2,headWidth=headLength*0.2){super();this.type='ArrowHelper';if(_lineGeometry===undefined){_lineGeometry=new BufferGeometry();_lineGeometry.setAttribute('position',new Float32BufferAttribute([0,0,0,0,1,0],3));_coneGeometry=new CylinderGeometry(0,0.5,1,5,1);_coneGeometry.translate(0,-0.5,0);}this.position.copy(origin);this.line=new Line(_lineGeometry,new LineBasicMaterial({color:color,toneMapped:false}));this.line.matrixAutoUpdate=false;this.add(this.line);this.cone=new Mesh(_coneGeometry,new MeshBasicMaterial({color:color,toneMapped:false}));this.cone.matrixAutoUpdate=false;this.add(this.cone);this.setDirection(dir);this.setLength(length,headLength,headWidth);}setDirection(dir){// dir is assumed to be normalized\nif(dir.y>0.99999){this.quaternion.set(0,0,0,1);}else if(dir.y<-0.99999){this.quaternion.set(1,0,0,0);}else{_axis.set(dir.z,0,-dir.x).normalize();const radians=Math.acos(dir.y);this.quaternion.setFromAxisAngle(_axis,radians);}}setLength(length,headLength=length*0.2,headWidth=headLength*0.2){this.line.scale.set(1,Math.max(0.0001,length-headLength),1);// see #17458\nthis.line.updateMatrix();this.cone.scale.set(headWidth,headLength,headWidth);this.cone.position.y=length;this.cone.updateMatrix();}setColor(color){this.line.material.color.set(color);this.cone.material.color.set(color);}copy(source){super.copy(source,false);this.line.copy(source.line);this.cone.copy(source.cone);return this;}dispose(){this.line.geometry.dispose();this.line.material.dispose();this.cone.geometry.dispose();this.cone.material.dispose();}}class AxesHelper extends (/* unused pure expression or super */ null && (LineSegments)){constructor(size=1){const vertices=[0,0,0,size,0,0,0,0,0,0,size,0,0,0,0,0,0,size];const colors=[1,0,0,1,0.6,0,0,1,0,0.6,1,0,0,0,1,0,0.6,1];const geometry=new BufferGeometry();geometry.setAttribute('position',new Float32BufferAttribute(vertices,3));geometry.setAttribute('color',new Float32BufferAttribute(colors,3));const material=new LineBasicMaterial({vertexColors:true,toneMapped:false});super(geometry,material);this.type='AxesHelper';}setColors(xAxisColor,yAxisColor,zAxisColor){const color=new Color();const array=this.geometry.attributes.color.array;color.set(xAxisColor);color.toArray(array,0);color.toArray(array,3);color.set(yAxisColor);color.toArray(array,6);color.toArray(array,9);color.set(zAxisColor);color.toArray(array,12);color.toArray(array,15);this.geometry.attributes.color.needsUpdate=true;return this;}dispose(){this.geometry.dispose();this.material.dispose();}}class ShapePath{constructor(){this.type='ShapePath';this.color=new Color();this.subPaths=[];this.currentPath=null;}moveTo(x,y){this.currentPath=new Path();this.subPaths.push(this.currentPath);this.currentPath.moveTo(x,y);return this;}lineTo(x,y){this.currentPath.lineTo(x,y);return this;}quadraticCurveTo(aCPx,aCPy,aX,aY){this.currentPath.quadraticCurveTo(aCPx,aCPy,aX,aY);return this;}bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY){this.currentPath.bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY);return this;}splineThru(pts){this.currentPath.splineThru(pts);return this;}toShapes(isCCW){function toShapesNoHoles(inSubpaths){const shapes=[];for(let i=0,l=inSubpaths.length;i<l;i++){const tmpPath=inSubpaths[i];const tmpShape=new Shape();tmpShape.curves=tmpPath.curves;shapes.push(tmpShape);}return shapes;}function isPointInsidePolygon(inPt,inPolygon){const polyLen=inPolygon.length;// inPt on polygon contour => immediate success or\n// toggling of inside/outside at every single! intersection point of an edge\n// with the horizontal line through inPt, left of inPt\n// not counting lowerY endpoints of edges and whole edges on that line\nlet inside=false;for(let p=polyLen-1,q=0;q<polyLen;p=q++){let edgeLowPt=inPolygon[p];let edgeHighPt=inPolygon[q];let edgeDx=edgeHighPt.x-edgeLowPt.x;let edgeDy=edgeHighPt.y-edgeLowPt.y;if(Math.abs(edgeDy)>_Number$EPSILON){// not parallel\nif(edgeDy<0){edgeLowPt=inPolygon[q];edgeDx=-edgeDx;edgeHighPt=inPolygon[p];edgeDy=-edgeDy;}if(inPt.y<edgeLowPt.y||inPt.y>edgeHighPt.y)continue;if(inPt.y===edgeLowPt.y){if(inPt.x===edgeLowPt.x)return true;// inPt is on contour ?\n// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n}else{const perpEdge=edgeDy*(inPt.x-edgeLowPt.x)-edgeDx*(inPt.y-edgeLowPt.y);if(perpEdge===0)return true;// inPt is on contour ?\nif(perpEdge<0)continue;inside=!inside;// true intersection left of inPt\n}}else{// parallel or collinear\nif(inPt.y!==edgeLowPt.y)continue;// parallel\n// edge lies on the same horizontal line as inPt\nif(edgeHighPt.x<=inPt.x&&inPt.x<=edgeLowPt.x||edgeLowPt.x<=inPt.x&&inPt.x<=edgeHighPt.x)return true;// inPt: Point on contour !\n// continue;\n}}return inside;}const isClockWise=ShapeUtils.isClockWise;const subPaths=this.subPaths;if(subPaths.length===0)return[];let solid,tmpPath,tmpShape;const shapes=[];if(subPaths.length===1){tmpPath=subPaths[0];tmpShape=new Shape();tmpShape.curves=tmpPath.curves;shapes.push(tmpShape);return shapes;}let holesFirst=!isClockWise(subPaths[0].getPoints());holesFirst=isCCW?!holesFirst:holesFirst;// console.log(\"Holes first\", holesFirst);\nconst betterShapeHoles=[];const newShapes=[];let newShapeHoles=[];let mainIdx=0;let tmpPoints;newShapes[mainIdx]=undefined;newShapeHoles[mainIdx]=[];for(let i=0,l=subPaths.length;i<l;i++){tmpPath=subPaths[i];tmpPoints=tmpPath.getPoints();solid=isClockWise(tmpPoints);solid=isCCW?!solid:solid;if(solid){if(!holesFirst&&newShapes[mainIdx])mainIdx++;newShapes[mainIdx]={s:new Shape(),p:tmpPoints};newShapes[mainIdx].s.curves=tmpPath.curves;if(holesFirst)mainIdx++;newShapeHoles[mainIdx]=[];//console.log('cw', i);\n}else{newShapeHoles[mainIdx].push({h:tmpPath,p:tmpPoints[0]});//console.log('ccw', i);\n}}// only Holes? -> probably all Shapes with wrong orientation\nif(!newShapes[0])return toShapesNoHoles(subPaths);if(newShapes.length>1){let ambiguous=false;let toChange=0;for(let sIdx=0,sLen=newShapes.length;sIdx<sLen;sIdx++){betterShapeHoles[sIdx]=[];}for(let sIdx=0,sLen=newShapes.length;sIdx<sLen;sIdx++){const sho=newShapeHoles[sIdx];for(let hIdx=0;hIdx<sho.length;hIdx++){const ho=sho[hIdx];let hole_unassigned=true;for(let s2Idx=0;s2Idx<newShapes.length;s2Idx++){if(isPointInsidePolygon(ho.p,newShapes[s2Idx].p)){if(sIdx!==s2Idx)toChange++;if(hole_unassigned){hole_unassigned=false;betterShapeHoles[s2Idx].push(ho);}else{ambiguous=true;}}}if(hole_unassigned){betterShapeHoles[sIdx].push(ho);}}}if(toChange>0&&ambiguous===false){newShapeHoles=betterShapeHoles;}}let tmpHoles;for(let i=0,il=newShapes.length;i<il;i++){tmpShape=newShapes[i].s;shapes.push(tmpShape);tmpHoles=newShapeHoles[i];for(let j=0,jl=tmpHoles.length;j<jl;j++){tmpShape.holes.push(tmpHoles[j].h);}}//console.log(\"shape\", shapes);\nreturn shapes;}}// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\nconst _tables=/*@__PURE__*/_generateTables();function _generateTables(){// float32 to float16 helpers\nconst buffer=new ArrayBuffer(4);const floatView=new Float32Array(buffer);const uint32View=new Uint32Array(buffer);const baseTable=new Uint32Array(512);const shiftTable=new Uint32Array(512);for(let i=0;i<256;++i){const e=i-127;// very small number (0, -0)\nif(e<-27){baseTable[i]=0x0000;baseTable[i|0x100]=0x8000;shiftTable[i]=24;shiftTable[i|0x100]=24;// small number (denorm)\n}else if(e<-14){baseTable[i]=0x0400>>-e-14;baseTable[i|0x100]=0x0400>>-e-14|0x8000;shiftTable[i]=-e-1;shiftTable[i|0x100]=-e-1;// normal number\n}else if(e<=15){baseTable[i]=e+15<<10;baseTable[i|0x100]=e+15<<10|0x8000;shiftTable[i]=13;shiftTable[i|0x100]=13;// large number (Infinity, -Infinity)\n}else if(e<128){baseTable[i]=0x7c00;baseTable[i|0x100]=0xfc00;shiftTable[i]=24;shiftTable[i|0x100]=24;// stay (NaN, Infinity, -Infinity)\n}else{baseTable[i]=0x7c00;baseTable[i|0x100]=0xfc00;shiftTable[i]=13;shiftTable[i|0x100]=13;}}// float16 to float32 helpers\nconst mantissaTable=new Uint32Array(2048);const exponentTable=new Uint32Array(64);const offsetTable=new Uint32Array(64);for(let i=1;i<1024;++i){let m=i<<13;// zero pad mantissa bits\nlet e=0;// zero exponent\n// normalized\nwhile((m&0x00800000)===0){m<<=1;e-=0x00800000;// decrement exponent\n}m&=~0x00800000;// clear leading 1 bit\ne+=0x38800000;// adjust bias\nmantissaTable[i]=m|e;}for(let i=1024;i<2048;++i){mantissaTable[i]=0x38000000+(i-1024<<13);}for(let i=1;i<31;++i){exponentTable[i]=i<<23;}exponentTable[31]=0x47800000;exponentTable[32]=0x80000000;for(let i=33;i<63;++i){exponentTable[i]=0x80000000+(i-32<<23);}exponentTable[63]=0xc7800000;for(let i=1;i<64;++i){if(i!==32){offsetTable[i]=1024;}}return{floatView:floatView,uint32View:uint32View,baseTable:baseTable,shiftTable:shiftTable,mantissaTable:mantissaTable,exponentTable:exponentTable,offsetTable:offsetTable};}// float32 to float16\nfunction toHalfFloat(val){if(Math.abs(val)>65504)console.warn('THREE.DataUtils.toHalfFloat(): Value out of range.');val=three_module_clamp(val,-65504,65504);_tables.floatView[0]=val;const f=_tables.uint32View[0];const e=f>>23&0x1ff;return _tables.baseTable[e]+((f&0x007fffff)>>_tables.shiftTable[e]);}// float16 to float32\nfunction fromHalfFloat(val){const m=val>>10;_tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[m]+(val&0x3ff)]+_tables.exponentTable[m];return _tables.floatView[0];}var DataUtils=/*#__PURE__*/freeze({__proto__:null,toHalfFloat:toHalfFloat,fromHalfFloat:fromHalfFloat});// r134, d65e0af06644fe5a84a6fc0e372f4318f95a04c0\nfunction ImmediateRenderObject(){console.error('THREE.ImmediateRenderObject has been removed.');}// r138, 48b05d3500acc084df50be9b4c90781ad9b8cb17\nclass WebGLMultisampleRenderTarget extends (/* unused pure expression or super */ null && (WebGLRenderTarget)){constructor(width,height,options){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the \"samples\" property to greater 0 to enable multisampling.');super(width,height,options);this.samples=4;}}// r138, f9cd9cab03b7b64244e304900a3a2eeaa3a588ce\nclass DataTexture2DArray extends (/* unused pure expression or super */ null && (DataArrayTexture)){constructor(data,width,height,depth){console.warn('THREE.DataTexture2DArray has been renamed to DataArrayTexture.');super(data,width,height,depth);}}// r138, f9cd9cab03b7b64244e304900a3a2eeaa3a588ce\nclass DataTexture3D extends (/* unused pure expression or super */ null && (Data3DTexture)){constructor(data,width,height,depth){console.warn('THREE.DataTexture3D has been renamed to Data3DTexture.');super(data,width,height,depth);}}// r144\nclass BoxBufferGeometry extends (/* unused pure expression or super */ null && (BoxGeometry)){constructor(width,height,depth,widthSegments,heightSegments,depthSegments){console.warn('THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.');super(width,height,depth,widthSegments,heightSegments,depthSegments);}}// r144\nclass CapsuleBufferGeometry extends (/* unused pure expression or super */ null && (CapsuleGeometry)){constructor(radius,length,capSegments,radialSegments){console.warn('THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.');super(radius,length,capSegments,radialSegments);}}// r144\nclass CircleBufferGeometry extends (/* unused pure expression or super */ null && (CircleGeometry)){constructor(radius,segments,thetaStart,thetaLength){console.warn('THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.');super(radius,segments,thetaStart,thetaLength);}}// r144\nclass ConeBufferGeometry extends (/* unused pure expression or super */ null && (ConeGeometry)){constructor(radius,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength){console.warn('THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.');super(radius,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength);}}// r144\nclass CylinderBufferGeometry extends (/* unused pure expression or super */ null && (CylinderGeometry)){constructor(radiusTop,radiusBottom,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength){console.warn('THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.');super(radiusTop,radiusBottom,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength);}}// r144\nclass DodecahedronBufferGeometry extends (/* unused pure expression or super */ null && (DodecahedronGeometry)){constructor(radius,detail){console.warn('THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.');super(radius,detail);}}// r144\nclass ExtrudeBufferGeometry extends (/* unused pure expression or super */ null && (ExtrudeGeometry)){constructor(shapes,options){console.warn('THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.');super(shapes,options);}}// r144\nclass IcosahedronBufferGeometry extends (/* unused pure expression or super */ null && (IcosahedronGeometry)){constructor(radius,detail){console.warn('THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.');super(radius,detail);}}// r144\nclass LatheBufferGeometry extends (/* unused pure expression or super */ null && (LatheGeometry)){constructor(points,segments,phiStart,phiLength){console.warn('THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.');super(points,segments,phiStart,phiLength);}}// r144\nclass OctahedronBufferGeometry extends (/* unused pure expression or super */ null && (OctahedronGeometry)){constructor(radius,detail){console.warn('THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.');super(radius,detail);}}// r144\nclass PlaneBufferGeometry extends (/* unused pure expression or super */ null && (PlaneGeometry)){constructor(width,height,widthSegments,heightSegments){console.warn('THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.');super(width,height,widthSegments,heightSegments);}}// r144\nclass PolyhedronBufferGeometry extends (/* unused pure expression or super */ null && (PolyhedronGeometry)){constructor(vertices,indices,radius,detail){console.warn('THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.');super(vertices,indices,radius,detail);}}// r144\nclass RingBufferGeometry extends (/* unused pure expression or super */ null && (RingGeometry)){constructor(innerRadius,outerRadius,thetaSegments,phiSegments,thetaStart,thetaLength){console.warn('THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.');super(innerRadius,outerRadius,thetaSegments,phiSegments,thetaStart,thetaLength);}}// r144\nclass ShapeBufferGeometry extends (/* unused pure expression or super */ null && (ShapeGeometry)){constructor(shapes,curveSegments){console.warn('THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.');super(shapes,curveSegments);}}// r144\nclass SphereBufferGeometry extends (/* unused pure expression or super */ null && (SphereGeometry)){constructor(radius,widthSegments,heightSegments,phiStart,phiLength,thetaStart,thetaLength){console.warn('THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.');super(radius,widthSegments,heightSegments,phiStart,phiLength,thetaStart,thetaLength);}}// r144\nclass TetrahedronBufferGeometry extends (/* unused pure expression or super */ null && (TetrahedronGeometry)){constructor(radius,detail){console.warn('THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.');super(radius,detail);}}// r144\nclass TorusBufferGeometry extends (/* unused pure expression or super */ null && (TorusGeometry)){constructor(radius,tube,radialSegments,tubularSegments,arc){console.warn('THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.');super(radius,tube,radialSegments,tubularSegments,arc);}}// r144\nclass TorusKnotBufferGeometry extends (/* unused pure expression or super */ null && (TorusKnotGeometry)){constructor(radius,tube,tubularSegments,radialSegments,p,q){console.warn('THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.');super(radius,tube,tubularSegments,radialSegments,p,q);}}// r144\nclass TubeBufferGeometry extends (/* unused pure expression or super */ null && (TubeGeometry)){constructor(path,tubularSegments,radius,radialSegments,closed){console.warn('THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.');super(path,tubularSegments,radius,radialSegments,closed);}}if(typeof __THREE_DEVTOOLS__!=='undefined'){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register',{detail:{revision:REVISION}}));}if(typeof window!=='undefined'){if(window.__THREE__){console.warn('WARNING: Multiple instances of Three.js being imported.');}else{window.__THREE__=REVISION;}}\n;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[1].use[0]!./src/core/worker/CreateEdgesGeometry.worker.ts\nconst CreateEdgesGeometry_worker_v0=/*@__PURE__*/new Vector3();const CreateEdgesGeometry_worker_v1=/*@__PURE__*/new Vector3();const CreateEdgesGeometry_worker_normal=/*@__PURE__*/new Vector3();const CreateEdgesGeometry_worker_triangle=/*@__PURE__*/new Triangle();const worker=self;worker.addEventListener(\"message\",function(event){try{const data=JSON.parse(event.data);const{id,position,index,thresholdAngle}=data;if(id&&position&&index&&thresholdAngle){const precisionPoints=4;const precision=Math.pow(10,precisionPoints);const thresholdDot=Math.cos(DEG2RAD*thresholdAngle);const indexType=index.type;const positionType=position.type;const indexAttr=new BufferAttribute(new self[indexType](index.array),index.itemSize,index.normalized);const positionAttr=new BufferAttribute(new self[positionType](position.array),position.itemSize,position.normalized);const indexCount=indexAttr?indexAttr.count:positionAttr.count;const indexArr=[0,0,0];const vertKeys=[\"a\",\"b\",\"c\"];const hashes=new Array(3);const edgeData={};const vertices=[];for(let i=0;i<indexCount;i+=3){if(indexAttr){indexArr[0]=indexAttr.getX(i);indexArr[1]=indexAttr.getX(i+1);indexArr[2]=indexAttr.getX(i+2);}else{indexArr[0]=i;indexArr[1]=i+1;indexArr[2]=i+2;}const{a,b,c}=CreateEdgesGeometry_worker_triangle;a.fromBufferAttribute(positionAttr,indexArr[0]);b.fromBufferAttribute(positionAttr,indexArr[1]);c.fromBufferAttribute(positionAttr,indexArr[2]);CreateEdgesGeometry_worker_triangle.getNormal(CreateEdgesGeometry_worker_normal);const r=val=>Math.round(val*precision);// create hashes for the edge from the vertices\nhashes[0]=`${r(a.x)}, ${r(a.y)}, ${r(a.z)}`;hashes[1]=`${r(b.x)}, ${r(b.y)}, ${r(b.z)}`;hashes[2]=`${r(c.x)}, ${r(c.y)}, ${r(c.z)}`;// skip degenerate triangles\nif(hashes[0]===hashes[1]||hashes[1]===hashes[2]||hashes[2]===hashes[0]){continue;}// iterate over every edge\nfor(let j=0;j<3;j++){// get the first and next vertex making up the edge\nconst jNext=(j+1)%3;const vecHash0=hashes[j];const vecHash1=hashes[jNext];const v0=CreateEdgesGeometry_worker_triangle[vertKeys[j]];const v1=CreateEdgesGeometry_worker_triangle[vertKeys[jNext]];const hash=`${vecHash0}_${vecHash1}`;const reverseHash=`${vecHash1}_${vecHash0}`;if(reverseHash in edgeData&&!!edgeData[reverseHash]){// if we found a sibling edge add it into the vertex array if\n// it meets the angle threshold and delete the edge from the map.\nif(CreateEdgesGeometry_worker_normal.dot(edgeData[reverseHash].normal)<=thresholdDot){vertices.push(v0.x,v0.y,v0.z);vertices.push(v1.x,v1.y,v1.z);}edgeData[reverseHash]=null;}else if(!(hash in edgeData)){// if we've already got an edge here then skip adding a new one\nedgeData[hash]={index0:indexArr[j],index1:indexArr[jNext],normal:CreateEdgesGeometry_worker_normal.clone()};}}}// iterate over all remaining, unmatched edges and add them to the vertex array\nfor(const key in edgeData){if(edgeData[key]){const{index0,index1}=edgeData[key];CreateEdgesGeometry_worker_v0.fromBufferAttribute(positionAttr,index0);CreateEdgesGeometry_worker_v1.fromBufferAttribute(positionAttr,index1);vertices.push(CreateEdgesGeometry_worker_v0.x,CreateEdgesGeometry_worker_v0.y,CreateEdgesGeometry_worker_v0.z);vertices.push(CreateEdgesGeometry_worker_v1.x,CreateEdgesGeometry_worker_v1.y,CreateEdgesGeometry_worker_v1.z);}}const uint8Array=new self[positionType](vertices);// eslint-disable-next-line no-undef\nworker.postMessage({id,vertices:uint8Array},[uint8Array.buffer]);}return promise_default().resolve();}catch(e){return promise_default().reject(e);}});\n}();\n","Worker",void 0,void 0)}const lf=new class{constructor(){gh(this,"worker",new of),gh(this,"geometries",new(ue())),gh(this,"jobCount",0),this.init()}add(e,t){this.geometries.set(e,t),this.jobCount++}get(e){return this.geometries.get(e)}init(){this.worker.addEventListener("message",(e=>{const t=this.geometries.get(e.data.id.toString());(null==t?void 0:t.length)>0&&(ge()(t).call(t,(t=>{null!=t&&t.geometry&&null!=t&&t.matrix&&null!=t&&t.geom&&null!=t&&t.line&&(t.geom.parameters={geometry:t.geometry,thresholdAngle:5},t.geom.setAttribute("position",new zr(e.data.vertices,3)),t.geom.applyMatrix4(t.matrix),t.line.geometry=t.geom,t.line.visible=!0)})),this.geometries.delete(e.data.id.toString()),this.jobCount--)}))}postMessage(e){this.worker.postMessage(V()(e))}},cf=new xn(0,1,0);class uf{static resetObjectStyle(e){this.revertWireframeMode(e),this.revertObjectOpacity(e,[]),this.revertAppliedMaterialToObject(e),this.revertVisibleForFloors(e)}static resetObjectStyleById(e,t){const n=this.getObjectById(e,t);this.resetObjectStyle(n)}static setObjectOpacity(e,t=.3,n,r){const i=[],s=e=>{Se()(i).call(i,(t=>t.id===e.id))||(i.push({id:e.id,opacity:e.opacity,transparent:e.transparent,side:e.side}),e.opacity*=t,e.transparent=!0,e.side=2)},a=e=>{const n=Se()(i).call(i,(t=>t.id===e.id));if(!n){const n=e.clone();return i.push({id:e.id,opacity:e.opacity,transparent:e.transparent,side:e.side,material:e,clonedMaterial:n}),n.opacity*=t,n.transparent=!0,n}return n.clonedMaterial};return e.traverse((e=>{if((!r||-1===w()(r).call(r,e.id))&&(!n||-1!==w()(n).call(n,e.id))&&e instanceof mi){const o=e;var t;if(n||r){if(x()(o.material)){var i;const e=[];ge()(i=o.material).call(i,(t=>{const n=a(t);n&&e.push(n)})),o.material=e}else if(o.material){const e=a(o.material);e&&(o.material=e)}}else if(x()(o.material))ge()(t=o.material).call(t,(e=>{s(e)}));else if(o.material){const e=o.material;s(e)}}})),i}static revertObjectOpacity(e,t,n,r){const i=e=>{const n=Se()(t).call(t,(t=>t.id===e.id));n&&(e.opacity=n.opacity,e.transparent=n.transparent,e.side=n.side)},s=e=>{const n=Se()(t).call(t,(t=>t.clonedMaterial&&t.clonedMaterial.id===e.id));if(n)return n.material};e.traverse((e=>{if((!r||-1===w()(r).call(r,e.id))&&(!n||-1!==w()(n).call(n,e.id))&&e instanceof mi)if(x()(e.material)){var t;const n=[];ge()(t=e.material).call(t,(e=>{const t=s(e);t?n.push(t):i(e)})),e.material=n}else if(e.material){const t=s(e.material);t?e.material=t:i(e.material)}}))}static setObjectOpacityById(e,t,n=.3,r,i){const s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);return uf.setObjectOpacity(s,n,r,i)}static revertObjectOpacityById(e,t,n,r,i){const s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);uf.revertObjectOpacity(s,n,r,i)}static applyMaterialToObject(e,t,n,r){e.traverse((e=>{r&&-1!==w()(r).call(r,e.id)||n&&-1===w()(n).call(n,e.id)||e instanceof mi&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),e.material=t)}))}static revertAppliedMaterialToObject(e,t,n){e.traverse((e=>{n&&-1!==w()(n).call(n,e.id)||t&&-1===w()(t).call(t,e.id)||e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,e.userData.originalMaterial=void 0)}))}static applyMaterialToObjectById(e,t,n,r,i){const s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);this.applyMaterialToObject(s,n,r,i)}static revertAppliedMaterialToObjectById(e,t,n,r){const i=e.getObjectById(t);if(!i)throw new Error(`Failed to find object by id: ${t}`);this.revertAppliedMaterialToObject(i,n,r)}static applyOpacityMaterialToObject(e,t,n){const r=new kr({color:0,transparent:!0,opacity:.05});this.applyMaterialToObject(e,r,t,n)}static explodeObject(e,t,n=!1){const r=new xn;rf.getPositionCenter(t,r);const i=new nf(e,t.id,r);return i.setOnlyExplodeUp(n),i.explode(),i}static unexplodeObject(e){if(!e)throw new Error("Invalid exploder!");e.unexplode()}static setWireframeMode(e){const t=new kr({color:16732160,wireframe:!0,transparent:!0,opacity:.8});e.traverseVisible((e=>{if(e instanceof mi){const n=e;n.userData.materialForWireframe=n.material,n.material=t}}))}static setWireframeModeById(e,t){const n=e.getObjectById(t);if(!n)throw new Error(`Failed to find object by id: ${t}`);uf.setWireframeMode(n)}static revertWireframeMode(e){e.traverseVisible((e=>{e instanceof mi&&e.userData.materialForWireframe&&(e.material=e.userData.materialForWireframe,e.userData.materialForWireframe=void 0)}))}static revertWireframeModeById(e,t){const n=e.getObjectById(t);if(!n)throw new Error(`Failed to find object by id: ${t}`);uf.revertWireframeMode(n)}static findInner(e,t,n=[],r=!1){const i=t.toLowerCase(),s=[],a=e=>{var t;return-1!==w()(t=e.toLowerCase()).call(t,i)},o=e=>{var t;return-1!==w()(t=e.toString()).call(t,i)},l=e=>{var t;if(e.name&&-1!==w()(t=e.name.toLowerCase()).call(t,i))return!0;if(e.gltfExtensions){var n;const t=e.gltfExtensions,r=t.objectId&&t.objectId.Value||t.elementId&&t.elementId.Value;if(r&&-1!==w()(n=r.toLowerCase()).call(n,i))return!0}return!1};if(n.length>0)for(let t=0;t<n.length;++t){const i=n[t],c=e.getObjectById(i);if(c&&c.traverse((e=>{(a(e.name)||o(e.id)||l(e.userData))&&s.push(e)})),r&&s.length>0)return[s[0]]}else if(e.traverse((e=>{(a(e.name)||o(e.id)||l(e.userData))&&s.push(e)})),r&&s.length>0)return[s[0]];return s}static find(e,t,n=[],r=!1){return this.findInner(e,t,n,r)}static findFirst(e,t,n=[],r=!1){const i=this.findInner(e,t,n,r);if(i.length>0)return i[0]}static getFloorsFromString(e){const t=[],n=new RegExp(/(?:-?(?:\d+(?:\.5)?)F)(?=\W|$)/,"g").exec(e);return n&&n.length>0&&ge()(n).call(n,(e=>{if(e){const n=e.replace("F",""),r=Number(n);r?t.push(r):console.log(`[OU] invalid floor: ${e}`)}})),t}static matchFloor(e,t){const n=this.getFloorsFromString(e);return-1!==sp()(n).call(n,(e=>e===t))}static matchFloors(e,t){const n=this.getFloorsFromString(e);return-1!==sp()(n).call(n,(e=>-1!==sp()(t).call(t,(t=>t===e))))}static distinctFloors(e,t){var n;const r=[],i=e=>{const t=this.getFloorsFromString(e);ge()(t).call(t,(e=>{r[e]=!0}))};return ge()(t).call(t,(t=>{const n=e.getObjectById(t);n&&n.traverse((e=>{if(i(e.name),e.userData.gltfExtensions){const t=e.userData.gltfExtensions;t.level&&t.level.Value&&i(t.level.Value)}}))})),re()(n=Q()(r)).call(n)}static traverseObjectByFloors(e,t,n,r,i){const s=e.getObjectById(t);if(!s)return[];s.traverse((e=>{let t=this.matchFloors(e.name,n);if(!t&&e.userData&&e.userData.gltfExtensions){const r=e.userData.gltfExtensions;r.level&&r.level.Value&&(t=this.matchFloors(r.level.Value,n))}t&&r&&r(e),!t&&i&&i(e)}))}static setVisibleForFloors(e,t,n,r=!0){this.traverseObjectByFloors(e,t,n,(e=>{let t=e;for(;t;)t.visible=!0,t=t.parent||void 0}),(e=>{r&&(e.visible=!1)}))}static revertVisibleForFloors(e){e.traverse((e=>{e.visible=!0}))}static revertVisibleForFloorsById(e,t){const n=this.getObjectById(e,t);this.revertVisibleForFloors(n)}static getObjectById(e,t){const n=e.getObjectById(t);if(!n)throw new Error(`Failed to find object by id: ${t}`);return n}static addOutlines(e,t={visibleOnly:!0,meshOnly:!0,replaceOriginalObject:!1}){if(!e)return[];if(0===e.children.length&&(t.visibleOnly&&!e.visible||t.meshOnly&&!(e instanceof mi)))return[];const n=e;for(let e=n.children.length-1;e>=0;--e){const r=n.children[e],i=this.addOutlines(r,t);ge()(i).call(i,(e=>e.applyMatrix4(n.matrixWorld)))}if(!n.geometry)return[];const r=[];if(n instanceof ko)for(let e=0;e<n.count;++e){const i=new Zn;n.getMatrixAt(e,i);const s=this.createOutline(n.geometry,i);if(t.replaceOriginalObject&&n.parent){n.parent.children.push(s)}else n.children.push(s);r.push(s)}else if(n instanceof mi){const e=this.createOutline(n.geometry,n.matrix);if(t.replaceOriginalObject&&n.parent){const t=n.parent;e.userData=q()(e.userData,n.userData),n.removeFromParent(),n.geometry.dispose(),t.children.push(e)}else n.children.push(e);r.push(e)}return r}static removeOutlines(e){if(e&&x()(e.children))for(let t=e.children.length-1;t>=0;--t){const n=e.children[t];n.children.length>0&&this.removeOutlines(n),n.userData.isOutline&&e.remove(n)}}static hasOutline(e){let t=!1;for(let n=0;n<e.children.length;++n){const r=e.children[n];if(r.userData.isOutline){t=!0;break}if(r.children.length>0&&(t=this.hasOutline(r),t))break}return t}static setOutlinesVisibility(e,t){e.traverse((e=>{e.userData.isOutline&&(e.visible=t)}))}static createOutline(e,t,n=this.OUTLINE_MATERIAL){var r;const i=new Sl,s=new Wo(i,n);return s.layers.set(Rh),s.userData.isOutline=!0,s.matrixAutoUpdate=Ih,s.visible=!1,s.updateMatrix(),lf.get(e.id.toString())||lf.add(e.id.toString(),[]),lf.add(e.id.toString(),be()(r=lf.get(e.id.toString())).call(r,[{geometry:e,matrix:t,geom:i,line:s}])),lf.postMessage({id:e.id,position:e.getAttribute("position").toJSON(),index:e.getIndex(),thresholdAngle:5}),s}static createOutlineSync(e,t,n=this.OUTLINE_MATERIAL){const r=new Sl(e,5),i=new Wo(r,n);return i.layers.set(Rh),i.userData.isOutline=!0,i.matrixAutoUpdate=Ih,i.applyMatrix4(t),i}static cloneObject(e,t=!0){const n=e.clone();return t&&n.traverse((e=>{(e instanceof mi||e instanceof Vo)&&(e.material=tf.cloneMaterial(e.material))})),n}static createBox(e,t,n,r=uf.BOX_FACE_MATERIAL,i=!0){const s=[],a=(e,t,n)=>{s.push(new xn(e,t,n))};a(0,0,0),a(e,0,0),a(e,t,0),a(0,t,0),a(0,0,n),a(e,0,n),a(e,t,n),a(0,t,n);const o=new Kr;o.setFromPoints(s);const l=[0,3,2,0,2,1,4,6,7,4,5,6,0,7,3,0,4,7,3,6,2,3,7,6,1,6,5,1,2,6];return i&&l.push(0,5,4,0,1,5),o.setIndex(l),o.computeVertexNormals(),new mi(o,r)}static rebaseObjectOnRTC(e){const t=e;if(!(t.isMesh||t.isLine||t.isPoints))return e;if(!(t.geometry&&t.geometry instanceof Kr))return e;const n=t.geometry;if(!n.hasAttribute("position"))return e;const r=n.getAttribute("position");if(0===r.count)return e;const i=r.itemSize,s=r.array,a=[];for(let e=0;e<i;e++)a.push(s[e]);for(let e=0;e<r.count;e++)for(let t=0;t<i;t++)s[e*i+t]-=a[t];e.updateMatrix();const o=e.matrix.clone();e.matrix.makeTranslation(a[0],a[1],a.length>2?a[2]:0);const l=e.matrixAutoUpdate;return e.matrixAutoUpdate=!1,e.applyMatrix4(o),e.matrixAutoUpdate=l,e}static isEmptyObject(e){if(0===e.children.length){const t=e.geometry;if(!t||!t.hasAttribute("position")||0===t.getAttribute("position").count)return!0}return!1}static removeEmptyObjects(e){for(let t=0;t<e.children.length;)this.removeEmptyObjects(e.children[t])||++t;return!!this.isEmptyObject(e)&&(e.removeFromParent(),!0)}static removeEmptyObjectsFromRemovingObjects(e,t){0!==e.length&&(ge()(e).call(e,(e=>{e.removeFromParent()})),this.removeEmptyObjects(t))}static setSharedVariablesOfObject(e){e.uuid="",e.up=cf}static isLeafObject(e){return(e instanceof mi||e instanceof Vo||e instanceof Qo)&&!(e.children.length>0||!e.geometry)}}gh(uf,"OUTLINE_MATERIAL",new Fo({name:"outline",color:0,transparent:!0,opacity:.2})),gh(uf,"BOX_FACE_MATERIAL",new lc({color:11648971,transparent:!0,opacity:.3,side:0}));const hf=new Zn,pf=new Zn;class df{static merge(e,t=!0){const n=Yh()();this.mergeInner(e,t),this.mergeInfo.elapsedTime+=Yh()()-n}static mergeInner(e,t=!0){var n,r;if(!e.children||e.children.length<1)return;const i=e.children.length,s={},a=[];for(let n=0;n<i;++n){const r=e.children[n];if(r.children.length>0){this.mergeInner(r,t);continue}if(r.userData.relativeToCenter)continue;if(r.isInstancedMesh)continue;if(!r.geometry)continue;if(!(r.geometry instanceof Kr))continue;let i=!1;const o=tp()(s);for(let t=o.length-1;t>=0;--t){const r=o[t].indexes[0];if(i=this.tryHandleMergeableObjects(e,n,r,s,a),i)break}for(let t=a.length-1;!i&&t>=0;--t){const r=a[t];if(i=this.tryHandleMergeableObjects(e,n,r,s,a),i)break}i||a.push(n)}if(Q()(s).length<=0)return;const o=[],l=[],c=[],u=[];ge()(n=tp()(s)).call(n,(n=>{const r=n.indexes,i=e.children[r[0]];let s=[],a=0,h=0,p=0;const d=[];if(ge()(r).call(r,(n=>{const r=e.children[n],i=r.geometry.clone();if(i.applyMatrix4(r.matrix),ef.tryConvertInterleavedBufferAttributes(i),i.userData.isLineSegments=!0===r.isLineSegments,s.push(i),t){var o,l,c;const e=null===(o=i.attributes)||void 0===o||null===(l=o.position)||void 0===l?void 0:l.count,t=(null===(c=i.index)||void 0===c?void 0:c.count)||0;d.push({batchId:a,positionStart:h,positionCount:e,indexStart:p,indexCount:t}),h+=e,p+=t,a++}})),0===s.length)return;let m;if(i.isMesh){const e=fm(s);if(!e)return;e.userData={},m=new mi(e,i.material),o.push(m)}else if(i.isLine){const e=this.mergeLineGeometries(s,t,i.material instanceof hc||i.material instanceof bi,d);if(!e)return;m=new Wo(e,i.material),l.push(m)}else if(i.isPoints){const e=fm(s);if(!e)return;e.userData={},m=new Qo(e,i.material),c.push(m)}m&&(t?m.userData.batches=d:m.userData=i.userData,m.userData.layerName=i.userData.layerName,m.name=`[Merged] ${i.name}`,m.matrixAutoUpdate=Ih,m.renderOrder=i.renderOrder,m.layers=i.layers,m.visible=i.visible,u.push(...r)),ge()(s).call(s,(e=>{ef.releaseGeometryManually(e)})),s=[]})),re()(u).call(u,((e,t)=>t-e)),ge()(u).call(u,(t=>{const n=e.children[t];e.remove(n)})),ge()(r=[...o,...l,...c]).call(r,(t=>{e.add(t)})),e.updateMatrix(),this.mergeInfo.removedObjects+=u.length,this.mergeInfo.mergedMeshes+=o.length,this.mergeInfo.mergedLines+=l.length,this.mergeInfo.mergedPoints+=c.length}static tryHandleMergeableObjects(e,t,n,r,i){let s=!1;const a=x()(e),o=a?e.length:e.children.length;if(t===n||t>=o||n>=o)return s;const l=a?e[t]:e.children[t],c=a?e[n]:e.children[n];return this.areObjectsMergeable(l,c)&&this.areGeometriesMergeable(l.geometry,c.geometry)&&tf.materialsEquals(l.material,c.material)&&(r[n]||(r[n]={indexes:[n]},this.removeFromArray(i,n)),r[n].indexes.push(t),s=!0),s}static isFilteredByOtherFactors(e,t){const n=e;if(n.isMesh&&n.material.isShaderMaterial)return!0;let r=!1,i=e;for(;i&&i!==t;){if(i.userData.spatialFilterHandle){r=!0;break}i=i.parent}return r}static deepMerge(e,t,n=!0,r=!0,i=!0){var s,a;const o={added:[],removed:[]};if(e.length<=1)return o;let l=Yh()();const c={},u=[];for(let n=0;n<e.length;++n){const r=e[n];if(r.isInstancedMesh)continue;if(!r.geometry)continue;if(!(r.geometry instanceof Kr))continue;if(this.isFilteredByOtherFactors(e[n],t))continue;let i=!1;const s=tp()(c);for(let t=s.length-1;t>=0;--t){const r=s[t].indexes[0];if(i=this.tryHandleMergeableObjects(e,n,r,c,u),i)break}for(let t=u.length-1;!i&&t>=0;--t){const r=u[t];if(i=this.tryHandleMergeableObjects(e,n,r,c,u),i)break}i||u.push(n)}if(Q()(c).length<=0)return o;im.debug(`[Merge] Building merged indexes in ${e.length} objects costs ${(Yh()()-l)/1e3}s`),l=Yh()();const h=[],p=[],d=[],m=[];ge()(s=tp()(c)).call(s,(n=>{const r=n.indexes;if(r.length<2)return;const s=e[r[0]];let a=[],o=0,l=0,c=0;const u=[];if(ge()(r).call(r,(n=>{const r=e[n],h=r.geometry.clone();if(s.material instanceof Fo&&h.deleteAttribute("lineDistance"),this.applyMatrix(h,r,t),h.userData.isLineSegments=!0===r.isLineSegments,a.push(h),i){var p,d,m;const e=null===(p=h.attributes)||void 0===p||null===(d=p.position)||void 0===d?void 0:d.count,t=(null===(m=h.index)||void 0===m?void 0:m.count)||0;let n;s.isLine&&(h.boundingSphere||h.computeBoundingSphere(),n=h.boundingSphere.clone()),u.push({batchId:o,positionStart:l,positionCount:e,indexStart:c,indexCount:t,boundingSphere:n}),l+=e,c+=t,o++}})),0===a.length)return;let f;if(s.isMesh){const e=fm(a);if(!e)return;e.userData={},f=new mi(e,s.material),h.push(f)}else if(s.isLine){const e=this.mergeLineGeometries(a,i,s.material instanceof hc||s.material instanceof bi,u);if(!e)return;f=new Wo(e,s.material),p.push(f)}else if(s.isPoints){const e=fm(a);if(!e)return;e.userData={},f=new Qo(e,s.material),d.push(f)}f&&(i?f.userData.batches=u:f.userData=s.userData,f.userData.layerName=s.userData.layerName,f.name=`[Merged] ${s.name}`,f.matrixAutoUpdate=Ih,f.renderOrder=s.renderOrder,f.layers=s.layers,f.visible=s.visible,ge()(r).call(r,(e=>m.push(e)))),ge()(a).call(a,(e=>{ef.releaseGeometryManually(e)})),a=[]})),im.debug(`[Merge] merge costs ${(Yh()()-l)/1e3}s`);const f=o.removed;ge()(m).call(m,(t=>{const r=e[t];f.push(r),n&&r.removeFromParent()}));const g=o.added;return ge()(a=[...h,...p,...d]).call(a,(e=>{g.push(e),n&&t&&(t.add(e),e.updateWorldMatrix(!1,!1))})),this.mergeInfo.removedObjects+=m.length,this.mergeInfo.mergedMeshes+=h.length,this.mergeInfo.mergedLines+=p.length,this.mergeInfo.mergedPoints+=d.length,r&&t&&uf.removeEmptyObjects(t),o}static applyMatrix(e,t,n){let r=t;for(hf.identity();r&&r!==n&&(hf.premultiply(r.matrix),r.parent);)r=r.parent;return hf.equals(pf)?e:e.applyMatrix4(hf)}static mergeLineGeometries(e,t,n,r){let i;if(n)i=df.mergeBufferGeometriesWithLinesToLineSegements(e,t,r);else{if(i=fm(e),!i)return;i.userData={};const n=[];let s=0;ge()(e).call(e,((e,i)=>{const a=e.attributes.position;if(!a)return;const o=e.index,l=!0===e.userData.isLineSegments,c=n.length;if(o)for(let e=0;e<o.count;e++){const t=o.array[e];l?n.push(s+t):e>0&&n.push(s+o.array[e-1],s+t)}else for(let e=0;e<a.count;e++)e>0&&(l?e%2==1&&n.push(s+e-1,s+e):n.push(s+e-1,s+e));s+=a.count,t&&r&&(r[i].indexStart=c,r[i].indexCount=n.length-c)})),i.setIndex(n)}return i}static mergeBufferGeometriesWithLinesToLineSegements(e,t,n){const r=new(pe())(Q()(e[0].attributes)),i={},s=new Kr,a=[];let o=0;for(let s=0;s<e.length;++s){let l=e[s];const c=!0===l.userData.isLineSegments;a.push(c),l.index&&(im.debug(`[Merge] Geometry '${s}' contains index buffer, going to convert it to non-indexed.`),l=ef.convertGeometryWithIndexedToNonIndexed(l));let u=0;for(const e in l.attributes){if(!r.has(e))return void im.error(`[Merge] mergeBufferGeometries() failed with geometry at index ${s}. All geometries must have compatible attributes; make sure ${e} attribute exists among all geometries, or in none of them`);i[e]||(i[e]=[]),i[e].push(l.attributes[e]),u++}if(u!==r.size)return void im.error(`[Merge] mergeBufferGeometries() failed with geometry at index ${s}. Make sure all geometries have the same number of attributes.`);if(t&&n){const e=l.attributes.position;n[s].indexStart=o,n[s].indexCount=e.count,n[s].positionStart=o,n[s].positionCount=e.count,o+=e.count}}for(const e in i){const t=df.mergeBufferAttributesWithLinesToLineSegements(i[e],a);if(!t)return void im.error(`[Merge] mergeBufferGeometries() failed while trying to merge the ${e} attribute.`);s.setAttribute(e,t)}return s}static mergeBufferAttributesWithLinesToLineSegements(e,t){let n,r,i,s=0;for(let a=0;a<e.length;++a){const o=e[a];if(void 0===n&&(n=o.array.constructor),n!==o.array.constructor)return void im.error("[Merge] mergeBufferAttributes() failed. THREE.BufferAttribute.array must be of consistent array types across matching attributes.");if(void 0===r&&(r=o.itemSize),r!==o.itemSize)return void im.error("[Merge] mergeBufferAttributes() failed. THREE.BufferAttribute.itemSize must be consistent across matching attributes.");if(void 0===i&&(i=o.normalized),i!==o.normalized)return void im.error("[Merge] mergeBufferAttributes() failed. THREE.BufferAttribute.normalized must be consistent across matching attributes.");const l=t[a]?0:o.count-2;s+=(o.count+l)*r}const a=new n(s);let o=0;for(let r=0;r<e.length;++r){const i=t[r],s=e[r],l=i?0:s.count-2,c=s.count+l,u=s.itemSize,h=new n(c*u);let p=0;for(let e=0;e<s.count;e++){const t=e*u,n=0!==e&&e!==s.count-1&&!i;for(let e=0;e<u;e++)h[p+e]=s.array[t+e],n&&(h[p+u+e]=s.array[t+e]);p+=n?2*u:u}a.set(h,o),o+=c*u}return new Br(a,r,i)}static removeFromArray(e,t){for(let n=e.length-1;n>=0;--n)if(e[n]===t)return void S()(e).call(e,n,1)}static removeObjectFromArray(e,t){for(let n=e.length-1;n>=0;--n)if(e[n]===t)return void S()(e).call(e,n,1)}static areGeometriesMergeable(e,t){if(!e||!t)return!1;if("InstancedBufferGeometry"===e.type||"InstancedBufferGeometry"===t.type)return!1;if(!!e.index!=!!t.index)return!1;const n=Q()(e.attributes);if(n.length!==Q()(t.attributes).length)return!1;for(const e of n)if(!t.attributes[e])return!1;return!0}static areObjectsMergeable(e,t){if(e.layers.mask!==t.layers.mask)return!1;if(e.renderOrder!==t.renderOrder)return!1;if(e.visible!==t.visible)return!1;if(e.userData.layerName!==t.userData.layerName)return!1;if(e.type===t.type)return!0;const n=e,r=t;return n.isMesh&&r.isMesh||n.isLine&&r.isLine||n.isPoints&&r.isPoints}static isMergedMesh(e){return!(!e||!e.userData.batches)}static getBatchByFaceIndex(e,t){if(t<0)return void im.error(`[Merge]: Invalid faceIndex: ${t}`);const n=e&&e.geometry&&e.userData.batches;if(n)for(let e=0;e<n.length;++e){const r=n[e],i=r.indexStart/3,s=(r.indexStart+r.indexCount)/3-1;if(t>=i&&t<=s)return r}}static getBatchIdByFaceIndex(e,t){const n=this.getBatchByFaceIndex(e,t);return n?n.batchId:-1}static getBatchByBatchId(e,t){const n=e&&e.geometry&&e.userData.batches;if(n)for(let e=0;e<n.length;++e){const r=n[e];if(r.batchId===t)return r}}static cloneGeometryForBatch(e,t){var n,r;const i=e&&e.geometry.clone();if(!i)return;const s=null===(n=i.attributes.position)||void 0===n?void 0:n.array;let a=null===(r=i.index)||void 0===r?void 0:r.array;if(!s||!a)return im.info(`[Merge]: Unexpected position: ${s}, or index: ${a}!`),i;const o=[],l=[],c=i.attributes.position.itemSize;for(let e=t.positionStart;e<t.positionStart+t.positionCount&&e<s.length;++e)2===c?o.push(new Xt(s[3*e],s[3*e+1])):3===c&&l.push(new xn(s[3*e],s[3*e+1],s[3*e+2]));if(2===c?i.setFromPoints(o):i.setFromPoints(l),a=M()(fp()).call(fp(),a,t.indexStart,t.indexStart+t.indexCount),o.length>0||l.length>0){const e=[];for(let n=0;n<a.length;++n)e.push(a[n]-t.positionStart);i.setIndex(e),i.computeBoundingBox()}else i.setIndex(a);return i}}let mf,ff;gh(df,"mergeInfo",{removedObjects:0,mergedMeshes:0,mergedLines:0,mergedPoints:0,mergedUnknownTypeObjects:0,elapsedTime:0}),function(e){e[e.ClickEvent=1]="ClickEvent",e[e.Popup=2]="Popup",e[e.SubMenu=3]="SubMenu",e[e.Switch=4]="Switch"}(mf||(mf={})),function(e){e.HomeView="HomeView",e.OrthoMode="OrthoMode",e.Measure="Measure",e.MeasureDistance="MeasureDistance",e.MeasureArea="MeasureArea",e.MeasureAngle="MeasureAngle",e.MeasureCoordinate="MeasureCoordinate",e.MeasureClear="MeasureClear",e.Markup="Markup",e.MarkupArrow="Arrow",e.MarkupRect="Rect",e.MarkupCloudRect="CloudRect",e.MarkupPolyLine="PolyLine",e.MarkupCloudLine="CloudLine",e.MarkupEllipse="Ellipse",e.MarkupCircle="Circle",e.MarkupDot="Dot",e.MarkupText="Text",e.MarkupX="X",e.MarkupStrokeStyle="StrokeStyle",e.MarkupLineWidth="LineWidth",e.MarkupLineWidth2="LineWidth2",e.MarkupLineWidth5="LineWidth5",e.MarkupLineWidth10="LineWidth10",e.MarkupFontSize="FontSize",e.MarkupFontSize14="FontSize14",e.MarkupFontSize18="FontSize18",e.MarkupFontSize24="FontSize24",e.MarkupClear="MarkupClear",e.MarkupQuit="MarkupQuit",e.Section="Section",e.SectionBox="SectionBox",e.SectionPlane="SectionPlane",e.AxisSectionPlane="AxisSectionPlane",e.BimTree="BimTree",e.Viewpoint="Viewpoint",e.Annotation="Annotation",e.Property="Property",e.Settings="Settings",e.Compared="Compared",e.QuitCompare="QuitCompare",e.Fullscreen="FullScreen",e.SceneClear="SceneClear",e.Layers="Layers",e.ZoomToRectangle="ZoomToRectangle"}(ff||(ff={}));const gf=e=>({bimViewer:t})=>t.translate(`ContextMenu.${e}`),_f=e=>{let t=0;return e.scene.traverseVisible((e=>{e instanceof mi&&t++})),t>0},vf=e=>e.hasTransparentObject(),yf=e=>!1!==e.userData.selectable,bf=(e,t,n,r)=>{const i=e.selectedObject;return!(!i||!t||i.id!==t.id)&&(null!=n&&i.isInstancedMesh?n===i.userData.instanceId:null==r||!df.isMergedMesh(i)||r===i.userData.batchId)},xf={getTitle:gf("viewFitEntity"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.flyToObject(t)}},Tf={getTitle:gf("viewFitAll"),getEnabled:({bimViewer:e})=>_f(e),doAction:({bimViewer:e})=>e.viewFitAll()},wf={getTitle:gf("hideEntity"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{yf(t)&&(t.visible=!1,e.enableRender())}},Ef={getTitle:gf("hideOthers"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.scene.traverse((e=>{e instanceof mi&&yf(e)&&(e.visible=!1)})),t.visible=!0,e.enableRender()}},Sf={getTitle:gf("hideAll"),getEnabled:({bimViewer:e})=>_f(e),doAction:({bimViewer:e})=>{e.scene.traverse((e=>{e instanceof mi&&yf(e)&&(e.visible=!1)})),e.enableRender()}},If={getTitle:gf("showAll"),getEnabled:({bimViewer:e})=>(e=>{let t=0;return e.scene.traverse((e=>{e instanceof mi&&t++})),e.scene.traverseVisible((e=>{e instanceof mi&&t--})),t>0})(e),doAction:({bimViewer:e})=>{e.scene.traverse((e=>{e instanceof mi&&yf(e)&&(e.visible=!0)})),e.enableRender()}},Mf={getTitle:({hit:e,bimViewer:t,instanceId:n,batchId:r})=>bf(t,e,n,r)?gf("deselect")({bimViewer:t}):gf("select")({bimViewer:t}),getShown:({hit:e})=>e,doAction:({hit:e,bimViewer:t,instanceId:n,batchId:r})=>{!1!==e.userData.selectable?bf(t,e,n,r)?t.clearSelection():t.selectObject(e,e.instanceId,r):im.log(`[ContextMenu] object(type: ${e.type}, name: ${e.name}) not selectable!`)}},Af={getTitle:gf("selectNone"),getEnabled:({bimViewer:e})=>e.selectedObject,doAction:({bimViewer:e})=>e.clearSelection()},Rf={getTitle:gf("xRayAll"),getShown:({bimViewer:e})=>!vf(e),doAction:({bimViewer:e})=>{e.addOrRemoveObjectOpacity(!0),e.enableRender()}},Df={getTitle:gf("xRayNone"),getEnabled:({bimViewer:e})=>vf(e),doAction:({bimViewer:e})=>{vf(e)&&(e.addOrRemoveObjectOpacity(!1),e.enableRender())}},Cf={getTitle:gf("xRayEntity"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.addOrRemoveObjectOpacity(!0,void 0,[t.id],void 0)}},Of={getTitle:gf("xRayOthers"),getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.addOrRemoveObjectOpacity(!0,.1,void 0,[t.id]),e.enableRender()}},Pf={getTitle:({bimViewer:e})=>{let t="";switch(e.sectionMode){case qh.PickPlaneSection:t="*showSectionPlane";break;case qh.AxisPlaneSection:t="showAxisSection";break;case qh.ObjectsBoxSection:t="*showSectionBox"}return e.translate(`ContextMenu.${t}`)},getShown:({bimViewer:e,section:t})=>!(e.sectionMode!==qh.PickPlaneSection&&e.sectionMode!==qh.AxisPlaneSection||!t||t.isShowSectionPlane),doAction:({bimViewer:e,section:t})=>{(e.sectionMode===qh.PickPlaneSection||e.sectionMode===qh.AxisPlaneSection)&&(null==t||t.showSectionPlane())}},Nf={getTitle:({bimViewer:e})=>{let t="";switch(e.sectionMode){case qh.PickPlaneSection:t="hideSectionPlane";break;case qh.AxisPlaneSection:t="hideAxisSection";break;case qh.ObjectsBoxSection:t="hideSectionBox"}return e.translate(`ContextMenu.${t}`)},getShown:e=>kf(e),doAction:({bimViewer:e,section:t})=>{(e.sectionMode===qh.PickPlaneSection||e.sectionMode===qh.AxisPlaneSection)&&(null==t||t.hideSectionPlane())}},Lf={getTitle:gf("undoSection"),getShown:e=>kf(e),doAction:({bimViewer:e,toolbar:t})=>{if(e.sectionMode===qh.PickPlaneSection){const e=null==t?void 0:t.menuList.get(ff.SectionPlane);null==e||e.setActive(!1)}else if(e.sectionMode===qh.AxisPlaneSection){const e=null==t?void 0:t.menuList.get(ff.AxisSectionPlane);null==e||e.setActive(!1)}else if(e.sectionMode===qh.ObjectsBoxSection){const e=null==t?void 0:t.menuList.get(ff.SectionBox);null==e||e.setActive(!1)}}},kf=({bimViewer:e,hit:t,section:n})=>(e.sectionMode===qh.PickPlaneSection||e.sectionMode===qh.AxisPlaneSection)&&!!n&&n.isShowSectionPlane&&(null==t?void 0:t.name)===Vh,Ff=[[Pf],[Nf,Lf],[xf,Tf],[wf,Ef,Sf,If],[Cf,Of,Rf,Df],[Mf,Af]];class Uf extends Tr{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}const Bf=new xn,jf=new Zn,Gf=new Zn,zf=new xn,Vf=new xn;class Hf{constructor(e={}){const t=this;let n,r,i,s;const a={objects:new ee},o=void 0!==e.element?e.element:document.createElement("div");function l(e,n,r){if(e.isCSS2DObject){Bf.setFromMatrixPosition(e.matrixWorld),Bf.applyMatrix4(Gf);const l=!0===e.visible&&Bf.z>=-1&&Bf.z<=1&&!0===e.layers.test(r.layers);if(e.element.style.display=!0===l?"":"none",!0===l){e.onBeforeRender(t,n,r);const a=e.element;a.style.transform="translate(-50%,-50%) translate("+(Bf.x*i+i)+"px,"+(-Bf.y*s+s)+"px)",a.parentNode!==o&&o.appendChild(a),e.onAfterRender(t,n,r)}const u={distanceToCameraSquared:c(r,e)};a.objects.set(e,u)}for(let t=0,i=e.children.length;t<i;t++)l(e.children[t],n,r)}function c(e,t){return zf.setFromMatrixPosition(e.matrixWorld),Vf.setFromMatrixPosition(t.matrixWorld),zf.distanceToSquared(Vf)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),jf.copy(t.matrixWorldInverse),Gf.multiplyMatrices(t.projectionMatrix,jf),l(e,e,t),function(e){var t;const n=ne(t=function(e){const t=[];return e.traverse((function(e){e.isCSS2DObject&&t.push(e)})),t}(e)).call(t,(function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;return a.objects.get(e).distanceToCameraSquared-a.objects.get(t).distanceToCameraSquared})),r=n.length;for(let e=0,t=n.length;e<t;e++)n[e].element.style.zIndex=r-e}(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,s=r/2,o.style.width=e+"px",o.style.height=t+"px"}}}class qf extends Tr{constructor(e=!0,t=!1){super(),gh(this,"name","COORDINATE_AXES"),gh(this,"AXIS_LENGTH",1),gh(this,"AXIS_COLOR_X",16711680),gh(this,"AXIS_COLOR_Y",65280),gh(this,"AXIS_COLOR_Z",255);const n=new xn(0,0,0),r=new xn(1,0,0),i=new xn(0,1,0),s=new Au(r,n,this.AXIS_LENGTH,this.AXIS_COLOR_X,0,0),a=new Au(i,n,this.AXIS_LENGTH,this.AXIS_COLOR_Y,0,0);if(this.add(s,a),!t){const e=new xn(0,0,1),t=new Au(e,n,this.AXIS_LENGTH,this.AXIS_COLOR_Z,0,0);this.add(t)}e&&this.addTexts(t)}addTexts(e=!1){const t=this.createText("X","#ff0000"),n=this.createText("Y","#00ff00");if(t.position.set(this.AXIS_LENGTH+.1,0,0),n.position.set(.1,this.AXIS_LENGTH,.1),this.add(t,n),!e){const e=this.createText("Z","#0000ff");e.position.set(0,0,this.AXIS_LENGTH+.1),this.add(e)}}createText(e,t,n=14){const r=document.createElement("div");r.innerHTML=e;const i=r.style;return i.color=t,i.width=`${n}px`,i.height=`${n}px`,i.textAlign="center",i.top="0px",i.left="0px",new Uf(r)}}class Wf{constructor(e,t,n=!1){gh(this,"hostRenderer",void 0),gh(this,"container",void 0),gh(this,"coordinateAxes",void 0),gh(this,"ignoreZAxis",!1),gh(this,"camera",void 0),gh(this,"scene",void 0),gh(this,"renderer",void 0),gh(this,"css2dRenderer",void 0),gh(this,"height",100),gh(this,"width",100),this.container=e,this.hostRenderer=t,this.width=e.clientWidth||this.width,this.height=e.clientHeight||this.height,this.ignoreZAxis=n,this.init()}init(){this.initRenderer(),this.initScene(),this.animate()}initRenderer(){this.renderer=new ho({antialias:!0,alpha:!0}),this.renderer.setSize(this.width,this.height),this.container.appendChild(this.renderer.domElement),this.css2dRenderer=new Hf,this.css2dRenderer.setSize(this.width,this.height),this.css2dRenderer.domElement.style.height="0",this.css2dRenderer.domElement.style.width="0",this.container.appendChild(this.css2dRenderer.domElement)}initScene(){this.scene=new mo,this.camera=new Wi(-1,1,1,-1,.1,100),this.scene.add(this.camera),this.coordinateAxes=new qf(!0,this.ignoreZAxis),this.scene.add(this.coordinateAxes)}render(){var e;this.scene&&this.camera&&(this.renderer&&(this.update(),this.renderer.render(this.scene,this.camera)),null===(e=this.css2dRenderer)||void 0===e||e.render(this.scene,this.camera))}animate(){var e;requestAnimationFrame(ve()(e=this.animate).call(e,this)),this.render()}update(){if(!this.hostRenderer||!this.hostRenderer.camera)return;const e=this.hostRenderer.camera;if(e){const t=new xn;e.getWorldDirection(t);const n=e.up;this.updateCameraDirection(t,n)}}updateCameraDirection(e,t){if(!this.camera||!e)return;e.normalize();const n=.3;this.camera.position.set(2*-e.x+n,2*-e.y+n,2*-e.z+n),this.camera.lookAt(n,n,n),this.camera.up=t}dispose(){this.scene&&this.camera&&this.coordinateAxes&&(this.scene.clear(),this.hostRenderer=void 0,this.camera=void 0,this.coordinateAxes=void 0,this.scene=void 0)}}function Yf(e,t){var n=e.__state.conversionName.toString(),r=Math.round(e.r),i=Math.round(e.g),s=Math.round(e.b),a=e.a,o=Math.round(e.h),l=e.s.toFixed(1),c=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var u=e.hex.toString(16);u.length<6;)u="0"+u;return"#"+u}return"CSS_RGB"===n?"rgb("+r+","+i+","+s+")":"CSS_RGBA"===n?"rgba("+r+","+i+","+s+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+r+","+i+","+s+"]":"RGBA_ARRAY"===n?"["+r+","+i+","+s+","+a+"]":"RGB_OBJ"===n?"{r:"+r+",g:"+i+",b:"+s+"}":"RGBA_OBJ"===n?"{r:"+r+",g:"+i+",b:"+s+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+o+",s:"+l+",v:"+c+"}":"HSVA_OBJ"===n?"{h:"+o+",s:"+l+",v:"+c+",a:"+a+"}":"unknown format"}var Xf=ge()(Array.prototype),$f=M()(Array.prototype),Kf={BREAK:{},extend:function(e){return this.each($f.call(arguments,1),(function(t){var n,r=this.isObject(t)?Q()(t):[];ge()(r).call(r,ve()(n=function(n){this.isUndefined(t[n])||(e[n]=t[n])}).call(n,this))}),this),e},defaults:function(e){return this.each($f.call(arguments,1),(function(t){var n,r=this.isObject(t)?Q()(t):[];ge()(r).call(r,ve()(n=function(n){this.isUndefined(e[n])&&(e[n]=t[n])}).call(n,this))}),this),e},compose:function(){var e=$f.call(arguments);return function(){for(var t=$f.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(Xf&&ge()(e)&&ge()(e)===Xf)ge()(e).call(e,t,n);else if(e.length===e.length+0){var r,i=void 0;for(i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===this.BREAK)return}else for(var s in e)if(t.call(n,e[s],s)===this.BREAK)return},defer:function(e){Re()(e,0)},debounce:function(e,t,n){var r=void 0;return function(){var i=this,s=arguments;function a(){r=null,n||e.apply(i,s)}var o=n||!r;clearTimeout(r),r=Re()(a,t),o&&e.apply(i,s)}},toArray:function(e){return e.toArray?e.toArray():$f.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return isNaN(e)})),isArray:x()||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return!1===e||!0===e},isFunction:function(e){return e instanceof Function}},Zf=[{litmus:Kf.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:L()("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:Yf},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:L()("0x"+t[1].toString(),0)}},write:Yf},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:P()(t[1]),g:P()(t[2]),b:P()(t[3])}},write:Yf},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:P()(t[1]),g:P()(t[2]),b:P()(t[3]),a:P()(t[4])}},write:Yf}}},{litmus:Kf.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:Kf.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:Kf.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(Kf.isNumber(e.r)&&Kf.isNumber(e.g)&&Kf.isNumber(e.b)&&Kf.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(Kf.isNumber(e.r)&&Kf.isNumber(e.g)&&Kf.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(Kf.isNumber(e.h)&&Kf.isNumber(e.s)&&Kf.isNumber(e.v)&&Kf.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(Kf.isNumber(e.h)&&Kf.isNumber(e.s)&&Kf.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],Jf=void 0,Qf=void 0,eg=function(){Qf=!1;var e=arguments.length>1?Kf.toArray(arguments):arguments[0];return Kf.each(Zf,(function(t){if(t.litmus(e))return Kf.each(t.conversions,(function(t,n){if(Jf=t.read(e),!1===Qf&&!1!==Jf)return Qf=Jf,Jf.conversionName=n,Jf.conversion=t,Kf.BREAK})),Kf.BREAK})),Qf},tg=void 0,ng={hsv_to_rgb:function(e,t,n){var r=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),s=n*(1-t),a=n*(1-i*t),o=n*(1-(1-i)*t),l=[[n,o,s],[a,n,s],[s,n,o],[s,a,n],[o,s,n],[n,s,a]][r];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var r=Math.min(e,t,n),i=Math.max(e,t,n),s=i-r,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-n)/s:t===i?2+(n-e)/s:4+(e-t)/s,(a/=6)<0&&(a+=1),{h:360*a,s:s/i,v:i/255})},rgb_to_hex:function(e,t,n){var r=this.hex_with_component(0,2,e);return r=this.hex_with_component(r,1,t),r=this.hex_with_component(r,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(tg=8*t)|e&~(255<<tg)}},rg="function"==typeof Sp()&&"symbol"==typeof C()?function(e){return typeof e}:function(e){return e&&"function"==typeof Sp()&&e.constructor===Sp()&&e!==Sp().prototype?"symbol":typeof e},ig=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},sg=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),B()(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),ag=function e(t,n,r){null===t&&(t=Function.prototype);var i=Zh()(t,n);if(void 0===i){var s=wp()(t);return null===s?void 0:e(s,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},og=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Op()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Np()?Np()(e,t):e.__proto__=t)},lg=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},cg=function(){function e(){if(ig(this,e),this.__state=eg.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return sg(e,[{key:"toString",value:function(){return Yf(this)}},{key:"toHexString",value:function(){return Yf(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),e}();function ug(e,t,n){B()(e,t,{get:function(){return"RGB"===this.__state.space||cg.recalculateRGB(this,t,n),this.__state[t]},set:function(e){"RGB"!==this.__state.space&&(cg.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function hg(e,t){B()(e,t,{get:function(){return"HSV"===this.__state.space||cg.recalculateHSV(this),this.__state[t]},set:function(e){"HSV"!==this.__state.space&&(cg.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}cg.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=ng.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");Kf.extend(e.__state,ng.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},cg.recalculateHSV=function(e){var t=ng.rgb_to_hsv(e.r,e.g,e.b);Kf.extend(e.__state,{s:t.s,v:t.v}),Kf.isNaN(t.h)?Kf.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},cg.COMPONENTS=["r","g","b","h","s","v","hex","a"],ug(cg.prototype,"r",2),ug(cg.prototype,"g",1),ug(cg.prototype,"b",0),hg(cg.prototype,"h"),hg(cg.prototype,"s"),hg(cg.prototype,"v"),B()(cg.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),B()(cg.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=ng.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}});var pg=function(){function e(t,n){ig(this,e),this.initialValue=t[n],this.domElement=document.createElement("div"),this.object=t,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return sg(e,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),e}(),dg={};Kf.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(e,t){Kf.each(e,(function(e){dg[e]=t}))}));var mg=/(\d+(\.\d+)?)px/;function fg(e){if("0"===e||Kf.isUndefined(e))return 0;var t=e.match(mg);return Kf.isNull(t)?0:P()(t[1])}var gg={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){var r=n,i=t;Kf.isUndefined(i)&&(i=!0),Kf.isUndefined(r)&&(r=!0),e.style.position="absolute",i&&(e.style.left=0,e.style.right=0),r&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,r){var i=n||{},s=dg[t];if(!s)throw new Error("Event type "+t+" not supported.");var a=document.createEvent(s);switch(s){case"MouseEvents":var o=i.x||i.clientX||0,l=i.y||i.clientY||0;a.initMouseEvent(t,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,o,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var c=a.initKeyboardEvent||a.initKeyEvent;Kf.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),c(t,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:a.initEvent(t,i.bubbles||!1,i.cancelable||!0)}Kf.defaults(a,r),e.dispatchEvent(a)},bind:function(e,t,n,r){var i=r||!1;return e.addEventListener?e.addEventListener(t,n,i):e.attachEvent&&e.attachEvent("on"+t,n),gg},unbind:function(e,t,n,r){var i=r||!1;return e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent&&e.detachEvent("on"+t,n),gg},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);-1===w()(n).call(n,t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return gg},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),r=w()(n).call(n,t);-1!==r&&(S()(n).call(n,r,1),e.className=n.join(" "))}else e.className=void 0;return gg},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return fg(t["border-left-width"])+fg(t["border-right-width"])+fg(t["padding-left"])+fg(t["padding-right"])+fg(t.width)},getHeight:function(e){var t=getComputedStyle(e);return fg(t["border-top-width"])+fg(t["border-bottom-width"])+fg(t["padding-top"])+fg(t["padding-bottom"])+fg(t.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)do{n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent}while(t);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},_g=function(e){function t(e,n){ig(this,t);var r=lg(this,(t.__proto__||wp()(t)).call(this,e,n)),i=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),ve()(gg).call(gg,r.__checkbox,"change",(function(){i.setValue(!i.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return og(t,e),sg(t,[{key:"setValue",value:function(e){var n=ag(t.prototype.__proto__||wp()(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),ag(t.prototype.__proto__||wp()(t.prototype),"updateDisplay",this).call(this)}}]),t}(pg),vg=function(e){function t(e,n,r){ig(this,t);var i=lg(this,(t.__proto__||wp()(t)).call(this,e,n)),s=r,a=i;if(i.__select=document.createElement("select"),Kf.isArray(s)){var o={};Kf.each(s,(function(e){o[e]=e})),s=o}return Kf.each(s,(function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),a.__select.appendChild(n)})),i.updateDisplay(),ve()(gg).call(gg,i.__select,"change",(function(){var e=this.options[this.selectedIndex].value;a.setValue(e)})),i.domElement.appendChild(i.__select),i}return og(t,e),sg(t,[{key:"setValue",value:function(e){var n=ag(t.prototype.__proto__||wp()(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return gg.isActive(this.__select)?this:(this.__select.value=this.getValue(),ag(t.prototype.__proto__||wp()(t.prototype),"updateDisplay",this).call(this))}}]),t}(pg),yg=function(e){function t(e,n){ig(this,t);var r=lg(this,(t.__proto__||wp()(t)).call(this,e,n)),i=r;function s(){i.setValue(i.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),ve()(gg).call(gg,r.__input,"keyup",s),ve()(gg).call(gg,r.__input,"change",s),ve()(gg).call(gg,r.__input,"blur",(function(){i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())})),ve()(gg).call(gg,r.__input,"keydown",(function(e){13===e.keyCode&&this.blur()})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return og(t,e),sg(t,[{key:"updateDisplay",value:function(){return gg.isActive(this.__input)||(this.__input.value=this.getValue()),ag(t.prototype.__proto__||wp()(t.prototype),"updateDisplay",this).call(this)}}]),t}(pg);function bg(e){var t=e.toString();return w()(t).call(t,".")>-1?t.length-w()(t).call(t,".")-1:0}var xg=function(e){function t(e,n,r){ig(this,t);var i=lg(this,(t.__proto__||wp()(t)).call(this,e,n)),s=r||{};return i.__min=s.min,i.__max=s.max,i.__step=s.step,Kf.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=bg(i.__impliedStep),i}return og(t,e),sg(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),ag(t.prototype.__proto__||wp()(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=bg(e),this}}]),t}(pg);var Tg=function(e){function t(e,n,r){ig(this,t);var i=lg(this,(t.__proto__||wp()(t)).call(this,e,n,r));i.__truncationSuspended=!1;var s=i,a=void 0;function o(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function l(e){var t=a-e.clientY;s.setValue(s.getValue()+t*s.__impliedStep),a=e.clientY}function c(){gg.unbind(window,"mousemove",l),gg.unbind(window,"mouseup",c),o()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),ve()(gg).call(gg,i.__input,"change",(function(){var e=P()(s.__input.value);Kf.isNaN(e)||s.setValue(e)})),ve()(gg).call(gg,i.__input,"blur",(function(){o()})),ve()(gg).call(gg,i.__input,"mousedown",(function(e){ve()(gg).call(gg,window,"mousemove",l),ve()(gg).call(gg,window,"mouseup",c),a=e.clientY})),ve()(gg).call(gg,i.__input,"keydown",(function(e){13===e.keyCode&&(s.__truncationSuspended=!0,this.blur(),s.__truncationSuspended=!1,o())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return og(t,e),sg(t,[{key:"updateDisplay",value:function(){var e,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(e*r)/r),ag(t.prototype.__proto__||wp()(t.prototype),"updateDisplay",this).call(this)}}]),t}(xg);function wg(e,t,n,r,i){return r+(e-t)/(n-t)*(i-r)}var Eg=function(e){function t(e,n,r,i,s){ig(this,t);var a=lg(this,(t.__proto__||wp()(t)).call(this,e,n,{min:r,max:i,step:s})),o=a;function l(e){e.preventDefault();var t=o.__background.getBoundingClientRect();return o.setValue(wg(e.clientX,t.left,t.right,o.__min,o.__max)),!1}function c(){gg.unbind(window,"mousemove",l),gg.unbind(window,"mouseup",c),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=e.touches[0].clientX,n=o.__background.getBoundingClientRect();o.setValue(wg(t,n.left,n.right,o.__min,o.__max))}function h(){gg.unbind(window,"touchmove",u),gg.unbind(window,"touchend",h),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),ve()(gg).call(gg,a.__background,"mousedown",(function(e){document.activeElement.blur(),ve()(gg).call(gg,window,"mousemove",l),ve()(gg).call(gg,window,"mouseup",c),l(e)})),ve()(gg).call(gg,a.__background,"touchstart",(function(e){if(1!==e.touches.length)return;ve()(gg).call(gg,window,"touchmove",u),ve()(gg).call(gg,window,"touchend",h),u(e)})),gg.addClass(a.__background,"slider"),gg.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return og(t,e),sg(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",ag(t.prototype.__proto__||wp()(t.prototype),"updateDisplay",this).call(this)}}]),t}(xg),Sg=function(e){function t(e,n,r){ig(this,t);var i=lg(this,(t.__proto__||wp()(t)).call(this,e,n)),s=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===r?"Fire":r,ve()(gg).call(gg,i.__button,"click",(function(e){return e.preventDefault(),s.fire(),!1})),gg.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return og(t,e),sg(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(pg),Ig=function(e){function t(e,n){ig(this,t);var r=lg(this,(t.__proto__||wp()(t)).call(this,e,n));r.__color=new cg(r.getValue()),r.__temp=new cg(0);var i=r;r.domElement=document.createElement("div"),gg.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",ve()(gg).call(gg,r.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),ve()(gg).call(gg,r.__input,"blur",h),ve()(gg).call(gg,r.__selector,"mousedown",(function(){var e;ve()(e=gg.addClass(this,"drag")).call(e,window,"mouseup",(function(){gg.removeClass(i.__selector,"drag")}))})),ve()(gg).call(gg,r.__selector,"touchstart",(function(){var e;ve()(e=gg.addClass(this,"drag")).call(e,window,"touchend",(function(){gg.removeClass(i.__selector,"drag")}))}));var s,a=document.createElement("div");function o(e){d(e),ve()(gg).call(gg,window,"mousemove",d),ve()(gg).call(gg,window,"touchmove",d),ve()(gg).call(gg,window,"mouseup",c),ve()(gg).call(gg,window,"touchend",c)}function l(e){m(e),ve()(gg).call(gg,window,"mousemove",m),ve()(gg).call(gg,window,"touchmove",m),ve()(gg).call(gg,window,"mouseup",u),ve()(gg).call(gg,window,"touchend",u)}function c(){gg.unbind(window,"mousemove",d),gg.unbind(window,"touchmove",d),gg.unbind(window,"mouseup",c),gg.unbind(window,"touchend",c),p()}function u(){gg.unbind(window,"mousemove",m),gg.unbind(window,"touchmove",m),gg.unbind(window,"mouseup",u),gg.unbind(window,"touchend",u),p()}function h(){var e=eg(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function p(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function d(e){var t;-1===w()(t=e.type).call(t,"touch")&&e.preventDefault();var n=i.__saturation_field.getBoundingClientRect(),r=e.touches&&e.touches[0]||e,s=r.clientX,a=r.clientY,o=(s-n.left)/(n.right-n.left),l=1-(a-n.top)/(n.bottom-n.top);return l>1?l=1:l<0&&(l=0),o>1?o=1:o<0&&(o=0),i.__color.v=l,i.__color.s=o,i.setValue(i.__color.toOriginal()),!1}function m(e){var t;-1===w()(t=e.type).call(t,"touch")&&e.preventDefault();var n=i.__hue_field.getBoundingClientRect(),r=1-((e.touches&&e.touches[0]||e).clientY-n.top)/(n.bottom-n.top);return r>1?r=1:r<0&&(r=0),i.__color.h=360*r,i.setValue(i.__color.toOriginal()),!1}return Kf.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Kf.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Kf.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Kf.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Kf.extend(a.style,{width:"100%",height:"100%",background:"none"}),Ag(a,"top","rgba(0,0,0,0)","#000"),Kf.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(s=r.__hue_field).style.background="",s.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",s.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",Kf.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),ve()(gg).call(gg,r.__saturation_field,"mousedown",o),ve()(gg).call(gg,r.__saturation_field,"touchstart",o),ve()(gg).call(gg,r.__field_knob,"mousedown",o),ve()(gg).call(gg,r.__field_knob,"touchstart",o),ve()(gg).call(gg,r.__hue_field,"mousedown",l),ve()(gg).call(gg,r.__hue_field,"touchstart",l),r.__saturation_field.appendChild(a),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return og(t,e),sg(t,[{key:"updateDisplay",value:function(){var e=eg(this.getValue());if(!1!==e){var t=!1;Kf.each(cg.COMPONENTS,(function(n){if(!Kf.isUndefined(e[n])&&!Kf.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&Kf.extend(this.__color.__state,e)}Kf.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;Kf.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,Ag(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Kf.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(pg),Mg=["-moz-","-o-","-webkit-","-ms-",""];function Ag(e,t,n,r){e.style.background="",Kf.each(Mg,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var Rg=function(e,t){var n=t||document,r=document.createElement("style");r.type="text/css",r.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(r)}catch(e){}},Dg='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',Cg=function(e,t){var n=e[t];return Kf.isArray(arguments[2])||Kf.isObject(arguments[2])?new vg(e,t,arguments[2]):Kf.isNumber(n)?Kf.isNumber(arguments[2])&&Kf.isNumber(arguments[3])?Kf.isNumber(arguments[4])?new Eg(e,t,arguments[2],arguments[3],arguments[4]):new Eg(e,t,arguments[2],arguments[3]):Kf.isNumber(arguments[4])?new Tg(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Tg(e,t,{min:arguments[2],max:arguments[3]}):Kf.isString(n)?new yg(e,t):Kf.isFunction(n)?new Sg(e,t,""):Kf.isBoolean(n)?new _g(e,t):null};var Og=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){Re()(e,1e3/60)},Pg=function(){function e(){ig(this,e),this.backgroundElement=document.createElement("div"),Kf.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),gg.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Kf.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;ve()(gg).call(gg,this.backgroundElement,"click",(function(){t.hide()}))}return sg(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),Kf.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",gg.unbind(e.domElement,"webkitTransitionEnd",t),gg.unbind(e.domElement,"transitionend",t),gg.unbind(e.domElement,"oTransitionEnd",t)};ve()(gg).call(gg,this.domElement,"webkitTransitionEnd",t),ve()(gg).call(gg,this.domElement,"transitionend",t),ve()(gg).call(gg,this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-gg.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-gg.getHeight(this.domElement)/2+"px"}}]),e}(),Ng=function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");Rg(Ng);var Lg="Default",kg=function(){try{return!!window.localStorage}catch(e){return!1}}(),Fg=void 0,Ug=!0,Bg=void 0,jg=!1,Gg=[],zg=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),gg.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=Kf.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=Kf.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),Kf.isUndefined(r.load)?r.load={preset:Lg}:r.preset&&(r.load.preset=r.preset),Kf.isUndefined(r.parent)&&r.hideable&&Gg.push(this),r.resizable=Kf.isUndefined(r.parent)&&r.resizable,r.autoPlace&&Kf.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,s=kg&&"true"===localStorage.getItem(Xg(this,"isLocal")),a=void 0,o=void 0;if($()(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(e){n.parent?n.getRoot().preset=e:r.load.preset=e,function(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value===e.preset&&(e.__preset_select.selectedIndex=t)}(this),n.revert()}},width:{get:function(){return r.width},set:function(e){r.width=e,Qg(n,e)}},name:{get:function(){return r.name},set:function(e){r.name=e,o&&(o.innerHTML=r.name)}},closed:{get:function(){return r.closed},set:function(t){r.closed=t,r.closed?gg.addClass(n.__ul,e.CLASS_CLOSED):gg.removeClass(n.__ul,e.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return r.load}},useLocalStorage:{get:function(){return s},set:function(e){kg&&(s=e,e?ve()(gg).call(gg,window,"unload",a):gg.unbind(window,"unload",a),localStorage.setItem(Xg(n,"isLocal"),e))}}}),Kf.isUndefined(r.parent)){if(this.closed=r.closed||!1,gg.addClass(this.domElement,e.CLASS_MAIN),gg.makeSelectable(this.domElement,!1),kg&&s){n.useLocalStorage=!0;var l=localStorage.getItem(Xg(this,"gui"));l&&(r.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,gg.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),r.closeOnTop?(gg.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(gg.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),ve()(gg).call(gg,this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===r.closed&&(r.closed=!0);var c=document.createTextNode(r.name);gg.addClass(c,"controller-name"),o=Vg(n,c);gg.addClass(this.__ul,e.CLASS_CLOSED),gg.addClass(o,"title"),ve()(gg).call(gg,o,"click",(function(e){return e.preventDefault(),n.closed=!n.closed,!1})),r.closed||(this.closed=!1)}r.autoPlace&&(Kf.isUndefined(r.parent)&&(Ug&&(Bg=document.createElement("div"),gg.addClass(Bg,"dg"),gg.addClass(Bg,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Bg),Ug=!1),Bg.appendChild(this.domElement),gg.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||Qg(n,r.width)),this.__resizeHandler=function(){n.onResizeDebounced()},ve()(gg).call(gg,window,"resize",this.__resizeHandler),ve()(gg).call(gg,this.__ul,"webkitTransitionEnd",this.__resizeHandler),ve()(gg).call(gg,this.__ul,"transitionend",this.__resizeHandler),ve()(gg).call(gg,this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),r.resizable&&Jg(this),a=function(){kg&&"true"===localStorage.getItem(Xg(n,"isLocal"))&&localStorage.setItem(Xg(n,"gui"),V()(n.getSaveObject()))},this.saveToLocalStorageIfPossible=a,r.parent||((i=n.getRoot()).width+=1,Kf.defer((function(){i.width-=1})))};function Vg(e,t,n){var r=document.createElement("li");return t&&r.appendChild(t),n?e.__ul.insertBefore(r,n):e.__ul.appendChild(r),e.onResize(),r}function Hg(e){gg.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&gg.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function qg(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];n.innerHTML=t?n.value+"*":n.value}function Wg(e,t){var n,r=e.getRoot(),i=w()(n=r.__rememberedObjects).call(n,t.object);if(-1!==i){var s=r.__rememberedObjectIndecesToControllers[i];if(void 0===s&&(s={},r.__rememberedObjectIndecesToControllers[i]=s),s[t.property]=t,r.load&&r.load.remembered){var a=r.load.remembered,o=void 0;if(a[e.preset])o=a[e.preset];else{if(!a.Default)return;o=a.Default}if(o[i]&&void 0!==o[i][t.property]){var l=o[i][t.property];t.initialValue=l,t.setValue(l)}}}}function Yg(e,t,n,r){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var i=void 0;if(r.color)i=new Ig(t,n);else{var s,a=be()(s=[t,n]).call(s,r.factoryArgs);i=Cg.apply(e,a)}r.before instanceof pg&&(r.before=r.before.__li),Wg(e,i),gg.addClass(i.domElement,"c");var o=document.createElement("span");gg.addClass(o,"property-name"),o.innerHTML=i.property;var l=document.createElement("div");l.appendChild(o),l.appendChild(i.domElement);var c=Vg(e,l,r.before);return gg.addClass(c,zg.CLASS_CONTROLLER_ROW),i instanceof Ig?gg.addClass(c,"color"):gg.addClass(c,rg(i.getValue())),function(e,t,n){if(n.__li=t,n.__gui=e,Kf.extend(n,{options:function(t){if(arguments.length>1){var r=n.__li.nextElementSibling;return n.remove(),Yg(e,n.object,n.property,{before:r,factoryArgs:[Kf.toArray(arguments)]})}if(Kf.isArray(t)||Kf.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),Yg(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof Eg){var r=new Tg(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});Kf.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],i=r[e];n[e]=r[e]=function(){var e=M()(Array.prototype).call(arguments);return i.apply(r,e),t.apply(n,e)}})),gg.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof Tg){var i=function(t){if(Kf.isNumber(n.__min)&&Kf.isNumber(n.__max)){var r,i=n.__li.firstElementChild.firstElementChild.innerHTML,s=w()(r=n.__gui.__listening).call(r,n)>-1;n.remove();var a=Yg(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return a.name(i),s&&a.listen(),a}return t};n.min=Kf.compose(i,n.min),n.max=Kf.compose(i,n.max)}else n instanceof _g?(ve()(gg).call(gg,t,"click",(function(){gg.fakeEvent(n.__checkbox,"click")})),ve()(gg).call(gg,n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof Sg?(ve()(gg).call(gg,t,"click",(function(){gg.fakeEvent(n.__button,"click")})),ve()(gg).call(gg,t,"mouseover",(function(){gg.addClass(n.__button,"hover")})),ve()(gg).call(gg,t,"mouseout",(function(){gg.removeClass(n.__button,"hover")}))):n instanceof Ig&&(gg.addClass(t,"color"),n.updateDisplay=Kf.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=Kf.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&qg(e.getRoot(),!0),t}),n.setValue)}(e,c,i),e.__controllers.push(i),i}function Xg(e,t){return document.location.href+"."+t}function $g(e,t,n){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function Kg(e,t){t.style.display=e.useLocalStorage?"block":"none"}function Zg(e){var t=e.__save_row=document.createElement("li");gg.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),gg.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",gg.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",gg.addClass(r,"button"),gg.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",gg.addClass(i,"button"),gg.addClass(i,"save-as");var s=document.createElement("span");s.innerHTML="Revert",gg.addClass(s,"button"),gg.addClass(s,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?Kf.each(e.load.remembered,(function(t,n){$g(e,n,n===e.preset)})):$g(e,Lg,!1),ve()(gg).call(gg,a,"change",(function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value})),t.appendChild(a),t.appendChild(n),t.appendChild(r),t.appendChild(i),t.appendChild(s),kg){var o=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(Xg(0,"isLocal"))&&l.setAttribute("checked","checked"),Kg(e,o),ve()(gg).call(gg,l,"change",(function(){e.useLocalStorage=!e.useLocalStorage,Kg(e,o)}))}var c=document.getElementById("dg-new-constructor");ve()(gg).call(gg,c,"keydown",(function(e){!e.metaKey||67!==e.which&&67!==e.keyCode||Fg.hide()})),ve()(gg).call(gg,n,"click",(function(){c.innerHTML=V()(e.getSaveObject(),void 0,2),Fg.show(),c.focus(),c.select()})),ve()(gg).call(gg,r,"click",(function(){e.save()})),ve()(gg).call(gg,i,"click",(function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)})),ve()(gg).call(gg,s,"click",(function(){e.revert()}))}function Jg(e){var t=void 0;function n(n){return n.preventDefault(),e.width+=t-n.clientX,e.onResize(),t=n.clientX,!1}function r(){gg.removeClass(e.__closeButton,zg.CLASS_DRAG),gg.unbind(window,"mousemove",n),gg.unbind(window,"mouseup",r)}function i(i){return i.preventDefault(),t=i.clientX,gg.addClass(e.__closeButton,zg.CLASS_DRAG),ve()(gg).call(gg,window,"mousemove",n),ve()(gg).call(gg,window,"mouseup",r),!1}e.__resize_handle=document.createElement("div"),Kf.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),ve()(gg).call(gg,e.__resize_handle,"mousedown",i),ve()(gg).call(gg,e.__closeButton,"mousedown",i),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}function Qg(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function e_(e,t){var n={};return Kf.each(e.__rememberedObjects,(function(r,i){var s={},a=e.__rememberedObjectIndecesToControllers[i];Kf.each(a,(function(e,n){s[n]=t?e.initialValue:e.getValue()})),n[i]=s})),n}function t_(e){0!==e.length&&Og.call(window,(function(){t_(e)})),Kf.each(e,(function(e){e.updateDisplay()}))}zg.toggleHide=function(){jg=!jg,Kf.each(Gg,(function(e){e.domElement.style.display=jg?"none":""}))},zg.CLASS_AUTO_PLACE="a",zg.CLASS_AUTO_PLACE_CONTAINER="ac",zg.CLASS_MAIN="main",zg.CLASS_CONTROLLER_ROW="cr",zg.CLASS_TOO_TALL="taller-than-window",zg.CLASS_CLOSED="closed",zg.CLASS_CLOSE_BUTTON="close-button",zg.CLASS_CLOSE_TOP="close-top",zg.CLASS_CLOSE_BOTTOM="close-bottom",zg.CLASS_DRAG="drag",zg.DEFAULT_WIDTH=245,zg.TEXT_CLOSED="Close Controls",zg.TEXT_OPEN="Open Controls",zg._keydownHandler=function(e){"text"===document.activeElement.type||72!==e.which&&72!==e.keyCode||zg.toggleHide()},ve()(gg).call(gg,window,"keydown",zg._keydownHandler,!1),Kf.extend(zg.prototype,{add:function(e,t){return Yg(this,e,t,{factoryArgs:M()(Array.prototype).call(arguments,2)})},addColor:function(e,t){return Yg(this,e,t,{color:!0})},remove:function(e){var t,n;this.__ul.removeChild(e.__li),S()(t=this.__controllers).call(t,w()(n=this.__controllers).call(n,e),1);var r=this;Kf.defer((function(){r.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Bg.removeChild(this.domElement);var e=this;Kf.each(this.__folders,(function(t){e.removeFolder(t)})),gg.unbind(window,"keydown",zg._keydownHandler,!1),Hg(this)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new zg(t);this.__folders[e]=n;var r=Vg(this,n.domElement);return gg.addClass(r,"folder"),n},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],Hg(e);var t=this;Kf.each(e.__folders,(function(t){e.removeFolder(t)})),Kf.defer((function(){t.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=gg.getOffset(e.__ul).top,n=0;Kf.each(e.__ul.childNodes,(function(t){e.autoPlace&&t===e.__save_row||(n+=gg.getHeight(t))})),window.innerHeight-t-20<n?(gg.addClass(e.domElement,zg.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-20+"px"):(gg.removeClass(e.domElement,zg.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&Kf.defer((function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"})),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:Kf.debounce((function(){this.onResize()}),50),remember:function(){if(Kf.isUndefined(Fg)&&((Fg=new Pg).domElement.innerHTML=Dg),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;Kf.each(M()(Array.prototype).call(arguments),(function(t){var n;0===e.__rememberedObjects.length&&Zg(e),-1===w()(n=e.__rememberedObjects).call(n,t)&&e.__rememberedObjects.push(t)})),this.autoPlace&&Qg(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=e_(this)),e.folders={},Kf.each(this.__folders,(function(t,n){e.folders[n]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=e_(this),qg(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=e_(this,!0)),this.load.remembered[e]=e_(this),this.preset=e,$g(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){Kf.each(this.__controllers,(function(t){this.getRoot().load.remembered?Wg(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),Kf.each(this.__folders,(function(e){e.revert(e)})),e||qg(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&t_(this.__listening)},updateDisplay:function(){Kf.each(this.__controllers,(function(e){e.updateDisplay()})),Kf.each(this.__folders,(function(e){e.updateDisplay()}))}});var n_=zg;class r_{static createGroundGrid(e,t,n){e=e||this.DEFAULT_WIDTH,t=t||this.DEFAULT_WIDTH_SEGS;const r=new Tu(e,t);n?r.position.set(n.x,n.y,n.z):r.position.y=0;const i=r.material;return x()(i)||(i.opacity=this.DEFAULT_MAT_PARAMS.opacity,i.transparent=this.DEFAULT_MAT_PARAMS.transparent),r.name=this.GROUND_GRID_NAME,r.layers.set(Rh),r.matrixAutoUpdate=!1,r.updateMatrix(),r}static createGrassGround(e,t,n,r,i){try{const s=this;return t=t||s.DEFAULT_WIDTH,n=n||s.DEFAULT_HEIGHT,v().resolve(new(v())((a=>{(new zc).load(e||"images/terrain/grass.jpg",(e=>{e.wrapS=e.wrapT=Ke,G()(e).set(r||s.DEFAULT_WIDTH_SEGS/5,i||s.DEFAULT_HEIGHT_SETS/5),e.anisotropy=16,e.encoding=St;const o=new uc({map:e});o.side=0;const l=new mi(new ki(t,n),o);return l.rotation.x=-Math.PI/2,l.position.y=0,l.receiveShadow=!0,l.name=s.GRASS_GROUND_NAME,l.layers.set(Rh),l.matrixAutoUpdate=!1,l.updateMatrix(),a(l)}))})))}catch(e){return v().reject(e)}}}gh(r_,"GROUND_GRID_NAME","GROUND_GRID"),gh(r_,"GRASS_GROUND_NAME","GRASS_GROUND"),gh(r_,"DEFAULT_WIDTH",1e3),gh(r_,"DEFAULT_HEIGHT",1e3),gh(r_,"DEFAULT_WIDTH_SEGS",100),gh(r_,"DEFAULT_HEIGHT_SETS",100),gh(r_,"DEFAULT_MAT_PARAMS",{color:12829635,transparent:!0,opacity:.5,wireframeLinewidth:.5});class i_{static createSkyOfGradientRamp(e=4e3,t=32,n=15,r=new xn,i=new xn(0,.7,.5)){const s=this.COLOR_TEMPLATES.default,a={topColor:{value:new cn(s[0])},skylineColor:{value:new cn(s[1])},bottomColor:{value:new cn(s[2])},offset:{value:400},exponent:{value:.9},skyCenter:{value:r||new xn},sunDirection:{value:i.normalize()}},o=new ic(e,t,n),l=new bi({uniforms:a,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader,side:1}),c=new mi(o,l);return c.matrixAutoUpdate=!1,c.name=this.NAME,c.userData.selectable=!1,c.layers.set(Rh),c}static createSkyOfGradientRampByObjectsInScene(e,t){if(!e)return new mi;const n=rf.getObjectsBoundingBox(e,t);return i_.createSkyOfGradientRampByBoundingBox(n)}static createSkyOfGradientRampByBoundingBox(e){let t=2*(e.max.x-e.min.x+(e.max.y-e.min.y)+(e.max.z-e.min.z));t<i_.MIN_SKY_RADIUS?t=i_.MIN_SKY_RADIUS:t>i_.MAX_SKY_RADIUS&&(t=i_.MAX_SKY_RADIUS);const n=new xn;e.getCenter(n);const r=i_.createSkyOfGradientRamp(t,void 0,void 0,n);return r.position.set(n.x,0,n.z),r}static createSkyFromTextures(e){try{const t=new jc;return v().resolve(new(v())((n=>{t.load(e,(e=>n(e)))})))}catch(e){return v().reject(e)}}}gh(i_,"NAME","SKYBOX"),gh(i_,"MIN_SKY_RADIUS",4e3),gh(i_,"MAX_SKY_RADIUS",2e4),gh(i_,"vertexShader","\n varying vec3 vWorldPosition;\n void main() {\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }"),gh(i_,"fragmentShader","\n uniform vec3 topColor;\n uniform vec3 skylineColor;\n uniform vec3 bottomColor;\n uniform float offset;\n uniform float exponent;\n uniform vec3 skyCenter;\n uniform vec3 sunDirection;\n varying vec3 vWorldPosition;\n // Used to find the position to draw the sun. Sun size is bigger when this value is smaller\n const float sunDirectionDotThreshold = 0.98;\n\n void main() {\n vec3 position = vec3(vWorldPosition.x - skyCenter.x, vWorldPosition.y - skyCenter.y, vWorldPosition.z - skyCenter.z);\n vec3 normalizedPosition = normalize( position + offset );\n float h = normalizedPosition.y;\n vec3 color;\n if (h > 0.0) {\n color = mix( skylineColor, topColor, pow( h, exponent ) );\n\n // draw the sun\n float dotResult = dot(sunDirection, normalizedPosition);\n if (dotResult > sunDirectionDotThreshold) {\n const float sunSize = 1.0 - sunDirectionDotThreshold; // maximum sun size\n const vec3 sunColor = vec3(1.0, 1.0, 1.0);\n color = mix(color, sunColor, pow((dotResult + sunSize - 1.0) / sunSize, 3.0));\n }\n } else {\n color = mix( skylineColor, bottomColor, pow( -h, exponent ) );\n }\n gl_FragColor = vec4(color , 1.0);\n }"),gh(i_,"COLOR_TEMPLATES",{default:[8828661,16777215,10066329],blueSky:[11189247,16777215,6974058],boardwalk:[14413823,16777215,15459804]});class s_ extends Gc{constructor(e){super(e),this.type=ct}parse(e){const t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},n=function(e,t,n){t=t||1024;let r=e.pos,i=-1,s=0,a="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=T(o).call(o,"\n"))&&s<t&&r<e.byteLength;)a+=o,s+=o.length,r+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i&&(!1!==n&&(e.pos+=s+i+1),a+I(o).call(o,0,i))},r=function(e,t,n,r){const i=e[t+3],s=Math.pow(2,i-128)/255;n[r+0]=e[t+0]*s,n[r+1]=e[t+1]*s,n[r+2]=e[t+2]*s,n[r+3]=1},i=function(e,t,n,r){const i=e[t+3],s=Math.pow(2,i-128)/255;n[r+0]=Ou.toHalfFloat(Math.min(e[t+0]*s,65504)),n[r+1]=Ou.toHalfFloat(Math.min(e[t+1]*s,65504)),n[r+2]=Ou.toHalfFloat(Math.min(e[t+2]*s,65504)),n[r+3]=Ou.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;const a=function(e){const r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,a=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,o={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,c;if(e.pos>=e.byteLength||!(l=n(e)))return t(1,"no header found");if(!(c=l.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(o.valid|=1,o.programtype=c[1],o.string+=l+"\n";l=n(e),!1!==l;)if(o.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(r))&&(o.gamma=O(c[1])),(c=l.match(i))&&(o.exposure=O(c[1])),(c=l.match(s))&&(o.valid|=2,o.format=c[1]),(c=l.match(a))&&(o.valid|=4,o.height=N(c[1],10),o.width=N(c[2],10)),2&o.valid&&4&o.valid)break}else o.comments+=l+"\n";return 2&o.valid?4&o.valid?o:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==a){const e=a.width,n=a.height,o=function(e,n,r){const i=n;if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(i!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");const s=new Uint8Array(4*n*r);if(!s.length)return t(4,"unable to allocate buffer space");let a=0,o=0;const l=4*i,c=new Uint8Array(4),u=new Uint8Array(l);let h=r;for(;h>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],2!=c[0]||2!=c[1]||(c[2]<<8|c[3])!=i)return t(3,"bad rgbe scanline format");let n,r=0;for(;r<l&&o<e.byteLength;){n=e[o++];const i=n>128;if(i&&(n-=128),0===n||r+n>l)return t(3,"bad scanline data");if(i){const t=e[o++];for(let e=0;e<n;e++)u[r++]=t}else u.set(e.subarray(o,o+n),r),r+=n,o+=n}const p=i;for(let e=0;e<p;e++){let t=0;s[a]=u[e+t],t+=i,s[a+1]=u[e+t],t+=i,s[a+2]=u[e+t],t+=i,s[a+3]=u[e+t],a+=4}h--}return s}(s.subarray(s.pos),e,n);if(-1!==o){let t,s,l;switch(this.type){case lt:l=o.length/4;const e=new Float32Array(4*l);for(let t=0;t<l;t++)r(o,4*t,e,4*t);t=e,s=lt;break;case ct:l=o.length/4;const n=new Uint16Array(4*l);for(let e=0;e<l;e++)i(o,4*e,n,4*e);t=n,s=ct;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:e,height:n,data:t,header:a.string,gamma:a.gamma,exposure:a.exposure,type:s}}}return null}setDataType(e){return this.type=e,this}load(e,t,n,r){return super.load(e,(function(e,n){switch(e.type){case lt:case ct:e.encoding=Et,e.minFilter=nt,e.magFilter=nt,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),n,r)}}class a_{static createEnvTexture(e,t){try{const n=new s_;return v().resolve(new(v())((r=>{n.load(t,(t=>{if(e){const n=e.fromEquirectangular(t).texture;e.dispose(),r(n)}}))})))}catch(e){return v().reject(e)}}static createEnvTextureFromDataArray(e,t,n=64,r=32){try{const i=this;if(void 0===t&&(t=i.HDR_CITY_STREET_64x32),e){const i=new Io(t,n,r);i.flipY=!0,i.magFilter=nt,i.minFilter=nt,i.type=ct,i.version=1;const s=e.fromEquirectangular(i).texture;return e.dispose(),v().resolve(s)}return v().reject("Invalid pmremGenerator!")}catch(e){return v().reject(e)}}}let o_;gh(a_,"HDR_CITY_STREET_64x32",Uint16Array.from([11910,12340,12797,15360,11926,12348,12806,15360,11958,12364,12814,15360,11974,12380,12830,15360,11958,12364,12822,15360,11926,12348,12797,15360,11878,12324,12773,15360,11830,12308,12749,15360,11798,12292,12733,15360,11782,12279,12725,15360,11765,12263,12709,15360,11749,12247,12701,15360,11733,12231,12701,15360,11701,12215,12693,15360,11685,12199,12685,15360,11685,12199,12685,15360,11701,12215,12693,15360,11717,12231,12701,15360,11733,12247,12709,15360,11749,12263,12717,15360,11749,12279,12717,15360,11765,12279,12725,15360,11765,12279,12725,15360,11765,12292,12725,15360,11798,12300,12733,15360,11830,12316,12749,15360,11846,12324,12757,15360,11894,12340,12781,15360,11926,12356,12797,15360,11942,12356,12797,15360,11926,12348,12789,15360,11926,12348,12789,15360,11942,12356,12797,15360,11942,12356,12797,15360,11942,12348,12806,15360,11942,12356,12806,15360,11942,12356,12814,15360,11958,12372,12830,15360,11974,12372,12830,15360,11974,12372,12838,15360,11990,12388,12854,15360,12055,12420,12886,15360,12119,12452,12918,15360,12167,12476,12950,15360,12231,12500,12982,15360,12263,12516,12998,15360,12231,12500,12974,15360,12199,12484,12958,15360,12199,12484,12958,15360,12199,12492,12966,15360,12247,12508,12982,15360,12247,12508,12990,15360,12231,12500,12982,15360,12199,12484,12966,15360,12167,12468,12942,15360,12119,12444,12918,15360,12087,12436,12902,15360,12055,12420,12886,15360,12055,12412,12878,15360,12039,12412,12878,15360,12022,12396,12862,15360,12006,12388,12846,15360,11958,12364,12830,15360,11910,12340,12806,15360,12119,12508,13103,15360,12087,12484,13071,15360,12055,12468,13046,15360,12006,12436,13006,15360,11926,12396,12958,15360,11878,12364,12926,15360,11846,12348,12894,15360,11782,12308,12854,15360,11749,12292,12830,15360,11717,12263,12814,15360,11685,12247,12806,15360,11669,12215,12789,15360,11685,12231,12789,15360,11701,12247,12797,15360,11701,12247,12806,15360,11717,12263,12814,15360,11749,12292,12822,15360,11782,12308,12838,15360,11798,12316,12846,15360,11814,12332,12862,15360,11846,12340,12870,15360,11862,12348,12878,15360,11846,12340,12870,15360,11846,12340,12862,15360,11878,12356,12886,15360,11910,12372,12910,15360,11942,12396,12934,15360,11958,12412,12958,15360,12039,12452,12998,15360,12071,12468,13022,15360,12039,12452,12998,15360,12039,12452,12998,15360,12006,12444,13006,15360,11974,12436,12998,15360,11942,12412,12982,15360,11926,12396,12974,15360,11926,12404,12974,15360,11958,12420,12998,15360,12006,12452,13038,15360,12055,12476,13071,15360,12039,12476,13079,15360,12087,12508,13127,15360,12247,12597,13231,15360,12388,12693,13332,15360,12420,12741,13364,15360,12436,12757,13372,15360,12468,12773,13380,15360,12500,12806,13388,15360,12516,12822,13404,15360,12629,12934,13452,15360,12741,13046,13508,15360,12806,13095,13532,15360,12757,13046,13516,15360,12645,12950,13460,15360,12565,12870,13428,15360,12532,12838,13412,15360,12549,12854,13412,15360,12516,12838,13396,15360,12452,12757,13356,15360,12420,12725,13340,15360,12404,12709,13332,15360,12372,12677,13316,15360,12279,12589,13207,15360,12135,12516,13119,15360,12388,12709,13348,15360,12247,12581,13223,15360,12055,12476,13087,15360,11910,12388,12982,15360,11733,12308,12886,15360,11669,12247,12846,15360,11621,12199,12814,15360,11541,12103,12765,15360,11492,12055,12733,15360,11508,12055,12733,15360,11476,12022,12717,15360,11525,12055,12725,15360,11589,12135,12757,15360,11669,12199,12765,15360,11765,12292,12814,15360,11862,12348,12886,15360,11910,12372,12910,15360,12006,12420,12966,15360,12071,12452,12998,15360,12119,12476,13022,15360,12167,12492,13046,15360,12183,12500,13063,15360,12199,12524,13079,15360,12308,12589,13151,15360,12300,12581,13151,15360,12167,12516,13087,15360,12087,12468,13030,15360,12022,12444,13014,15360,11990,12420,12990,15360,11974,12420,12990,15360,11974,12420,12990,15360,11990,12436,13014,15360,11990,12444,13030,15360,12103,12500,13103,15360,12087,12508,13111,15360,12039,12484,13103,15360,12039,12476,13103,15360,11942,12436,13054,15360,11974,12452,13087,15360,12039,12492,13135,15360,12103,12532,13199,15360,12183,12581,13263,15360,12308,12661,13340,15360,12484,12822,13436,15360,12613,12918,13484,15360,12725,13046,13540,15360,13046,13332,13677,15360,13143,13380,13717,15360,13223,13420,13741,15360,13396,13540,13862,15360,13436,13589,13902,15360,13484,13629,13942,15360,13468,13621,13934,15360,13412,13564,13878,15360,13372,13524,13846,15360,13287,13452,13781,15360,13223,13428,13749,15360,13340,13492,13805,15360,13239,13428,13749,15360,13095,13364,13685,15360,12918,13223,13597,15360,12822,13111,13556,15360,12613,12934,13468,15360,12532,12854,13428,15360,12565,12870,13444,15360,12468,12789,13396,15360,12372,12693,13340,15360,12087,12492,13111,15360,11846,12364,12958,15360,11717,12300,12878,15360,11557,12135,12781,15360,11476,12055,12741,15360,11460,12022,12725,15360,11476,12022,12725,15360,11476,12022,12709,15360,11476,11958,12605,15360,11364,11733,12332,15360,11111,11412,11661,15360,11223,11476,11773,15360,11388,11669,12095,15360,11765,12119,12492,15360,12388,12613,13079,15360,12661,12902,13356,15360,12998,13255,13564,15360,13372,13508,13797,15360,13412,13548,13846,15360,13287,13436,13725,15360,13271,13428,13709,15360,13287,13428,13717,15360,13014,13287,13597,15360,12709,12998,13460,15360,12452,12741,13332,15360,12364,12653,13271,15360,12404,12693,13316,15360,12420,12709,13316,15360,12420,12709,13332,15360,12263,12589,13231,15360,12332,12661,13312,15360,12300,12629,13295,15360,12263,12605,13287,15360,12231,12597,13279,15360,12247,12613,13303,15360,12231,12597,13295,15360,12231,12605,13312,15360,12199,12597,13324,15360,12231,12613,13340,15360,12516,12870,13468,15360,12725,13063,13564,15360,12741,13079,13573,15360,12854,13175,13613,15360,12902,13223,13629,15360,13046,13348,13693,15360,13356,13516,13846,15360,13605,13765,14078,15360,13717,13870,14191,15360,13765,13918,14255,15360,13765,13910,14247,15360,13701,13854,14191,15360,13573,13733,14070,15360,13508,13677,14006,15360,13380,13548,13886,15360,13111,13380,13741,15360,13063,13348,13709,15360,12886,13207,13629,15360,12725,13046,13548,15360,12645,12966,13508,15360,12677,12982,13508,15360,12629,12950,13492,15360,12452,12789,13412,15360,12324,12661,13332,15360,12356,12677,13340,15360,12388,12693,13348,15360,12279,12597,13247,15360,11894,12396,12998,15360,11637,12231,12846,15360,11573,12135,12789,15360,11589,12151,12797,15360,11621,12167,12797,15360,11637,12119,12677,15360,11079,11404,11693,15360,10517,10701,10653,15360,10252,10348,10007,15360,9902,9999,9428,15360,9846,9886,9047,15360,10135,10260,9685,15360,10412,10533,10412,15360,11268,11436,11549,15360,12364,12605,13087,15360,12444,12709,13255,15360,12549,12822,13348,15360,12613,12886,13396,15360,12597,12886,13412,15360,12581,12870,13404,15360,12661,12950,13460,15360,12725,13014,13492,15360,13079,13332,13645,15360,12757,13046,13500,15360,12677,12982,13476,15360,12854,13143,13556,15360,12693,12982,13492,15360,12581,12886,13452,15360,12709,13030,13508,15360,12372,12709,13364,15360,12324,12661,13348,15360,12292,12645,13340,15360,12292,12645,13348,15360,12468,12806,13436,15360,12532,12854,13460,15360,12500,12854,13468,15360,12500,12854,13484,15360,12725,13063,13589,15360,12982,13324,13701,15360,13111,13388,13741,15360,13014,13340,13709,15360,13014,13332,13717,15360,13287,13476,13862,15360,13436,13621,13974,15360,13532,13717,14095,15360,13725,13902,14295,15360,13942,14103,14420,15360,13974,14135,14436,15360,13862,14022,14388,15360,13725,13894,14295,15360,13789,13958,14336,15360,13830,13990,14348,15360,13372,13548,13942,15360,13014,13332,13733,15360,12886,13239,13661,15360,12854,13207,13637,15360,12757,13095,13589,15360,12757,13079,13573,15360,12645,12982,13516,15360,12629,12966,13532,15360,12549,12870,13468,15360,12356,12693,13372,15360,12151,12549,13231,15360,12215,12573,13247,15360,12199,12565,13231,15360,12071,12492,13135,15360,12055,12468,13087,15360,11878,12372,12958,15360,11685,12199,12781,15360,10774,11159,11412,15360,9533,9621,8870,15360,9308,9340,8071,15360,9276,9300,7878,15360,9324,9332,8420,15360,9191,9216,7991,15360,8950,8983,7766,15360,9493,9525,8677,15360,10252,10332,10007,15360,10661,10846,10894,15360,10701,10926,10998,15360,10950,11276,11428,15360,11364,11637,12063,15360,11958,12388,12926,15360,12183,12540,13175,15360,12340,12645,13295,15360,12420,12693,13316,15360,12757,13030,13460,15360,13046,13324,13645,15360,13095,13348,13677,15360,13303,13460,13781,15360,13207,13404,13741,15360,13127,13372,13717,15360,13372,13524,13862,15360,12693,13030,13540,15360,12725,13046,13548,15360,12468,12822,13436,15360,12263,12629,13348,15360,12436,12773,13428,15360,12693,12998,13524,15360,12725,13046,13564,15360,12645,12982,13556,15360,12613,12966,13556,15360,12886,13255,13685,15360,13436,13629,14022,15360,13637,13813,14231,15360,13621,13789,14215,15360,13878,14038,14412,15360,14022,14183,14468,15360,13926,14119,14452,15360,14054,14231,14508,15360,14135,14311,14540,15360,14348,14436,14669,15360,14460,14540,14749,15360,14404,14484,14709,15360,14420,14500,14709,15360,14653,14717,14894,15360,14119,14279,14508,15360,13484,13669,14078,15360,13063,13380,13773,15360,12677,13079,13613,15360,12484,12886,13516,15360,12436,12822,13476,15360,12468,12838,13476,15360,12039,12532,13316,15360,12231,12613,13340,15360,12468,12789,13436,15360,12388,12725,13396,15360,12135,12557,13287,15360,12151,12557,13271,15360,12039,12484,13175,15360,11878,12396,13038,15360,11814,12348,12950,15360,11492,11894,12460,15360,9950,10103,9621,15360,8830,8838,7220,15360,8565,8533,7015,15360,8541,8501,6919,15360,8332,8300,6822,15360,8412,8372,7220,15360,8710,8701,7686,15360,9372,9404,8549,15360,9533,9621,9079,15360,9268,9292,8196,15360,9452,9460,8167,15360,9533,9581,8533,15360,9742,9870,9316,15360,11460,11814,12348,15360,11942,12388,12902,15360,11749,12167,12573,15360,11300,11492,11621,15360,11974,12332,12669,15360,12436,12741,13364,15360,12597,12886,13460,15360,12966,13271,13653,15360,12998,13303,13669,15360,13476,13629,13974,15360,13733,13886,14239,15360,13364,13524,13894,15360,13063,13356,13725,15360,12982,13287,13669,15360,12484,12806,13444,15360,12565,12902,13500,15360,12950,13287,13693,15360,12934,13271,13677,15360,12693,13046,13589,15360,12661,13030,13605,15360,12870,13271,13717,15360,13348,13548,13966,15360,13621,13813,14271,15360,13797,13974,14412,15360,13942,14119,14484,15360,14263,14388,14629,15360,14420,14508,14733,15360,14460,14548,14773,15360,14982,15046,15231,15360,15564,15580,15669,15360,15974,15982,16078,15360,15805,15821,15926,15360,15460,15476,15572,15360,15436,15460,15556,15360,14781,14862,15127,15360,13621,13813,14348,15360,12789,13207,13757,15360,12452,12886,13581,15360,12263,12709,13476,15360,12039,12597,13396,15360,11942,12516,13340,15360,11846,12468,13271,15360,11733,12380,13127,15360,11926,12460,13191,15360,12055,12524,13263,15360,11878,12428,13159,15360,11605,12231,12886,15360,11412,11990,12709,15360,11508,12103,12789,15360,11637,12231,12854,15360,10661,11079,11380,15360,9541,9685,9252,15360,8573,8605,7493,15360,8404,8388,7348,15360,8830,8822,8212,15360,9308,9324,9095,15360,9324,9364,9220,15360,9047,9119,8653,15360,9023,9055,8404,15360,9055,9063,8167,15360,8870,8846,7541,15360,8862,8806,7380,15360,8950,8910,7252,15360,9268,9284,7557,15360,10316,10468,10380,15360,11239,11476,11677,15360,10653,10942,11047,15360,9661,9814,9324,15360,10693,10958,11047,15360,11396,11653,11990,15360,11878,12292,12597,15360,12468,12789,13396,15360,12773,13095,13589,15360,13364,13516,13894,15360,13894,14054,14380,15360,13717,13870,14247,15360,13420,13589,13958,15360,13255,13452,13830,15360,12806,13143,13637,15360,13159,13412,13830,15360,13629,13813,14215,15360,13303,13500,13910,15360,13079,13396,13805,15360,13191,13452,13878,15360,13412,13621,14062,15360,14103,14279,14540,15360,14773,14854,15086,15360,14717,14805,15046,15360,14295,14420,14685,15360,14380,14476,14733,15360,14572,14661,14902,15360,15596,15612,15701,15360,16351,16335,16384,15360,16484,16476,16492,15360,16516,16500,16516,15360,16388,16375,16404,15360,16054,16054,16118,15360,15918,15926,16006,15360,15556,15572,15669,15360,14653,14725,14982,15360,13637,13838,14319,15360,13412,13613,14054,15360,12870,13287,13789,15360,12404,12838,13524,15360,12199,12677,13428,15360,12324,12741,13452,15360,11942,12516,13324,15360,11765,12380,13111,15360,11428,11942,12589,15360,10886,11388,11902,15360,10372,10717,11006,15360,9846,10240,10191,15360,10252,10549,10766,15360,10613,11079,11484,15360,10581,10998,11388,15360,9613,9846,9629,15360,8525,8557,7541,15360,8605,8613,7814,15360,9292,9324,9079,15360,9388,9396,9220,15360,10709,10846,11031,15360,9894,9966,9854,15360,9252,9236,8774,15360,8822,8790,8183,15360,8292,8260,6533,15360,8111,8007,6324,15360,8228,8183,6405,15360,8501,8501,6565,15360,8814,8878,7172,15360,9260,9364,8244,15360,8902,9095,8252,15360,9444,9581,9047,15360,9509,9637,8790,15360,9477,9613,8806,15360,10725,11063,11079,15360,11508,11910,12356,15360,12484,12789,13380,15360,12838,13159,13629,15360,13428,13589,13974,15360,14135,14279,14484,15360,13942,14087,14396,15360,13677,13846,14247,15360,13436,13613,14006,15360,13597,13781,14183,15360,14183,14340,14540,15360,14022,14215,14484,15360,13637,13838,14271,15360,14038,14231,14508,15360,14380,14476,14701,15360,14757,14854,15078,15360,15030,15111,15343,15360,15420,15452,15556,15360,15476,15500,15588,15360,15351,15388,15492,15360,15572,15596,15677,15360,15653,15669,15717,15360,15821,15821,15853,15360,15845,15845,15869,15360,15998,15990,16022,15360,15926,15926,15974,15360,15653,15669,15733,15360,15661,15677,15749,15360,15612,15629,15717,15360,15271,15335,15452,15360,14484,14572,14821,15360,14215,14372,14588,15360,13468,13677,14167,15360,12773,13175,13653,15360,12725,13143,13637,15360,12452,12886,13532,15360,12263,12709,13444,15360,11894,12436,13103,15360,10252,10533,10661,15360,8613,8693,7445,15360,8742,8782,7047,15360,8420,8412,6565,15360,7926,7910,6405,15360,8806,8854,7300,15360,9127,9228,8007,15360,8685,8750,7300,15360,8348,8356,6758,15360,8380,8340,7300,15360,8991,8918,8388,15360,9838,9790,9549,15360,10055,10127,10047,15360,9501,9493,9268,15360,9332,9292,8902,15360,9079,9007,8509,15360,8300,8260,7252,15360,8693,8701,8196,15360,8228,8212,7111,15360,8469,8501,7380,15360,8420,8501,6919,15360,8549,8645,6983,15360,8581,8661,6951,15360,9268,9332,7718,15360,9063,9207,7445,15360,9284,9380,7718,15360,9412,9557,8693,15360,10276,10517,10103,15360,11830,12279,12589,15360,12725,13079,13589,15360,13127,13396,13773,15360,14087,14231,14460,15360,13974,14119,14412,15360,13677,13854,14247,15360,14119,14279,14500,15360,13990,14167,14460,15360,14364,14452,14653,15360,14564,14653,14837,15360,14404,14492,14701,15360,14870,14942,15135,15360,15388,15420,15500,15360,15207,15287,15420,15360,14797,14894,15127,15360,15271,15335,15452,15360,15926,15942,15990,15360,16207,16207,16231,15360,16118,16110,16126,15360,15741,15733,15741,15360,16239,16207,16175,15360,16444,16460,16484,15360,16046,16022,16006,15360,15942,15950,15966,15360,15773,15789,15829,15360,15789,15797,15845,15360,15693,15709,15757,15360,15540,15564,15653,15360,15303,15364,15468,15360,14733,14813,15014,15360,13862,14054,14420,15360,12838,13255,13725,15360,12789,13207,13693,15360,12468,12918,13564,15360,12404,12838,13500,15360,11428,11862,12412,15360,9143,9276,8388,15360,8541,8533,6726,15360,8444,8428,6629,15360,8212,8183,6597,15360,8388,8380,7015,15360,8726,8710,6758,15360,8332,8316,6437,15360,8453,8428,6565,15360,8597,8605,7814,15360,8701,8661,8151,15360,9452,9396,9015,15360,10581,10557,10380,15360,10950,10974,10846,15360,10380,10356,10252,15360,10749,10741,10685,15360,9870,9854,9693,15360,9023,9039,8669,15360,8790,8854,8509,15360,8196,8167,7332,15360,7975,8015,7079,15360,8589,8750,7445,15360,9095,9260,7111,15360,8983,9135,7188,15360,8902,8991,7252,15360,8862,9007,7015,15360,8967,9111,7300,15360,8742,8878,7493,15360,9557,9999,9549,15360,11292,11613,11862,15360,12135,12468,12982,15360,12215,12460,12878,15360,13356,13468,13685,15360,13821,13934,14199,15360,13548,13701,14022,15360,14103,14263,14468,15360,14279,14388,14572,15360,14364,14452,14645,15360,14709,14789,14950,15360,15143,15199,15327,15360,15388,15412,15468,15360,15476,15500,15548,15360,15420,15444,15492,15360,15436,15460,15516,15360,15612,15637,15685,15360,16086,16086,16110,15360,16396,16388,16396,15360,16094,16094,16110,15360,15869,15861,15861,15360,16135,16110,16070,15360,16428,16420,16404,15360,15588,15556,15524,15360,15484,15500,15508,15360,15335,15364,15396,15360,15677,15685,15717,15360,15604,15621,15661,15360,15420,15444,15500,15360,15303,15372,15452,15360,14717,14805,14998,15360,14412,14508,14701,15360,13548,13765,14199,15360,13271,13508,13942,15360,12661,13159,13709,15360,12468,12854,13436,15360,10260,10484,10509,15360,8613,8669,6951,15360,8151,8143,6469,15360,8653,8629,7814,15360,8469,8444,7541,15360,8718,8693,7814,15360,8372,8332,6597,15360,8356,8308,7111,15360,9047,8983,8396,15360,8822,8798,8308,15360,9372,9348,8967,15360,10364,10364,10183,15360,10268,10260,9894,15360,10541,10533,10468,15360,10380,10364,10276,15360,10621,10613,10549,15360,9910,9942,9758,15360,8364,8380,7621,15360,8581,8637,8135,15360,8252,8300,7573,15360,8119,8175,7300,15360,8372,8453,7493,15360,8420,8501,6983,15360,8742,8822,7573,15360,8782,8854,8151,15360,8581,8661,7079,15360,9220,9268,8340,15360,9549,9645,8854,15360,11717,11950,12127,15360,12468,12741,13207,15360,12709,12966,13388,15360,12300,12508,12886,15360,12492,12709,13063,15360,13239,13372,13548,15360,12476,12597,12814,15360,13581,13685,13878,15360,14476,14548,14685,15360,14556,14629,14773,15360,14765,14829,14966,15360,15159,15207,15303,15360,15372,15396,15444,15360,15516,15532,15572,15360,15653,15661,15693,15360,15829,15837,15853,15360,16022,16014,16022,15360,16311,16295,16279,15360,16343,16319,16303,15360,16412,16388,16359,15360,15813,15797,15773,15360,13063,13151,13183,15360,11484,11701,11798,15360,12300,12412,12468,15360,14613,14637,14653,15360,11974,12215,12316,15360,14135,14215,14303,15360,15604,15629,15677,15360,15524,15548,15596,15360,15351,15380,15428,15360,14797,14894,15054,15360,13990,14231,14500,15360,13492,13709,14070,15360,12886,13316,13701,15360,12613,13207,13749,15360,11525,11974,12428,15360,9284,9412,8629,15360,8597,8653,6951,15360,7806,7790,6292,15360,7589,7541,6437,15360,7485,7437,6597,15360,7453,7404,6180,15360,7774,7686,6565,15360,8300,8260,7332,15360,9918,9942,9862,15360,10348,10372,10231,15360,9725,9709,9228,15360,10613,10621,10509,15360,10199,10175,9838,15360,10380,10388,10340,15360,11207,11255,11284,15360,10661,10717,10725,15360,10103,10135,9950,15360,8444,8436,7669,15360,8469,8501,7445,15360,8950,9111,8854,15360,9485,9798,10071,15360,8364,8501,8039,15360,7959,7951,6806,15360,8597,8605,8039,15360,8501,8533,7557,15360,8758,8830,7509,15360,10758,10830,10693,15360,11508,11605,11621,15360,13524,13669,13886,15360,13830,14022,14327,15360,13926,14103,14364,15360,13460,13621,13886,15360,12854,13191,13420,15360,13597,13733,13926,15360,13846,13990,14223,15360,13773,13942,14199,15360,13910,14087,14356,15360,13813,14022,14319,15360,14247,14396,14540,15360,14693,14765,14878,15360,15223,15279,15343,15360,15508,15524,15540,15360,15540,15548,15564,15360,15327,15335,15319,15360,15303,15311,15303,15360,15918,15910,15886,15360,16247,16207,16151,15360,16175,16143,16086,15360,14436,14452,14436,15360,12263,12380,12404,15360,11476,11701,11773,15360,12380,12492,12532,15360,14797,14797,14757,15360,11372,11589,11677,15360,12597,12934,13356,15360,13990,14364,14725,15360,14183,14444,14773,15360,14231,14444,14717,15360,14412,14532,14709,15360,14054,14199,14380,15360,12372,12500,12605,15360,12199,12565,13006,15360,12581,13175,13653,15360,10055,10380,10324,15360,8557,8573,6726,15360,8167,8196,6533,15360,7517,7485,6119,15360,7244,7172,5798,15360,7071,6959,5718,15360,7669,7581,6260,15360,8661,8605,7975,15360,10942,11079,11151,15360,12573,12741,13014,15360,11902,12030,12191,15360,10308,10332,10135,15360,11255,11300,11284,15360,11276,11348,11396,15360,10055,10215,10292,15360,12183,12332,12468,15360,9918,9966,9798,15360,8734,8742,8196,15360,8967,8950,8469,15360,10260,10276,10039,15360,9734,9758,9605,15360,9388,9404,9308,15360,7943,7878,7095,15360,7726,7637,6645,15360,8047,7983,7204,15360,9284,9236,8693,15360,9621,9565,9143,15360,11255,11268,11047,15360,13175,13332,13420,15360,13773,13934,14175,15360,13854,14022,14271,15360,13870,14038,14279,15360,13388,13516,13677,15360,12279,12629,12966,15360,13348,13452,13564,15360,13821,13918,14054,15360,13701,13846,14022,15360,13460,13605,13781,15360,13492,13637,13821,15360,13709,13821,13950,15360,14372,14428,14476,15360,14516,14572,14613,15360,14741,14789,14813,15360,14725,14749,14749,15360,13452,13484,13468,15360,13476,13500,13492,15360,14990,15022,15022,15360,14556,14572,14564,15360,15094,15111,15094,15360,13231,13287,13215,15360,11255,11380,11175,15360,10677,10886,10492,15360,11846,12006,11934,15360,14327,14340,14279,15360,10766,11039,10862,15360,12918,13255,13452,15360,14231,14548,14886,15360,13878,14380,14765,15360,13444,13862,14412,15360,12151,12404,12621,15360,12637,12902,13215,15360,11549,11749,11870,15360,12279,12653,13119,15360,13223,13404,13516,15360,9228,9260,8276,15360,8087,7991,6308,15360,7918,7814,6919,15360,7469,7364,6148,15360,7485,7380,6212,15360,8228,7991,7204,15360,9276,8967,8212,15360,9806,9573,8742,15360,10135,10087,9621,15360,11452,11452,11452,15360,10629,10637,10509,15360,10693,10733,10637,15360,11095,11111,10982,15360,11292,11348,11372,15360,10199,10244,10167,15360,10814,10926,10846,15360,8669,8774,7493,15360,7870,7910,6244,15360,8204,8183,6919,15360,9806,9758,9159,15360,9460,9436,8629,15360,9159,9087,8260,15360,7637,7509,6790,15360,7758,7629,6838,15360,7967,7918,6774,15360,10854,10749,10501,15360,11508,11412,11316,15360,12372,12300,12151,15360,12030,12119,12063,15360,12781,12910,12982,15360,13476,13581,13661,15360,13484,13589,13677,15360,12404,12428,12380,15360,11605,11765,11798,15360,11492,11533,11452,15360,11838,11886,11798,15360,12263,12372,12380,15360,12151,12231,12175,15360,11492,11508,11412,15360,11119,11111,10838,15360,12508,12581,12573,15360,12621,12693,12677,15360,12573,12629,12589,15360,12292,12324,12231,15360,12476,12565,12573,15360,11998,12159,12215,15360,12950,13071,13159,15360,12263,12372,12428,15360,12380,12428,12444,15360,11300,11308,11143,15360,10199,10244,9734,15360,9709,9701,9252,15360,10492,10581,10404,15360,11476,11516,11388,15360,9477,9517,8790,15360,11717,11854,11838,15360,14247,14420,14524,15360,14054,14311,14436,15360,13597,13805,13982,15360,11364,11533,11597,15360,12263,12428,12549,15360,11436,11605,11653,15360,13079,13324,13444,15360,12516,12613,12605,15360,10039,10015,9605,15360,8693,8621,7878,15360,7951,7862,6902,15360,8196,8204,7015,15360,8677,8589,7637,15360,9284,9031,8340,15360,9814,9605,8902,15360,10685,10428,9910,15360,10492,10260,9685,15360,9404,9252,7943,15360,8830,8766,7220,15360,9220,9047,7943,15360,9693,9669,9015,15360,11412,11468,11372,15360,11135,11159,11023,15360,10087,10055,9428,15360,9910,10007,9621,15360,9236,9300,8934,15360,9597,9557,8902,15360,10669,10549,9782,15360,9926,9870,9127,15360,9894,9918,9047,15360,8685,8742,7910,15360,9958,10167,10284,15360,10215,10332,10396,15360,11396,11428,11452,15360,11223,11255,11300,15360,11814,11862,11958,15360,10685,10846,10870,15360,10340,10380,10007,15360,11175,11207,10894,15360,12103,12207,12215,15360,11143,11103,10902,15360,9910,9966,9613,15360,10015,10079,9493,15360,10806,10846,10517,15360,10862,10934,10637,15360,10838,10942,10661,15360,10958,11087,10878,15360,10709,10838,10701,15360,10669,10741,10589,15360,10581,10669,10525,15360,10252,10348,9974,15360,11396,11500,11525,15360,11207,11255,11264,15360,10878,10910,10934,15360,11031,11063,11159,15360,11292,11324,11396,15360,11223,11255,11300,15360,10693,10685,10645,15360,10428,10420,10324,15360,10300,10252,9991,15360,10838,10846,10798,15360,10428,10428,10364,15360,9669,9605,9380,15360,10167,10244,10087,15360,11709,11854,11910,15360,11223,11284,11268,15360,10231,10244,9878,15360,10199,10244,9862,15360,10183,10260,9942,15360,10525,10653,10541,15360,12500,12597,12621,15360,11814,11741,11597,15360,11533,11460,11175,15360,11103,11006,10557,15360,10444,10396,9846,15360,10007,10023,9228,15360,9653,9790,8469,15360,9316,9372,8039,15360,9557,9830,8071,15360,9621,9918,8071,15360,9677,10015,8167,15360,9991,10284,8420,15360,10215,10436,8581,15360,10260,10484,8645,15360,10292,10476,8902,15360,10324,10468,9252,15360,9910,9894,8886,15360,10525,10573,9701,15360,9782,10039,8581,15360,9565,9814,8167,15360,9950,10039,8934,15360,10749,10758,10199,15360,10669,10685,10244,15360,10838,10838,10460,15360,11215,10910,10087,15360,11492,11364,10806,15360,11095,11159,11055,15360,11364,11388,11356,15360,11023,11039,10990,15360,11653,11653,11613,15360,11798,11725,11557,15360,11974,11862,11637,15360,12039,11942,11765,15360,12119,12047,11934,15360,12151,12071,11950,15360,12087,12006,11886,15360,12047,11966,11838,15360,11990,11926,11790,15360,11974,11910,11798,15360,11998,11934,11814,15360,12111,12039,11886,15360,12231,12143,11998,15360,12292,12199,12039,15360,12039,11974,11846,15360,11822,11782,11653,15360,11862,11838,11765,15360,11798,11765,11701,15360,11782,11733,11669,15360,11798,11749,11685,15360,11838,11790,11725,15360,11870,11822,11749,15360,11741,11701,11621,15360,11565,11541,11452,15360,11533,11500,11412,15360,11621,11581,11484,15360,11605,11557,11460,15360,11516,11468,11372,15360,11565,11533,11444,15360,11677,11637,11541,15360,11725,11661,11557,15360,11725,11661,11557,15360,11733,11669,11573,15360,11838,11773,11677,15360,11998,11926,11814,15360,12014,11926,11798,15360,11460,11404,11332,15360,11637,11557,11428,15360,12014,11894,11693,15360,12167,12022,11765,15360,12119,11982,11709,15360,11926,11806,11516,15360,11685,11589,11300,15360,11476,11404,10886,15360,11239,11151,10468,15360,10766,10733,9894,15360,10565,10565,9589,15360,10436,10444,9332,15360,10308,10308,9031,15360,10308,10316,8999,15360,10199,10244,8774,15360,9725,9645,8549,15360,10244,10276,8967,15360,10878,10838,10183,15360,11055,10966,10348,15360,11119,11006,10404,15360,11264,11135,10565,15360,11404,11316,10822,15360,11492,11388,10982,15360,11798,11613,11223,15360,12047,11830,11412,15360,12039,11894,11597,15360,12127,11990,11693,15360,12127,11990,11725,15360,12191,12055,11806,15360,12191,12055,11830,15360,11870,11773,11613,15360,11573,11516,11428,15360,11533,11484,11412,15360,11541,11492,11420,15360,11565,11516,11452,15360,11589,11541,11476,15360,11605,11557,11500,15360,11637,11589,11533,15360,11669,11621,11557,15360,11701,11645,11573,15360,11733,11669,11589,15360,11798,11717,11605,15360,11838,11749,11621,15360,11878,11782,11661,15360,11894,11798,11661,15360,11926,11806,11653,15360,11958,11822,11661,15360,11982,11846,11677,15360,12006,11870,11685,15360,12095,11950,11765,15360,12047,11910,11741,15360,11886,11765,11605,15360,11838,11733,11589,15360,11814,11717,11589,15360,11814,11709,11573,15360,11790,11693,11565,15360,11741,11677,11589,15360,11733,11677,11613,15360,11733,11685,11629,15360,11717,11669,11621,15360,11685,11645,11589,15360,11629,11589,11533,15360,11573,11525,11468,15360,11492,11444,11380,15360,11316,11255,11111,15360,11348,11292,11143,15360,11516,11436,11316,15360,11854,11749,11589,15360,12127,11990,11765,15360,12199,12055,11782,15360,12340,12231,11910,15360,12372,12292,11958,15360,12380,12300,11974,15360,12348,12247,11910,15360,12324,12215,11878,15360,12247,12103,11773,15360,12095,11958,11637,15360,12055,11926,11613,15360,11974,11854,11541,15360,11870,11765,11468,15360,11966,11854,11541,15360,12300,12151,11846,15360,12396,12316,12006,15360,12388,12308,11990,15360,12388,12308,12006,15360,12396,12316,12022,15360,12396,12308,12022,15360,12396,12308,12022,15360,12364,12279,11974,15360,12340,12247,11942,15360,12340,12231,11926,15360,12215,12071,11806,15360,12095,11966,11749,15360,11741,11645,11500,15360,11420,11356,11255,15360,11364,11308,11207,15360,11356,11300,11175,15360,11348,11292,11191,15360,11372,11324,11255,15360,11412,11364,11308,15360,11420,11372,11316,15360,11428,11380,11324,15360,11444,11388,11332,15360,11484,11428,11364,15360,11508,11460,11396,15360,11557,11500,11436,15360,11589,11533,11460,15360,11613,11557,11484,15360,11621,11557,11492,15360,11613,11557,11500,15360,11621,11557,11500,15360,11629,11573,11508,15360,11629,11573,11508,15360,11605,11557,11484,15360,11589,11533,11468,15360,11557,11508,11436,15360,11549,11500,11428,15360,11557,11500,11436,15360,11549,11492,11436,15360,11533,11484,11428,15360,11525,11476,11428,15360,11516,11476,11428,15360,11525,11484,11444,15360,11516,11476,11428,15360,11468,11428,11380,15360,11428,11388,11332,15360,11356,11308,11239,15360,11308,11255,11127,15360,11167,11071,10926,15360,11223,11119,10966,15360,11276,11175,10998,15360,11404,11332,11191,15360,11773,11693,11557,15360,11926,11798,11613,15360,12207,12039,11773,15360,12348,12231,11894,15360,12308,12151,11846,15360,12332,12215,11894,15360,12364,12279,11958,15360,12380,12292,11974,15360,12396,12316,12022,15360,12404,12316,12039,15360,12412,12332,12087,15360,12412,12332,12103,15360,12436,12356,12135,15360,12372,12292,12039,15360,12420,12332,12087,15360,12396,12316,12055,15360,12356,12263,11990,15360,12340,12231,11942,15360,12271,12127,11854,15360,12215,12071,11814,15360,12292,12135,11878,15360,12288,12135,11870,15360,12111,11982,11765,15360,11990,11886,11717,15360,11637,11557,11428,15360,11364,11300,11143,15360,11316,11239,11079,15360,11300,11207,11047,15360,11268,11159,11015,15360,11268,11159,11015,15360,11268,11159,11031,15360,11300,11223,11095,15360,11340,11292,11191,15360,11348,11300,11223,15360,11372,11324,11255,15360,11380,11332,11255,15360,11372,11316,11239,15360,11396,11340,11268,15360,11468,11404,11300,15360,11460,11404,11324,15360,11484,11428,11356,15360,11492,11436,11372,15360,11500,11444,11388,15360,11508,11460,11404,15360,11500,11452,11396,15360,11492,11436,11380,15360,11468,11412,11356,15360,11444,11388,11324,15360,11444,11388,11324,15360,11428,11380,11316,15360,11412,11356,11300,15360,11404,11348,11300,15360,11404,11356,11308,15360,11396,11356,11308,15360,11388,11348,11308,15360,11372,11340,11292,15360,11348,11308,11255,15360,11284,11223,11111,15360,11231,11143,11023,15360,11199,11111,10974,15360,11047,10958,10814,15360,11127,11023,10870,15360,11119,11006,10846,15360,11175,11055,10886,15360,11292,11191,10998,15360,11525,11404,11284,15360,11822,11637,11476,15360,11878,11733,11549,15360,11918,11790,11573,15360,12063,11918,11653,15360,12223,12063,11765,15360,12300,12151,11846,15360,12255,12103,11814,15360,12271,12127,11846,15360,12271,12127,11862,15360,12271,12127,11886,15360,12308,12183,11942,15360,12175,12039,11814,15360,12063,11934,11709,15360,12159,12014,11765,15360,12215,12063,11798,15360,12143,11998,11757,15360,12071,11934,11693,15360,11998,11870,11661,15360,11974,11870,11685,15360,11998,11910,11757,15360,11846,11765,11629,15360,11468,11396,11284,15360,11308,11223,11031,15360,11215,11103,10934,15360,11207,11095,10942,15360,11215,11103,10950,15360,11191,11087,10942,15360,11175,11079,10942,15360,11167,11063,10934,15360,11143,11031,10902,15360,11247,11143,11015,15360,11284,11191,11079,15360,11300,11223,11095,15360,11316,11268,11127,15360,11340,11284,11143,15360,11340,11284,11159,15360,11356,11300,11191,15360,11372,11316,11239,15360,11380,11324,11255,15360,11372,11316,11255,15360,11380,11324,11276,15360,11380,11324,11268,15360,11372,11316,11255,15360,11364,11316,11255,15360,11364,11308,11239,15360,11348,11292,11207,15360,11340,11284,11191,15360,11348,11292,11191,15360,11348,11292,11207,15360,11340,11292,11207,15360,11340,11292,11207,15360,11324,11276,11207,15360,11308,11255,11175,15360,11264,11175,11079,15360,11119,11039,10934,15360,11103,11015,10902,15360,11095,11006,10878,15360,11031,10942,10806,15360,10990,10902,10766,15360,11047,10942,10814,15360,11031,10926,10790,15360,11055,10942,10806,15360,11119,10998,10846,15360,11151,11015,10830,15360,11268,11095,10886,15360,11484,11396,11268,15360,11790,11701,11549,15360,11886,11790,11637,15360,11838,11741,11581,15360,11838,11725,11541,15360,11902,11782,11581,15360,11966,11838,11629,15360,11974,11846,11629,15360,11958,11838,11629,15360,11950,11838,11637,15360,11814,11701,11525,15360,11581,11492,11332,15360,11645,11541,11380,15360,11806,11701,11533,15360,11902,11806,11637,15360,11950,11862,11717,15360,12014,11934,11790,15360,11942,11862,11725,15360,11565,11492,11388,15360,11292,11191,11015,15360,11231,11111,10950,15360,11159,11047,10894,15360,11119,11006,10854,15360,11127,11023,10878,15360,11159,11055,10902,15360,11135,11031,10894,15360,11111,11006,10878,15360,11095,10990,10870,15360,11095,10998,10886,15360,11071,10966,10846,15360,11111,11006,10902,15360,11191,11095,10974,15360,11268,11159,11031,15360,11284,11191,11063,15360,11292,11207,11063,15360,11300,11223,11079,15360,11332,11268,11143,15360,11316,11255,11127,15360,11316,11255,11143,15360,11308,11239,11127,15360,11316,11255,11159,15360,11300,11223,11127,15360,11292,11207,11095,15360,11300,11223,11111,15360,11300,11223,11095,15360,11300,11223,11095,15360,11308,11239,11111,15360,11300,11223,11111,15360,11292,11207,11111,15360,11264,11167,11071,15360,11215,11127,11047,15360,11135,11055,10966,15360,11015,10934,10846,15360,10918,10838,10733,15360,10982,10894,10782,15360,10974,10886,10766,15360,10982,10894,10766,15360,10958,10862,10749,15360,10982,10886,10774,15360,10958,10862,10758,15360,10958,10862,10749,15360,11015,10910,10790,15360,11023,10910,10774,15360,11079,10958,10806,15360,11103,10974,10798,15360,11191,11047,10846,15360,11468,11388,11276,15360,11846,11765,11637,15360,12006,11918,11782,15360,11998,11910,11782,15360,11902,11822,11693,15360,11838,11749,11637,15360,11782,11709,11605,15360,11806,11741,11645,15360,11782,11717,11629,15360,11773,11717,11621,15360,11870,11806,11701,15360,11942,11862,11757,15360,12183,12103,11974,15360,11974,11894,11765,15360,11476,11404,11308,15360,11268,11143,10966,15360,11183,11063,10902,15360,11111,10998,10854,15360,11055,10942,10806,15360,11023,10910,10766,15360,11047,10934,10782,15360,11039,10926,10782,15360,11079,10966,10830,15360,11031,10918,10782,15360,11031,10926,10806,15360,10990,10894,10782,15360,10974,10886,10790,15360,10966,10870,10774,15360,11006,10902,10806,15360,11039,10942,10838,15360,11127,11023,10910,15360,11175,11079,10958,15360,11191,11087,10958,15360,11207,11095,10958,15360,11268,11143,11015,15360,11276,11175,11047,15360,11284,11191,11079,15360,11292,11191,11079,15360,11276,11175,11079,15360,11239,11135,11031,15360,11268,11159,11047,15360,11215,11111,11006,15360,11239,11127,11015,15360,11255,11143,11031,15360,11223,11119,11015,15360,11199,11103,10998,15360,11175,11087,10982,15360,11143,11047,10958,15360,11031,10942,10854,15360,10958,10878,10790,15360,10910,10830,10741,15360,10942,10862,10758,15360,10926,10838,10733,15360,10854,10758,10637,15360,10918,10830,10709,15360,10910,10822,10717,15360,10942,10846,10749,15360,10942,10854,10741,15360,10942,10854,10749,15360,10966,10870,10758,15360,10966,10870,10758,15360,10958,10854,10733,15360,10998,10886,10741,15360,10942,10830,10677,15360,11039,10918,10749,15360,11095,10974,10806,15360,11308,11223,11031,15360,11468,11396,11292,15360,11605,11533,11428,15360,11701,11621,11525,15360,11693,11629,11541,15360,11685,11621,11549,15360,11685,11629,11549,15360,11629,11565,11484,15360,11589,11533,11444,15360,11364,11308,11191,15360,11191,11087,10958,15360,11135,11031,10902,15360,11135,11031,10894,15360,11055,10950,10830,15360,11015,10910,10782,15360,10958,10854,10733,15360,10942,10838,10717,15360,10974,10870,10733,15360,10982,10878,10749,15360,10990,10886,10758,15360,11015,10910,10798,15360,10966,10862,10758,15360,10950,10854,10758,15360,10910,10822,10733,15360,10894,10798,10709,15360,10902,10814,10725,15360,10934,10846,10758,15360,10910,10822,10733,15360,10950,10854,10749,15360,10974,10878,10766,15360,11047,10942,10830,15360,11095,10990,10878,15360,11167,11055,10942,15360,11199,11103,10990,15360,11191,11087,10982,15360,11151,11047,10950,15360,11135,11031,10934,15360,11095,10998,10902,15360,11143,11047,10950,15360,11079,10990,10894,15360,11079,10990,10902,15360,11103,11006,10910,15360,11079,10982,10886,15360,11023,10926,10822,15360,10982,10894,10798,15360,10958,10870,10782,15360,10910,10814,10725,15360,10926,10838,10741,15360,10934,10838,10733,15360,10950,10854,10749,15360,10886,10798,10709,15360,10910,10814,10709,15360,10926,10830,10725,15360,10910,10814,10701,15360,10862,10774,10677,15360,10950,10854,10733,15360,10926,10830,10717,15360,10926,10838,10725,15360,10926,10830,10725,15360,10894,10798,10685,15360,10926,10830,10701,15360,10958,10854,10717,15360,10934,10830,10685,15360,10950,10846,10709,15360,10974,10862,10717,15360,10942,10830,10685,15360,10958,10846,10701,15360,11006,10894,10749,15360,10950,10846,10725,15360,10958,10862,10741,15360,10894,10806,10701,15360,10854,10774,10669,15360,10886,10806,10701,15360,10862,10790,10693,15360,10878,10806,10717,15360,10982,10902,10798,15360,10990,10902,10798,15360,10950,10862,10758,15360,10942,10846,10733,15360,10870,10774,10669,15360,10894,10798,10693,15360,10918,10830,10725,15360,10894,10806,10701,15360,10926,10830,10733,15360,10902,10830,10725,15360,10870,10790,10693,15360,10886,10814,10725,15360,10814,10741,10661,15360,10838,10766,10677,15360,10822,10741,10661,15360,10822,10741,10669,15360,10862,10790,10709,15360,10846,10758,10669,15360,10894,10798,10693,15360,10974,10878,10766,15360,10966,10870,10766,15360,11023,10926,10814,15360,11079,10974,10862,15360,11006,10910,10814,15360,10950,10862,10766,15360,10982,10894,10798,15360,10958,10862,10774,15360,10958,10870,10782,15360,10910,10830,10741,15360,10950,10862,10766,15360,10982,10886,10790,15360,10918,10822,10725,15360,10886,10798,10701,15360,10854,10766,10669,15360,10894,10806,10709,15360,10926,10830,10725,15360,10926,10830,10725,15360,10958,10862,10749,15360,10958,10862,10749,15360,10894,10806,10717,15360,10902,10814,10717,15360,10878,10790,10677,15360,10942,10838,10717,15360,10918,10814,10701,15360,10886,10790,10661,15360,10942,10838,10717,15360,10950,10854,10725,15360,10950,10854,10725,15360,10910,10814,10693,15360,10910,10814,10685,15360,10942,10838,10709,15360,10894,10790,10661,15360,10910,10806,10669,15360,10822,10725,10597,15360,10749,10661,10541,15360,10830,10733,10613,15360,10838,10741,10629,15360,10806,10709,10597,15360,10854,10766,10653,15360,10862,10774,10669,15360,10798,10725,10629,15360,10822,10749,10653,15360,10854,10782,10693,15360,10806,10741,10661,15360,10862,10790,10701,15360,10870,10790,10685,15360,10870,10790,10693,15360,10878,10790,10677,15360,10862,10782,10677,15360,10870,10790,10693,15360,10870,10782,10685,15360,10894,10814,10709,15360,10886,10814,10709,15360,10846,10782,10685,15360,10741,10669,10573,15360,10766,10693,10589,15360,10709,10637,10541,15360,10741,10669,10589,15360,10741,10677,10589,15360,10709,10637,10557,15360,10774,10701,10613,15360,10862,10774,10677,15360,11006,10918,10806,15360,11006,10902,10782,15360,10974,10870,10749,15360,10958,10854,10733,15360,10934,10838,10725,15360,10934,10838,10733,15360,10934,10838,10725,15360,10886,10790,10685,15360,10854,10766,10661,15360,10886,10798,10701,15360,10838,10749,10645,15360,10878,10782,10661,15360,10822,10725,10613,15360,10822,10717,10605,15360,10846,10749,10629,15360,10854,10749,10637,15360,10950,10854,10733,15360,10958,10854,10741,15360,10910,10806,10693,15360,10926,10822,10693,15360,10934,10838,10725,15360,10910,10822,10709,15360,10910,10822,10709,15360,10886,10782,10661,15360,10910,10814,10677,15360,10910,10806,10677,15360,10926,10822,10685,15360,10958,10854,10717,15360,10974,10870,10725,15360,10926,10830,10693,15360,10926,10830,10693,15360,10918,10822,10693,15360,10934,10838,10701,15360,10918,10814,10685,15360,10878,10782,10653,15360,10870,10774,10645,15360,10838,10749,10629,15360,10806,10717,10605,15360,10822,10733,10621,15360,10822,10733,10621,15360,10846,10758,10653,15360,10846,10766,10653,15360,10822,10741,10629,15360,10806,10733,10629,15360,10806,10725,10621,15360,10790,10709,10605,15360,10766,10693,10589,15360,10814,10741,10629,15360,10846,10766,10653,15360,10838,10758,10653,15360,10878,10790,10677,15360,10894,10798,10685,15360,10830,10741,10629,15360,10830,10758,10653,15360,10798,10725,10629,15360,10806,10733,10629,15360,10717,10637,10525,15360,10661,10581,10476,15360,10701,10621,10517,15360,10733,10661,10565,15360,10782,10685,10557,15360,10862,10758,10613,15360,10974,10862,10725,15360,10958,10846,10709,15360,11006,10902,10766,15360,11006,10902,10774,15360,11039,10934,10814,15360,11006,10902,10790,15360,11006,10910,10790,15360,10950,10854,10741,15360,10934,10830,10709,15360,10918,10814,10701,15360,10854,10758,10653,15360,10918,10814,10701,15360,10870,10766,10645,15360,10830,10733,10621,15360,10934,10830,10709,15360,10990,10886,10758,15360,10950,10838,10717,15360,10910,10814,10701,15360,10926,10822,10693,15360,10934,10830,10709,15360,10878,10774,10653,15360,10934,10830,10701,15360,10926,10822,10693,15360,10878,10782,10661,15360,10878,10782,10661,15360,10862,10766,10621,15360,10886,10782,10645,15360,10886,10782,10653,15360,10926,10822,10701,15360,10902,10806,10685,15360,10926,10822,10701,15360,10918,10814,10685,15360,10878,10782,10645,15360,10910,10806,10669,15360,10854,10758,10621,15360,10886,10790,10645,15360,10854,10758,10629,15360,10830,10741,10613,15360,10918,10814,10685,15360,10862,10766,10645,15360,10830,10741,10613,15360,10806,10717,10597,15360,10741,10661,10557,15360,10774,10693,10581,15360,10749,10669,10557,15360,10774,10693,10581,15360,10766,10685,10573,15360,10790,10709,10597,15360,10782,10701,10589,15360,10790,10709,10597,15360,10838,10749,10621,15360,10870,10774,10645,15360,10894,10790,10661,15360,10878,10782,10653,15360,10846,10741,10613,15360,10790,10693,10557,15360,10814,10717,10597,15360,10790,10701,10581,15360,10741,10645,10525,15360,10717,10629,10509,15360,10774,10685,10573,15360,10725,10637,10525,15360,10854,10749,10621,15360,10950,10846,10701,15360,10966,10854,10709,15360,10934,10814,10677,15360,10926,10822,10701,15360,10982,10878,10766,15360,10998,10894,10782,15360,10990,10878,10766,15360,10998,10894,10782,15360,10998,10886,10774,15360,10998,10886,10758,15360,11006,10894,10774,15360,10942,10838,10733,15360,10958,10854,10741,15360,10958,10854,10749,15360,11006,10902,10790,15360,11015,10902,10798,15360,10982,10870,10758,15360,10998,10894,10782,15360,10974,10870,10758,15360,11006,10902,10790,15360,10998,10894,10774,15360,10974,10870,10758,15360,10950,10854,10741,15360,10878,10790,10693,15360,10902,10814,10701,15360,10918,10822,10709,15360,10838,10733,10613,15360,10878,10782,10661,15360,10934,10838,10717,15360,10902,10806,10693,15360,10918,10822,10709,15360,10926,10830,10709,15360,10838,10733,10605,15360,10910,10806,10661,15360,10942,10838,10693,15360,10886,10782,10645,15360,10886,10782,10637,15360,10854,10749,10621,15360,10926,10830,10709,15360,10966,10862,10741,15360,10846,10749,10629,15360,10830,10733,10605,15360,10854,10758,10637,15360,10822,10725,10605,15360,10886,10790,10661,15360,10902,10806,10669,15360,10918,10814,10677,15360,10830,10733,10605,15360,10806,10717,10589,15360,10870,10774,10645,15360,10934,10838,10709,15360,10958,10862,10733,15360,10886,10790,10661,15360,10894,10798,10661,15360,10958,10854,10709,15360,10934,10830,10709,15360,10814,10717,10581,15360,10862,10758,10613,15360,10854,10741,10589,15360,10814,10717,10573,15360,10886,10782,10645,15360,10814,10725,10597,15360,10862,10766,10637,15360,10910,10806,10669,15360,10942,10838,10709,15360,10966,10862,10733,15360,10974,10870,10741,15360,10974,10870,10749,15360,10958,10862,10749,15360,11031,10934,10822,15360,10998,10894,10782,15360,10974,10870,10766,15360,11023,10918,10814,15360,11039,10926,10822,15360,10958,10846,10741,15360,10918,10814,10693,15360,10966,10870,10741,15360,10982,10886,10766,15360,10982,10878,10766,15360,10942,10846,10733,15360,10958,10862,10758,15360,10950,10854,10758,15360,10934,10830,10717,15360,10966,10862,10733,15360,10942,10846,10725,15360,10934,10846,10733,15360,10934,10846,10733,15360,10878,10798,10693,15360,10886,10798,10693,15360,10910,10814,10709,15360,10942,10846,10733,15360,10838,10733,10597,15360,10878,10774,10645,15360,10918,10822,10701,15360,10878,10782,10653,15360,10894,10790,10661,15360,10934,10838,10725,15360,10958,10854,10725,15360,10966,10862,10733,15360,10910,10806,10685,15360,10982,10878,10758,15360,10942,10854,10749,15360,10934,10838,10733,15360,10918,10814,10701,15360,10894,10798,10669,15360,10894,10798,10669,15360,10814,10725,10605,15360,10902,10798,10669,15360,10814,10725,10605,15360,10894,10798,10685,15360,10958,10862,10749,15360,10910,10814,10701,15360,10910,10806,10685,15360,10918,10814,10693,15360,10926,10822,10709,15360,10894,10790,10661,15360,10902,10806,10677,15360,10902,10806,10685,15360,10934,10838,10717,15360,10934,10838,10701,15360,10934,10838,10717,15360,10950,10854,10725,15360,10894,10798,10661,15360,10862,10749,10597,15360,10894,10798,10677,15360,10878,10782,10661,15360,10926,10838,10717,15360,10926,10838,10717,15360,10918,10822,10709,15360,10934,10838,10733,15360,10926,10838,10733,15360,10958,10870,10766,15360,10942,10854,10749,15360,10958,10870,10774,15360,10974,10878,10774,15360,10958,10854,10741,15360,10950,10846,10741,15360,10950,10854,10758,15360,10934,10838,10733,15360,10942,10846,10725,15360,10966,10862,10741,15360,10926,10838,10733,15360,10958,10862,10749,15360,10910,10822,10709,15360,10942,10854,10758,15360,10926,10838,10733,15360,10910,10822,10717,15360,10934,10838,10733,15360,10934,10846,10733,15360,10902,10814,10709,15360,10926,10830,10717,15360,10918,10822,10709,15360,10838,10749,10637,15360,10878,10790,10677,15360,10942,10846,10733,15360,10926,10822,10701,15360,10958,10862,10749,15360,10886,10790,10685,15360,10918,10814,10693,15360,10910,10814,10693,15360,10902,10806,10701,15360,10878,10774,10637,15360,10798,10693,10565,15360,10822,10725,10597,15360,10934,10838,10709,15360,10958,10854,10725,15360,10886,10790,10669,15360,10910,10806,10677,15360,10886,10782,10645,15360,10830,10725,10597,15360,10822,10717,10581,15360,10862,10758,10637,15360,10878,10782,10669,15360,10926,10822,10709,15360,10974,10878,10774,15360,10966,10870,10758,15360,10918,10822,10709,15360,10846,10749,10645,15360,10894,10798,10693,15360,10918,10822,10709,15360,10974,10878,10774,15360,10918,10822,10717,15360,10982,10886,10774,15360,10974,10878,10758,15360,10950,10854,10741,15360,10958,10854,10725,15360,10982,10886,10766,15360,10918,10822,10701,15360,10878,10782,10669,15360,10886,10790,10669,15360,10934,10838,10717,15360,10950,10854,10741,15360,10934,10838,10733,15360,10982,10886,10782,15360,10886,10798,10701,15360,10870,10782,10685,15360,10894,10814,10717,15360,10910,10822,10725,15360,10934,10838,10733,15360,10950,10846,10741,15360,10934,10838,10725,15360,10934,10846,10749,15360,10902,10814,10717,15360,10878,10790,10677,15360,10878,10782,10669,15360,10854,10766,10645,15360,10838,10749,10629,15360,10902,10814,10701,15360,10910,10814,10693,15360,10902,10798,10669,15360,10910,10806,10677,15360,10886,10782,10653,15360,10854,10749,10629,15360,10870,10774,10653,15360,10974,10870,10758,15360,10990,10878,10758,15360,10918,10822,10709,15360,10926,10838,10725,15360,10958,10854,10733,15360,10894,10790,10653,15360,10822,10725,10605,15360,10878,10782,10661,15360,10974,10870,10749,15360,10902,10806,10677,15360,10934,10838,10725,15360,10870,10774,10653,15360,10798,10701,10581,15360,10854,10749,10621,15360,10894,10798,10669,15360,10934,10822,10685,15360,10942,10830,10701,15360,10910,10806,10669,15360,10870,10758,10629,15360,10886,10774,10645,15360,10950,10838,10701,15360,10966,10870,10749,15360,10886,10790,10685,15360,10870,10782,10677,15360,10934,10838,10733,15360,10934,10838,10725,15360,10822,10725,10621,15360,10878,10790,10677,15360,10894,10798,10693,15360,10822,10733,10629,15360,10894,10798,10685,15360,10998,10902,10790,15360,11015,10918,10806,15360,10950,10854,10741,15360,10950,10846,10741,15360,10934,10838,10733,15360,10942,10846,10749,15360,10910,10822,10725,15360,10846,10758,10653,15360,10878,10790,10685,15360,10894,10798,10701,15360,10862,10774,10669,15360,10814,10725,10621,15360,10846,10758,10645,15360,10870,10774,10661,15360,10870,10774,10677,15360,10878,10790,10693,15360,10878,10782,10677,15360,10830,10741,10637,15360,10870,10782,10677,15360,10966,10870,10766,15360,11015,10918,10814,15360,10910,10814,10701,15360,10942,10846,10725,15360,10950,10846,10725,15360,10942,10838,10725,15360,10934,10830,10701,15360,10910,10798,10677,15360,10886,10782,10653,15360,10838,10733,10597,15360,10902,10806,10669,15360,10830,10733,10613,15360,10838,10741,10621,15360,10838,10741,10621,15360,10894,10798,10669,15360,10934,10830,10685,15360,10886,10790,10669,15360,10902,10806,10685,15360,10854,10749,10637,15360])),function(e){e.Top="Top",e.Bottom="Bottom",e.Front="Front",e.Back="Back",e.Left="Left",e.Right="Right"}(o_||(o_={}));class l_{static getCameraPositionByView(e,t,n,r,i){const s=rf.getVisibleObjectBoundingBox(e),a=l_.getCameraDirectionByView(t);l_.getCameraPositionByBboxAndDirection(s,n,r,i,a)}static getCameraPositionByObjectIds(e,t,n,r,i,s){const a=rf.getObjectsBoundingBox(e,t),o=l_.getCameraDirectionByView(n);l_.getCameraPositionByBboxAndDirection(a,r,i,s,o)}static getCameraPositionByObjects(e,t,n,r){const i=new En;ge()(e).call(e,(e=>{const t=rf.getBoundingBox(e);i.union(t)}));const s=new xn;t.getWorldDirection(s),l_.getCameraPositionByBboxAndDirection(i,n,r,t.projectionMatrix,s)}static getCameraPositionByVisibleObject(e,t,n,r){const i=rf.getVisibleObjectBoundingBox(e);l_.getCameraPositionByBboxAndDirection(i,n,r,t.projectionMatrix)}static getCameraPositionByBboxAndView(e,t,n,r,i){const s=l_.getCameraDirectionByView(t);return this.getCameraPositionByBboxAndDirection(e,n,r,i,s)}static getCameraPositionByBboxAndDirection(e,t,n,r,i){if(e.isEmpty())return;if(!r)return;const s=new xn,a=new xn,o=new xn(0,1,0);e.getSize(a),e.getCenter(s);let l,c,u=(a.x+a.y+a.z)/3*1.5;if(!i||null!=i&&i.equals(new xn))l=new xn(s.x+u,s.y+u/1.5,s.z+u),c=l.clone().sub(s);else{const e=new xn(u,u/1.5,u).length();c=new xn(-i.x,-i.y,-i.z).normalize().multiplyScalar(e),l=c.clone().add(s)}u=c.length(),c=c.normalize();const h=new Zn;h.lookAt(l,s,o);const p=new Zn;p.makeTranslation(-l.x,-l.y,-l.z);const d=e.clone().applyMatrix4(p).applyMatrix4(h.invert()).applyMatrix4(r),m=Math.max(Math.abs(d.max.x),Math.abs(d.min.x)),f=Math.max(Math.abs(d.max.y),Math.abs(d.min.y));u*=1.1*Math.sqrt(Math.pow(m,2)+Math.pow(f,2)),l=c.multiplyScalar(u).add(s),n.set(s.x,s.y,s.z),t.set(l.x,l.y,l.z)}static getCameraDirectionByView(e){const t=new xn(1,0,0);return e===o_.Top?t.set(0,-1,0):e===o_.Bottom?t.set(0,1,0):e===o_.Front?t.set(0,0,-1):e===o_.Back?t.set(0,0,1):e===o_.Left?t.set(1,0,0):e===o_.Right&&t.set(-1,0,0),t}static sleep(e){try{return v().resolve(new(v())((t=>{Re()((()=>{t("")}),e)})))}catch(e){return v().reject(e)}}static twinkle(e,t=500){try{const n=this,r=l_.twinklingObjectIds;return r[e.id]?v().resolve():(r[e.id]=!0,e.visible=!e.visible,v().resolve(n.sleep(t)).then((function(){return e.visible=!e.visible,v().resolve(n.sleep(t)).then((function(){return e.visible=!e.visible,v().resolve(n.sleep(t)).then((function(){return e.visible=!e.visible,v().resolve(n.sleep(t)).then((function(){return e.visible=!e.visible,v().resolve(n.sleep(t)).then((function(){e.visible=!e.visible,delete r[e.id]}))}))}))}))})))}catch(e){return v().reject(e)}}}gh(l_,"twinklingObjectIds",{});var c_=n(40703),u_=n.n(c_);const h_=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],p_=(()=>{const e=h_[0],t={};for(const n of h_){if((null==n?void 0:n[1])in document){for(const[r,i]of c_(n).call(n))t[e[r]]=i;return t}}return!1})(),d_={change:p_.fullscreenchange,error:p_.fullscreenerror};let m_={request:(e=document.documentElement,t)=>new _(((n,r)=>{const i=()=>{m_.off("change",i),n()};m_.on("change",i);const s=e[p_.requestFullscreen](t);s instanceof _&&s.then(i).catch(r)})),exit:()=>new _(((e,t)=>{if(!m_.isFullscreen)return void e();const n=()=>{m_.off("change",n),e()};m_.on("change",n);const r=document[p_.exitFullscreen]();r instanceof _&&r.then(n).catch(t)})),toggle:(e,t)=>m_.isFullscreen?m_.exit():m_.request(e,t),onchange(e){m_.on("change",e)},onerror(e){m_.on("error",e)},on(e,t){const n=d_[e];n&&document.addEventListener(n,t,!1)},off(e,t){const n=d_[e];n&&document.removeEventListener(n,t,!1)},raw:p_};X(m_,{isFullscreen:{get:()=>Boolean(document[p_.fullscreenElement])},element:{enumerable:!0,get:()=>{var e;return null!==(e=document[p_.fullscreenElement])&&void 0!==e?e:void 0}},isEnabled:{enumerable:!0,get:()=>Boolean(document[p_.fullscreenEnabled])}}),p_||(m_={isEnabled:!1});var f_=m_,g_=n(81290),__=n.n(g_);function v_(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function y_(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=v_(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=v_(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}class b_{constructor(e="uploadModelFile"){var t;gh(this,"input",void 0),this.input=document.createElement("input"),this.input.id=e,this.input.type="file",this.input.multiple=!0,this.input.accept=Z()(t=this.formats()).call(t,(e=>"."+e)).join(","),this.input.style.display="none",this.input.onchange=e=>{const t=e.target.files;!t||t.length<=0?im.error("[Uploader] No files to be uploaded!"):this.uploadFiles(t)}}formats(){return im.warn("[Uploader]: Should call derived class instead!"),[]}uploadFiles(e){im.warn(`[Uploader]: Should call derived class instead! files: ${e}`)}openFileBrowserToUpload(){this.input.click()}}class x_ extends b_{constructor(e,t){super(t),gh(this,"viewer",void 0),gh(this,"defaultModelConfig",{src:"",position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],instantiate:!1,merge:!1}),this.viewer=e}formats(){return["gltf","glb","dxf","obj","stl","fbx","ifc","dae"]}uploadFiles(e){const t=e[0],n=__().createObjectURL(t),r=y_({},this.defaultModelConfig);r.src=t.name,this.viewer.loadLocalModel(n,r,(e=>{const n=Math.floor(100*e.loaded/e.total);im.info(`[Uploader] Loading ${t.name}, ${n}%`)})).then((()=>{im.info(`[Uploader] Loaded ${t.name}`),__().revokeObjectURL(n)}))}}class T_ extends b_{constructor(e,t){super(t),gh(this,"viewer",void 0),gh(this,"onSuccess",void 0),gh(this,"defaultModelConfig",{src:"",position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],instantiate:!1,merge:!0}),this.viewer=e}formats(){return["dxf"]}uploadFiles(e){const t=e=>{let t="Loading progress";"parseProgress"===e.type&&(t="Parsing progress");const n=(100*e.loaded/e.total).toFixed(2);im.info(`[Uploader] ${t}: ${n}%`)};if(2===e.length){const n=e[0],r=e[1],i=__().createObjectURL(n),s=__().createObjectURL(r);this.viewer.compare({src:i,modelId:n.name},{src:s,modelId:r.name},t).then((()=>{this.onSuccess&&this.onSuccess({compare:!0}),console.log(`[Uploader] Compared models: ${i}, ${s}`)}))}else{const n=e[0],r=__().createObjectURL(n),i=y_({},this.defaultModelConfig);i.src=r,i.modelId=n.name;try{this.viewer.loadModelAsync(i,t).then((()=>{this.onSuccess&&this.onSuccess({}),im.info(`[Uploader] Loaded model '${i.src}'`)}))}catch(e){im.info(e)}}}}class w_ extends b_{constructor(e,t){super(t),gh(this,"viewer",void 0),this.viewer=e}formats(){return["png","jpg","jpeg"]}uploadFiles(e){const t={panoramas:[],id:"viewpoint_1",name:"",position:[0,1,0],initialDirection:[0,0,1]};if(1===e.length){const n=[];n.push(__().createObjectURL(e[0])),t.panoramas.push({id:"panorama_1",images:n}),this.viewer.setViewpoints([t]),this.viewer.activatePanoramaById(t.id,t.panoramas[0].id)}else if(6===e.length){const n=t=>{let n="";for(let r=0;r<e.length;++r){let i=e[r].name;i=M()(i).call(i,0,w()(i).call(i,".")),i=i.toLowerCase();let s=!1;for(let e=0;e<t.length;++e)if(t[e]===i){s=!0;break}if(s){n=__().createObjectURL(e[r]);break}}return n},r=[n(["right","r"]),n(["left","l"]),n(["up","top","u"]),n(["down","bottom","d"]),n(["front","f"]),n(["back","b"])];t.panoramas.push({id:"panorama_1",images:r}),this.viewer.setViewpoints([t]),this.viewer.activatePanoramaById(t.id,t.panoramas[0].id)}else im.warn(`[Uploader] Expected 1 or 6 file, bug got ${e.length}!`)}}class E_{constructor(e){gh(this,"viewer",void 0),gh(this,"gui",void 0),gh(this,"exploderDict",{}),gh(this,"controls",{showGroundGrid:!1,showGrassGround:!1,skyMode:["None","Black Background","White Background","Gradient ramp","Cloudy"],environments:["None","Default (City Streat 64x32)","Venice Sunset","Footprint Court (HDR Labs)","City Street"],homeView:()=>console.log("[DGH] Go to home view"),views:["Top","Bottom","Front","Back","Left","Right"],OrthographicCamera:!1,viewpoints:!1,annotations:!1,takeSnapshot:()=>console.log("[DGH] Taking snapshot..."),fullScreen:()=>console.log("[DGH] Full screen..."),webcam:!1,uploadFile:()=>console.log("[DGH] Upload file..."),showBimTree:!1,showPropertyPanel:!1,transparentMode:!1,showVertexNormals:!1,sectionMode:["No section","Box section","Plane section"],alVisible:!0,alColor:"#cccccc",alIntensity:1,alCastShadow:!0,dlVisible:!0,dlColor:"#dddddd",dlIntensity:2,dlCastShadow:!0,hlVisible:!0,hlIntensity:1,hlColor:[255,255,255,.6],hlGroundColor:[200,255,200,.6],fogEnabled:!1,fogColor:14540253,fogNearDistance:1,fogFarDistance:1e3,composerEnabled:!1,renderPassEnabled:!1,fxaaEnabled:!1,saoEnabled:!1,ssaoEnabled:!1,outlineEnabled:!1,ssaaEnabled:!1,bloomEnabled:!1,unrealBloomEnabled:!1}),this.viewer=e,this.init()}init(){if(!this.viewer||!this.viewer.renderer||!this.viewer.scene)throw new Error("Need to initialize renderer, scene first!");const e=this.viewer,t=this.viewer.scene,n=this.controls;this.gui=new n_({name:"controls",autoPlace:!0,width:300,closed:!0}),this.gui.domElement.style.opacity="0.6";const r=this.gui.addFolder("Common settings");r.add(n,"showGroundGrid").name("Show ground grid").onChange((n=>{e.groundGrid?e.groundGrid.visible=n:n&&(e.groundGrid=r_.createGroundGrid(),t.add(e.groundGrid),e.enableRender()),e.enableRender()})),r.add(n,"showGrassGround").name("Show grass ground").onChange((n=>{if(e.grassGround)e.grassGround.visible=n;else if(n)try{return v().resolve(r_.createGrassGround()).then((function(n){e.grassGround=n,t.add(e.grassGround),e.enableRender()}))}catch(n){v().reject(n)}e.enableRender()}));const i=r.add(n,"skyMode",n.skyMode).name("Sky mode");i.onChange((n=>{if(e.skyOfGradientRamp&&(e.skyOfGradientRamp.visible="Gradient ramp"===n),"Black Background"===n)t.background=new cn(0);else if("White Background"===n)t.background=new cn(16777215);else if("Gradient ramp"===n)e.skyOfGradientRamp||(e.skyOfGradientRamp=i_.createSkyOfGradientRamp(),t.add(e.skyOfGradientRamp)),e.skyOfGradientRamp.visible=!0;else if("Cloudy"===n){let e=["right.jpg","left.jpg","top.jpg","bottom.jpg","front.jpg","back.jpg"];e=Z()(e).call(e,(e=>`${window.location.origin}/images/skybox/cloudy/${e}`)),i_.createSkyFromTextures(e).then((e=>{t.background=e}))}else t.background=e.sceneBackgroundColor;e.enableRender()})),i.setValue("Gradient ramp");r.add(n,"environments",n.environments).name("Environments").onChange((n=>{let r="";if("Default (City Streat 64x32)"===n){if(e.pmremGenerator)return a_.createEnvTextureFromDataArray(e.pmremGenerator).then((e=>{t.environment=e})),void e.enableRender()}else"Venice Sunset"===n?r="venice_sunset_1k.hdr":"Footprint Court (HDR Labs)"===n?r="footprint_court_2k.hdr":"City Street"===n&&(r="city_street_256.hdr");""===r?t.environment=null:(r=`${window.location.origin}/images/envmap/${r}`,a_.createEnvTexture(e.pmremGenerator,r).then((e=>{t.environment=e}))),e.enableRender()})),r.add(n,"homeView").name("Go to home view").onChange((()=>{e.goToHomeView()})),r.add(n,"views",n.views).name("Views").onChange((n=>{var r;const i=new xn,s=new xn;l_.getCameraPositionByView(t,n,i,s,null===(r=e.camera)||void 0===r?void 0:r.projectionMatrix),e.flyTo(i,s)})),r.add(n,"OrthographicCamera").name("Orth Camera").onChange((t=>{e.setToOrthographicCamera(t)})),r.add(n,"takeSnapshot").name("Take snapshot").onChange((()=>{})),r.add(n,"fullScreen").name("Full screen").onChange((()=>{f_&&f_.isEnabled&&f_.request(),e.enableRender()})),r.add(n,"uploadFile").name("Upload file").onChange((()=>{new x_(e).openFileBrowserToUpload()}));const s=this.gui.addFolder("Model operations");s.add(n,"transparentMode",n.transparentMode).name("Transparent mode").onChange((t=>{e.addOrRemoveObjectOpacity(t),e.enableRender()})),s.add(n,"showVertexNormals",n.showVertexNormals).name("Show Vertex Normals").onChange((t=>{e.showVertexNormals(t),e.enableRender()})),s.add(n,"sectionMode",n.sectionMode).name("Section mode").onChange((t=>{"No section"===t?e.disableSection():"Box section"===t?e.enableSection(qh.ObjectsBoxSection):"Plane section"===t&&e.enableSection(qh.PickPlaneSection),e.enableRender()}));const a=this.viewer.ambientLight,o=this.gui.addFolder("Ambient light");o.add(n,"alVisible",n.alVisible).name("visible").onChange((t=>{a&&(a.visible=t),e.enableRender()})),o.addColor(n,"alColor").name("color").onChange((t=>{a&&(a.color=new cn(t)),e.enableRender()})),o.add(n,"alIntensity",0,5).name("intensity").onChange((t=>{a&&(a.intensity=t),e.enableRender()})),o.add(n,"alCastShadow").name("castShadow").onChange((t=>{a&&(a.castShadow=t),e.enableRender()}));const l=this.viewer.directionalLight,c=this.gui.addFolder("Directional light");c.add(n,"dlVisible",n.dlVisible).name("visible").onChange((t=>{l&&(l.visible=t),e.enableRender()})),c.addColor(n,"dlColor").name("color").onChange((t=>{l&&(l.color=new cn(t)),e.enableRender()})),c.add(n,"dlIntensity",0,5).name("intensity").onChange((t=>{l&&(l.intensity=t),e.enableRender()})),c.add(n,"dlCastShadow").name("castShadow").onChange((t=>{l&&(l.castShadow=t),e.enableRender()}));const u=this.viewer.hemisphereLight,h=this.gui.addFolder("Hemisphere Light");h.add(n,"hlVisible",n.hlVisible).name("visible").onChange((t=>{u&&(u.visible=t),e.enableRender()})),h.add(n,"hlIntensity",0,5).name("intensity").onChange((t=>{u&&(u.intensity=t),e.enableRender()})),h.addColor(n,"hlColor").name("color").onChange((t=>{u&&(u.color=new cn(t)),e.enableRender()})),h.addColor(n,"hlGroundColor").name("groundColor").onChange((t=>{u&&(u.groundColor=new cn(t)),e.enableRender()}));const p=this.gui.addFolder("Fog");p.add(n,"fogEnabled",n.fogEnabled).name("Enabled").onChange((r=>{t.fog=r?new po(n.fogColor,n.fogNearDistance,n.fogFarDistance):null,e.enableRender()})),p.add(n,"fogNearDistance",0,100).name("Near").onChange((r=>{n.fogEnabled&&t&&(t.fog=new po(n.fogColor,r,n.fogFarDistance)),e.enableRender()})),p.add(n,"fogFarDistance",100,2e3).name("Far").onChange((r=>{n.fogEnabled&&t&&(t.fog=new po(n.fogColor,n.fogNearDistance,r)),e.enableRender()}));const d=this.gui.addFolder("Composer");d.add(n,"composerEnabled",n.composerEnabled).name("Composer Enabled").onChange((t=>{e.enableComposer(t)})),d.add(n,"renderPassEnabled",n.renderPassEnabled).name("RenderPass Enabled").onChange((t=>{e.enableRenderPass(t)})),d.add(n,"fxaaEnabled",n.fxaaEnabled).name("Effect FXAA Enabled").onChange((t=>{e.enableFxaaPass(t)})),d.add(n,"saoEnabled",n.saoEnabled).name("SAO Enabled").onChange((t=>{e.enableSaoPass(t)})),d.add(n,"ssaoEnabled",n.ssaoEnabled).name("SSAO Enabled").onChange((t=>{e.enableSsaoPass(t)})),d.add(n,"outlineEnabled",n.outlineEnabled).name("OutlinePass Enabled").onChange((t=>{e.enableOutlinePass(t)})),d.add(n,"ssaaEnabled",n.ssaaEnabled).name("SSAA Enabled").onChange((t=>{e.enableSsaaPass(t)})),d.add(n,"bloomEnabled",n.bloomEnabled).name("Bloom Enabled").onChange((t=>{e.enableBloomPass(t)})),d.add(n,"unrealBloomEnabled",n.unrealBloomEnabled).name("Unreal Bloom Enabled").onChange((t=>{e.enableUnrealBloomPass(t)}))}setExplodeMode(e,t=!1){var n;this.viewer&&this.viewer.scene&&this.viewer.loadedModels&&this.exploderDict&&(e?rf.explodeObjects(this.viewer.scene,this.exploderDict,Z()(n=tp()(this.viewer.loadedModels)).call(n,(e=>e.id)),t):rf.unexplodeObjects(this.viewer.scene,this.exploderDict||{}))}open(){this.gui&&this.gui.open()}close(){this.gui&&this.gui.close()}beforeDestroy(){this.viewer=void 0,this.gui&&this.gui.destroy(),this.gui=void 0,this.exploderDict=[]}}class S_{constructor(e){gh(this,"viewer",void 0),gh(this,"gui",void 0),gh(this,"controls",{fullScreen:()=>console.log("[DGH] Full screen...")}),this.viewer=e,this.init()}init(){if(!this.viewer||!this.viewer.renderer||!this.viewer.scene)throw new Error("Need to initialize renderer, scene first!");const e=this.controls;this.gui=new n_({name:"controls",autoPlace:!0,width:300,closed:!0}),this.gui.domElement.style.opacity="0.6";this.gui.addFolder("Common settings").add(e,"fullScreen").name("Full screen").onChange((()=>{f_&&f_.isEnabled&&f_.request()}))}open(){this.gui&&this.gui.open()}close(){this.gui&&this.gui.close()}beforeDestroy(){this.viewer=void 0,this.gui&&this.gui.destroy(),this.gui=void 0}}class I_{constructor(e){gh(this,"viewer",void 0),gh(this,"gui",void 0),gh(this,"controls",{background:["Default","Black","White","Gray"],fullScreen:()=>console.log("[DGH] Full screen...")}),this.viewer=e,this.init()}init(){if(!this.viewer||!this.viewer.renderer||!this.viewer.scene)throw new Error("Need to initialize renderer, scene first!");const e=this.viewer,t=this.viewer.scene,n=this.controls;this.gui=new n_({name:"controls",autoPlace:!0,width:300,closed:!0}),this.gui.domElement.style.opacity="0.6";this.gui.add(n,"background",n.background).name("Background color").onChange((n=>{"Default"===n?t.background=new cn(2172976):"Black"===n?t.background=new cn(0):"White"===n?t.background=new cn(16777215):"Gray"===n&&(t.background=new cn(8947848)),e.enableRender()}));this.gui.add(n,"fullScreen").name("Full screen").onChange((()=>{f_&&f_.isEnabled&&f_.request()}))}open(){this.gui&&this.gui.open()}close(){this.gui&&this.gui.close()}beforeDestroy(){this.viewer=void 0,this.gui&&this.gui.destroy(),this.gui=void 0}}class M_{static getScreenPointByEvent(e,t){const n=new Xt,{x:r,y:i}=t.getBoundingClientRect();return n.x=e.clientX-r,n.y=e.clientY-i,n}static worldPosition2ScreenPoint(e,t,n){const{clientWidth:r,clientHeight:i}=n,s=e.clone(),a=new Xt;return s.project(t),a.x=(.5+s.x/2)*r,a.y=(.5-s.y/2)*i,a}static screenPoint2worldPosition(e,t,n){const r=M_.screenPoint2NdcPoint(e,t,n);return new xn(r.x,r.y,1).unproject(t)}static screenPoint2NdcPoint(e,t,n){const{clientWidth:r,clientHeight:i}=n,s=new Xt;return s.x=e.x/r*2-1,s.y=-e.y/i*2+1,s}}const A_={unit:"file",decimalPrecision:99,camera:{near:.1,far:3e4},mouse:{sensitivity:3},keyboard:{sensitivity:3}},R_=99,D_=(e,t)=>e.toFixed(t===R_?2:t);class C_{static isTouchScreenDevice(){return!!("ontouchstart"in window)}static printDeviceInfo(){const e=navigator.userAgent,t=/(?:Android)/.test(e),n=/(?:Firefox)/.test(e),r=/(?:Chrome|CriOS)/.test(e),i=/(?:iPad|PlayBook)/.test(e)||t&&!/(?:Mobile)/.test(e)||n&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!i,a=!s&&!t,o=C_.isTouchScreenDevice();t&&im.log("[DI] is android"),n&&im.log("[DI] is fireFox"),r&&im.log("[DI] is chrome"),i&&im.log("[DI] is tablet"),s&&im.log("[DI] is iPhone"),a&&im.log("[DI] is PC"),o&&im.log("[DI] is touch device")}static getWebGlRendererInfo(e){if(!e)throw new Error("Invalid canvas!");const t=e.getContext("webgl2")||e.getContext("webgl"),n=t&&t.getExtension("WEBGL_debug_renderer_info");let r="unknown";return n&&(r=t.getParameter(n.UNMASKED_RENDERER_WEBGL)),r}}class O_{parse(e,t={decodeSpeed:5,encodeSpeed:5,encoderMethod:O_.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1}){if(void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");const n=e.geometry,r=DracoEncoderModule(),i=new r.Encoder;let s,a;if(!0===e.isMesh){s=new r.MeshBuilder,a=new r.Mesh;const e=n.getAttribute("position");s.AddFloatAttributeToMesh(a,r.POSITION,e.count,e.itemSize,e.array);const i=n.getIndex();if(null!==i)s.AddFacesToMesh(a,i.count/3,i.array);else{const t=new(e.count>65535?Uint32Array:Uint16Array)(e.count);for(let e=0;e<t.length;e++)t[e]=e;s.AddFacesToMesh(a,e.count,t)}if(!0===t.exportNormals){const e=n.getAttribute("normal");void 0!==e&&s.AddFloatAttributeToMesh(a,r.NORMAL,e.count,e.itemSize,e.array)}if(!0===t.exportUvs){const e=n.getAttribute("uv");void 0!==e&&s.AddFloatAttributeToMesh(a,r.TEX_COORD,e.count,e.itemSize,e.array)}if(!0===t.exportColor){const e=n.getAttribute("color");void 0!==e&&s.AddFloatAttributeToMesh(a,r.COLOR,e.count,e.itemSize,e.array)}}else{if(!0!==e.isPoints)throw new Error("DRACOExporter: Unsupported object type.");{s=new r.PointCloudBuilder,a=new r.PointCloud;const e=n.getAttribute("position");if(s.AddFloatAttribute(a,r.POSITION,e.count,e.itemSize,e.array),!0===t.exportColor){const e=n.getAttribute("color");void 0!==e&&s.AddFloatAttribute(a,r.COLOR,e.count,e.itemSize,e.array)}}}const o=new r.DracoInt8Array,l=void 0!==t.encodeSpeed?t.encodeSpeed:5,c=void 0!==t.decodeSpeed?t.decodeSpeed:5;if(i.SetSpeedOptions(l,c),void 0!==t.encoderMethod&&i.SetEncodingMethod(t.encoderMethod),void 0!==t.quantization)for(let e=0;e<5;e++)void 0!==t.quantization[e]&&i.SetAttributeQuantization(e,t.quantization[e]);let u;if(u=!0===e.isMesh?i.EncodeMeshToDracoBuffer(a,o):i.EncodePointCloudToDracoBuffer(a,!0,o),r.destroy(a),0===u)throw new Error("THREE.DRACOExporter: Draco encoding failed.");const h=new Int8Array(new ArrayBuffer(u));for(let e=0;e<u;e++)h[e]=o.GetValue(e);return r.destroy(o),r.destroy(i),r.destroy(s),h}}O_.MESH_EDGEBREAKER_ENCODING=1,O_.MESH_SEQUENTIAL_ENCODING=0,O_.POINT_CLOUD=0,O_.TRIANGULAR_MESH=1,O_.INVALID=-1,O_.POSITION=0,O_.NORMAL=1,O_.COLOR=2,O_.TEX_COORD=3,O_.GENERIC=4;var P_=n(8244),N_=n(18033),L_=n.n(N_);class k_{constructor(){this.pluginCallbacks=[],this.register((function(e){return new hv(e)})),this.register((function(e){return new pv(e)})),this.register((function(e){return new dv(e)})),this.register((function(e){return new gv(e)})),this.register((function(e){return new _v(e)})),this.register((function(e){return new mv(e)})),this.register((function(e){return new fv(e)}))}register(e){var t;return-1===T(t=this.pluginCallbacks).call(t,e)&&this.pluginCallbacks.push(e),this}unregister(e){var t,n,r;-1!==T(t=this.pluginCallbacks).call(t,e)&&E(n=this.pluginCallbacks).call(n,T(r=this.pluginCallbacks).call(r,e),1);return this}parse(e,t,n,r){const i=new uv,s=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)s.push(this.pluginCallbacks[e](i));i.setPlugins(s),i.write(e,t,r).catch(n)}parseAsync(e,t){const n=this;return new _((function(r,i){n.parse(e,r,i,t)}))}}const F_=0,U_=1,B_=2,j_=3,G_=4,z_=5121,V_=5123,H_=5126,q_=5125,W_=34962,Y_=34963,X_=9728,$_=9729,K_=9984,Z_=9985,J_=9986,Q_=9987,ev=33071,tv=33648,nv=10497,rv={};rv[1003]=X_,rv[1004]=K_,rv[1005]=J_,rv[1006]=$_,rv[1007]=Z_,rv[1008]=Q_,rv[1001]=ev,rv[1e3]=nv,rv[1002]=tv;const iv={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"};function sv(e,t){return e.length===t.length&&P_(e).call(e,(function(e,n){return e===t[n]}))}function av(e){return 4*Math.ceil(e/4)}function ov(e,t=0){const n=av(e.byteLength);if(n!==e.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(e)),0!==t)for(let i=e.byteLength;i<n;i++)r[i]=t;return r.buffer}return e}function lv(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function cv(e,t){if(void 0!==e.toBlob)return new _((n=>e.toBlob(n,t)));let n;return"image/jpeg"===t?n=.92:"image/webp"===t&&(n=.8),e.convertToBlob({type:t,quality:n})}class uv{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new ce,this.skins=[],this.extensionsUsed={},this.uids=new ce,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new ce,attributes:new ce,attributesNormalized:new ce,materials:new ce,textures:new ce,images:new ce}}setPlugins(e){this.plugins=e}write(e,t,n){try{const r=this;return r.options=H({},{binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),r.options.animations.length>0&&(r.options.trs=!0),r.processInput(e),_.resolve(_.all(r.pending)).then((function(){const e=r,i=e.buffers,s=e.json;n=e.options;const a=e.extensionsUsed,o=new Blob(i,{type:"application/octet-stream"}),l=J(a);if(l.length>0&&(s.extensionsUsed=l),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=o.size),!0===n.binary){const e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){const n=ov(e.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,n.byteLength,!0),r.setUint32(4,5130562,!0);const i=ov((a=z(s),(new TextEncoder).encode(a).buffer),32);var a;const o=new DataView(new ArrayBuffer(8));o.setUint32(0,i.byteLength,!0),o.setUint32(4,1313821514,!0);const l=new ArrayBuffer(12),c=new DataView(l);c.setUint32(0,1179937895,!0),c.setUint32(4,2,!0);const u=12+o.byteLength+i.byteLength+r.byteLength+n.byteLength;c.setUint32(8,u,!0);const h=new Blob([l,o,i,r,n],{type:"application/octet-stream"}),p=new FileReader;p.readAsArrayBuffer(h),p.onloadend=function(){t(p.result)}}}else if(s.buffers&&s.buffers.length>0){const e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){const n=e.result;s.buffers[0].uri=n,t(s)}}else t(s)}))}catch(e){return _.reject(e)}}serializeUserData(e,t){if(0===J(e.userData).length)return;const n=this.options,r=this.extensionsUsed;try{const i=JSON.parse(z(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(const e in i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],r[e]=!0;delete i.gltfExtensions}J(i).length>0&&(t.extras=i)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){const t=new ce;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new xn;for(let n=0,r=e.count;n<r;n++)if(Math.abs(t.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const n=e.clone(),r=new xn;for(let e=0,t=n.count;e<t;e++)r.fromBufferAttribute(n,e),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),n.setXYZ(e,r.x,r.y,r.z);return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1;const r={};0===t.offset.x&&0===t.offset.y||(r.offset=t.offset.toArray(),n=!0),0!==t.rotation&&(r.rotation=t.rotation,n=!0),1===j(t).x&&1===j(t).y||(r.scale=j(t).toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=r,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function n(e){return e.encoding===St?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");const r=null==e?void 0:e.image,i=null==t?void 0:t.image,s=Math.max((null==r?void 0:r.width)||0,(null==i?void 0:i.width)||0),a=Math.max((null==r?void 0:r.height)||0,(null==i?void 0:i.height)||0),o=lv();o.width=s,o.height=a;const l=o.getContext("2d");l.fillStyle="#00ffff",l.fillRect(0,0,s,a);const c=l.getImageData(0,0,s,a);if(r){l.drawImage(r,0,0,s,a);const t=n(e),i=l.getImageData(0,0,s,a).data;for(let e=2;e<i.length;e+=4)c.data[e]=256*t(i[e]/256)}if(i){l.drawImage(i,0,0,s,a);const e=n(t),r=l.getImageData(0,0,s,a).data;for(let t=1;t<r.length;t+=4)c.data[t]=256*e(r[t]/256)}l.putImageData(c,0,0);const u=(e||t).clone();return u.source=new pn(o),u.encoding=Et,u}processBuffer(e){const t=this.json,n=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,t,n,r,i){const s=this.json;let a;s.bufferViews||(s.bufferViews=[]),a=t===z_?1:t===V_?2:4;const o=av(r*e.itemSize*a),l=new DataView(new ArrayBuffer(o));let c=0;for(let i=n;i<n+r;i++)for(let n=0;n<e.itemSize;n++){let r;e.itemSize>4?r=e.array[i*e.itemSize+n]:0===n?r=e.getX(i):1===n?r=e.getY(i):2===n?r=e.getZ(i):3===n&&(r=e.getW(i)),t===H_?l.setFloat32(c,r,!0):t===q_?l.setUint32(c,r,!0):t===V_?l.setUint16(c,r,!0):t===z_&&l.setUint8(c,r),c+=a}const u={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};void 0!==i&&(u.target=i),i===W_&&(u.byteStride=e.itemSize*a),this.byteOffset+=o,s.bufferViews.push(u);return{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new _((function(r){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const e=ov(i.result),s={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,r(n.bufferViews.push(s)-1)}}))}processAccessor(e,t,n,r){const i=this.json;let s;if(e.array.constructor===Float32Array)s=H_;else if(e.array.constructor===Uint32Array)s=q_;else if(e.array.constructor===Uint16Array)s=V_;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");s=z_}if(void 0===n&&(n=0),void 0===r&&(r=e.count),0===r)return null;const a=function(e,t,n){var r,i;const s={min:N_(r=new Array(e.itemSize)).call(r,Number.POSITIVE_INFINITY),max:N_(i=new Array(e.itemSize)).call(i,Number.NEGATIVE_INFINITY)};for(let r=t;r<t+n;r++)for(let t=0;t<e.itemSize;t++){let n;e.itemSize>4?n=e.array[r*e.itemSize+t]:0===t?n=e.getX(r):1===t?n=e.getY(r):2===t?n=e.getZ(r):3===t&&(n=e.getW(r)),s.min[t]=Math.min(s.min[t],n),s.max[t]=Math.max(s.max[t],n)}return s}(e,n,r);let o;void 0!==t&&(o=e===t.index?Y_:W_);const l=this.processBufferView(e,s,n,r,o),c={bufferView:l.id,byteOffset:l.byteOffset,componentType:s,count:r,max:a.max,min:a.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(c.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(c)-1}processImage(e,t,n,r="image/png"){const i=this,s=i.cache,a=i.json,o=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),u=r+":flipY/"+n.toString();if(void 0!==c[u])return c[u];a.images||(a.images=[]);const h={mimeType:r},p=lv();p.width=Math.min(e.width,o.maxTextureSize),p.height=Math.min(e.height,o.maxTextureSize);const d=p.getContext("2d");if(!0===n&&(d.translate(0,p.height),d.scale(1,-1)),void 0!==e.data){t!==ht&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const n=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<n.length;t+=4)n[t+0]=e.data[t+0],n[t+1]=e.data[t+1],n[t+2]=e.data[t+2],n[t+3]=e.data[t+3];d.putImageData(new ImageData(n,e.width,e.height),0,0)}else d.drawImage(e,0,0,p.width,p.height);!0===o.binary?l.push(cv(p,r).then((e=>i.processBufferViewImage(e))).then((e=>{h.bufferView=e}))):void 0!==p.toDataURL?h.uri=p.toDataURL(r):l.push(cv(p,r).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{h.uri=e})));const m=a.images.push(h)-1;return c[u]=m,m}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const n={magFilter:rv[e.magFilter],minFilter:rv[e.minFilter],wrapS:rv[e.wrapS],wrapT:rv[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){const t=this.cache,n=this.json;if(t.textures.has(e))return t.textures.get(e);n.textures||(n.textures=[]);let r=e.userData.mimeType;"image/webp"===r&&(r="image/png");const i={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(i.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,i)}));const s=n.textures.push(i)-1;return t.textures.set(e,s),s}processMaterial(e){var t;const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const s=ye(t=e.color.toArray()).call(t,[e.opacity]);if(sv(s,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=s),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),n={index:this.processTexture(t)};this.applyTextureTransform(n,t),i.pbrMetallicRoughness.metallicRoughnessTexture=n}if(K(e)){const t={index:this.processTexture(K(e))};this.applyTextureTransform(t,K(e)),i.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){const t=e.emissive.clone().multiplyScalar(e.emissiveIntensity),n=Math.max(t.r,t.g,t.b);if(n>1&&(t.multiplyScalar(1/n),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),n>0&&(i.emissiveFactor=t.toArray()),e.emissiveMap){const t={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(t,e.emissiveMap),i.emissiveTexture=t}}if(e.normalMap){const t={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),i.normalTexture=t}if(e.aoMap){const t={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),i.occlusionTexture=t}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),2===e.side&&(i.doubleSided=!0),""!==e.name&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,i)}));const a=r.materials.push(i)-1;return n.materials.set(e,a),a}processMesh(e){const t=this.cache,n=this.json,r=[e.geometry.uuid];if(b(e.material))for(let t=0,n=e.material.length;t<n;t++)r.push(e.material[t].uuid);else r.push(e.material.uuid);const i=r.join(":");if(t.meshes.has(i))return t.meshes.get(i);const s=e.geometry;let a;a=e.isLineSegments?U_:e.isLineLoop?B_:e.isLine?j_:e.isPoints?F_:e.material.wireframe?U_:G_;const o={},l={},c=[],u=[],h={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},p=s.getAttribute("normal");void 0===p||this.isNormalizedNormalAttribute(p)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(p)));let d=null;for(let e in s.attributes){if("morph"===I(e).call(e,0,5))continue;const n=s.attributes[e];e=h[e]||e.toUpperCase();if(/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),t.attributes.has(this.getUID(n))){l[e]=t.attributes.get(this.getUID(n));continue}d=null;const r=n.array;"JOINTS_0"!==e||r instanceof Uint16Array||r instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new Br(new Uint16Array(r),n.itemSize,n.normalized));const i=this.processAccessor(d||n,s);null!==i&&(l[e]=i,t.attributes.set(this.getUID(n),i))}if(void 0!==p&&s.setAttribute("normal",p),0===J(l).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){const n=[],r=[],i={};if(void 0!==e.morphTargetDictionary)for(const t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let a=0;a<e.morphTargetInfluences.length;++a){const o={};let l=!1;for(const e in s.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}const n=s.morphAttributes[e][a],r=e.toUpperCase(),i=s.attributes[e];if(t.attributes.has(this.getUID(n,!0))){o[r]=t.attributes.get(this.getUID(n,!0));continue}const c=n.clone();if(!s.morphTargetsRelative)for(let e=0,t=n.count;e<t;e++)c.setXYZ(e,n.getX(e)-i.getX(e),n.getY(e)-i.getY(e),n.getZ(e)-i.getZ(e));o[r]=this.processAccessor(c,s),t.attributes.set(this.getUID(i,!0),o[r])}u.push(o),n.push(e.morphTargetInfluences[a]),void 0!==e.morphTargetDictionary&&r.push(i[a])}o.weights=n,r.length>0&&(o.extras={},o.extras.targetNames=r)}const m=b(e.material);if(m&&0===s.groups.length)return null;const f=m?e.material:[e.material],g=m?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=g.length;e<n;e++){const n={mode:a,attributes:l};if(this.serializeUserData(s,n),u.length>0&&(n.targets=u),null!==s.index){let r=this.getUID(s.index);void 0===g[e].start&&void 0===g[e].count||(r+=":"+g[e].start+":"+g[e].count),t.attributes.has(r)?n.indices=t.attributes.get(r):(n.indices=this.processAccessor(s.index,s,g[e].start,g[e].count),t.attributes.set(r,n.indices)),null===n.indices&&delete n.indices}const r=this.processMaterial(f[g[e].materialIndex]);null!==r&&(n.material=r),c.push(n)}o.primitives=c,n.meshes||(n.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,o)}));const _=n.meshes.push(o)-1;return t.meshes.set(i,_),_}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const n=e.isOrthographicCamera,r={type:n?"orthographic":"perspective"};return n?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:Yt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){const n=this.json,r=this.nodeMap;n.animations||(n.animations=[]);const i=(e=k_.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,s=[],a=[];for(let e=0;e<i.length;++e){const n=i[e],o=fu.parseTrackName(n.name);let l=fu.findNode(t,o.nodeName);const c=iv[o.propertyName];if("bones"===o.objectName&&(l=!0===l.isSkinnedMesh?l.skeleton.getBoneByName(o.objectIndex):void 0),!l||!c)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',n.name),null;const u=1;let h,p=de(n).length/n.times.length;c===iv.morphTargetInfluences&&(p/=l.morphTargetInfluences.length),!0===n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(h="CUBICSPLINE",p/=3):h=n.getInterpolation()===vt?"STEP":"LINEAR",a.push({input:this.processAccessor(new Br(n.times,u)),output:this.processAccessor(new Br(de(n),p)),interpolation:h}),s.push({sampler:a.length-1,target:{node:r.get(l),path:c}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:a,channels:s}),n.animations.length-1}processSkin(e){const t=this.json,n=this.nodeMap,r=t.nodes[n.get(e)],i=e.skeleton;if(void 0===i)return null;const s=e.skeleton.bones[0];if(void 0===s)return null;const a=[],o=new Float32Array(16*i.bones.length),l=new Zn;for(let t=0;t<i.bones.length;++t)a.push(n.get(i.bones[t])),l.copy(i.boneInverses[t]),l.multiply(e.bindMatrix).toArray(o,16*t);void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new Br(o,16)),joints:a,skeleton:n.get(s)});return r.skin=t.skins.length-1}processNode(e){const t=this.json,n=this.options,r=this.nodeMap;t.nodes||(t.nodes=[]);const i={};if(n.trs){const t=e.quaternion.toArray(),n=e.position.toArray(),r=e.scale.toArray();sv(t,[0,0,0,1])||(i.rotation=t),sv(n,[0,0,0])||(i.translation=n),sv(r,[1,1,1])||(i.scale=r)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===sv(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(i.matrix=e.matrix.elements);if(""!==e.name&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){const t=this.processMesh(e);null!==t&&(i.mesh=t)}else e.isCamera&&(i.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const t=[];for(let r=0,i=e.children.length;r<i;r++){const i=e.children[r];if(i.visible||!1===n.onlyVisible){const e=this.processNode(i);null!==e&&t.push(e)}}t.length>0&&(i.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,i)}));const s=t.nodes.push(i)-1;return r.set(e,s),s}processScene(e){const t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);const r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);const i=[];for(let t=0,r=e.children.length;t<r;t++){const r=e.children[t];if(r.visible||!1===n.onlyVisible){const e=this.processNode(r);null!==e&&i.push(e)}}i.length>0&&(r.nodes=i),this.serializeUserData(e,r)}processObjects(e){const t=new mo;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));const n=[];for(let t=0;t<e.length;t++)e[t]instanceof mo?this.processScene(e[t]):n.push(e[t]);n.length>0&&this.processObjects(n);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,n=this.plugins.length;t<n;t++)e(this.plugins[t])}}class hv{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);const n=this.writer,r=n.json,i=n.extensionsUsed,s={};e.name&&(s.name=e.name),s.color=e.color.toArray(),s.intensity=e.intensity,e.isDirectionalLight?s.type="directional":e.isPointLight?(s.type="point",e.distance>0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),!e.target||e.target.parent===e&&0===e.target.position.x&&0===e.target.position.y&&-1===e.target.position.z||console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},i[this.name]=!0);const a=r.extensions[this.name].lights;a.push(s),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}}class pv{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class dv{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;const n=this.writer,r=n.extensionsUsed,i={};t.pbrMetallicRoughness.baseColorFactor&&(i.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);const s=[1,1,1];if(e.specular.toArray(s,0),i.specularFactor=s,i.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(i.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){const t={index:n.processTexture(e.specularMap)};n.applyTextureTransform(t,e.specularMap),i.specularGlossinessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class mv{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const t={index:n.processTexture(e.clearcoatMap)};n.applyTextureTransform(t,e.clearcoatMap),i.clearcoatTexture=t}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const t={index:n.processTexture(e.clearcoatRoughnessMap)};n.applyTextureTransform(t,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){const t={index:n.processTexture(e.clearcoatNormalMap)};n.applyTextureTransform(t,e.clearcoatNormalMap),i.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class fv{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const t={index:n.processTexture(e.iridescenceMap)};n.applyTextureTransform(t,e.iridescenceMap),i.iridescenceTexture=t}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const t={index:n.processTexture(e.iridescenceThicknessMap)};n.applyTextureTransform(t,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class gv{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const t={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(t,e.transmissionMap),i.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class _v{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const t={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(t,e.thicknessMap),i.thicknessTexture=t}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}k_.Utils={insertKeyframe:function(e,t){const n=.001,r=e.getValueSize(),i=new e.TimeBufferType(e.times.length+1),s=new e.ValueBufferType(de(e).length+r),a=e.createInterpolant(new e.ValueBufferType(r));let o;if(0===e.times.length){i[0]=t;for(let e=0;e<r;e++)s[e]=0;o=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<n)return 0;i[0]=t,i.set(e.times,1),s.set(a.evaluate(t),0),s.set(de(e),r),o=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<n)return e.times.length-1;i[i.length-1]=t,i.set(e.times,0),s.set(de(e),0),s.set(a.evaluate(t),de(e).length),o=i.length-1}else for(let p=0;p<e.times.length;p++){if(Math.abs(e.times[p]-t)<n)return p;if(e.times[p]<t&&e.times[p+1]>t){var l,c,u,h;i.set(I(l=e.times).call(l,0,p+1),0),i[p+1]=t,i.set(I(c=e.times).call(c,p+1),p+2),s.set(I(u=de(e)).call(u,0,(p+1)*r),0),s.set(a.evaluate(t),(p+1)*r),s.set(I(h=de(e)).call(h,(p+1)*r),(p+2)*r),o=p+1;break}}return e.times=i,e.values=s,o},mergeMorphTargetTracks:function(e,t){const n=[],r={},i=e.tracks;for(let e=0;e<i.length;++e){let s=i[e];const a=fu.parseTrackName(s.name),o=fu.findNode(t,a.nodeName);if("morphTargetInfluences"!==a.propertyName||void 0===a.propertyIndex){n.push(s);continue}if(s.createInterpolant!==s.InterpolantFactoryMethodDiscrete&&s.createInterpolant!==s.InterpolantFactoryMethodLinear){if(s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),s=s.clone(),s.setInterpolation(yt)}const l=o.morphTargetInfluences.length,c=o.morphTargetDictionary[a.propertyIndex];if(void 0===c)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);let u;if(void 0===r[o.uuid]){u=s.clone();const e=new u.ValueBufferType(l*u.times.length);for(let t=0;t<u.times.length;t++)e[t*l+c]=de(u)[t];u.name=(a.nodeName||"")+".morphTargetInfluences",u.values=e,r[o.uuid]=u,n.push(u);continue}const h=s.createInterpolant(new s.ValueBufferType(1));u=r[o.uuid];for(let e=0;e<u.times.length;e++)de(u)[e*l+c]=h.evaluate(u.times[e]);for(let e=0;e<s.times.length;e++){const t=this.insertKeyframe(u,s.times[e]);de(u)[t*l+c]=de(s)[e]}}return e.tracks=n,e}};class vv{parse(e){let t="",n=0,r=0,i=0;const s=new xn,a=new cn,o=new xn,l=new Xt,c=[];return e.traverse((function(e){!0===e.isMesh&&function(e){let a=0,u=0,h=0;const p=e.geometry,d=new $t,m=p.getAttribute("position"),f=p.getAttribute("normal"),g=p.getAttribute("uv"),_=p.getIndex();if(t+="o "+e.name+"\n",e.material&&e.material.name&&(t+="usemtl "+e.material.name+"\n"),void 0!==m)for(let n=0,r=m.count;n<r;n++,a++)s.fromBufferAttribute(m,n),s.applyMatrix4(e.matrixWorld),t+="v "+s.x+" "+s.y+" "+s.z+"\n";if(void 0!==g)for(let e=0,n=g.count;e<n;e++,h++)l.fromBufferAttribute(g,e),t+="vt "+l.x+" "+l.y+"\n";if(void 0!==f){d.getNormalMatrix(e.matrixWorld);for(let e=0,n=f.count;e<n;e++,u++)o.fromBufferAttribute(f,e),o.applyMatrix3(d).normalize(),t+="vn "+o.x+" "+o.y+" "+o.z+"\n"}if(null!==_)for(let e=0,s=_.count;e<s;e+=3){for(let t=0;t<3;t++){const s=_.getX(e+t)+1;c[t]=n+s+(f||g?"/"+(g?r+s:"")+(f?"/"+(i+s):""):"")}t+="f "+c.join(" ")+"\n"}else for(let e=0,s=m.count;e<s;e+=3){for(let t=0;t<3;t++){const s=e+t+1;c[t]=n+s+(f||g?"/"+(g?r+s:"")+(f?"/"+(i+s):""):"")}t+="f "+c.join(" ")+"\n"}n+=a,r+=h,i+=u}(e),!0===e.isLine&&function(e){let r=0;const i=e.geometry,a=e.type,o=i.getAttribute("position");if(t+="o "+e.name+"\n",void 0!==o)for(let n=0,i=o.count;n<i;n++,r++)s.fromBufferAttribute(o,n),s.applyMatrix4(e.matrixWorld),t+="v "+s.x+" "+s.y+" "+s.z+"\n";if("Line"===a){t+="l ";for(let e=1,r=o.count;e<=r;e++)t+=n+e+" ";t+="\n"}if("LineSegments"===a)for(let e=1,r=e+1,i=o.count;e<i;e+=2,r=e+1)t+="l "+(n+e)+" "+(n+r)+"\n";n+=r}(e),!0===e.isPoints&&function(e){let r=0;const i=e.geometry,o=i.getAttribute("position"),l=i.getAttribute("color");if(t+="o "+e.name+"\n",void 0!==o){for(let n=0,i=o.count;n<i;n++,r++)s.fromBufferAttribute(o,n),s.applyMatrix4(e.matrixWorld),t+="v "+s.x+" "+s.y+" "+s.z,void 0!==l&&(a.fromBufferAttribute(l,n).convertLinearToSRGB(),t+=" "+a.r+" "+a.g+" "+a.b),t+="\n";t+="p ";for(let e=1,r=o.count;e<=r;e++)t+=n+e+" ";t+="\n"}n+=r}(e)})),t}}class yv{static exportToGltf(e,t){yv.exportToGltfOrGlb(e,t,{binary:!1})}static exportToGlb(e,t){yv.exportToGltfOrGlb(e,t,{binary:!0})}static exportToGltfOrGlb(e,t,n={}){if(!e||!t)throw new Error("Invalid input or filename!");const r=new k_;n=q()({},{binary:!0,onlyVisible:!1,includeCustomExtensions:!1},n),r.parse(e,(e=>{if(n.binary){t=yv.addExtention(t,yv.EXTENSION_GLB);const n=e;yv.saveArrayBuffer(n,t)}else t=yv.addExtention(t,yv.EXTENSION_GLTF),yv.saveJson(e,t)}),(e=>console.log(e)),n)}static exportToObj(e,t){if(!e||!t)throw new Error("Invalid input or filename!");t=yv.addExtention(t,yv.EXTENSION_OBJ);const n=(new vv).parse(e);yv.saveString(n,t)}static exportToDraco(e,t,n={}){if(!e||!t)throw new Error("Invalid input or filename!");t=yv.addExtention(t,yv.EXTENSION_DRACO);const r=new O_;n=q()({},{encodeSpeed:5},n);const i=r.parse(e,n);yv.saveArrayBuffer(i,t)}static exportToThreeJsJson(e,t){var n;const r=e.toJSON();vp()(n=t.toLowerCase()).call(n,yv.EXTENSION_JSON)||(t+=yv.EXTENSION_JSON),yv.saveJson(r,t)}static save(e,t){let n=yv.downloadLink;n||(n=document.createElement("a"),n.style.display="none",document.body.appendChild(n),yv.downloadLink=n),n.href=__().createObjectURL(e),n.download=t,n.click()}static saveArrayBuffer(e,t){yv.save(new Blob([e],{type:"application/octet-stream"}),t)}static saveJson(e,t){yv.saveJsonString(V()(e),t)}static saveJsonString(e,t){yv.save(new Blob([e],{type:"application/json"}),t)}static saveString(e,t){yv.save(new Blob([e],{type:"text/csv"}),t)}static addExtention(e,t){var n;return vp()(n=e.toLowerCase()).call(n,t.toLowerCase())||(e+=t),e}}gh(yv,"EXTENSION_GLTF",".gltf"),gh(yv,"EXTENSION_GLB",".glb"),gh(yv,"EXTENSION_OBJ",".obj"),gh(yv,"EXTENSION_DRACO",".drc"),gh(yv,"EXTENSION_JSON",".json"),gh(yv,"downloadLink",void 0);class bv{constructor(){gh(this,"eventList",new(ue()))}addEventListener(e,t){const n=this.eventList.get(e);n?n.push(t):this.eventList.set(e,[t])}dispatchEvent(e,t){const n=this.eventList.get(e);n&&ge()(n).call(n,(e=>e(t)))}}class xv{constructor(){gh(this,"prevTime",Yh()()),gh(this,"beginTime",Yh()()),gh(this,"frames",0),gh(this,"fps",Number.NaN)}begin(){this.beginTime=Yh()()}end(){this.frames++;const e=Yh()();return e>=this.prevTime+1e3&&(this.fps=Math.round(1e3*this.frames/(e-this.prevTime)),this.frames=0,this.prevTime=e),e}update(){this.beginTime=this.end()}}var Tv=n(92007),wv=n.n(Tv);const Ev=new xn,Sv=new xn;class Iv{modify(e,t){const n=(e=e.clone()).attributes;for(const t in n)"position"!==t&&e.deleteAttribute(t);e=function(e,t=1e-4){t=Math.max(t,W);const n={},r=e.getIndex(),i=e.getAttribute("position"),s=r?r.count:i.count;let a=0;const o=J(e.attributes),l={},c={},u=[],h=["getX","getY","getZ","getW"],p=["setX","setY","setZ","setW"];for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.attributes[n];l[n]=new Br(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=e.morphAttributes[n];i&&(c[n]=new Br(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized))}const d=dm(1/t),m=Math.pow(10,d);for(let t=0;t<s;t++){const i=r?r.getX(t):t;let s="";for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.getAttribute(n),a=r.itemSize;for(let e=0;e<a;e++)s+=~~(r[h[e]](i)*m)+","}if(s in n)u.push(n[s]);else{for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.getAttribute(n),s=e.morphAttributes[n],u=r.itemSize,d=l[n],m=c[n];for(let e=0;e<u;e++){const t=h[e],n=p[e];if(d[n](a,r[t](i)),s)for(let e=0,r=s.length;e<r;e++)m[e][n](a,s[e][t](i))}}n[s]=a,u.push(a),a++}}const f=e.clone();for(const t in e.attributes){var g;const e=l[t];if(f.setAttribute(t,new Br(I(g=e.array).call(g,0,a*e.itemSize),e.itemSize,e.normalized)),t in c)for(let e=0;e<c[t].length;e++){var _;const n=c[t][e];f.morphAttributes[t][e]=new Br(I(_=n.array).call(_,0,a*n.itemSize),n.itemSize,n.normalized)}}return f.setIndex(u),f}(e);const r=[],i=[],s=e.getAttribute("position");for(let e=0;e<s.count;e++){const t=(new xn).fromBufferAttribute(s,e),n=new Lv(t);r.push(n)}let a,o=e.getIndex();if(null!==o)for(let e=0;e<o.count;e+=3){const t=o.getX(e),n=o.getX(e+1),s=o.getX(e+2),a=new Nv(r[t],r[n],r[s],t,n,s);i.push(a)}else for(let e=0;e<s.count;e+=3){const t=e,n=e+1,s=e+2,a=new Nv(r[t],r[n],r[s],t,n,s);i.push(a)}for(let e=0,t=r.length;e<t;e++)Rv(r[e]);let l=t;for(;l--;){if(a=Pv(r),!a){console.log("THREE.SimplifyModifier: No next vertex");break}Ov(r,i,a,a.collapseNeighbor)}const c=new Kr,u=[];o=[];for(let e=0;e<r.length;e++){const t=r[e].position;u.push(t.x,t.y,t.z),r[e].id=e}for(let e=0;e<i.length;e++){const t=i[e];o.push(t.v1.id,t.v2.id,t.v3.id)}return c.setAttribute("position",new zr(u,3)),c.setIndex(o),c}}function Mv(e,t){const n=T(e).call(e,t);n>-1&&E(e).call(e,n,1)}function Av(e,t){const n=t.position.distanceTo(e.position);let r=0;const i=[];for(let n=0,r=e.faces.length;n<r;n++){const r=e.faces[n];r.hasVertex(t)&&i.push(r)}for(let t=0,n=e.faces.length;t<n;t++){let n=1;const s=e.faces[t];for(let e=0;e<i.length;e++){const t=i[e],r=s.normal.dot(t.normal);n=Math.min(n,(1.001-r)/2)}r=Math.max(r,n)}i.length<2&&(r=1);return n*r+0}function Rv(e){if(0===e.neighbors.length)return e.collapseNeighbor=null,void(e.collapseCost=-.01);e.collapseCost=1e5,e.collapseNeighbor=null;for(let t=0;t<e.neighbors.length;t++){const n=Av(e,e.neighbors[t]);e.collapseNeighbor||(e.collapseNeighbor=e.neighbors[t],e.collapseCost=n,e.minCost=n,e.totalCost=0,e.costCount=0),e.costCount++,e.totalCost+=n,n<e.minCost&&(e.collapseNeighbor=e.neighbors[t],e.minCost=n)}e.collapseCost=e.totalCost/e.costCount}function Dv(e,t){for(console.assert(0===e.faces.length);e.neighbors.length;){Mv(e.neighbors.pop().neighbors,e)}Mv(t,e)}function Cv(e,t){Mv(t,e),e.v1&&Mv(e.v1.faces,e),e.v2&&Mv(e.v2.faces,e),e.v3&&Mv(e.v3.faces,e);const n=[e.v1,e.v2,e.v3];for(let e=0;e<3;e++){const t=n[e],r=n[(e+1)%3];t&&r&&(t.removeIfNonNeighbor(r),r.removeIfNonNeighbor(t))}}function Ov(e,t,n,r){if(!r)return void Dv(n,e);const i=[];for(let e=0;e<n.neighbors.length;e++)i.push(n.neighbors[e]);for(let e=n.faces.length-1;e>=0;e--)n.faces[e]&&n.faces[e].hasVertex(r)&&Cv(n.faces[e],t);for(let e=n.faces.length-1;e>=0;e--)n.faces[e].replaceVertex(n,r);Dv(n,e);for(let e=0;e<i.length;e++)Rv(i[e])}function Pv(e){let t=e[0];for(let n=0;n<e.length;n++)e[n].collapseCost<t.collapseCost&&(t=e[n]);return t}class Nv{constructor(e,t,n,r,i,s){this.a=r,this.b=i,this.c=s,this.v1=e,this.v2=t,this.v3=n,this.normal=new xn,this.computeNormal(),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(n),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(n),n.faces.push(this),n.addUniqueNeighbor(e),n.addUniqueNeighbor(t)}computeNormal(){const e=this.v1.position,t=this.v2.position,n=this.v3.position;Ev.subVectors(n,t),Sv.subVectors(e,t),Ev.cross(Sv).normalize(),this.normal.copy(Ev)}hasVertex(e){return e===this.v1||e===this.v2||e===this.v3}replaceVertex(e,t){e===this.v1?this.v1=t:e===this.v2?this.v2=t:e===this.v3&&(this.v3=t),Mv(e.faces,this),t.faces.push(this),e.removeIfNonNeighbor(this.v1),this.v1.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v2),this.v2.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v3),this.v3.removeIfNonNeighbor(e),this.v1.addUniqueNeighbor(this.v2),this.v1.addUniqueNeighbor(this.v3),this.v2.addUniqueNeighbor(this.v1),this.v2.addUniqueNeighbor(this.v3),this.v3.addUniqueNeighbor(this.v1),this.v3.addUniqueNeighbor(this.v2),this.computeNormal()}}class Lv{constructor(e){this.position=e,this.id=-1,this.faces=[],this.neighbors=[],this.collapseCost=0,this.collapseNeighbor=null}addUniqueNeighbor(e){var t,n;t=this.neighbors,n=e,-1===T(t).call(t,n)&&t.push(n)}removeIfNonNeighbor(e){const t=this.neighbors,n=this.faces,r=T(t).call(t,e);if(-1!==r){for(let t=0;t<n.length;t++)if(n[t].hasVertex(e))return;E(t).call(t,r,1)}}}class kv{static simplifyGeometry(e,t){const n=this.getNumberOfVerticesToRemove(e,t);if(n>0){return(new Iv).modify(e,n)}return e}static simplifyPoints(e,t=1){const n=wv()(e,t);return this.simplifiedInfo.total+=e.length,this.simplifiedInfo.removed+=e.length-n.length,n}static getNumberOfVerticesToRemove(e,t){let n=0;e instanceof Kr&&e.index&&(n=e.attributes.position.count);const r=Math.floor(n*t);return n<20?0:r}}gh(kv,"simplifiedInfo",{total:0,removed:0});const Fv={file:1,m:1,mm:.001,cm:.01,ft:.3048,in:.0254,pt:function(){const e=document.createElement("div");return e.setAttribute("style","height: 1in; visibility: hidden; position: absolute; margin: 0; padding: 0;"),document.body.appendChild(e),.0254/e.clientHeight}()},Uv={file:"m",m:"m",mm:"mm",cm:"cm",ft:"ft",in:"in",pt:"pt"},Bv=e=>2===e?"²":3===e?"³":"",jv=(e,t=1)=>Uv[e]+Bv(t),Gv=(e,t,n,r=1)=>{if(null==n&&(n=t),n===t)return{value:e,unit:jv(n)};return{value:e*Math.pow(Fv[t]/Fv[n],r),unit:jv(n)+Bv(r)}},zv=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Vv(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,u,h,p,d;if(r&&(s=function(e,t,n,r){const i=[];let s,a,o,l,c;for(s=0,a=t.length;s<a;s++)o=t[s]*r,l=s<a-1?t[s+1]*r:e.length,c=Vv(e,o,l,r,!1),c===c.next&&(c.steiner=!0),i.push(ey(c));for(ne(i).call(i,Kv),s=0;s<i.length;s++)n=Zv(i[s],n);return n}(e,t,s,n)),e.length>80*n){o=c=e[0],l=u=e[1];for(let t=n;t<i;t+=n)h=e[t],p=e[t+1],h<o&&(o=h),p<l&&(l=p),h>c&&(c=h),p>u&&(u=p);d=Math.max(c-o,u-l),d=0!==d?32767/d:0}return qv(s,a,n,o,l,d,0),a};function Vv(e,t,n,r,i){let s,a;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(s=t;s<n;s+=r)a=uy(s,e[s],e[s+1],a);else for(s=n-r;s>=t;s-=r)a=uy(s,e[s],e[s+1],a);return a&&iy(a,a.next)&&(hy(a),a=a.next),a}function Hv(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!iy(r,r.next)&&0!==ry(r.prev,r,r.next))r=r.next;else{if(hy(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function qv(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=Qv(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,s,a,o,l,c=1;do{for(n=e,e=null,s=null,a=0;n;){for(a++,r=n,o=0,t=0;t<c&&(o++,r=r.nextZ,r);t++);for(l=c;o>0||l>0&&r;)0!==o&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;n=r}s.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,s);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?Yv(e,r,i,s):Wv(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),hy(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?qv(e=Xv(Hv(e),t,n),t,n,r,i,s,2):2===a&&$v(e,t,n,r,i,s):qv(Hv(e),t,n,r,i,s,1);break}}function Wv(e){const t=e.prev,n=e,r=e.next;if(ry(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,c=r.y,u=i<s?i<a?i:a:s<a?s:a,h=o<l?o<c?o:c:l<c?l:c,p=i>s?i>a?i:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&ty(i,o,s,l,a,c,m.x,m.y)&&ry(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Yv(e,t,n,r){const i=e.prev,s=e,a=e.next;if(ry(i,s,a)>=0)return!1;const o=i.x,l=s.x,c=a.x,u=i.y,h=s.y,p=a.y,d=o<l?o<c?o:c:l<c?l:c,m=u<h?u<p?u:p:h<p?h:p,f=o>l?o>c?o:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,_=Qv(d,m,t,n,r),v=Qv(f,g,t,n,r);let y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=m&&y.y<=g&&y!==i&&y!==a&&ty(o,u,l,h,c,p,y.x,y.y)&&ry(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,b.x>=d&&b.x<=f&&b.y>=m&&b.y<=g&&b!==i&&b!==a&&ty(o,u,l,h,c,p,b.x,b.y)&&ry(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=d&&y.x<=f&&y.y>=m&&y.y<=g&&y!==i&&y!==a&&ty(o,u,l,h,c,p,y.x,y.y)&&ry(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=g&&b!==i&&b!==a&&ty(o,u,l,h,c,p,b.x,b.y)&&ry(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Xv(e,t,n){let r=e;do{const i=r.prev,s=r.next.next;!iy(i,s)&&sy(i,r,r.next,s)&&ly(i,s)&&ly(s,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),hy(r),hy(r.next),r=e=s),r=r.next}while(r!==e);return Hv(r)}function $v(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&ny(a,e)){let o=cy(a,e);return a=Hv(a,a.next),o=Hv(o,o.next),qv(a,t,n,r,i,s,0),void qv(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function Kv(e,t){return e.x-t.x}function Zv(e,t){const n=function(e,t){let n,r=t,i=-1/0;const s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){const e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===s))return n}r=r.next}while(r!==t);if(!n)return null;const o=n,l=n.x,c=n.y;let u,h=1/0;r=n;do{s>=r.x&&r.x>=l&&s!==r.x&&ty(a<c?s:i,a,l,c,a<c?i:s,a,r.x,r.y)&&(u=Math.abs(a-r.y)/(s-r.x),ly(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&Jv(n,r)))&&(n=r,h=u)),r=r.next}while(r!==o);return n}(e,t);if(!n)return t;const r=cy(n,e);return Hv(r,r.next),Hv(n,n.next)}function Jv(e,t){return ry(e.prev,e,t.prev)<0&&ry(t.next,e,e.next)<0}function Qv(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ey(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function ty(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function ny(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&sy(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ly(e,t)&&ly(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(ry(e.prev,e,t.prev)||ry(e,t.prev,t))||iy(e,t)&&ry(e.prev,e,e.next)>0&&ry(t.prev,t,t.next)>0)}function ry(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function iy(e,t){return e.x===t.x&&e.y===t.y}function sy(e,t,n,r){const i=oy(ry(e,t,n)),s=oy(ry(e,t,r)),a=oy(ry(n,r,e)),o=oy(ry(n,r,t));return i!==s&&a!==o||(!(0!==i||!ay(e,n,t))||(!(0!==s||!ay(e,r,t))||(!(0!==a||!ay(n,e,r))||!(0!==o||!ay(n,t,r)))))}function ay(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function oy(e){return e>0?1:e<0?-1:0}function ly(e,t){return ry(e.prev,e,e.next)<0?ry(e,t,e.next)>=0&&ry(e,e.prev,t)>=0:ry(e,t,e.prev)<0||ry(e,e.next,t)<0}function cy(e,t){const n=new py(e.i,e.x,e.y),r=new py(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function uy(e,t,n,r){const i=new py(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function hy(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function py(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}const dy=n(21593);class my{static getFaces(e){var t;const n=bp()(t=Z()(e).call(e,(e=>e.toArray()))).call(t,((e,t)=>(e.push(...t),e)),[]),r=[],i=zv(n,[],3);return ge()(i).call(i,(e=>r.push(e))),r}static arePointsCoplanar(e){if(e.length<4)return!0;const t=e[1].clone().sub(e[0]),n=e[2].clone().sub(e[0]).cross(t).normalize();for(let t=3;t<e.length;t++){if(e[t].clone().sub(e[0]).projectOnVector(n).length()>.01)return!1}return!0}static isSelfIntersecting(e){const t=Z()(e).call(e,(e=>{var t;return M()(t=e.toArray()).call(t,0,-1)}));return dy(t).length>0}}class fy{constructor(e,t,n){gh(this,"node",void 0),gh(this,"parentNode",void 0),gh(this,"target",void 0),gh(this,"childNode",void 0),gh(this,"follow",(e=>{this.node.style.left=e.clientX+15+"px",this.node.style.top=e.clientY-30+"px"})),gh(this,"show",(()=>this.node.hasAttribute("hidden")&&this.node.removeAttribute("hidden"))),gh(this,"hide",(()=>!this.node.hasAttribute("hidden")&&this.node.setAttribute("hidden",""))),gh(this,"destroy",(()=>{document.removeEventListener(Ph,this.follow),this.parentNode.removeChild(this.node)})),this.node=document.createElement("div"),this.node.id=e,t&&this.node.append(t),this.childNode=document.createElement("div"),this.target=null==n?void 0:n.target,this.parentNode=(null==n?void 0:n.parentNode)||document.body,null!=n&&n.followPointer&&(this.node.classList.add("follow-tooltip"),document.addEventListener(Ph,this.follow)),this.parentNode.appendChild(this.node),(null==n||!n.showOnCreate)&&this.node.setAttribute("hidden","")}setContent(e){this.node.textContent&&(this.node.textContent=null),(0,mp.forEach)(this.node.children,(e=>{this.node.removeChild(e)})),this.node.append(e),this.node.appendChild(this.childNode)}updateChildContent(e){this.childNode.textContent&&(this.childNode.textContent=null),(0,mp.forEach)(this.childNode.children,(e=>{this.childNode.removeChild(e)})),this.childNode.append(e)}}let gy,_y;!function(e){e.Distance="Distance",e.Area="Area",e.Angle="Angle",e.Coordinate="Coordinate"}(gy||(gy={}));class vy extends bv{constructor(e,t,n,r){super(),gh(this,"type",void 0),gh(this,"viewer",void 0),gh(this,"scene",void 0),gh(this,"osnapHelper",void 0),gh(this,"raycaster",void 0),gh(this,"mouseMoved",!1),gh(this,"mouseDowned",!1),gh(this,"lastMoveEvent",void 0),gh(this,"mouseDownPositionX",-1),gh(this,"mouseDownPositionY",-1),gh(this,"measurementAssets",void 0),gh(this,"lastClickTime",void 0),gh(this,"tooltip",void 0),gh(this,"snapPoint",void 0),gh(this,"completed",!1),gh(this,"snapObjectMap",{}),gh(this,"mousedown",(e=>{const t=M_.getScreenPointByEvent(e,this.canvas);this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y,this.mouseMoved=!1,this.mouseDowned=!0})),gh(this,"mousemove",(e=>{if(this.lastMoveEvent=e,this.mouseDownPositionX>=0&&this.mouseDownPositionY>=0){const t=5;(Math.abs(e.offsetX-this.mouseDownPositionX)>t||Math.abs(e.offsetY-this.mouseDownPositionY)>t)&&(this.mouseMoved=!0)}if(this.mouseDowned)return;const t=this.getIntersections(e);if(!t.length)return;const n=Yh()();this.handleSnap(t),im.debug(`[BaseMeasurement] this.handleSnap costs ${(Yh()()-n)/1e3}s`),this.onMouseMove(this.snapPoint)})),gh(this,"mouseup",(e=>{0===e.buttons&&(this.mouseDowned=!1),this.mouseMoved||this.onMouseClick(e)})),gh(this,"dblclick",(()=>{im.info("[Measure] Double clicked")})),gh(this,"keydown",(e=>{"Enter"===e.key?(this.lastMoveEvent&&this.onMouseClick(this.lastMoveEvent),this.complete(),this.lastMoveEvent=void 0):"Escape"===e.key&&this.cancel()})),gh(this,"getIntersections",(e=>{if(!this.raycaster)return[];this.raycaster&&this.raycaster.layers.disable(Ah);const t=this.viewer.getRaycastableObjectsByMouse(e);im.debug(`[BaseMeasurement] The count of raycastable object is ${t.length}`,t);const n=Yh()(),r=this.raycaster.intersectObjects(t,!0)||[];return im.debug(`[BaseMeasurement] this.raycaster.intersectObjects costs ${(Yh()()-n)/1e3}s`),im.debug("intersects: ",r),r})),gh(this,"lastMouseDownPosition",void 0),this.type=e,this.viewer=t,this.scene=n,this.osnapHelper=r}get canvas(){var e;return null===(e=this.viewer.renderer)||void 0===e?void 0:e.domElement}get camera(){return this.viewer.camera}get isActive(){return!!this.raycaster}get isMeasuring(){return this.isActive&&!this.completed}activate(){this.canvas.addEventListener("pointerdown",this.mousedown),this.canvas.addEventListener("pointermove",this.mousemove),this.canvas.addEventListener("pointerup",this.mouseup),this.canvas.addEventListener("dblclick",this.dblclick),window.addEventListener("keydown",this.keydown),this.tooltip=new fy("measure-tooltip",this.viewer.translate("Tooltip.measure"),{followPointer:!0,showOnCreate:!0}),this.setTooltipContent(),this.raycaster=this.viewer.getRaycaster()}deactivate(){var e,t;const n=this.canvas;n&&(n.removeEventListener("pointerdown",this.mousedown),n.removeEventListener("pointermove",this.mousemove),n.removeEventListener("pointerup",this.mouseup),n.removeEventListener("dblclick",this.dblclick)),window.removeEventListener("keydown",this.keydown),null===(e=this.tooltip)||void 0===e||e.hide(),null===(t=this.tooltip)||void 0===t||t.destroy(),this.tooltip=void 0,this.raycaster=void 0;const r=this.measurementAssets;null!=r&&r.measurementsData&&(r.measurementsData.points=[]),null!=r&&r.markers&&r.markers.remove(...r.markers.children)}toVecArr(e){const t=[];for(const n of e){const e=cm.arrayToVector3(n);e&&t.push(e)}return t}createMeasurementAssets(e){return{measurementsData:e||{type:this.type,id:cm.guid(),points:[]},markers:new io}}createPointMarker(e){const t=lm.createPointMarker();return e&&t.position.set(e.x,e.y,e.z),t.name=vy.OBJ_NAME,t}createLine(e=vy.LINE_MATERIAL,t=[]){const n=new Kr;(null==t?void 0:t.length)>0&&n.setFromPoints(t);const r=new Vo(n,e);return r.frustumCulled=!1,r.name=vy.OBJ_NAME,r}createFaces(e=[]){const t=new Kr;if((null==e?void 0:e.length)>0){t.setFromPoints(e);const n=my.getFaces(e);t.setIndex(n),t.computeVertexNormals()}const n=new mi(t,vy.MESH_MATERIAL);return n.frustumCulled=!1,n.name=vy.OBJ_NAME,n}getLabelColor(){var e;const t=null===(e=this.viewer.scene.background)||void 0===e?void 0:e.getHexString();let n="#ffffff";return"#ffffff"===(t?cm.convertDecimalToHex(t):"")&&(n="#333333"),n}onMouseClick(e){const t=Yh()();this.lastClickTime&&t-this.lastClickTime<500||(this.lastClickTime=t)}createCurve(e,t,n){const r=new fl(e,t,n).getPoints(6),i=(new Kr).setFromPoints(r),s=new Vo(i,vy.LINE_MATERIAL);return s.name=vy.OBJ_NAME,s}calculateArea(e){let t=0;const n=my.getFaces(e);for(let r=0;r<n.length/3;r++){const i=e[n[3*r]],s=e[n[3*r+1]],a=e[n[3*r+2]],o=s.clone().sub(i),l=a.clone().sub(i);t+=o.cross(l).length()/2}return t}calculateAngle(e,t,n){const r=e,i=t,s=n,a=new xn(r.x-i.x,r.y-i.y,r.z-i.z),o=new xn(s.x-i.x,s.y-i.y,s.z-i.z);return 180*a.angleTo(o)/Math.PI}getAngleBisector(e,t,n){const r=e,i=t,s=n,a=new xn(r.x-i.x,r.y-i.y,r.z-i.z).normalize(),o=new xn(s.x-i.x,s.y-i.y,s.z-i.z).normalize();return new xn(a.x+o.x,a.y+o.y,a.z+o.z).normalize()}getBarycenter(e){const t=e.length;let n=0,r=0,i=0;return ge()(e).call(e,(e=>{n+=e.x,r+=e.y,i+=e.z})),new xn(n/t,r/t,i/t)}getUnitString(){return this.type===gy.Distance?jv("mm"):this.type===gy.Area?`${jv("m",2)}`:this.type===gy.Angle?"°":""}handleSnap(e){var t;let n,r=[];if(this.viewer instanceof g$){for(const t of e){var i;t.point.z=0,"groundPlane"!==(null===(i=t.object)||void 0===i?void 0:i.name)?t.object.name!==vy.OBJ_NAME&&r.push(t):n=t.point}if(n){for(const e of r)e.distance=e.point.distanceTo(n);const e=e=>e instanceof Qo?0:e instanceof Wo?2:e instanceof Vo?1:3;re()(r).call(r,((t,n)=>{const r=e(t.object),i=e(n.object);return r!==i?r-i:t.distance-n.distance}))}}else r=e;im.debug("[BaseMeasurement] filteredIntersections:",r);const s=this.lastMouseDownPosition||M_.screenPoint2worldPosition(new Xt(this.mouseDownPositionX,this.mouseDownPositionY),this.camera,this.canvas);this.snapPoint=(null===(t=this.osnapHelper.handleSnap(r,s,this.completed))||void 0===t?void 0:t.clone())||e[0].point.clone(),this.snapPoint||(this.viewer instanceof g$?this.snapPoint=n:this.snapPoint=e[0].point);const a=this.viewer;a.enableSVGRender&&a.enableSVGRender()}}gh(vy,"MAX_DISTANCE",5e3),gh(vy,"OBJ_NAME","object_for_measure"),gh(vy,"LABEL_NAME","label_for_measure"),gh(vy,"LINE_MATERIAL",new Fo({color:16773120,linewidth:2.5,opacity:.8,transparent:!0,side:2,depthWrite:!1,depthTest:!1})),gh(vy,"MESH_MATERIAL",new kr({color:8900346,transparent:!0,opacity:.5,side:2,depthWrite:!1,depthTest:!1})),function(e){e.Arrow="ArrowMarkup",e.Circle="CircleMarkup",e.CloudLine="CloudLineMarkup",e.CloudLineRectangle="CloudRectMarkup",e.Dot="DotMarkup",e.Ellipse="EllipseMarkup",e.PolyLine="PolylineMarkup",e.Rectangle="RectMarkup",e.Text="TextMarkup",e.X="XMarkup"}(_y||(_y={}));class yy{constructor(e,t,n=[...Iy]){this.bimViewer=e,this.menuConfig=t,this.groupConfig=n,gh(this,"element",void 0),gh(this,"menuList",new(ue())),this.init()}init(){var e;const t=document.createElement("div");t.classList.add("toolbar"),ge()(e=this.groupConfig).call(e,((e,n)=>{const r=document.createElement("div");r.classList.add("toolbar-group");const i=document.createElement("div");i.classList.add("toolbar-group-division"),ge()(e).call(e,(e=>{const t=(0,mp.get)(this.menuConfig,e);if(t&&!1!==t.visible){const n=this.createToolbarMenu(this.bimViewer,e,t);r.appendChild(n.element)}})),r.hasChildNodes()&&(n&&t.appendChild(i),t.appendChild(r))})),this.element=t,this.bimViewer.rootHtmlElement.appendChild(t),t.oncontextmenu=e=>{e.preventDefault()}}createToolbarMenu(e,t,n,r){const i=new by(e,this,t,n,r);if(this.menuList.set(t,i),n.children){const t=document.createElement("div");t.classList.add("toolbar-sub-menu");const r=document.createElement("div");r.classList.add("toolbar-sub-menu-list"),t.appendChild(r),(0,mp.forIn)(n.children,((t,n)=>{if(t&&!1!==t.visible){const s=this.createToolbarMenu(e,n,t,i);r.appendChild(s.element)}})),i.element.appendChild(t)}return i}updateMenu(e,t){(0,mp.assign)(this.menuConfig[e],t),this.refresh()}updateMenus(e){(0,mp.forEach)(e,(({menuId:e,config:t})=>{(0,mp.assign)(this.menuConfig[e],t)})),this.refresh()}addMenu(e,t,n){var r;if(cp()(r=(0,mp.keys)(this.menuConfig)).call(r,e))im.error("[Toolbar]",e,"exists.");else{if((0,mp.assign)(this.menuConfig,{[e]:t}),n){const[t,r]=n;if(t>this.groupConfig.length-1)this.groupConfig=(0,mp.concat)(this.groupConfig,[[e]]);else{const n=this.groupConfig[t];this.groupConfig[t]=r>n.length-1?(0,mp.concat)(n,e):(0,mp.concat)((0,mp.take)(n,r),e,(0,mp.takeRight)(n,n.length-r))}}else this.groupConfig=(0,mp.concat)(this.groupConfig,[[e]]);this.refresh()}}refresh(){this.destroy(),this.init()}deactivateMeasureMenu(){const e=[ff.Measure,ff.MeasureDistance,ff.MeasureArea,ff.MeasureAngle];ge()(e).call(e,(e=>{const t=document.querySelector(`#${e}`);if(null!=t&&t.classList.contains("active")){t.classList.remove("active");const n=this.menuList.get(e);null==n||n.setActive(!1)}}))}show(){this.element&&(this.element.style.display="")}hide(){this.element&&(this.element.style.display="none")}destroy(){this.element&&this.element.remove(),this.element=void 0,this.menuList.clear()}}class by{constructor(e,t,n,r,i){this.bimViewer=e,this.toolbar=t,this.menuId=n,gh(this,"eventBus",Zd()),gh(this,"active",void 0),gh(this,"element",void 0),this.active=r.defaultActive||!1,this.element=r.customElement&&r.customElement(e,this.menuId,r)||this.createButton(e,this.menuId,r),this.eventBus.on("activeChange",(t=>{t?(this.element.classList.add("active"),(0,mp.forEach)(r.mutexIds,(e=>{var t;const n=null===(t=this.toolbar)||void 0===t?void 0:t.menuList.get(e);n&&n.active&&n.setActive(!1)})),r.onActive&&r.onActive(e)):(this.element.classList.remove("active"),r.onDeactive&&r.onDeactive(e)),this.element.firstChild instanceof HTMLElement&&um(this.element.firstChild.classList,r.icon,this.active),i&&i.setActive(t)})),this.element.onclick=t=>{switch(t.stopPropagation(),r.type){case mf.ClickEvent:r.onClick&&r.onClick(e,this.toolbar,t);break;case mf.Switch:r.onClick&&r.onClick(e,this.toolbar,t),this.active=!this.active,this.eventBus.emit("activeChange",this.active)}}}createButton(e,t,n){const r=document.createElement("div");r.id=t,r.classList.add("toolbar-menu"),n.defaultActive&&r.classList.add("active"),n.children&&r.classList.add("toolbar-parent-menu");const{default:i="icon-new",iconFont:s=Dh}=n.icon;return r.innerHTML=`<div class="icon ${s} ${i}"></div>`,r.title=Yd(n.menuName),r.innerHTML+=`<span>${r.title}</span>`,r}setActive(e){this.active=e,this.eventBus.emit("activeChange",this.active)}}const xy={[ff.MarkupArrow]:{menuName:"Toolbar.markupArrow",icon:{default:"icon-arrow",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.Arrow)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupRect]:{defaultActive:!0,menuName:"Toolbar.markupRect",icon:{default:"icon-rectangle",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.Rectangle)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupArrow,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupCloudRect]:{menuName:"Toolbar.markupCloudRect",icon:{default:"icon-cloud",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.CloudLineRectangle)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupArrow,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupPolyLine]:{menuName:"Toolbar.markupPolyLine",icon:{default:"icon-polyline",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.PolyLine)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupArrow,ff.MarkupCloudRect,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupCloudLine]:{menuName:"Toolbar.markupCloudLine",icon:{default:"icon-cloud-segment",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.CloudLine)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupArrow,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupEllipse]:{menuName:"Toolbar.markupEllipse",icon:{default:"icon-oval",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.Ellipse)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupArrow,ff.MarkupCircle,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupCircle]:{menuName:"Toolbar.markupCircle",icon:{default:"icon-round",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.Circle)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupArrow,ff.MarkupDot,ff.MarkupText,ff.MarkupX]},[ff.MarkupDot]:{menuName:"Toolbar.markupDot",icon:{default:"icon-round",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.Dot)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupArrow,ff.MarkupCircle,ff.MarkupText,ff.MarkupX]},[ff.MarkupX]:{menuName:"Toolbar.markupX",icon:{default:"icon-cross",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.X)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupArrow,ff.MarkupText]},[ff.MarkupText]:{menuName:"Toolbar.markupText",icon:{default:"icon-text",iconFont:"iconfont"},type:mf.Switch,onActive:e=>{e.activateMarkup(_y.Text)},onDeactive(e){e.activateMarkup()},mutexIds:[ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupCloudLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupDot,ff.MarkupArrow,ff.MarkupX]},[ff.MarkupStrokeStyle]:{menuName:"Toolbar.markupStroke",icon:{default:"icon-color-red",iconFont:"iconfont"},type:mf.ClickEvent,onClick:(e,t,n)=>{const r=n.target.parentElement,i=null==r?void 0:r.firstElementChild,s=document.createElement("input");s.setAttribute("type","color"),s.style.position="absolute",s.style.left=`${n.x}px`,s.style.top=`${n.y}px`,s.value=e.getMarkupLineColor(),s.click(),s.oninput=t=>{const n=t.target.value;e.setMarkupLineColor(n),i.style.color=n}}},[ff.MarkupLineWidth]:{menuName:"Toolbar.markupLineWidth",icon:{default:"icon-line",iconFont:"iconfont"},customElement(e,t,n){const r=document.createElement("div");return r.id=t,r.classList.add("toolbar-menu"),n.children&&r.classList.add("toolbar-parent-menu"),r.title=Yd(n.menuName),r.innerHTML+=`<span>${r.title}</span>`,r},type:mf.SubMenu,children:{[ff.MarkupLineWidth2]:{defaultActive:!0,icon:{default:"icon-line-2",iconFont:"iconfont"},onClick:e=>{e.setMarkupLineWidth(2)},type:mf.Switch,menuName:"Toolbar.markupLineWidth2",mutexIds:[ff.MarkupLineWidth5,ff.MarkupLineWidth10]},[ff.MarkupLineWidth5]:{icon:{default:"icon-line-3",iconFont:"iconfont"},onClick:e=>{e.setMarkupLineWidth(3)},type:mf.Switch,menuName:"Toolbar.markupLineWidth5",mutexIds:[ff.MarkupLineWidth2,ff.MarkupLineWidth10]},[ff.MarkupLineWidth10]:{icon:{default:"icon-line-4",iconFont:"iconfont"},onClick:e=>{e.setMarkupLineWidth(4)},type:mf.Switch,menuName:"Toolbar.markupLineWidth10",mutexIds:[ff.MarkupLineWidth2,ff.MarkupLineWidth5]}}},[ff.MarkupFontSize]:{menuName:"Toolbar.markupFontSize",icon:{default:"icon-font"},customElement(e,t,n){const r=document.createElement("div");return r.id=t,r.classList.add("toolbar-menu"),n.children&&r.classList.add("toolbar-parent-menu"),r.title=Yd(n.menuName),r.innerHTML+=`<span>${r.title}</span>`,r},type:mf.SubMenu,children:{[ff.MarkupFontSize14]:{icon:{default:"icon-font14",iconFont:"iconfont"},onClick:e=>{e.setMarkupFontSize(14)},type:mf.Switch,menuName:"",mutexIds:[ff.MarkupFontSize18,ff.MarkupFontSize24]},[ff.MarkupFontSize18]:{defaultActive:!0,icon:{default:"icon-font18",iconFont:"iconfont"},onClick:e=>{e.setMarkupFontSize(18)},type:mf.Switch,menuName:"",mutexIds:[ff.MarkupFontSize14,ff.MarkupFontSize24]},[ff.MarkupFontSize24]:{icon:{default:"icon-font24",iconFont:"iconfont"},onClick:e=>{e.setMarkupFontSize(24)},type:mf.Switch,menuName:"",mutexIds:[ff.MarkupFontSize14,ff.MarkupFontSize18]}}},[ff.MarkupClear]:{icon:{default:"icon-eraser",iconFont:"iconfont"},onClick:e=>{im.info("[Toolbar]","Clear Markup",e),e.clearMarkups()},type:mf.ClickEvent,menuName:"Toolbar.clearMarkup"},[ff.MarkupQuit]:{icon:{default:""},customElement(e,t,n){const r=document.createElement("div");return r.id=t,r.classList.add("toolbar-menu"),n.children&&r.classList.add("toolbar-parent-menu"),r.title=Yd(n.menuName),r.innerHTML+=`<span>${r.title}</span>`,r},onClick:(e,t)=>{var n;e.activateMarkup(),t.destroy(),null===(n=e.toolbar)||void 0===n||n.show()},type:mf.ClickEvent,menuName:"Toolbar.quitMarkup"}},Ty=[[ff.MarkupArrow,ff.MarkupRect,ff.MarkupCloudRect,ff.MarkupPolyLine,ff.MarkupEllipse,ff.MarkupCircle,ff.MarkupText,ff.MarkupClear,ff.MarkupQuit]];class wy extends yy{constructor(e,t,n=[...Ty]){super(e,t,n)}}function Ey(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}const Sy={[ff.HomeView]:{icon:{default:"icon-home",active:"icon-home-filled"},menuName:"Toolbar.homeView",type:mf.ClickEvent,onClick:e=>{e.goToHomeView()}},[ff.OrthoMode]:{icon:{default:"icon-orthomode",active:"icon-orthomode-filled"},menuName:"Toolbar.orthoView",type:mf.Switch,onActive:e=>{im.info("[Toolbar]","Enter OrthoMode"),e.setToOrthographicCamera(!0)},onDeactive:e=>{im.info("[Toolbar]","Exit OrthoMode"),e.setToOrthographicCamera(!1)}},[ff.Measure]:{icon:{default:"icon-measure",active:"icon-measure-filled"},menuName:"Toolbar.measurement",type:mf.SubMenu,children:{[ff.MeasureDistance]:{icon:{default:"icon-distancemeasure",active:"icon-distancemeasure-filled"},menuName:"Toolbar.distanceMeasurement",onActive:e=>{e.activateMeasurement(gy.Distance)},onDeactive:e=>{e.deactivateMeasurement()},type:mf.Switch,mutexIds:[ff.MeasureArea,ff.MeasureAngle,ff.MeasureAngle]},[ff.MeasureArea]:{icon:{default:"icon-areameasure",active:"icon-areameasure-filled"},onActive:e=>{e.activateMeasurement(gy.Area)},onDeactive:e=>{e.deactivateMeasurement()},type:mf.Switch,menuName:"Toolbar.areaMeasurement",mutexIds:[ff.MeasureDistance,ff.MeasureAngle,ff.MeasureCoordinate]},[ff.MeasureAngle]:{menuName:"Toolbar.angleMeasurement",icon:{default:"icon-anglemeasure"},type:mf.Switch,onActive:e=>{e.activateMeasurement(gy.Angle)},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:[ff.MeasureDistance,ff.MeasureArea,ff.MeasureCoordinate]},[ff.MeasureCoordinate]:{menuName:"Toolbar.coordinateMeasurement",icon:{default:"icon-distancemeasure"},type:mf.Switch,onActive:e=>{e.activateMeasurement(gy.Coordinate)},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:[ff.MeasureDistance,ff.MeasureArea,ff.MeasureAngle]},[ff.MeasureClear]:{icon:{default:"icon-clear",active:"icon-clear-filled"},onClick:e=>{im.info("[Toolbar]","Clear Measure",e),e.clearMeasurements()},type:mf.ClickEvent,menuName:"Toolbar.clearMeasurement"}}},[ff.Section]:{icon:{default:"icon-section",active:"icon-section-filled"},menuName:"Toolbar.section",type:mf.SubMenu,children:{[ff.AxisSectionPlane]:{icon:{default:"icon-sectionplane",active:"icon-sectionplane-filled"},menuName:"Toolbar.axisSection",type:mf.Switch,onActive:e=>{e.enableSection(qh.AxisPlaneSection)},onDeactive:e=>{e.disableSection()},mutexIds:[ff.SectionBox,ff.SectionPlane]},[ff.SectionPlane]:{icon:{default:"icon-choosesectionplane",active:"icon-choosesectionplane-filled"},menuName:"Toolbar.pickSectionPlane",type:mf.Switch,onActive:e=>{e.enableSection(qh.PickPlaneSection)},onDeactive:e=>{e.disableSection()},mutexIds:[ff.AxisSectionPlane,ff.SectionBox]},[ff.SectionBox]:{icon:{default:"icon-sectionbox",active:"icon-sectionbox-filled"},menuName:"Toolbar.sectionBox",type:mf.Switch,onActive:e=>{e.enableSection()},onDeactive:e=>{e.disableSection()},mutexIds:[ff.AxisSectionPlane,ff.SectionPlane]}}},[ff.BimTree]:{icon:{default:"icon-bimtree",active:"icon-bimtree-filled"},menuName:"Toolbar.bimTree",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Bim Tree")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Bim Tree")}},[ff.Viewpoint]:{icon:{default:"icon-viewpoint",active:"icon-viewpoint-filled"},menuName:"Toolbar.viewpoint",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Viewpoint")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Viewpoint")},visible:!1},[ff.Annotation]:{icon:{default:"icon-annotation",active:"icon-annotation-filled"},menuName:"Toolbar.annotation",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Annotation")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Annotation")},visible:!1},[ff.Property]:{icon:{default:"icon-property",active:"icon-property-filled"},menuName:"Toolbar.property",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Property")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Property")},visible:!1},[ff.Settings]:{icon:{default:"icon-settings",active:"icon-settings-filled"},menuName:"Toolbar.settings",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Settings")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Settings")},visible:!1},[ff.Fullscreen]:{icon:{default:"icon-fullscreen",active:"icon-fullscreen-filled"},menuName:"Toolbar.fullscreen",type:mf.Switch,onClick:(e,t)=>{const n=()=>{const e=null==t?void 0:t.menuList.get(ff.Fullscreen);e&&e.setActive(cm.isFullScreen())};cm.isFullScreen()?(cm.exitFullscreen(),window.removeEventListener("resize",n)):cm.fullScreen(e.container),window.addEventListener("resize",n)}}},Iy=[[ff.HomeView,ff.OrthoMode,ff.Fullscreen,ff.ZoomToRectangle],[ff.Measure,ff.Markup,ff.Section],[ff.BimTree,ff.Viewpoint,ff.Annotation,ff.Property,ff.Compared,ff.QuitCompare,ff.Layers],[ff.Settings]],My={[ff.SceneClear]:{icon:{default:"icon-clear",active:"icon-clear-filled"},menuName:"clear",type:mf.ClickEvent,onClick:()=>{}}},Ay={[ff.HomeView]:{icon:{default:"icon-zhushitu",active:"icon-zhushitu",iconFont:"iconfont"},menuName:"Toolbar.homeView",type:mf.ClickEvent,onClick:e=>{e.goToHomeView()}},[ff.ZoomToRectangle]:{icon:{default:"icon-kuangxuanfangda",active:"icon-kuangxuanfangda",iconFont:"iconfont"},menuName:"Toolbar.zoomToRectangle",type:mf.Switch,onClick:()=>{},visible:!1},[ff.Measure]:{icon:{default:"icon-celiang1",active:"icon-celiang1",iconFont:"iconfont"},menuName:"Toolbar.measurement",type:mf.SubMenu,children:{[ff.MeasureDistance]:{icon:{default:"icon-distancemeasure",active:"icon-distancemeasure-filled"},menuName:"Toolbar.distanceMeasurement",onActive:e=>{e.activateMeasurement(gy.Distance)},onDeactive:e=>{e.deactivateMeasurement()},type:mf.Switch,mutexIds:[ff.MeasureArea,ff.MeasureAngle,ff.MeasureCoordinate]},[ff.MeasureArea]:{icon:{default:"icon-areameasure",active:"icon-areameasure-filled"},onActive:e=>{e.activateMeasurement(gy.Area)},onDeactive:e=>{e.deactivateMeasurement()},type:mf.Switch,menuName:"Toolbar.areaMeasurement",mutexIds:[ff.MeasureDistance,ff.MeasureAngle,ff.MeasureCoordinate]},[ff.MeasureAngle]:{menuName:"Toolbar.angleMeasurement",icon:{default:"icon-anglemeasure"},type:mf.Switch,onActive:e=>{e.activateMeasurement(gy.Angle)},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:[ff.MeasureDistance,ff.MeasureArea,ff.MeasureCoordinate]},[ff.MeasureCoordinate]:{menuName:"Toolbar.coordinateMeasurement",icon:{default:"icon-distancemeasure"},type:mf.Switch,onActive:e=>{e.activateMeasurement(gy.Coordinate)},onDeactive:e=>{e.deactivateMeasurement()},visible:!1,mutexIds:[ff.MeasureDistance,ff.MeasureArea,ff.MeasureAngle]},[ff.MeasureClear]:{icon:{default:"icon-clear",active:"icon-clear-filled"},onClick:e=>{im.info("[Toolbar]","Clear Measure",e),e.clearMeasurements()},type:mf.ClickEvent,menuName:"Toolbar.clearMeasurement"}}},[ff.Markup]:{icon:{default:"icon-tianjiapizhu",iconFont:"iconfont"},menuName:"Toolbar.markup",type:mf.ClickEvent,onClick:(e,t)=>{e.activateMarkup(_y.Rectangle),t.hide(),e.deactivateMeasurement(),new wy(e,function(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=Ey(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=Ey(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}({},xy))}},[ff.Settings]:{icon:{default:"icon-settings",active:"icon-settings-filled"},menuName:"Toolbar.settings",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Settings")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Settings")},visible:!0},[ff.Compared]:{icon:{default:"icon-compared",iconFont:"iconfont"},menuName:"Toolbar.compared",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Compare")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Compare")},visible:!1},[ff.QuitCompare]:{icon:{default:"icon-compared",iconFont:"iconfont"},menuName:"Toolbar.quitCompare",type:mf.Switch,onActive:()=>{im.info("[Toolbar]","Activate Compare")},onDeactive:()=>{im.info("[Toolbar]","Deactivate Compare")},visible:!1},[ff.Layers]:{icon:{default:"icon-tucengkongzhi",active:"icon-tucengkongzhi",iconFont:"iconfont"},menuName:"Toolbar.layers",type:mf.Switch,onClick:()=>{}},[ff.Fullscreen]:{icon:{default:"icon-quanping",active:"icon-quanping",iconFont:"iconfont"},menuName:"Toolbar.fullscreen",type:mf.Switch,onClick:(e,t)=>{const n=()=>{const e=null==t?void 0:t.menuList.get(ff.Fullscreen);e&&e.setActive(cm.isFullScreen())};cm.isFullScreen()?(cm.exitFullscreen(),window.removeEventListener("resize",n)):cm.fullScreen(e.container),window.addEventListener("resize",n)}}},Ry={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor.a *= opacity;\n\n\n\t\t}"};class Dy extends Rm{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof bi?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=yi.clone(e.uniforms),this.material=new bi({defines:H({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Om(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class Cy extends Rm{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let s,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class Oy extends Rm{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class Py{constructor(e,t){if(this.renderer=e,void 0===t){const n=e.getSize(new Xt);this._pixelRatio=e.getPixelRatio(),this._width=n.width,this._height=n.height,(t=new _n(this._width*this._pixelRatio,this._height*this._pixelRatio)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Ry&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===Dy&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new Dy(Ry),this.clock=new ou}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){var n;E(n=this.passes).call(n,t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){var t;const n=T(t=this.passes).call(t,e);var r;-1!==n&&E(r=this.passes).call(r,n,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let t=0,r=this.passes.length;t<r;t++){const r=this.passes[t];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(t),r.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),r.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==Cy&&(r instanceof Cy?n=!0:r instanceof Oy&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new Xt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let e=0;e<this.passes.length;e++)this.passes[e].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}new Wi(-1,1,1,-1,0,1);const Ny=new Kr;Ny.setAttribute("position",new zr([-1,3,0,-1,-1,0,3,-1,0],3)),Ny.setAttribute("uv",new zr([0,2,0,0,2,0],2));const Ly={uniforms:{tDiffuse:{value:null},resolution:{value:new Xt(1/1024,1/512)}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\tprecision highp float;\n\n\tuniform sampler2D tDiffuse;\n\n\tuniform vec2 resolution;\n\n\tvarying vec2 vUv;\n\n\t// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)\n\n\t//----------------------------------------------------------------------------------\n\t// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag\n\t// SDK Version: v3.00\n\t// Email: gameworks@nvidia.com\n\t// Site: http://developer.nvidia.com/\n\t//\n\t// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n\t//\n\t// Redistribution and use in source and binary forms, with or without\n\t// modification, are permitted provided that the following conditions\n\t// are met:\n\t// * Redistributions of source code must retain the above copyright\n\t// notice, this list of conditions and the following disclaimer.\n\t// * Redistributions in binary form must reproduce the above copyright\n\t// notice, this list of conditions and the following disclaimer in the\n\t// documentation and/or other materials provided with the distribution.\n\t// * Neither the name of NVIDIA CORPORATION nor the names of its\n\t// contributors may be used to endorse or promote products derived\n\t// from this software without specific prior written permission.\n\t//\n\t// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\n\t// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\t// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\t// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n\t// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\t// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n\t// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n\t// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n\t// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t//\n\t//----------------------------------------------------------------------------------\n\n\t#ifndef FXAA_DISCARD\n\t\t\t//\n\t\t\t// Only valid for PC OpenGL currently.\n\t\t\t// Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n\t\t\t//\n\t\t\t// 1 = Use discard on pixels which don't need AA.\n\t\t\t// For APIs which enable concurrent TEX+ROP from same surface.\n\t\t\t// 0 = Return unchanged color on pixels which don't need AA.\n\t\t\t//\n\t\t\t#define FXAA_DISCARD 0\n\t#endif\n\n\t/*--------------------------------------------------------------------------*/\n\t#define FxaaTexTop(t, p) texture2D(t, p, -100.0)\n\t#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), -100.0)\n\t/*--------------------------------------------------------------------------*/\n\n\t#define NUM_SAMPLES 5\n\n\t// assumes colors have premultipliedAlpha, so that the calculated color contrast is scaled by alpha\n\tfloat contrast( vec4 a, vec4 b ) {\n\t\t\tvec4 diff = abs( a - b );\n\t\t\treturn max( max( max( diff.r, diff.g ), diff.b ), diff.a );\n\t}\n\n\t/*============================================================================\n\n\t\t\t\t\t\t\t\t\tFXAA3 QUALITY - PC\n\n\t============================================================================*/\n\n\t/*--------------------------------------------------------------------------*/\n\tvec4 FxaaPixelShader(\n\t\t\tvec2 posM,\n\t\t\tsampler2D tex,\n\t\t\tvec2 fxaaQualityRcpFrame,\n\t\t\tfloat fxaaQualityEdgeThreshold,\n\t\t\tfloat fxaaQualityinvEdgeThreshold\n\t) {\n\t\t\tvec4 rgbaM = FxaaTexTop(tex, posM);\n\t\t\tvec4 rgbaS = FxaaTexOff(tex, posM, vec2( 0.0, 1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaE = FxaaTexOff(tex, posM, vec2( 1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaN = FxaaTexOff(tex, posM, vec2( 0.0,-1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaW = FxaaTexOff(tex, posM, vec2(-1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\t// . S .\n\t\t\t// W M E\n\t\t\t// . N .\n\n\t\t\tbool earlyExit = max( max( max(\n\t\t\t\t\tcontrast( rgbaM, rgbaN ),\n\t\t\t\t\tcontrast( rgbaM, rgbaS ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaE ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaW ) )\n\t\t\t\t\t< fxaaQualityEdgeThreshold;\n\t\t\t// . 0 .\n\t\t\t// 0 0 0\n\t\t\t// . 0 .\n\n\t\t\t#if (FXAA_DISCARD == 1)\n\t\t\t\t\tif(earlyExit) FxaaDiscard;\n\t\t\t#else\n\t\t\t\t\tif(earlyExit) return rgbaM;\n\t\t\t#endif\n\n\t\t\tfloat contrastN = contrast( rgbaM, rgbaN );\n\t\t\tfloat contrastS = contrast( rgbaM, rgbaS );\n\t\t\tfloat contrastE = contrast( rgbaM, rgbaE );\n\t\t\tfloat contrastW = contrast( rgbaM, rgbaW );\n\n\t\t\tfloat relativeVContrast = ( contrastN + contrastS ) - ( contrastE + contrastW );\n\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\tbool horzSpan = relativeVContrast > 0.;\n\t\t\t// . 1 .\n\t\t\t// 0 0 0\n\t\t\t// . 1 .\n\n\t\t\t// 45 deg edge detection and corners of objects, aka V/H contrast is too similar\n\t\t\tif( abs( relativeVContrast ) < .3 ) {\n\t\t\t\t\t// locate the edge\n\t\t\t\t\tvec2 dirToEdge;\n\t\t\t\t\tdirToEdge.x = contrastE > contrastW ? 1. : -1.;\n\t\t\t\t\tdirToEdge.y = contrastS > contrastN ? 1. : -1.;\n\t\t\t\t\t// . 2 . . 1 .\n\t\t\t\t\t// 1 0 2 ~= 0 0 1\n\t\t\t\t\t// . 1 . . 0 .\n\n\t\t\t\t\t// tap 2 pixels and see which ones are \"outside\" the edge, to\n\t\t\t\t\t// determine if the edge is vertical or horizontal\n\n\t\t\t\t\tvec4 rgbaAlongH = FxaaTexOff(tex, posM, vec2( dirToEdge.x, -dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongH = contrast( rgbaM, rgbaAlongH );\n\t\t\t\t\t// . 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 H\n\n\t\t\t\t\tvec4 rgbaAlongV = FxaaTexOff(tex, posM, vec2( -dirToEdge.x, dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongV = contrast( rgbaM, rgbaAlongV );\n\t\t\t\t\t// V 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 .\n\n\t\t\t\t\trelativeVContrast = matchAlongV - matchAlongH;\n\t\t\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\t\t\tif( abs( relativeVContrast ) < .3 ) { // 45 deg edge\n\t\t\t\t\t\t\t// 1 1 .\n\t\t\t\t\t\t\t// 0 0 1\n\t\t\t\t\t\t\t// . 0 1\n\n\t\t\t\t\t\t\t// do a simple blur\n\t\t\t\t\t\t\treturn mix(\n\t\t\t\t\t\t\t\t\trgbaM,\n\t\t\t\t\t\t\t\t\t(rgbaN + rgbaS + rgbaE + rgbaW) * .25,\n\t\t\t\t\t\t\t\t\t.4\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\thorzSpan = relativeVContrast > 0.;\n\t\t\t}\n\n\t\t\tif(!horzSpan) rgbaN = rgbaW;\n\t\t\tif(!horzSpan) rgbaS = rgbaE;\n\t\t\t// . 0 . 1\n\t\t\t// 1 0 1 -> 0\n\t\t\t// . 0 . 1\n\n\t\t\tbool pairN = contrast( rgbaM, rgbaN ) > contrast( rgbaM, rgbaS );\n\t\t\tif(!pairN) rgbaN = rgbaS;\n\n\t\t\tvec2 offNP;\n\t\t\toffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n\t\t\toffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n\n\t\t\tbool doneN = false;\n\t\t\tbool doneP = false;\n\n\t\t\tfloat nDist = 0.;\n\t\t\tfloat pDist = 0.;\n\n\t\t\tvec2 posN = posM;\n\t\t\tvec2 posP = posM;\n\n\t\t\tint iterationsUsed = 0;\n\t\t\tint iterationsUsedN = 0;\n\t\t\tint iterationsUsedP = 0;\n\t\t\tfor( int i = 0; i < NUM_SAMPLES; i++ ) {\n\t\t\t\t\titerationsUsed = i;\n\n\t\t\t\t\tfloat increment = float(i + 1);\n\n\t\t\t\t\tif(!doneN) {\n\t\t\t\t\t\t\tnDist += increment;\n\t\t\t\t\t\t\tposN = posM + offNP * nDist;\n\t\t\t\t\t\t\tvec4 rgbaEndN = FxaaTexTop(tex, posN.xy);\n\t\t\t\t\t\t\tdoneN = contrast( rgbaEndN, rgbaM ) > contrast( rgbaEndN, rgbaN );\n\t\t\t\t\t\t\titerationsUsedN = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!doneP) {\n\t\t\t\t\t\t\tpDist += increment;\n\t\t\t\t\t\t\tposP = posM - offNP * pDist;\n\t\t\t\t\t\t\tvec4 rgbaEndP = FxaaTexTop(tex, posP.xy);\n\t\t\t\t\t\t\tdoneP = contrast( rgbaEndP, rgbaM ) > contrast( rgbaEndP, rgbaN );\n\t\t\t\t\t\t\titerationsUsedP = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(doneN || doneP) break;\n\t\t\t}\n\n\n\t\t\tif ( !doneP && !doneN ) return rgbaM; // failed to find end of edge\n\n\t\t\tfloat dist = min(\n\t\t\t\t\tdoneN ? float( iterationsUsedN ) / float( NUM_SAMPLES - 1 ) : 1.,\n\t\t\t\t\tdoneP ? float( iterationsUsedP ) / float( NUM_SAMPLES - 1 ) : 1.\n\t\t\t);\n\n\t\t\t// hacky way of reduces blurriness of mostly diagonal edges\n\t\t\t// but reduces AA quality\n\t\t\tdist = pow(dist, .5);\n\n\t\t\tdist = 1. - dist;\n\n\t\t\treturn mix(\n\t\t\t\t\trgbaM,\n\t\t\t\t\trgbaN,\n\t\t\t\t\tdist * .5\n\t\t\t);\n\t}\n\n\tvoid main() {\n\t\t\tconst float edgeDetectionQuality = .2;\n\t\t\tconst float invEdgeDetectionQuality = 1. / edgeDetectionQuality;\n\n\t\t\tgl_FragColor = FxaaPixelShader(\n\t\t\t\t\tvUv,\n\t\t\t\t\ttDiffuse,\n\t\t\t\t\tresolution,\n\t\t\t\t\tedgeDetectionQuality, // [0,1] contrast needed, otherwise early discard\n\t\t\t\t\tinvEdgeDetectionQuality\n\t\t\t);\n\n\t}\n\t"};class ky{constructor(e){gh(this,"object",void 0),this.object=e}instantiate(){const e=Yh()();this.instantiateInner(this.object),console.log(`[Inst] instantiate() costed ${(Yh()()-e)/1e3}s`)}instantiateInner(e){var t;if(!e.children||0===e.children.length)return;const n=e.children.length,r={},i=[];for(let t=0;t<n;++t){const n=e.children[t];if(this.instantiateInner(n),n.children&&n.children.length>0)continue;if(!n.geometry)continue;let s=!1;const a=tp()(r);for(let o=a.length-1;o>=0;--o){const l=a[o].indexes[0],c=e.children[l];if(this.geometryEquals(n.geometry,c.geometry)&&tf.materialsEquals(n.material,c.material)){r[l]||(r[l]={indexes:[l]},this.removeFromArray(i,l)),r[l].indexes.push(t),s=!0;break}}for(let a=i.length-1;!s&&a>=0;--a){const o=i[a],l=e.children[o];if(this.geometryEquals(n.geometry,l.geometry)&&tf.materialsEquals(n.material,l.material)){r[o]||(r[o]={indexes:[o]},this.removeFromArray(i,o)),r[o].indexes.push(t),s=!0;break}}s||i.push(t)}if(Q()(r).length<=0)return;const s=[],a=[];ge()(t=tp()(r)).call(t,(t=>{const n=t.indexes;a.push(...n);const r=e.children[n[0]];let i=r.material;if(i instanceof Lr)i=i.clone();else if(x()(i)){const e=[];ge()(i).call(i,(t=>e.push(t.clone()))),i=e}const o=new ko(r.geometry,i,n.length);o.name=`[Instanced] ${r.name}`;for(let t=0;t<n.length;++t){const r=n[t],i=e.children[r];i.updateMatrix(),o.setMatrixAt(t,i.matrix)}o.matrixAutoUpdate=Ih,Ih||o.updateMatrix(),s.push(o)})),re()(a).call(a,((e,t)=>t-e)),ge()(a).call(a,(t=>e.remove(e.children[t]))),ge()(s).call(s,(t=>{t.parent=e,e.children.push(t)})),e.updateMatrix(),console.log(`[Inst] ${a.length}(out of ${n}) objects instanced to ${s.length} InstancedMesh`)}removeFromArray(e,t){for(let n=e.length-1;n>=0;--n)if(e[n]===t)return void S()(e).call(e,n,1)}geometryEquals(e,t){return ef.geometryEquals(e,t)}}class Fy extends vy{constructor(e,t,n){super(gy.Angle,e,t,n),gh(this,"pointMarkers",[]),gh(this,"line",void 0)}createMeasurementAssetsByData(e){const t=this.toVecArr(e.points);t.length<3&&im.warn("[Measure] Invalid MeasurementData:",e);const n=this.createMeasurementAssets(e);ge()(t).call(t,(e=>{const t=this.createPointMarker(e);t.visible=!1,t.userData.visibleWhenSelected=!0,n.markers.add(t)}));const r=this.createLine(vy.LINE_MATERIAL,t);n.markers.add(r),r.userData.measurementDataId=n.measurementsData.id;const i=this.createCurveAndLabel(t);return null!=i&&i.curveObj&&(n.markers.add(i.curveObj),r.children.push(null==i?void 0:i.curveObj)),null!=i&&i.labelObj&&n.markers.add(i.labelObj),this.scene.add(n.markers),n}select(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.userData.visibleWhenSelected&&(e.visible=!0)}))}unselect(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.userData.visibleWhenSelected&&(e.visible=!1)}))}onMouseMove(e){this.createOrUpdatePointMarkers(e),this.createOrUpdateLineMarker(e)}onMouseClick(e){var t;super.onMouseClick(e);const n=this.getMeasurementAssets();if(e.button===Le)return n.measurementsData.points=[],void this.removeMarkers();const r=this.getIntersections(e)[0];if(!r)return;const i=null!==(t=this.snapPoint)&&void 0!==t?t:null==r?void 0:r.point;n.measurementsData.points.push([i.x,i.y,i.z]);const s=this.toVecArr(n.measurementsData.points);if(this.lastMouseDownPosition=i,1===s.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdatePointMarkers(i),this.createOrUpdateLineMarker(i),s.length>=3){const e=this.createCurveAndLabel(s);var a;if(null!=e&&e.curveObj)n.markers.add(e.curveObj),null===(a=this.line)||void 0===a||a.children.push(e.curveObj);null!=e&&e.labelObj&&n.markers.add(e.labelObj),this.complete()}}complete(){const e=this.measurementAssets;this.dispatchEvent("complete",e),this.completed=!0,this.pointMarkers=[],this.line=void 0,this.measurementAssets=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.measurementAssets,t=(null==e?void 0:e.measurementsData.points)||[];if(t.length>0){const n=this.pointMarkers.pop();if(n&&(null==e||e.markers.remove(n)),t.pop(),0===t.length&&(this.completed=!0),this.lastMoveEvent){const e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}}else this.removeMarkers(),this.deactivate(),this.dispatchEvent("deactivate",this.type);this.osnapHelper.deactivate(),this.viewer.enableSVGRender(),this.lastMouseDownPosition=void 0}setTooltipContent(){const e=this.viewer.translate("Tooltip.measure");var t;e&&this.tooltip&&(null===(t=this.tooltip)||void 0===t||t.setContent(e))}getMeasurementAssets(){return this.measurementAssets||(this.measurementAssets=this.createMeasurementAssets(),this.scene.add(this.measurementAssets.markers)),this.measurementAssets}removeMarkers(){const e=this.measurementAssets;e&&(this.pointMarkers&&(e.markers.remove(...this.pointMarkers),this.pointMarkers=[]),this.line&&(e.markers.remove(this.line),this.line=void 0))}createOrUpdatePointMarkers(e){const t=this.getMeasurementAssets(),n=t.measurementsData.points;if(!(n.length<1)&&this.pointMarkers.length<n.length){const n=this.createPointMarker(e);n.userData.visibleWhenSelected=!0,t.markers.add(n),this.pointMarkers.push(n)}}createOrUpdateLineMarker(e){const t=this.getMeasurementAssets(),n=this.toVecArr(t.measurementsData.points);var r;n.length<1?null===(r=this.line)||void 0===r||r.geometry.setFromPoints([]):(this.line||(this.line=this.createLine(vy.LINE_MATERIAL)),this.line.userData.measurementDataId=t.measurementsData.id,this.line.geometry.setFromPoints([...n,e]),this.line.geometry.computeBoundingSphere(),t.markers.add(this.line))}createCurveAndLabel(e){if(e.length<3)return void im.warn(`[Measure] Invalid number of points, expected 3, got ${e.length}`);const t=e[0],n=e[1],r=e[2],i=new xn(t.x-n.x,t.y-n.y,t.z-n.z).normalize(),s=this.getAngleBisector(t,n,r),a=new xn(r.x-n.x,r.y-n.y,r.z-n.z).normalize(),o=this.calculateAngle(t,n,r),l=`${D_(o,2)} ${this.getUnitString()}`,c=Math.min(t.distanceTo(n),r.distanceTo(n));let u=.3*c,h=n.clone().add(new xn(s.x*u,s.y*u,s.z*u));const p=this.getLabelColor(),d=lm.createLabel(l,p);d.position.set(h.x,h.y,h.z),u=.2*c,h=n.clone().add(new xn(s.x*u,s.y*u,s.z*u));const m=n.clone().add(new xn(i.x*u,i.y*u,i.z*u)),f=n.clone().add(new xn(a.x*u,a.y*u,a.z*u));return{curveObj:this.createCurve(m,h,f),labelObj:d}}}class Uy extends vy{constructor(e,t,n){super(gy.Area,e,t,n),gh(this,"pointMarkers",[]),gh(this,"line",void 0)}createMeasurementAssetsByData(e){const t=this.toVecArr(e.points);t.length<3&&im.warn("[Measure] Invalid MeasurementData:",e),my.arePointsCoplanar(t)||im.warn("[Measure] points are not coplanar");const n=this.createMeasurementAssets(e);ge()(t).call(t,(e=>{const t=this.createPointMarker(e);t.visible=!1,t.userData.visibleWhenSelected=!0,n.markers.add(t)}));const r=this.createLine(vy.LINE_MATERIAL,t);n.markers.add(r);const i=this.createFaces(t);i.userData.measurementDataId=n.measurementsData.id,n.markers.add(i);const s=this.createLabel(t);return n.markers.add(s),this.scene.add(n.markers),n}onMouseMove(e){this.createOrUpdatePointMarkers(e),this.createOrUpdateLineMarker(e)}select(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.userData.visibleWhenSelected&&(e.visible=!0)}))}unselect(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.userData.visibleWhenSelected&&(e.visible=!1)}))}onMouseClick(e){var t,n;super.onMouseClick(e);const r=this.getMeasurementAssets(),i=this.toVecArr(r.measurementsData.points),s=e=>my.arePointsCoplanar(e)&&!my.isSelfIntersecting(e);if(e.button===Le){var a;if(i.length<3||!s(i))return r.measurementsData.points=[],void this.removeMarkers();i.push(i[0]),null===(a=this.line)||void 0===a||a.geometry.setFromPoints(i);const e=this.createFaces(i);e.userData.measurementDataId=r.measurementsData.id,r.markers.add(e);const t=this.createLabel(i);r.markers.add(t),this.complete()}const o=this.getIntersections(e)[0];if(!o)return;const l=null!==(t=null===(n=this.snapPoint)||void 0===n?void 0:n.clone())&&void 0!==t?t:null==o?void 0:o.point.clone();i.length>=3&&!s([...i,l])?im.warn("[Measure] The position is either not coplanar with other points, or is self intersecting!"):(r.measurementsData.points.push([l.x,l.y,l.z]),this.lastMouseDownPosition=l,1===r.measurementsData.points.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdatePointMarkers(l),this.createOrUpdateLineMarker(l))}complete(){const e=this.getMeasurementAssets();this.dispatchEvent("complete",e),this.completed=!0,this.pointMarkers=[],this.line=void 0,this.measurementAssets=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.measurementAssets,t=(null==e?void 0:e.measurementsData.points)||[];if(t.length>0){const n=this.pointMarkers.pop();if(n&&(null==e||e.markers.remove(n)),t.pop(),0===t.length&&(this.completed=!0),this.lastMoveEvent){const e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}}else this.removeMarkers(),this.deactivate(),this.dispatchEvent("deactivate",this.type);this.osnapHelper.deactivate(),this.viewer.enableSVGRender(),this.lastMouseDownPosition=void 0}setTooltipContent(){const e=this.viewer.translate("Tooltip.areaMeasurement");var t;e&&this.tooltip&&(null===(t=this.tooltip)||void 0===t||t.setContent(e))}getMeasurementAssets(){return this.measurementAssets||(this.measurementAssets=this.createMeasurementAssets(),this.scene.add(this.measurementAssets.markers)),this.measurementAssets}removeMarkers(){const e=this.measurementAssets;e&&(this.pointMarkers&&(e.markers.remove(...this.pointMarkers),this.pointMarkers=[]),this.line&&(e.markers.remove(this.line),this.line=void 0))}createOrUpdatePointMarkers(e){const t=this.getMeasurementAssets(),n=this.toVecArr(t.measurementsData.points);if(!(n.length<1)&&this.pointMarkers.length<n.length){const n=this.createPointMarker(e);n.userData.visibleWhenSelected=!0,t.markers.add(n),this.pointMarkers.push(n)}}createOrUpdateLineMarker(e){const t=this.getMeasurementAssets(),n=this.toVecArr(t.measurementsData.points);var r;n.length<1?null===(r=this.line)||void 0===r||r.geometry.setFromPoints([]):(this.line||(this.line=this.createLine(vy.LINE_MATERIAL),t.markers.add(this.line)),this.line.geometry.setFromPoints([...n,e]))}createLabel(e){const t=this.calculateArea(e),n=`${D_(t,2)}`,r=this.getBarycenter(M()(e).call(e,1)),i=this.getLabelColor(),s=lm.createLabel(n,i);return s.position.set(r.x,r.y,r.z),s}}class By extends vy{constructor(e,t,n){super(gy.Coordinate,e,t,n),gh(this,"pointMarker",void 0)}createMeasurementAssetsByData(e){const t=this.toVecArr(e.points);t.length<1&&im.warn("[Measure] Invalid MeasurementData:",e);const n=this.createMeasurementAssets(e),r=this.createPointMarker(t[0]);r.visible=!1,r.userData.visibleWhenSelected=!0,n.markers.add(r);const i=this.createLabel(t[0]);return n.markers.add(i),this.scene.add(n.markers),n}select(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.userData.visibleWhenSelected&&(e.visible=!0)}))}unselect(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.userData.visibleWhenSelected}))}onMouseMove(e){this.createOrUpdatePointMarker(e)}onMouseClick(e){var t;super.onMouseClick(e);const n=this.getMeasurementAssets();if(e.button===Le)return n.measurementsData.points=[],void this.removeMarkers();const r=this.getIntersections(e)[0];if(!r)return;const i=null!==(t=this.snapPoint)&&void 0!==t?t:null==r?void 0:r.point;n.measurementsData.points.push([i.x,i.y,i.z]);const s=this.toVecArr(n.measurementsData.points);if(this.lastMouseDownPosition=i,1===s.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdatePointMarker(i),s.length>=1){const e=this.createLabel(s[0]);e&&n.markers.add(e),this.complete()}}complete(){const e=this.measurementAssets;this.dispatchEvent("complete",e),this.completed=!0,this.pointMarker=void 0,this.measurementAssets=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.measurementAssets,t=(null==e?void 0:e.measurementsData.points)||[];if(t.length>0){const n=this.pointMarker;if(n&&(null==e||e.markers.remove(n)),t.pop(),0===t.length&&(this.completed=!0),this.lastMoveEvent){const e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}}else this.removeMarkers(),this.deactivate(),this.dispatchEvent("deactivate",this.type);this.osnapHelper.deactivate(),this.viewer.enableSVGRender(),this.lastMouseDownPosition=void 0}setTooltipContent(){const e=this.viewer.translate("Tooltip.measure");var t;e&&this.tooltip&&(null===(t=this.tooltip)||void 0===t||t.setContent(e))}getMeasurementAssets(){return this.measurementAssets||(this.measurementAssets=this.createMeasurementAssets(),this.scene.add(this.measurementAssets.markers)),this.measurementAssets}removeMarkers(){const e=this.measurementAssets;e&&this.pointMarker&&(e.markers.remove(this.pointMarker),this.pointMarker=void 0)}createOrUpdatePointMarker(e){const t=this.getMeasurementAssets();if(!(t.measurementsData.points.length<1||this.pointMarker)){const n=this.createPointMarker(e);n.userData.visibleWhenSelected=!0,t.markers.add(n),this.pointMarker=n}}createLabel(e){let t=`${D_(e.x,2)}, ${D_(e.y,2)}`;this.viewer instanceof SX&&(t+=`, ${D_(e.z,2)}`);const n=this.getLabelColor(),r=lm.createLabel(t,n,12,15);return r.position.set(e.x,e.y,e.z),r}}class jy extends vy{constructor(e,t,n){super(gy.Distance,e,t,n),gh(this,"pointMarkers",[]),gh(this,"line",void 0),gh(this,"label",void 0),gh(this,"lineMarkers",[]),this.initEvents()}createMeasurementAssetsByData(e){const t=this.toVecArr(e.points);t.length<2&&im.warn("[Measure] Invalid MeasurementData:",e);const n=this.createMeasurementAssets(e);ge()(t).call(t,(e=>{const t=this.createPointMarker(e);t.visible=!1,t.userData.visibleWhenSelected=!0,n.markers.add(t)}));const r=t[0],i=t[1],s=this.createLine(vy.LINE_MATERIAL,t);s.userData.measurementDataId=n.measurementsData.id;const a=this.createVerticalLineMarkers(t),o=t[0].distanceTo(t[1]),l=`${D_(o,2)}`,c=r.clone().add(i).divideScalar(2),u=this.getLabelColor(),h=lm.createLabel(l,u,14,-4);return h.position.set(c.x,c.y,c.z),n.markers.add(s,...a,h),this.scene.add(n.markers),n}select(e){var t;ge()(t=e.markers.children).call(t,(e=>{void 0!==e.userData.visibleWhenSelected&&(e.visible=e.userData.visibleWhenSelected)}))}unselect(e){var t;ge()(t=e.markers.children).call(t,(e=>{e.visible=!e.userData.visibleWhenSelected}))}onMouseMove(e){this.createOrUpdateLineMarker(e)}onMouseClick(e){var t;super.onMouseClick(e);const n=this.getMeasurementAssets();if(e.button===Le)return n.measurementsData.points=[],void this.removeMarkers();const r=this.getIntersections(e)[0];if(!r)return;const i=null!==(t=this.snapPoint)&&void 0!==t?t:null==r?void 0:r.point,s=n.measurementsData.points;s.push([i.x,i.y,i.z]),this.lastMouseDownPosition=i,1===s.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdatePointMarkers(i),this.createOrUpdateLineMarker(i),s.length>=2&&(this.createOrUpdateLabel(i),this.complete())}complete(){const e=this.getMeasurementAssets(),t=this.toVecArr(e.measurementsData.points),n=this.createVerticalLineMarkers(t);var r;(e.markers.add(...n),this.line)&&(this.line.userData.points=t,this.line.userData.shortLines=n,null===(r=this.lineMarkers)||void 0===r||r.push(this.line));this.dispatchEvent("complete",e),this.completed=!0,this.pointMarkers=[],this.line=void 0,this.label=void 0,this.measurementAssets=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.measurementAssets,t=(null==e?void 0:e.measurementsData.points)||[];t.length>0?(t.pop(),0===t.length&&(this.completed=!0),this.removeMarkers()):(this.removeMarkers(),this.deactivate(),this.dispatchEvent("deactivate",this.type)),this.osnapHelper.deactivate(),this.viewer.enableSVGRender(),this.lastMouseDownPosition=void 0}setTooltipContent(){const e=this.viewer.translate("Tooltip.measure");var t;e&&this.tooltip&&(null===(t=this.tooltip)||void 0===t||t.setContent(e))}getMeasurementAssets(){return this.measurementAssets||(this.measurementAssets=this.createMeasurementAssets(),this.scene.add(this.measurementAssets.markers)),this.measurementAssets}removeMarkers(){const e=this.measurementAssets;e&&(this.pointMarkers&&(e.markers.remove(...this.pointMarkers),this.pointMarkers=[]),this.line&&(e.markers.remove(this.line),this.line=void 0),this.label&&(e.markers.remove(this.label),this.label=void 0))}createOrUpdatePointMarkers(e){const t=this.getMeasurementAssets(),n=t.measurementsData.points;if(!(n.length<1)&&this.pointMarkers.length<n.length){const n=this.createPointMarker(e);n.userData.visibleWhenSelected=!0,t.markers.add(n),this.pointMarkers.push(n)}}createOrUpdateLineMarker(e){const t=this.getMeasurementAssets(),n=this.toVecArr(t.measurementsData.points);var r;if(n.length<1)return void(null===(r=this.line)||void 0===r||r.geometry.setFromPoints([]));this.line||(this.line=this.createLine(vy.LINE_MATERIAL)),this.line.userData.measurementDataId=t.measurementsData.id;const i=[n[0],e],s=new xn,a=ef.checkAndRebasePositionsOnRTC(i,s);this.line.geometry.setFromPoints(i),a&&(this.line.position.x=s.x,this.line.position.y=s.y,this.line.position.z=1),this.line.updateMatrix(),t.markers.add(this.line)}createOrUpdateLabel(e){const t=this.getMeasurementAssets(),n=this.toVecArr(t.measurementsData.points);if(n.length<1)return;const r=n[0].distanceTo(e),i=`${D_(r,2)}`,s=n[0].clone().add(e).divideScalar(2);if(!this.label){const e=this.getLabelColor();this.label=lm.createLabel(i,e,14,-4),t.markers.add(this.label)}this.label.position.set(s.x,s.y,s.z)}createVerticalLineMarkers(e){const[t,n]=e,r=t.clone(),i=n.clone();this.viewer instanceof SX&&(r.project(this.camera),i.project(this.camera));const s=Gy(r,i),a=lm.createLine();a.position.set(t.x,t.y,t.z),a.rotation.z=s,a.updateMatrix(),a.visible=!1,a.userData.visibleWhenSelected=!1;const o=lm.createLine();return o.position.set(n.x,n.y,n.z),o.rotation.z=s,o.updateMatrix(),o.visible=!1,o.userData.visibleWhenSelected=!1,[a,o]}initEvents(){var e;this.viewer instanceof SX&&(null===(e=this.viewer.controls)||void 0===e||e.addEventListener("change",(()=>{this.updateShortLines()})))}updateShortLines(){var e;null===(e=this.lineMarkers)||void 0===e||ge()(e).call(e,(e=>{const{points:t,shortLines:n}=e.userData,[r,i]=t,s=Gy(r.clone().project(this.camera),i.clone().project(this.camera));ge()(n).call(n,(e=>{e.rotation.z=s}))}))}}function Gy(e,t){const n=t.clone().sub(e).normalize();return 180-180*new Xt(-n.y,n.x).angle()/Math.PI}class zy{constructor(e){gh(this,"history",[]),gh(this,"step",0),gh(this,"maxCount",50),this.maxCount=e||this.maxCount}addRecord(e,t){var n;(this.history.length===this.maxCount&&this.history.shift(),this.step!==this.history.length)&&S()(n=this.history).call(n,this.step);this.history.push({type:e,payload:(0,mp.cloneDeep)(t)}),this.step++}undo(){if(0!==this.step)return this.step--,this.history[this.step]}redo(){if(this.step!==this.history.length)return this.step++,this.history[this.step-1]}clear(){this.history=[],this.step=0}destroy(){this.clear(),this.maxCount=0}}let Vy,Hy;!function(e){e.Add="ADD",e.Remove="REMOVE"}(Vy||(Vy={}));class qy extends zy{constructor(e,t=30){super(t),gh(this,"manager",void 0),this.manager=e}undo(){const e=super.undo();switch(null==e?void 0:e.type){case Vy.Add:{const t=e.payload.measurementsData.id;t&&this.manager.removeMeasurementById(t,!1)}break;case Vy.Remove:{const t=e.payload;this.manager.addMeasurement(t,!1),this.manager.scene.add(t.markers)}}return e}redo(){const e=super.redo();switch(null==e?void 0:e.type){case Vy.Add:{const t=e.payload;this.manager.addMeasurement(t,!1),this.manager.scene.add(t.markers)}break;case Vy.Remove:{const t=e.payload.measurementsData.id;t&&this.manager.removeMeasurementById(t,!1)}}return e}}!function(e){e[e.None=0]="None",e[e.StartPoint=1]="StartPoint",e[e.EndPoint=2]="EndPoint",e[e.MiddlePoint=4]="MiddlePoint",e[e.PointOnLine=8]="PointOnLine",e[e.Intersection=16]="Intersection",e[e.FootOfPerpendicular=32]="FootOfPerpendicular"}(Hy||(Hy={}));class Wy{constructor(e,t){gh(this,"scene",void 0),gh(this,"camera",void 0),gh(this,"markers",{}),gh(this,"activeOSnapType",Hy.None),this.scene=e,this.camera=t,this.initOSnapMarkers()}initOSnapMarkers(){var e;const t=lm.createSnapIcon(om.Square),n=lm.createSnapIcon(om.Triangle),r=lm.createSnapIcon(om.Dot,am),i=lm.createSnapIcon(om.Cross),s=lm.createSnapIcon(om.Perpendicular);this.markers[Hy.StartPoint]=t,this.markers[Hy.EndPoint]=t,this.markers[Hy.MiddlePoint]=n,this.markers[Hy.PointOnLine]=r,this.markers[Hy.Intersection]=i,this.markers[Hy.FootOfPerpendicular]=s,ge()(e=tp()(this.markers)).call(e,(e=>{e.visible=!1,this.scene.add(e)}))}getMarker(e){return this.markers[e]}deactivate(){this.activeOSnapType&&(this.markers[this.activeOSnapType].visible=!1),this.activeOSnapType=Hy.None}destroy(){}handleSnap(e,t,n){if(null==e||!e.length)return void this.activateMarker(Hy.None);const r=[];for(const t of e){const e=this.getOSnapInfo(t);if(e&&e.type!==Hy.None){if(e.type!==Hy.PointOnLine)return this.activateMarker(e.type,e.point),e.point;r.push(e)}}const i=this.getSnapTolerance();for(let t=0;t<e.length-1;t++){const n=e[t];if(!(n.object instanceof Vo))continue;const r=n.point,{startPoint:s,endPoint:a}=this.getStartAndEndPoints(n);for(let o=t+1;o<e.length;o++){const t=e[o];if(!(n.object instanceof Vo))continue;const l=t.point,{startPoint:c,endPoint:u}=this.getStartAndEndPoints(t);if(s&&a&&c&&u){const e={start:new Xt(s.x,s.y),end:new Xt(a.x,a.y)},t={start:new Xt(c.x,c.y),end:new Xt(u.x,u.y)},n=ef.getLineSegmentsIntersectingPoint(e,t),o=new xn(null==n?void 0:n.x,null==n?void 0:n.y,s.z);if(o.distanceTo(r)<i&&o.distanceTo(l)<i)return this.activateMarker(Hy.Intersection,o),o}}}if(!n)for(const n of e){const{startPoint:e,endPoint:r}=this.getStartAndEndPoints(n);if(e&&r){const s=this.getFootOfPerpendicular(t,e,r);if(n.point.distanceTo(s)<2*i)return this.activateMarker(Hy.FootOfPerpendicular,s),s}}if(r.length>0)return this.activateMarker(r[0].type,r[0].point),r[0].point;this.activateMarker(Hy.None)}activateMarker(e,t){this.activeOSnapType&&(this.markers[this.activeOSnapType].visible=!1),this.activeOSnapType=e;const n=this.markers[e];n&&t&&(n.position.set(t.x,t.y,t.z),n.visible=!0)}getOSnapInfo(e){const t=e.object;t.updateWorldMatrix(!0,!1);const n=this.getSnapTolerance();if(t instanceof Vo){const{startPoint:t,endPoint:r}=this.getStartAndEndPoints(e);if(!t||!r)return;const i=r.clone().add(t).multiplyScalar(.5),s=e.point.distanceTo(t),a=e.point.distanceTo(r),o=e.point.distanceTo(i),l=[];if(s<=n&&l.push({point:t,distance:s,type:Hy.StartPoint}),a<=n&&l.push({point:r,distance:a,type:Hy.EndPoint}),o<=n&&l.push({point:i,distance:o,type:Hy.MiddlePoint}),0===l.length){const n=new Xt(e.point.x,e.point.y),i={start:new Xt(t.x,t.y),end:new Xt(r.x,r.y)};ef.isPointOnLineSegment(n,i)&&l.push({point:e.point,distance:o,type:Hy.PointOnLine})}if(re()(l).call(l,((t,n)=>t.point.distanceTo(e.point)-n.point.distanceTo(e.point))),l.length>0)return l[0]}}getStartAndEndPoints(e){const t=e.object;if(t instanceof Vo){var n,r,i;t.updateWorldMatrix(!0,!1);const s=t.matrixWorld,a=t.geometry.attributes.position.array,o=(null===(n=t.geometry.getIndex())||void 0===n?void 0:n.array)||[],l=e=>new xn(a[3*e],a[3*e+1],a[3*e+2]).applyMatrix4(s),c=e.index,u=c+1,h=null!==(r=o[c])&&void 0!==r?r:c,p=null!==(i=o[u])&&void 0!==i?i:u;return{startPoint:l(h),endPoint:l(p)}}return{startPoint:void 0,endPoint:void 0}}getFootOfPerpendicular(e,t,n){const r=t.x-n.x,i=t.y-n.y;if(t.distanceTo(n)<1e-5)return t.clone();let s=(e.x-t.x)*(t.x-n.x)+(e.y-t.y)*(t.y-n.y);return s/=r*r+i*i,new xn(t.x+s*r,t.y+s*i,0)}getSnapTolerance(){let e=.1;return this.camera instanceof Wi&&(e=12/this.camera.zoom),e}}class Yy{constructor(e){gh(this,"scene",void 0),gh(this,"selectedMeasurementAssets",void 0),gh(this,"viewer",void 0),gh(this,"osnapHelper",void 0),gh(this,"measurements",{}),gh(this,"measurementAssetsArray",[]),gh(this,"activeMeasurementType",void 0),gh(this,"undoRedoHelper",new qy(this)),gh(this,"keydown",(e=>{var t;const n=this.getActiveMeasurementType();let r;n&&(r=this.measurements[n]);const i=null===(t=this.selectedMeasurementAssets)||void 0===t?void 0:t.measurementsData.id;var s,a;(i&&"Delete"===e.code&&this.removeMeasurementById(i),e.ctrlKey&&"KeyZ"===e.code)&&(null!==(s=r)&&void 0!==s&&s.isMeasuring?r.cancel():this.undo());e.ctrlKey&&"KeyY"===e.code&&(null!==(a=r)&&void 0!==a&&a.isMeasuring||this.redo());this.viewer.enableSVGRender()})),this.viewer=e,this.scene=new mo,this.osnapHelper=new Wy(this.scene,this.viewer.camera),this.measurements[gy.Distance]=new jy(this.viewer,this.scene,this.osnapHelper),this.measurements[gy.Area]=new Uy(this.viewer,this.scene,this.osnapHelper),this.measurements[gy.Angle]=new Fy(this.viewer,this.scene,this.osnapHelper),this.measurements[gy.Coordinate]=new By(this.viewer,this.scene,this.osnapHelper),this.eventHandlers()}eventHandlers(){var e;ge()(e=tp()(this.measurements)).call(e,(e=>{e.addEventListener("complete",(e=>{this.addMeasurement(e)})),e.addEventListener("deactivate",(()=>{var e;this.osnapHelper.deactivate(),null===(e=this.viewer.toolbar)||void 0===e||e.deactivateMeasureMenu()})),e.addEventListener("firstpointpicked",(()=>{this.selectedMeasurementAssets&&this.unselectMeasurement()}))})),window.addEventListener("keydown",this.keydown)}addMeasurement(e,t=!0){this.measurementAssetsArray.push(e),this.selectedMeasurementAssets=e,t&&this.undoRedoHelper.addRecord(Vy.Add,e)}render(e,t){e.render(this.scene,t)}activateMeasurement(e){this.activeMeasurementType&&this.deactivateMeasurement(),this.measurements[e]?(this.measurements[e].activate(),this.activeMeasurementType=e):(this.activeMeasurementType=void 0,im.error("[Measure] Failed to activate measurement, type:",e))}deactivateMeasurement(){const e=this.activeMeasurementType;e&&this.measurements[e].deactivate(),this.activeMeasurementType=void 0,window.removeEventListener("keydown",this.keydown)}getActiveMeasurementType(){return this.activeMeasurementType}isMeasurementActive(){const e=this.activeMeasurementType;return e?this.measurements[e].isActive:!!this.getActiveMeasurementType()}hasMeasurementData(){return this.measurementAssetsArray.length>0}getMeasurementsData(){var e;return Z()(e=this.measurementAssetsArray).call(e,(e=>{const t=e.measurementsData;return im.warn("[Measure] TODO: should return data with units - meter"),t}))}setMeasurementsData(e){this.measurementAssetsArray=[],ge()(e).call(e,(e=>{const t=this.measurements[e.type];if(t)if(e.points.length>=2){const n=t.createMeasurementAssetsByData(e);this.measurementAssetsArray.push(n)}else im.info("[Measure] Invalid points found in MeasurementData:",e);else im.warn("[Measure] Failed to add measurement data for",e)}))}getMeasurementsMarkers(){const{measurementAssetsArray:e}=this;return bp()(e).call(e,((e,t)=>(e.push(t.markers),e)),[])}setMeasurementsVisibility(e){var t;ge()(t=this.measurementAssetsArray).call(t,(t=>{var n;ge()(n=t.markers.children).call(n,(t=>{e?t.userData.visibleWhenSelected||(t.visible=!0):t.visible=!1}))}))}clearMeasurements(){var e;ge()(e=this.measurementAssetsArray).call(e,(e=>{e.markers&&(e.markers.remove(...e.markers.children),this.scene.remove(e.markers))})),this.measurementAssetsArray=[]}removeMeasurementById(e,t=!0){for(let r=0;r<this.measurementAssetsArray.length;++r){const i=this.measurementAssetsArray[r];if(i.measurementsData.id===e){var n;const e=i.markers;this.scene.remove(e),S()(n=this.measurementAssetsArray).call(n,r,1),t&&this.undoRedoHelper.addRecord(Vy.Remove,i);break}}im.warn("[Measure] Failed to find measurement by id:",e)}selectMeasurement(e){this.unselectMeasurement();const t=this.findMeasurementAssetsById(e);if(t){const e=t.measurementsData.type;this.measurements[e].select(t)}this.selectedMeasurementAssets=t}unselectMeasurement(){const e=this.selectedMeasurementAssets;if(e){const t=e.measurementsData.type;this.measurements[t].unselect(e)}this.selectedMeasurementAssets=void 0}undo(){this.undoRedoHelper.undo()}redo(){this.undoRedoHelper.redo()}destroy(){var e;this.deactivateMeasurement(),this.clearMeasurements(),this.measurements={},null===(e=this.osnapHelper)||void 0===e||e.destroy(),this.scene.clear(),window.removeEventListener("keydown",this.keydown)}findMeasurementAssetsById(e){var t;return Se()(t=this.measurementAssetsArray).call(t,(t=>t.measurementsData.id===e))}}const Xy=new xn,$y=new bn,Ky=new xn;class Zy extends Tr{constructor(e=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}const Jy=new Zn,Qy=new Zn;class eb{constructor(e={}){const t=this;let n,r,i,s;const a={camera:{fov:0,style:""},objects:new ee},o=void 0!==e.element?e.element:document.createElement("div");o.style.overflow="hidden",this.domElement=o;const l=document.createElement("div");function c(e){return Math.abs(e)<1e-10?0:e}function u(e){const t=e.elements;return"matrix3d("+c(t[0])+","+c(-t[1])+","+c(t[2])+","+c(t[3])+","+c(t[4])+","+c(-t[5])+","+c(t[6])+","+c(t[7])+","+c(t[8])+","+c(-t[9])+","+c(t[10])+","+c(t[11])+","+c(t[12])+","+c(-t[13])+","+c(t[14])+","+c(t[15])+")"}function h(e){const t=e.elements;return"translate(-50%,-50%)"+("matrix3d("+c(t[0])+","+c(t[1])+","+c(t[2])+","+c(t[3])+","+c(-t[4])+","+c(-t[5])+","+c(-t[6])+","+c(-t[7])+","+c(t[8])+","+c(t[9])+","+c(t[10])+","+c(t[11])+","+c(t[12])+","+c(t[13])+","+c(t[14])+","+c(t[15])+")")}function p(e,n,r,i){if(e.isCSS3DObject){const i=!0===e.visible&&!0===e.layers.test(r.layers);if(e.element.style.display=!0===i?"":"none",!0===i){let i;e.onBeforeRender(t,n,r),e.isCSS3DSprite?(Jy.copy(r.matrixWorldInverse),Jy.transpose(),0!==e.rotation2D&&Jy.multiply(Qy.makeRotationZ(e.rotation2D)),e.matrixWorld.decompose(Xy,$y,Ky),Jy.setPosition(Xy),Jy.scale(Ky),Jy.elements[3]=0,Jy.elements[7]=0,Jy.elements[11]=0,Jy.elements[15]=1,i=h(Jy)):i=h(e.matrixWorld);const s=e.element,o=a.objects.get(e);if(void 0===o||o.style!==i){s.style.transform=i;const t={style:i};a.objects.set(e,t)}s.parentNode!==l&&l.appendChild(s),e.onAfterRender(t,n,r)}}for(let t=0,s=e.children.length;t<s;t++)p(e.children[t],n,r,i)}l.style.transformStyle="preserve-3d",l.style.pointerEvents="none",o.appendChild(l),this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){const n=t.projectionMatrix.elements[5]*s;let r,h;a.camera.fov!==n&&(o.style.perspective=t.isPerspectiveCamera?n+"px":"",a.camera.fov=n),!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),t.isOrthographicCamera&&(r=-(t.right+t.left)/2,h=(t.top+t.bottom)/2);const d=t.isOrthographicCamera?"scale("+n+")translate("+c(r)+"px,"+c(h)+"px)"+u(t.matrixWorldInverse):"translateZ("+n+"px)"+u(t.matrixWorldInverse),m=d+"translate("+i+"px,"+s+"px)";a.camera.style!==m&&(l.style.transform=m,a.camera.style=m),p(e,e,t,d)},this.setSize=function(e,t){n=e,r=t,i=n/2,s=r/2,o.style.width=e+"px",o.style.height=t+"px",l.style.width=e+"px",l.style.height=t+"px"}}}function tb(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function nb(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=tb(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=tb(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}const rb="#2C7BE5",ib=Math.PI/2,sb=Math.PI/4,ab=([e,t,n],[r,i,s])=>({position:new xn(e,t,n),rotation:new or(r,i,s)}),ob={[o_.Front]:nb(nb({},ab([0,0,1],[0,0,0])),{},{label:"NavCube.front"}),[o_.Right]:nb(nb({},ab([1,0,0],[0,ib,0])),{},{label:"NavCube.right"}),[o_.Back]:nb(nb({},ab([0,0,-1],[0,Math.PI,0])),{},{label:"NavCube.back"}),[o_.Left]:nb(nb({},ab([-1,0,0],[0,-ib,0])),{},{label:"NavCube.left"}),[o_.Top]:nb(nb({},ab([0,1,0],[-ib,0,0])),{},{label:"NavCube.top"}),[o_.Bottom]:nb(nb({},ab([0,-1,0],[ib,0,0])),{},{label:"NavCube.bottom"})},lb=[ab([0,1,1],[-sb,0,-ib]),ab([0,1,-1],[-3*sb,0,-ib]),ab([0,-1,1],[sb,0,-ib]),ab([0,-1,-1],[3*sb,0,-ib]),ab([1,1,0],[-ib,sb,0]),ab([1,-1,0],[-ib,3*sb,0]),ab([-1,1,0],[-ib,-sb,0]),ab([-1,-1,0],[-ib,-3*sb,0]),ab([1,0,1],[0,sb,0]),ab([1,0,-1],[0,3*sb,0]),ab([-1,0,1],[0,-sb,0]),ab([-1,0,-1],[0,-3*sb,0])],cb=[{position:new xn(1,1,1),rotation:[new or(-ib,ib,-sb),new or(-ib,0,sb),new or(0,0,3*sb)]},{position:new xn(1,1,-1),rotation:[new or(0,ib,3*sb),new or(-ib,0,3*sb),new or(0,Math.PI,-3*sb)]},{position:new xn(-1,1,-1),rotation:[new or(Math.PI,-ib,sb),new or(-ib,0,-3*sb),new or(0,Math.PI,3*sb)]},{position:new xn(-1,1,1),rotation:[new or(0,-ib,3*sb),new or(-ib,0,-sb),new or(0,0,-3*sb)]},{position:new xn(1,-1,1),rotation:[new or(0,ib,-sb),new or(-ib,Math.PI,-sb),new or(0,0,sb)]},{position:new xn(1,-1,-1),rotation:[new or(-ib,ib,3*sb),new or(ib,0,sb),new or(0,Math.PI,-sb)]},{position:new xn(-1,-1,1),rotation:[new or(0,-ib,sb),new or(ib,0,-3*sb),new or(0,0,-sb)]},{position:new xn(-1,-1,-1),rotation:[new or(0,-ib,-sb),new or(ib,0,-sb),new or(0,Math.PI,sb)]}];class ub extends Tr{constructor(e={}){super(),gh(this,"NAVCUBE_SIZE",100),gh(this,"clickHandler",void 0),this.clickHandler=e.onClick,(0,mp.forEach)(ob,(e=>{this.createPlane(e)})),(0,mp.forEach)(lb,(e=>{this.createEdge(e)})),(0,mp.forEach)(cb,((e,t)=>{this.createCorner(e,t)}))}createPlane(e){const t=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2),{rotation:n,label:r}=e,i=document.createElement("div");i.style.width=this.NAVCUBE_SIZE+"px",i.style.height=this.NAVCUBE_SIZE+"px",i.classList.add("navcube-plane"),i.classList.add("outer");const s=document.createElement("div");s.style.width=this.NAVCUBE_SIZE-4+"px",s.style.height=this.NAVCUBE_SIZE-4+"px",s.innerHTML=Yd(r),s.classList.add("navcube-plane"),s.classList.add("inner"),i.appendChild(s);const a=new Zy(i);a.position.copy(t),a.rotation.copy(n),this.add(a),i.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(t.clone().normalize(),n)}))}createEdge(e){const t=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2),n=document.createElement("div");n.style.width="4px",n.style.height=this.NAVCUBE_SIZE-40+"px",n.style.background=rb,n.classList.add("navcube-edge");const r=new Zy(n);r.position.copy(t),r.rotation.copy(e.rotation),this.add(r),n.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(t.clone().normalize(),e.rotation)}))}createCorner(e,t){const n=n=>{n.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(e.position.clone().normalize(),new or)})),n.addEventListener("mouseenter",(()=>{const e=document.getElementsByClassName("group-"+t);(0,mp.forEach)(e,(e=>{e instanceof HTMLElement&&e.classList.add("highlight")}))})),n.addEventListener("mouseleave",(()=>{const e=document.getElementsByClassName("group-"+t);(0,mp.forEach)(e,(e=>{e instanceof HTMLElement&&e.classList.remove("highlight")}))}))},r=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2+.5),i=document.createElement("div");i.style.borderTop=14*Math.sqrt(3)+"px solid #efefef",i.style.borderLeft="14px solid transparent",i.style.borderRight="14px solid transparent",i.classList.add("navcube-corner"),i.classList.add("group-"+t);const s=new Zy(i);s.position.copy(r).lerp(e.position,.14);const a=Math.atan2(r.z,r.x);s.rotateY(r.z*r.x<0?Math.PI+a:a);const o=(new or).setFromVector3(r.clone().normalize());s.rotateX(-o.y),r.y<0&&s.rotateZ(Math.PI),this.add(s);const l=(t,i,s)=>{const a=document.createElement("div");a.style.borderTop="13px solid #2C7BE5",a.style.borderLeft="13px solid transparent",a.style.borderRight="13px solid transparent",a.classList.add("navcube-corner-plane"),a.classList.add("group-"+i);const o=new Zy(a),l=e.position.clone();l.setComponent(s,0),o.position.copy(r).sub(l),o.rotateX(t.x),o.rotateY(t.y),o.rotateZ(t.z),this.add(o),n(a)};(0,mp.forEach)(e.rotation,((e,n)=>{l(e,t,n)})),n(i)}}class hb{constructor(e,t){gh(this,"hostRenderer",void 0),gh(this,"renderer",void 0),gh(this,"navCube",void 0),gh(this,"camera",void 0),gh(this,"scene",void 0),gh(this,"height",150),gh(this,"width",150),this.width=e||this.width,this.height=t||this.height,this.init()}init(){this.initRenderer(),this.initScene(),this.animate()}initRenderer(){this.renderer=new eb,this.renderer.setSize(this.width,this.height),this.renderer.domElement.classList.add("css3d-navcube"),document.body.appendChild(this.renderer.domElement)}initScene(){this.scene=new mo;const e=window.innerWidth/window.innerHeight,t=200;this.camera=new Wi(t*e/-2,t*e/2,100,-100,1,1e3),this.camera.position.set(-200,200,200),this.scene.add(this.camera);this.navCube=new ub({onClick:e=>{if(!(this.camera&&e&&this.hostRenderer&&this.hostRenderer.camera&&this.hostRenderer.controls))return;const t=this.hostRenderer.controls.target,n=this.hostRenderer.camera.position.distanceTo(t);this.hostRenderer.flyTo(t.clone().add(e.clone().multiplyScalar(n)),t)}}),this.scene.add(this.navCube)}render(){this.renderer&&this.scene&&this.camera&&(this.update(),this.renderer.render(this.scene,this.camera))}animate(){var e;requestAnimationFrame(ve()(e=this.animate).call(e,this)),this.render()}setHostRenderer(e){this.hostRenderer=e,this.update()}update(){if(!this.hostRenderer||!this.hostRenderer.camera)return;const e=this.hostRenderer.camera;if(e){const t=new xn;e.getWorldDirection(t);const n=e.up;this.updateCameraDirection(t,n)}}updateCameraDirection(e,t){if(!this.camera||!e)return;e.normalize();this.camera.position.set(20*-e.x+0,20*-e.y+0,20*-e.z+0),this.camera.lookAt(0,0,0),this.camera.up=t}dispose(){this.scene&&this.camera&&this.navCube&&(this.scene.clear(),this.hostRenderer=void 0,this.camera=void 0,this.navCube=void 0,this.scene=void 0)}}const pb=new cn(0,.855,.718),db=new cn(1,1,0);let mb=.5,fb=.2;const gb=e=>{const t=e[0].clone(),n=e[1].clone(),r=e[2].clone(),i=e[3].clone();return t.add(n).add(r).add(i).multiplyScalar(.25)};class _b extends Wo{constructor(e,t){super(),gh(this,"normalMaterial",new Fo({color:pb})),gh(this,"activeMaterial",new Fo({color:pb})),ge()(t).call(t,(e=>e.lines.push(this))),this.geometry=new Kr,this.geometry.setFromPoints(e),this.material=this.normalMaterial}setFromPoints(e){this.geometry.setFromPoints(e)}setActive(e){this.material=e?this.activeMaterial:this.normalMaterial}}class vb extends mi{constructor(e,t){super(),gh(this,"axis",void 0),gh(this,"lines",[]),gh(this,"backFace",void 0),gh(this,"vertices",[]),this.axis=e,this.lines=[],this.geometry=new Kr,this.vertices=t,this.geometry.setFromPoints(t),this.geometry.setIndex([0,3,2,0,2,1]),this.geometry.computeVertexNormals(),this.material=new kr({colorWrite:!1,depthWrite:!1});const n=new kr({color:pb,transparent:!0,opacity:0,side:1});this.backFace=new mi(this.geometry,n)}setFromPoints(e){this.vertices=e,this.geometry.setFromPoints(e)}setActive(e){var t;this.material=new kr({color:pb,transparent:!0,opacity:e?.1:0}),ge()(t=this.lines).call(t,(t=>{t.setActive(e)}))}}class yb extends class{constructor(e,t,n,r){gh(this,"isOpen",!1),gh(this,"sectionBox",void 0),gh(this,"scene",void 0),gh(this,"camera",void 0),gh(this,"renderer",void 0),gh(this,"controls",void 0),gh(this,"draggableArrowView",""),gh(this,"visibleArrowView",""),gh(this,"sectionBoxBoundary",new En),gh(this,"group",new io),gh(this,"arrows",new(ue())),gh(this,"planes",[]),gh(this,"vertices",[new xn,new xn,new xn,new xn,new xn,new xn,new xn,new xn]),gh(this,"faces",[]),gh(this,"lines",[]),gh(this,"sectionPlaneMap",new(ue())),gh(this,"raycaster",new gu),gh(this,"mousePosition",new Xt),gh(this,"activeFace",null),gh(this,"onMouseMove",(e=>{var t;const n=(e,t=!1,n=!1)=>{const r=this.arrows.get(e);if(!r)return;const i=r.children[0].material;t?(i.opacity=1,i.color.set(db)):n?(i.opacity=1,i.color.set(pb)):(i.color.set(pb),i.opacity=0)};this.updateMouseAndRay(e);const r=[...me()(t=this.arrows).call(t),...this.faces],i=this.raycaster.intersectObjects(r,!0);if(i.length<=0)return this.draggableArrowView&&(n(this.draggableArrowView,!1),this.draggableArrowView=""),this.visibleArrowView&&(n(this.visibleArrowView,!1),this.visibleArrowView=""),this.activeFace&&(this.activeFace.setActive(!1),this.activeFace=null),void(this.renderer.domElement.style.cursor="auto");const s=i[0].object;if(s instanceof vb){const e=s;this.draggableArrowView&&(e!==this.activeFace?n(this.draggableArrowView,!1):n(this.draggableArrowView,!1,!0),this.draggableArrowView=""),e!==this.activeFace&&(this.activeFace&&(this.activeFace.setActive(!1),this.visibleArrowView&&(n(this.visibleArrowView,!1),this.visibleArrowView="")),e.setActive(!0),n(e.axis,!1,!0),this.activeFace=e,this.visibleArrowView=e.axis)}else{const e=s.userData.view;this.draggableArrowView!==e&&(this.draggableArrowView&&n(this.draggableArrowView,!1),n(e,!0),this.draggableArrowView=e)}this.renderer.domElement.style.cursor="pointer"})),gh(this,"isMouseDown",!1),gh(this,"onMouseDown",(e=>{const t=0===e.button;t&&(this.isMouseDown=!0,this.lastCanvasPos=[e.clientX,e.clientY],this.draggableArrowView&&t&&this.dragStart())})),gh(this,"lastCanvasPos",void 0),gh(this,"dragStart",(()=>{im.info("[Section] dragStart"),this.controls.enablePan=!1,this.controls.enableZoom=!1,this.controls.enableRotate=!1,window.removeEventListener("pointermove",this.onMouseMove),window.addEventListener("pointermove",this.dragMove),window.addEventListener("pointerup",this.dragEnd)})),gh(this,"dragEnd",(()=>{im.info("[Section] dragEnd"),this.controls.enablePan=!0,this.controls.enableZoom=!0,this.controls.enableRotate=!0,this.isMouseDown=!1,window.removeEventListener("pointermove",this.dragMove),window.removeEventListener("pointerup",this.dragEnd),window.addEventListener("pointermove",this.onMouseMove)})),gh(this,"dragMove",(e=>{const t=new xn(1,0,0),n=new xn(0,1,0),r=new xn(0,0,1),i=[e.clientX,e.clientY];if(this.isMouseDown){switch(this.lastCanvasPos||(this.lastCanvasPos=i),this.draggableArrowView){case o_.Left:case o_.Right:this.dragTranslateSectionPlane(t,this.lastCanvasPos,i);break;case o_.Top:case o_.Bottom:this.dragTranslateSectionPlane(n,this.lastCanvasPos,i);break;case o_.Front:case o_.Back:this.dragTranslateSectionPlane(r,this.lastCanvasPos,i)}this.lastCanvasPos=i,this.renderer.render(this.scene,this.camera)}})),this.scene=e,this.camera=t,this.renderer=n,this.controls=r}setSectionBox(e){if(this.sectionBox)throw new Error("sectionBox is assigned already!");this.sectionBox=e,cm.expandBoxByScale(this.sectionBox,1.1);const t=e.max,n=e.min,r=t.x-n.x+t.y-n.y+t.z-n.z;cm.expandBoxByMinSize(this.sectionBox,r/20),mb=r/300,fb=mb}open(){this.initSectionBox(),this.addMouseListener(),this.isOpen=!0}close(){this.isOpen=!1,this.removeMouseListener(),this.clearSectionBox()}reset(){this.close(),this.open()}initSectionBox(){if(!this.sectionBox)throw new Error("Need to set sectionBox first!");this.group=new io,this.initPlanes(),this.initOrUpdateVertices(),this.initArrowGizmos();const e=this.sectionBox.clone();cm.expandBoxByScale(e,1.5);const t=e.max,n=e.min,r=t.x-n.x+t.y-n.y+t.z-n.z;cm.expandBoxByMinSize(e,r/10),this.sectionBoxBoundary=e;const i=new xn;e.getCenter(i),this.group.position.set(i.x,i.y,i.z),this.initOrUpdateFaces(),this.initOrUpdateLines(),this.setArrowPosition(!0),this.scene.add(this.group)}initPlanes(){if(!this.sectionBox)return;const e=this.sectionBox.min,t=this.sectionBox.max;this.planes=[new Di(new xn(0,-1,0),t.y),new Di(new xn(0,1,0),-e.y),new Di(new xn(1,0,0),-e.x),new Di(new xn(-1,0,0),t.x),new Di(new xn(0,0,-1),t.z),new Di(new xn(0,0,1),-e.z)];const n=this.sectionPlaneMap;n.set(o_.Top,this.planes[0]),n.set(o_.Bottom,this.planes[1]),n.set(o_.Left,this.planes[2]),n.set(o_.Right,this.planes[3]),n.set(o_.Front,this.planes[4]),n.set(o_.Back,this.planes[5])}updatePlanes(){const e=new Zn,t=this.group.position;e.makeRotationFromQuaternion(this.group.quaternion);for(const[r,i]of this.sectionPlaneMap){var n;const s=i.normal.applyMatrix4(e),a=Se()(n=this.faces).call(n,(e=>e.axis===r));let o=gb(a.vertices);o=this.localToWorldVec(o,!1),o=o.add(t),i.setFromNormalAndCoplanarPoint(s,o)}}initOrUpdateVertices(){if(!this.sectionBox)return;const e=this.sectionBox.min,t=this.sectionBox.max,n=this.vertices;n[0].set(e.x,t.y,e.z),n[1].set(t.x,t.y,e.z),n[2].set(t.x,t.y,t.z),n[3].set(e.x,t.y,t.z),n[4].set(e.x,e.y,e.z),n[5].set(t.x,e.y,e.z),n[6].set(t.x,e.y,t.z),n[7].set(e.x,e.y,t.z)}initOrUpdateFaces(){const e=this.vertices,t=e=>Z()(e).call(e,(e=>e.clone().sub(this.group.position)));if(this.faces&&0!==this.faces.length){const n=this.faces;n[0].setFromPoints(t([e[0],e[1],e[2],e[3]])),n[1].setFromPoints(t([e[4],e[7],e[6],e[5]])),n[2].setFromPoints(t([e[0],e[3],e[7],e[4]])),n[3].setFromPoints(t([e[1],e[5],e[6],e[2]])),n[4].setFromPoints(t([e[2],e[6],e[7],e[3]])),n[5].setFromPoints(t([e[0],e[4],e[5],e[1]]))}else{var n;this.faces=[new vb(o_.Top,t([e[0],e[1],e[2],e[3]])),new vb(o_.Bottom,t([e[4],e[7],e[6],e[5]])),new vb(o_.Left,t([e[0],e[3],e[7],e[4]])),new vb(o_.Right,t([e[1],e[5],e[6],e[2]])),new vb(o_.Front,t([e[2],e[6],e[7],e[3]])),new vb(o_.Back,t([e[0],e[4],e[5],e[1]]))],this.group.add(...this.faces),ge()(n=this.faces).call(n,(e=>{this.group.add(e.backFace)}))}}initOrUpdateLines(){const e=this.vertices,t=e=>Z()(e).call(e,(e=>e.clone().sub(this.group.position)));if(this.lines&&0!==this.lines.length){let n=0;this.lines[n++].setFromPoints(t([e[0],e[1]])),this.lines[n++].setFromPoints(t([e[1],e[2]])),this.lines[n++].setFromPoints(t([e[2],e[3]])),this.lines[n++].setFromPoints(t([e[3],e[0]])),this.lines[n++].setFromPoints(t([e[4],e[5]])),this.lines[n++].setFromPoints(t([e[5],e[6]])),this.lines[n++].setFromPoints(t([e[6],e[7]])),this.lines[n++].setFromPoints(t([e[7],e[4]])),this.lines[n++].setFromPoints(t([e[0],e[4]])),this.lines[n++].setFromPoints(t([e[1],e[5]])),this.lines[n++].setFromPoints(t([e[2],e[6]])),this.lines[n++].setFromPoints(t([e[3],e[7]]))}else{const n=this.faces;if(!n)throw Error("Need to init Face first!");this.lines=[new _b(t([e[0],e[1]]),[n[0],n[5]]),new _b(t([e[1],e[2]]),[n[0],n[3]]),new _b(t([e[2],e[3]]),[n[0],n[4]]),new _b(t([e[3],e[0]]),[n[0],n[2]]),new _b(t([e[4],e[5]]),[n[1],n[5]]),new _b(t([e[5],e[6]]),[n[1],n[3]]),new _b(t([e[6],e[7]]),[n[1],n[4]]),new _b(t([e[7],e[4]]),[n[1],n[2]]),new _b(t([e[0],e[4]]),[n[2],n[5]]),new _b(t([e[1],e[5]]),[n[3],n[5]]),new _b(t([e[2],e[6]]),[n[3],n[4]]),new _b(t([e[3],e[7]]),[n[2],n[4]])],this.group.add(...this.lines)}}initArrowGizmos(){var e;const t=new lc({color:pb,depthTest:!1,transparent:!0,side:2}),n=new kr({wireframe:!0,transparent:!0,opacity:0}),r=8*mb,i=12*mb,s=new bl(0,2*mb,r),a=new bl(mb/2,mb/2,i),o=new bl(4*mb,4*mb,r+i),l=(e,t)=>{e.applyMatrix4((new Zn).makeTranslation(0,t,0))};l(s,i+r/2),l(a,i/2),l(o,(i+r)/2),ge()(e=tp()(o_)).call(e,(e=>{const r=fm([s,a]),i=t.clone();i.opacity=0;const l=new mi(r,i);l.userData.view=e;const c=new mi(o,n);c.userData.view=e;const u=new io;u.add(l,c),u.applyMatrix4((new Zn).makeRotationAxis(new xn(1,0,0),-Math.PI/2)),this.group.add(u),this.arrows.set(e,u)}))}setArrowPosition(e=!1){const t=this.sectionBox;if(!t)return;const n=t.max.x-t.min.x,r=t.max.y-t.min.y,i=t.max.z-t.min.z,s=(e,t)=>{const n=Math.sqrt(e.dot(e)*t.dot(t));let r=n+e.dot(t),i=new xn;return r<1e-8*n?(r=0,Math.abs(e.x)>Math.abs(e.z)?(i.setX(-e.y),i.setY(e.x),i.setZ(0)):(i.setX(0),i.setY(-e.z),i.setZ(e.y))):i=e.cross(t),new bn(i.x,i.y,i.z,r).normalize()};for(const[t,a]of this.sectionPlaneMap){const o=this.arrows.get(t);if(!o)return;if(e){const e=s(new xn(0,0,1),a.normal),t=new Zn;t.makeRotationFromQuaternion(e),o.applyMatrix4(t)}switch(t){case o_.Right:o.position.set(n/2,0,0);break;case o_.Left:o.position.set(-n/2,0,0);break;case o_.Top:o.position.set(0,r/2,0);break;case o_.Bottom:o.position.set(0,-r/2,0);break;case o_.Front:o.position.set(0,0,i/2);break;case o_.Back:o.position.set(0,0,-i/2)}}}localToWorldVec(e,t=!0){const n=new Zn;n.makeRotationFromQuaternion(this.group.quaternion);const r=e.applyMatrix4(n);return t&&r.normalize(),r}worldToLocalVec(e){const t=new Zn;t.makeRotationFromQuaternion(this.group.quaternion),t.invert();return e.applyMatrix4(t)}getTranslationPlane(e){const t=Math.abs(e.x);let n;return n=t>Math.abs(e.y)&&t>Math.abs(e.z)?e.clone().cross(new xn(0,1,0)):e.clone().cross(new xn(1,0,0)),n=n.cross(e),n.normalize(),n}getPointerPlaneIntersect(e,t,n=0){let r=new gn(0,0,0,1),i=new Zn;r.x=e[0]/this.renderer.domElement.width*2-1,r.y=-(e[1]/this.renderer.domElement.height*2-1),r.z=0,r.w=1,i=i.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),i=i.invert(),r=r.applyMatrix4(i),r.multiplyScalar(1/r.w);let s=new xn(r.x,r.y,r.z);const a=this.camera.position.clone();s=s.sub(a);let o=new xn(0,0,0);if(this.draggableArrowView){const e=this.getBoxFaceVerties(this.draggableArrowView);o=gb(e).add(this.group.position)}const l=-o.dot(t)-n,c=t.dot(s);if(Math.abs(c)>1e-4){const e=-(t.dot(a)+l)/c;let n=s.multiplyScalar(e);return n=n.add(a),n=n.sub(o),n}return!1}dragTranslateSectionPlane(e,t,n){let r=new xn;const i=this.localToWorldVec(e),s=this.getTranslationPlane(i);let a;const o=this.getPointerPlaneIntersect(t,s);if(!o)return void im.info("[Section] p1 doesn't exists");if(a=this.getPointerPlaneIntersect(n,s),!a)return void im.info("[Section] p2 doesn't exists");const l=this.sectionBox;if(!l)return void im.error("[BoxSection] Invalid sectionBox!");const c=l.min,u=l.max;a=a.sub(o),r=this.worldToLocalVec(a);const h=r.dot(e),p=new xn(e.x*h,e.y*h,e.z*h);let d,m=new xn;if(this.draggableArrowView){const e=this.getBoxFaceVerties(this.draggableArrowView);m=gb(e)}switch(m=m.add(p).add(this.group.position),this.draggableArrowView){case o_.Left:d=Math.max(this.sectionBoxBoundary.min.x,m.x),d=Math.min(u.x-fb,d),c.setX(d);break;case o_.Right:d=Math.min(this.sectionBoxBoundary.max.x,m.x),d=Math.max(c.x+fb,d),u.setX(d);break;case o_.Bottom:d=Math.max(this.sectionBoxBoundary.min.y,m.y),d=Math.min(u.y-fb,d),c.setY(d);break;case o_.Top:d=Math.min(this.sectionBoxBoundary.max.y,m.y),d=Math.max(c.y+fb,d),u.setY(d);break;case o_.Back:d=Math.max(this.sectionBoxBoundary.min.z,m.z),d=Math.min(u.z-fb,d),c.setZ(d);break;case o_.Front:d=Math.min(this.sectionBoxBoundary.max.z,m.z),d=Math.max(c.z+fb,d),u.setZ(d)}const f=new xn;l.getCenter(f),this.group.position.set(f.x,f.y,f.z),this.initOrUpdateVertices(),this.updatePlanes(),this.initOrUpdateFaces(),this.initOrUpdateLines(),this.setArrowPosition()}dragRotateSectionPlane(e,t,n){let r=new xn,i=0;const s=this.localToWorldVec(e);let a=this.getPointerPlaneIntersect(t,s),o=this.getPointerPlaneIntersect(n,s);if(!(a&&o)){const e=this.getTranslationPlane(s);a=this.getPointerPlaneIntersect(t,e,1),o=this.getPointerPlaneIntersect(n,e,1),a&&o&&(i=a.dot(s),a.setX(a.x-i*s.x),a.setY(a.y-i*s.y),a.setZ(a.z-i*s.z),i=o.dot(s),o.setX(o.x-i*s.x),o.setY(o.y-i*s.y),o.setZ(o.z-i*s.z))}if(a&&o){a=a.normalize(),o=o.normalize(),i=a.dot(o),i=Yt.clamp(i,-1,1);let t=Math.acos(i);r=a.cross(o),r.dot(s)<0&&(t=-t),im.info("[Section] rotate, = ",t),this.group.rotateOnAxis(e,2*t),this.updatePlanes()}}getBoxFaceVerties(e){var t;const n=Se()(t=this.faces).call(t,(t=>t.axis===e));return n&&n.vertices}clearSectionBox(){this.scene.remove(this.group),this.renderer.domElement.style.cursor=""}addMouseListener(){window.addEventListener("pointermove",this.onMouseMove),window.addEventListener("pointerdown",this.onMouseDown)}removeMouseListener(){window.removeEventListener("pointermove",this.onMouseMove),window.removeEventListener("pointerdown",this.onMouseDown)}updateMouseAndRay(e){const t=this.renderer.domElement,n=t.clientWidth,r=t.clientHeight;this.mousePosition.setX(e.offsetX/n*2-1),this.mousePosition.setY(-e.offsetY/r*2+1),this.raycaster.setFromCamera(this.mousePosition,this.camera)}}{constructor(e,t,n,r,i){var s;super(e,t,n,r),gh(this,"objectIds",void 0),this.objectIds=i;const a=new En;ge()(s=this.objectIds).call(s,(e=>{const t=this.scene.getObjectById(e);t&&a.expandByObject(t)})),super.setSectionBox(a)}initPlanes(){var e;super.initPlanes(),ge()(e=this.objectIds).call(e,(e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t,n;cp()(t=["Mesh","LineSegments"]).call(t,e.type)&&(x()(e.material)?ge()(n=e.material).call(n,(e=>{e.clippingPlanes=this.planes,e.clipIntersection=!1})):e.material&&(e.material.clippingPlanes=this.planes,e.material.clipIntersection=!1))}))}))}clearSectionBox(){var e;super.clearSectionBox(),ge()(e=this.objectIds).call(e,(e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t,n;cp()(t=["Mesh","LineSegments"]).call(t,e.type)&&(x()(e.material)?ge()(n=e.material).call(n,(e=>{e.clippingPlanes=[]})):e.material&&(e.material.clippingPlanes=[]))}))}))}}const bb={type:"change"},xb={type:"start"},Tb={type:"end"};class wb extends Pt{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new xn,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:ke,MIDDLE:Fe,RIGHT:Ue},this.touches={ONE:Be,TWO:Ge},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(e){e.addEventListener("keydown",H),this._domElementKeyEvents=e},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(bb),n.update(),i=r.NONE},this.update=function(){const t=new xn,h=(new bn).setFromUnitVectors(e.up,new xn(0,1,0)),p=h.clone().invert(),d=new xn,m=new bn,f=2*Math.PI;return function(){const e=n.object.position;t.copy(e).sub(n.target),t.applyQuaternion(h),a.setFromVector3(t),n.autoRotate&&i===r.NONE&&w(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(a.theta+=o.theta*n.dampingFactor,a.phi+=o.phi*n.dampingFactor):(a.theta+=o.theta,a.phi+=o.phi);let g=n.minAzimuthAngle,_=n.maxAzimuthAngle;return isFinite(g)&&isFinite(_)&&(g<-Math.PI?g+=f:g>Math.PI&&(g-=f),_<-Math.PI?_+=f:_>Math.PI&&(_-=f),a.theta=g<=_?Math.max(g,Math.min(_,a.theta)):a.theta>(g+_)/2?Math.max(g,a.theta):Math.min(_,a.theta)),a.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=l,a.radius=Math.max(n.minDistance,Math.min(n.maxDistance,a.radius)),!0===n.enableDamping?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),t.setFromSpherical(a),t.applyQuaternion(p),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(o.theta*=1-n.dampingFactor,o.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(o.set(0,0,0),c.set(0,0,0)),l=1,!!(u||d.distanceToSquared(n.object.position)>s||8*(1-m.dot(n.object.quaternion))>s)&&(n.dispatchEvent(bb),d.copy(n.object.position),m.copy(n.object.quaternion),u=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",q),n.domElement.removeEventListener("pointerdown",B),n.domElement.removeEventListener("pointercancel",z),n.domElement.removeEventListener("wheel",V),n.domElement.removeEventListener("pointermove",j),n.domElement.removeEventListener("pointerup",G),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",H)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const s=1e-6,a=new yu,o=new yu;let l=1;const c=new xn;let u=!1;const h=new Xt,p=new Xt,d=new Xt,m=new Xt,f=new Xt,g=new Xt,_=new Xt,v=new Xt,y=new Xt,b=[],x={};function T(){return Math.pow(.95,n.zoomSpeed)}function w(e){o.theta-=e}function S(e){o.phi-=e}const I=function(){const e=new xn;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),c.add(e)}}(),M=function(){const e=new xn;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),c.add(e)}}(),A=function(){const e=new xn;return function(t,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const s=n.object.position;e.copy(s).sub(n.target);let a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),I(2*t*a/i.clientHeight,n.object.matrix),M(2*r*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(I(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),M(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function R(e){n.object.isPerspectiveCamera?l/=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),u=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function D(e){n.object.isPerspectiveCamera?l*=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),u=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function C(e){h.set(e.clientX,e.clientY)}function O(e){m.set(e.clientX,e.clientY)}function P(){if(1===b.length)h.set(b[0].pageX,b[0].pageY);else{const e=.5*(b[0].pageX+b[1].pageX),t=.5*(b[0].pageY+b[1].pageY);h.set(e,t)}}function N(){if(1===b.length)m.set(b[0].pageX,b[0].pageY);else{const e=.5*(b[0].pageX+b[1].pageX),t=.5*(b[0].pageY+b[1].pageY);m.set(e,t)}}function L(){const e=b[0].pageX-b[1].pageX,t=b[0].pageY-b[1].pageY,n=Math.sqrt(e*e+t*t);_.set(0,n)}function k(e){if(1==b.length)p.set(e.pageX,e.pageY);else{const t=X(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);p.set(n,r)}d.subVectors(p,h).multiplyScalar(n.rotateSpeed);const t=n.domElement;w(2*Math.PI*d.x/t.clientHeight),S(2*Math.PI*d.y/t.clientHeight),h.copy(p)}function F(e){if(1===b.length)f.set(e.pageX,e.pageY);else{const t=X(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);f.set(n,r)}g.subVectors(f,m).multiplyScalar(n.panSpeed),A(g.x,g.y),m.copy(f)}function U(e){const t=X(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);v.set(0,s),y.set(0,Math.pow(v.y/_.y,n.zoomSpeed)),R(y.y),_.copy(v)}function B(e){!1!==n.enabled&&(0===b.length&&(n.domElement.setPointerCapture(e.pointerId),n.domElement.addEventListener("pointermove",j),n.domElement.addEventListener("pointerup",G)),function(e){b.push(e)}(e),"touch"===e.pointerType?function(e){switch(Y(e),b.length){case 1:switch(n.touches.ONE){case Be:if(!1===n.enableRotate)return;P(),i=r.TOUCH_ROTATE;break;case je:if(!1===n.enablePan)return;N(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case Ge:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&L(),n.enablePan&&N(),i=r.TOUCH_DOLLY_PAN;break;case ze:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&L(),n.enableRotate&&P(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(xb)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Fe:if(!1===n.enableZoom)return;!function(e){_.set(e.clientX,e.clientY)}(e),i=r.DOLLY;break;case ke:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;O(e),i=r.PAN}else{if(!1===n.enableRotate)return;C(e),i=r.ROTATE}break;case Ue:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;C(e),i=r.ROTATE}else{if(!1===n.enablePan)return;O(e),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(xb)}(e))}function j(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(Y(e),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;k(e),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;F(e),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&U(e),n.enablePan&&F(e)}(e),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&U(e),n.enableRotate&&k(e)}(e),n.update();break;default:i=r.NONE}}(e):function(e){switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(e){p.set(e.clientX,e.clientY),d.subVectors(p,h).multiplyScalar(n.rotateSpeed);const t=n.domElement;w(2*Math.PI*d.x/t.clientHeight),S(2*Math.PI*d.y/t.clientHeight),h.copy(p),n.update()}(e);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(e){v.set(e.clientX,e.clientY),y.subVectors(v,_),y.y>0?R(T()):y.y<0&&D(T()),_.copy(v),n.update()}(e);break;case r.PAN:if(!1===n.enablePan)return;!function(e){f.set(e.clientX,e.clientY),g.subVectors(f,m).multiplyScalar(n.panSpeed),A(g.x,g.y),m.copy(f),n.update()}(e)}}(e))}function G(e){W(e),0===b.length&&(n.domElement.releasePointerCapture(e.pointerId),n.domElement.removeEventListener("pointermove",j),n.domElement.removeEventListener("pointerup",G)),n.dispatchEvent(Tb),i=r.NONE}function z(e){W(e)}function V(e){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(e.preventDefault(),n.dispatchEvent(xb),function(e){e.deltaY<0?D(T()):e.deltaY>0&&R(T()),n.update()}(e),n.dispatchEvent(Tb))}function H(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case Ie(n).UP:A(0,n.keyPanSpeed),t=!0;break;case Ie(n).BOTTOM:A(0,-n.keyPanSpeed),t=!0;break;case Ie(n).LEFT:A(n.keyPanSpeed,0),t=!0;break;case Ie(n).RIGHT:A(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function q(e){!1!==n.enabled&&e.preventDefault()}function W(e){delete x[e.pointerId];for(let t=0;t<b.length;t++)if(b[t].pointerId==e.pointerId)return void E(b).call(b,t,1)}function Y(e){let t=x[e.pointerId];void 0===t&&(t=new Xt,x[e.pointerId]=t),t.set(e.pageX,e.pageY)}function X(e){const t=e.pointerId===b[0].pointerId?b[1]:b[0];return x[t.pointerId]}n.domElement.addEventListener("contextmenu",q),n.domElement.addEventListener("pointerdown",B),n.domElement.addEventListener("pointercancel",z),n.domElement.addEventListener("wheel",V,{passive:!1}),this.update()}}class Eb extends Rm{constructor(e,t,n,r){super(),this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new cn(1,1,1),this.hiddenEdgeColor=new cn(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new ce,this.resolution=void 0!==e?new Xt(e.x,e.y):new Xt(256,256);const i=Math.round(this.resolution.x/this.downSampleRatio),s=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new _n(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new Za,this.depthMaterial.side=2,this.depthMaterial.depthPacking=It,this.depthMaterial.blending=0,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=2,this.prepareMaskMaterial.fragmentShader=function(e,t){const n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new _n(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new _n(i,s),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new _n(i,s),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new _n(Math.round(i/2),Math.round(s/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new _n(i,s),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new _n(Math.round(i/2),Math.round(s/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(i,s),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(i/2),Math.round(s/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===Ry&&console.error("THREE.OutlinePass relies on CopyShader");const a=Ry;this.copyUniforms=yi.clone(a.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new bi({uniforms:this.copyUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,blending:0,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new cn,this.oldClearAlpha=1,this.fsQuad=new Om(null),this.tempPulseColor1=new cn,this.tempPulseColor2=new cn,this.textureMatrix=new Zn}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose(),this.depthMaterial.dispose(),this.prepareMaskMaterial.dispose(),this.edgeDetectionMaterial.dispose(),this.separableBlurMaterial1.dispose(),this.separableBlurMaterial2.dispose(),this.overlayMaterial.dispose(),this.materialCopy.dispose(),this.fsQuad.dispose()}setSize(e,t){this.renderTargetMaskBuffer.setSize(e,t),this.renderTargetDepthBuffer.setSize(e,t);let n=Math.round(e/this.downSampleRatio),r=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(n,r),this.renderTargetBlurBuffer1.setSize(n,r),this.renderTargetEdgeBuffer1.setSize(n,r),this.separableBlurMaterial1.uniforms.texSize.value.set(n,r),n=Math.round(n/2),r=Math.round(r/2),this.renderTargetBlurBuffer2.setSize(n,r),this.renderTargetEdgeBuffer2.setSize(n,r),this.separableBlurMaterial2.uniforms.texSize.value.set(n,r)}changeVisibilityOfSelectedObjects(e){const t=this._visibilityCache;function n(n){n.isMesh&&(!0===e?n.visible=t.get(n):(t.set(n,n.visible),n.visible=e))}for(let e=0;e<this.selectedObjects.length;e++){this.selectedObjects[e].traverse(n)}}changeVisibilityOfNonSelectedObjects(e){const t=this._visibilityCache,n=[];function r(e){e.isMesh&&n.push(e)}for(let e=0;e<this.selectedObjects.length;e++){this.selectedObjects[e].traverse(r)}this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite){let i=!1;for(let e=0;e<n.length;e++){if(n[e].id===r.id){i=!0;break}}if(!1===i){const n=r.visible;!1!==e&&!0!==t.get(r)||(r.visible=e),t.set(r,n)}}else(r.isPoints||r.isLine)&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,n,r,i){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,i&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const r=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=Eb.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=Eb.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=Eb.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=Eb.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new bi({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new Xt(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t\tvPosition = mvPosition;\n\n\t\t\t\t\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t\t\t\t\t#ifdef USE_INSTANCING\n\n\t\t\t\t\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t\t\t\t\t#endif\n\t\t\t\t\t\n\t\t\t\t\tworldPosition = modelMatrix * worldPosition;\n\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\n\t\t\t\t}"})}getEdgeDetectionMaterial(){return new bi({uniforms:{maskTexture:{value:null},texSize:{value:new Xt(.5,.5)},visibleEdgeColor:{value:new xn(1,1,1)},hiddenEdgeColor:{value:new xn(1,1,1)}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}getSeperableBlurMaterial(e){return new bi({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new Xt(.5,.5)},direction:{value:new Xt(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat sigma = kernelRadius/2.0;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, sigma);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = kernelRadius * float(i) / float(MAX_RADIUS);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, sigma);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}getOverlayMaterial(){return new bi({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n\t\t\t\t}",blending:2,depthTest:!1,depthWrite:!1,transparent:!0})}}Eb.BlurDirectionX=new Xt(1,0),Eb.BlurDirectionY=new Xt(0,1);class Sb extends Jd{constructor(e=document.body){super("pick-section-pop-panel","拾取面剖切",e),gh(this,"eventBus",Zd()),gh(this,"activeSelectNode",void 0),gh(this,"isVisible",!0),gh(this,"enabled",!0),gh(this,"visibleNode",void 0),gh(this,"resetNode",void 0),this.createActiveSelectLayout(),this.addActiveItems()}createActiveSelectLayout(){const e=document.createElement("div");e.classList.add("pop-panel-active-select"),this.body.appendChild(e),this.activeSelectNode=e}addActiveItems(){const e=(e,t)=>{const n=document.createElement("i");n.classList.add(Dh),n.classList.add(t),e.innerHTML="",e.appendChild(n)},t=(t,n,r="")=>{const i=document.createElement("div");return i.classList.add("pop-panel-item"),n&&i.setAttribute("title",n),i.setAttribute("itemName",t),i.setAttribute("isActive","false"),e(i,r),i},n=t("visible","隐藏剖切面","icon-hidesectionplane");n.onclick=()=>{this.enabled&&(this.isVisible=!this.isVisible,this.isVisible?(e(n,"icon-hidesectionplane"),n.setAttribute("title","隐藏剖切面")):(e(n,"icon-showsectionplane"),n.setAttribute("title","显示剖切面")),this.eventBus.emit("visible",this.isVisible))},this.activeSelectNode&&this.activeSelectNode.appendChild(n),this.visibleNode=n;const r=t("reset","重置","icon-reset");r.onclick=t=>{t.stopPropagation(),this.enabled&&(this.isVisible=!0,e(n,"icon-hidesectionplane"),n.setAttribute("title","隐藏剖切面"),this.eventBus.emit("reset"))},this.activeSelectNode&&this.activeSelectNode.appendChild(r),this.resetNode=r}enable(){this.enabled=!0,this.visibleNode&&this.visibleNode.classList.remove("disable")}disable(){this.enabled=!1,this.visibleNode&&this.visibleNode.classList.add("disable")}}class Ib{constructor(e,t,n){if(this.container=n,gh(this,"bimViewer",void 0),gh(this,"camera",void 0),gh(this,"controls",void 0),gh(this,"scene",void 0),gh(this,"renderer",void 0),gh(this,"objectIds",void 0),gh(this,"isShowSectionPlane",!0),gh(this,"sectionPlane",void 0),gh(this,"popPanel",void 0),gh(this,"tooltip",void 0),gh(this,"isSelected",!1),gh(this,"raycaster",new gu),gh(this,"clickOnceListerner",(e=>{if(this.bimViewer.mouseMoved)return;this.pickFace(e)&&(this.isSelected=!0,window.removeEventListener("click",this.clickOnceListerner),this.popPanel&&this.popPanel.enable(),this.tooltip&&this.tooltip.hide())})),this.bimViewer=e,!e.camera||!e.renderer||!e.controls)throw new Error("Invalid bimViewer!");this.camera=e.camera,this.scene=e.scene,this.renderer=e.renderer,this.controls=e.controls,this.objectIds=t,this.init()}updateMouseAndRay(e){const t=new Xt;t.setX(e.clientX/window.innerWidth*2-1),t.setY(-e.clientY/window.innerHeight*2+1),this.raycaster.setFromCamera(t,this.camera)}pickFace(e){var t;this.updateMouseAndRay(e);const n=[];ge()(t=this.objectIds).call(t,(e=>{const t=this.scene&&this.scene.getObjectById(e);t&&t.visible&&n.push(t)}));const r=this.raycaster.intersectObjects(n,!0);if(0===r.length)return!1;const i=Se()(r).call(r,(e=>{const t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof mi)}));if(!i||!i.face)return!1;const s=(new $t).getNormalMatrix(i.object.matrixWorld),a=i.face.normal.clone().applyMatrix3(s).normalize(),o=i.point,l=new xn(0,1,0);let c;c=1===a.y||-1===a.y?new xn(1,0,0):l.clone().cross(a);const u=Math.acos(a.dot(l));return this.sectionPlane&&this.sectionPlane.isOpen&&this.sectionPlane.close(),this.sectionPlane=new Em(this.scene,this.camera,this.renderer,this.controls),this.sectionPlane.setSectionPlane(this.bimViewer.bbox),this.sectionPlane.open(),this.sectionPlane.canvasHeight=this.bimViewer.height,this.enableSection(),this.sectionPlane.rotatePlane(c,u),this.sectionPlane.movePlaneToCenter(o),!0}init(){this.isSelected=!1,this.popPanel=new Sb(this.container);const e=this.popPanel.eventBus;e.on("visible",(e=>{e?this.showSectionPlane():this.hideSectionPlane()})),e.on("reset",(()=>{this.popPanel&&this.popPanel.disable(),this.sectionPlane&&(this.sectionPlane.close(),this.cancelSection()),this.tooltip&&this.tooltip.show(),this.open(),this.bimViewer.enableRender()})),this.tooltip=new fy("pick-section-plane","点击选择面",{parentNode:this.container,followPointer:!0,showOnCreate:!0})}open(){window.addEventListener("click",this.clickOnceListerner)}close(){this.popPanel&&(this.popPanel.eventBus.off("visible"),this.popPanel.eventBus.off("reset"),this.popPanel.destroy(),this.popPanel=void 0),this.tooltip&&(this.tooltip.destroy(),this.tooltip=void 0),this.cancelSection(),this.sectionPlane&&this.sectionPlane.close(),this.isSelected||window.removeEventListener("click",this.clickOnceListerner)}enableSection(){var e;ge()(e=this.objectIds).call(e,(e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t,n;if(cp()(t=["Mesh","LineSegments"]).call(t,e.type))if(x()(e.material))ge()(n=e.material).call(n,(e=>{var t;e.clippingPlanes=null===(t=this.sectionPlane)||void 0===t?void 0:t.planes,e.clipIntersection=!0}));else if(e.material){var r;e.material.clippingPlanes=null===(r=this.sectionPlane)||void 0===r?void 0:r.planes,e.material.clipIntersection=!0}}))}))}cancelSection(){var e;ge()(e=this.objectIds).call(e,(e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t,n;cp()(t=["Mesh","LineSegments"]).call(t,e.type)&&(x()(e.material)?ge()(n=e.material).call(n,(e=>{e.clippingPlanes=[]})):e.material&&(e.material.clippingPlanes=[]))}))}))}hideSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!1,this.sectionPlane.setSectionObjectVisible(!1))}showSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!0,this.sectionPlane.setSectionObjectVisible(!0))}}class Mb{constructor(){gh(this,"TIMEOUT","timeout"),gh(this,"INTERVAL","interval"),gh(this,"timeoutMap",{}),gh(this,"intervalMap",{})}run(e=this.INTERVAL,t,n=16.7){const r=Yh();let i=r(),s=i;const a=Sp()(""),o=()=>{this.setIdMap(a,e,o),s=r(),s-i>=n&&(e===this.intervalMap&&(i=r(),s=i),t(),e===this.TIMEOUT&&this.clearTimeout(a))};return this.setIdMap(a,e,o),a}setIdMap(e,t,n){const r=requestAnimationFrame(n);t===this.INTERVAL?this.intervalMap[e]=r:t===this.TIMEOUT&&(this.timeoutMap[e]=r)}setTimeout(e,t){return this.run(this.TIMEOUT,e,t)}clearTimeout(e){cancelAnimationFrame(this.timeoutMap[e])}setInterval(e,t){return this.run(this.INTERVAL,e,t)}clearInterval(e){cancelAnimationFrame(this.intervalMap[e])}}class Ab extends Rm{constructor(e,t,n,r,i){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=void 0!==i?i:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new cn}render(e,t,n){const r=e.autoClear;let i,s;e.autoClear=!1,void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),i=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,i),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=r}}const Rb={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new Xt(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new Zn},cameraInverseProjectionMatrix:{value:new Zn},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}",fragmentShader:"\n\n\t\t#include <common>\n\n\t\tvarying vec2 vUv;\n\n\t\t#if DIFFUSE_TEXTURE == 1\n\t\tuniform sampler2D tDiffuse;\n\t\t#endif\n\n\t\tuniform sampler2D tDepth;\n\n\t\t#if NORMAL_TEXTURE == 1\n\t\tuniform sampler2D tNormal;\n\t\t#endif\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\n\t\tuniform float scale;\n\t\tuniform float intensity;\n\t\tuniform float bias;\n\t\tuniform float kernelRadius;\n\t\tuniform float minResolution;\n\t\tuniform vec2 size;\n\t\tuniform float randomSeed;\n\n\t\t// RGBA depth\n\n\t\t#include <packing>\n\n\t\tvec4 getDefaultColor( const in vec2 screenPosition ) {\n\t\t\t#if DIFFUSE_TEXTURE == 1\n\t\t\treturn texture2D( tDiffuse, vUv );\n\t\t\t#else\n\t\t\treturn vec4( 1.0 );\n\t\t\t#endif\n\t\t}\n\n\t\tfloat getDepth( const in vec2 screenPosition ) {\n\t\t\t#if DEPTH_PACKING == 1\n\t\t\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );\n\t\t\t#else\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\t\t\t#endif\n\t\t}\n\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\n\t\tvec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n\t\t\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );\n\t\t\tclipPosition *= clipW; // unprojection.\n\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;\n\t\t}\n\n\t\tvec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {\n\t\t\t#if NORMAL_TEXTURE == 1\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );\n\t\t\t#else\n\t\t\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );\n\t\t\t#endif\n\t\t}\n\n\t\tfloat scaleDividedByCameraFar;\n\t\tfloat minResolutionMultipliedByCameraFar;\n\n\t\tfloat getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {\n\t\t\tvec3 viewDelta = sampleViewPosition - centerViewPosition;\n\t\t\tfloat viewDistance = length( viewDelta );\n\t\t\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;\n\n\t\t\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );\n\t\t}\n\n\t\t// moving costly divides into consts\n\t\tconst float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );\n\t\tconst float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );\n\n\t\tfloat getAmbientOcclusion( const in vec3 centerViewPosition ) {\n\t\t\t// precompute some variables require in getOcclusion.\n\t\t\tscaleDividedByCameraFar = scale / cameraFar;\n\t\t\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;\n\t\t\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );\n\n\t\t\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/\n\t\t\tfloat angle = rand( vUv + randomSeed ) * PI2;\n\t\t\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;\n\t\t\tvec2 radiusStep = radius;\n\n\t\t\tfloat occlusionSum = 0.0;\n\t\t\tfloat weightSum = 0.0;\n\n\t\t\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {\n\t\t\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;\n\t\t\t\tradius += radiusStep;\n\t\t\t\tangle += ANGLE_STEP;\n\n\t\t\t\tfloat sampleDepth = getDepth( sampleUv );\n\t\t\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfloat sampleViewZ = getViewZ( sampleDepth );\n\t\t\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );\n\t\t\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );\n\t\t\t\tweightSum += 1.0;\n\t\t\t}\n\n\t\t\tif( weightSum == 0.0 ) discard;\n\n\t\t\treturn occlusionSum * ( intensity / weightSum );\n\t\t}\n\n\t\tvoid main() {\n\t\t\tfloat centerDepth = getDepth( vUv );\n\t\t\tif( centerDepth >= ( 1.0 - EPSILON ) ) {\n\t\t\t\tdiscard;\n\t\t\t}\n\n\t\t\tfloat centerViewZ = getViewZ( centerDepth );\n\t\t\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );\n\n\t\t\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );\n\n\t\t\tgl_FragColor = getDefaultColor( vUv );\n\t\t\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;\n\t\t}"},Db={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new Xt(512,512)},sampleUvOffsets:{value:[new Xt(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:"\n\n\t\t#include <common>\n\n\t\tuniform vec2 size;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vInvSize;\n\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tvInvSize = 1.0 / size;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}",fragmentShader:"\n\n\t\t#include <common>\n\t\t#include <packing>\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform sampler2D tDepth;\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform float depthCutoff;\n\n\t\tuniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];\n\t\tuniform float sampleWeights[ KERNEL_RADIUS + 1 ];\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vInvSize;\n\n\t\tfloat getDepth( const in vec2 screenPosition ) {\n\t\t\t#if DEPTH_PACKING == 1\n\t\t\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );\n\t\t\t#else\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\t\t\t#endif\n\t\t}\n\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\n\t\tvoid main() {\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tif( depth >= ( 1.0 - EPSILON ) ) {\n\t\t\t\tdiscard;\n\t\t\t}\n\n\t\t\tfloat centerViewZ = -getViewZ( depth );\n\t\t\tbool rBreak = false, lBreak = false;\n\n\t\t\tfloat weightSum = sampleWeights[0];\n\t\t\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;\n\n\t\t\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {\n\n\t\t\t\tfloat sampleWeight = sampleWeights[i];\n\t\t\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;\n\n\t\t\t\tvec2 sampleUv = vUv + sampleUvOffset;\n\t\t\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );\n\n\t\t\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;\n\n\t\t\t\tif( ! rBreak ) {\n\t\t\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;\n\t\t\t\t\tweightSum += sampleWeight;\n\t\t\t\t}\n\n\t\t\t\tsampleUv = vUv - sampleUvOffset;\n\t\t\t\tviewZ = -getViewZ( getDepth( sampleUv ) );\n\n\t\t\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;\n\n\t\t\t\tif( ! lBreak ) {\n\t\t\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;\n\t\t\t\t\tweightSum += sampleWeight;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgl_FragColor = diffuseSum / weightSum;\n\t\t}"},Cb={createSampleWeights:function(e,t){const n=[];for(let r=0;r<=e;r++)n.push(Ob(r,t));return n},createSampleOffsets:function(e,t){const n=[];for(let r=0;r<=e;r++)n.push(t.clone().multiplyScalar(r));return n},configure:function(e,t,n,r){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=Cb.createSampleOffsets(t,r),e.uniforms.sampleWeights.value=Cb.createSampleWeights(t,n),e.needsUpdate=!0}};function Ob(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)}const Pb={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\t#include <packing>\n\n\t\tvoid main() {\n\n\t\t\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );\n\t\t\tgl_FragColor = vec4( vec3( depth ), opacity );\n\n\t\t}"};class Nb extends Rm{constructor(e,t,n=!1,r=!1,i=new Xt(256,256)){let s;super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=n,this.supportsNormalTexture=r,this.originalClearColor=new cn,this._oldClearColor=new cn,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=new Xt(i.x,i.y),this.saoRenderTarget=new _n(this.resolution.x,this.resolution.y),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new _n(this.resolution.x,this.resolution.y,{minFilter:Qe,magFilter:Qe}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension&&(s=new oo,s.type=at,this.beautyRenderTarget.depthTexture=s,this.beautyRenderTarget.depthBuffer=!0),this.depthMaterial=new Za,this.depthMaterial.depthPacking=It,this.depthMaterial.blending=0,this.normalMaterial=new cc,this.normalMaterial.blending=0,void 0===Rb&&console.error("THREE.SAOPass relies on SAOShader"),this.saoMaterial=new bi({defines:H({},Rb.defines),fragmentShader:Rb.fragmentShader,vertexShader:Rb.vertexShader,uniforms:yi.clone(Rb.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=0,void 0===Db&&console.error("THREE.SAOPass relies on DepthLimitedBlurShader"),this.vBlurMaterial=new bi({uniforms:yi.clone(Db.uniforms),defines:H({},Db.defines),vertexShader:Db.vertexShader,fragmentShader:Db.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=0,this.hBlurMaterial=new bi({uniforms:yi.clone(Db.uniforms),defines:H({},Db.defines),vertexShader:Db.vertexShader,fragmentShader:Db.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=0,void 0===Ry&&console.error("THREE.SAOPass relies on CopyShader"),this.materialCopy=new bi({uniforms:yi.clone(Ry.uniforms),vertexShader:Ry.vertexShader,fragmentShader:Ry.fragmentShader,blending:0}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=5,this.materialCopy.blendSrc=208,this.materialCopy.blendDst=He,this.materialCopy.blendEquation=Ve,this.materialCopy.blendSrcAlpha=206,this.materialCopy.blendDstAlpha=He,this.materialCopy.blendEquationAlpha=Ve,void 0===Pb&&console.error("THREE.SAOPass relies on UnpackDepthRGBAShader"),this.depthCopy=new bi({uniforms:yi.clone(Pb.uniforms),vertexShader:Pb.vertexShader,fragmentShader:Pb.fragmentShader,blending:0}),this.fsQuad=new Om(null)}render(e,t,n){if(this.renderToScreen&&(this.materialCopy.blending=0,this.materialCopy.uniforms.tDiffuse.value=n.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1===this.params.output)return;e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const r=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;const i=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=i,this.hBlurMaterial.uniforms.depthCutoff.value=i,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(Cb.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Xt(0,1)),Cb.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Xt(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));let s=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,s=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?s.blending=5:s.blending=0,this.renderPass(e,s,this.renderToScreen?null:n),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=r}renderPass(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}dispose(){this.saoRenderTarget.dispose(),this.blurIntermediateRenderTarget.dispose(),this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.depthRenderTarget.dispose(),this.depthMaterial.dispose(),this.normalMaterial.dispose(),this.saoMaterial.dispose(),this.vBlurMaterial.dispose(),this.hBlurMaterial.dispose(),this.materialCopy.dispose(),this.depthCopy.dispose(),this.fsQuad.dispose()}}Nb.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4};class Lb extends Rm{constructor(e,t,n,r){super(),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==n?n:0,this.clearAlpha=void 0!==r?r:0,this._oldClearColor=new cn,void 0===Ry&&console.error("THREE.SSAARenderPass relies on CopyShader");const i=Ry;this.copyUniforms=yi.clone(i.uniforms),this.copyMaterial=new bi({uniforms:this.copyUniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,transparent:!0,blending:2,depthTest:!1,depthWrite:!1}),this.fsQuad=new Om(this.copyMaterial)}dispose(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null),this.copyMaterial.dispose(),this.fsQuad.dispose()}setSize(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)}render(e,t,n){this.sampleRenderTarget||(this.sampleRenderTarget=new _n(n.width,n.height),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");const r=kb[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1,e.getClearColor(this._oldClearColor);const s=e.getClearAlpha(),a=1/r.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;const o={fullWidth:n.width,fullHeight:n.height,offsetX:0,offsetY:0,width:n.width,height:n.height},l=H({},this.camera.view);l.enabled&&H(o,l);for(let n=0;n<r.length;n++){const i=r[n];this.camera.setViewOffset&&this.camera.setViewOffset(o.fullWidth,o.fullHeight,o.offsetX+.0625*i[0],o.offsetY+.0625*i[1],o.width,o.height);let s=a;if(this.unbiased){s+=.03125*((n+.5)/r.length-.5)}this.copyUniforms.opacity.value=s,e.setClearColor(this.clearColor,this.clearAlpha),e.setRenderTarget(this.sampleRenderTarget),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.renderToScreen?null:t),0===n&&(e.setClearColor(0,0),e.clear()),this.fsQuad.render(e)}this.camera.setViewOffset&&l.enabled?this.camera.setViewOffset(l.fullWidth,l.fullHeight,l.offsetX,l.offsetY,l.width,l.height):this.camera.clearViewOffset&&this.camera.clearViewOffset(),e.autoClear=i,e.setClearColor(this._oldClearColor,s)}}const kb=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];class Fb{constructor(e=Math){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.grad4=[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]],this.p=[];for(let t=0;t<256;t++)this.p[t]=Math.floor(256*e.random());this.perm=[];for(let e=0;e<512;e++)this.perm[e]=this.p[255&e];this.simplex=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]}dot(e,t,n){return e[0]*t+e[1]*n}dot3(e,t,n,r){return e[0]*t+e[1]*n+e[2]*r}dot4(e,t,n,r,i){return e[0]*t+e[1]*n+e[2]*r+e[3]*i}noise(e,t){let n,r,i;const s=(e+t)*(.5*(Math.sqrt(3)-1)),a=Math.floor(e+s),o=Math.floor(t+s),l=(3-Math.sqrt(3))/6,c=(a+o)*l,u=e-(a-c),h=t-(o-c);let p,d;u>h?(p=1,d=0):(p=0,d=1);const m=u-p+l,f=h-d+l,g=u-1+2*l,_=h-1+2*l,v=255&a,y=255&o,b=this.perm[v+this.perm[y]]%12,x=this.perm[v+p+this.perm[y+d]]%12,T=this.perm[v+1+this.perm[y+1]]%12;let w=.5-u*u-h*h;w<0?n=0:(w*=w,n=w*w*this.dot(this.grad3[b],u,h));let E=.5-m*m-f*f;E<0?r=0:(E*=E,r=E*E*this.dot(this.grad3[x],m,f));let S=.5-g*g-_*_;return S<0?i=0:(S*=S,i=S*S*this.dot(this.grad3[T],g,_)),70*(n+r+i)}noise3d(e,t,n){let r,i,s,a;const o=(e+t+n)*(1/3),l=Math.floor(e+o),c=Math.floor(t+o),u=Math.floor(n+o),h=1/6,p=(l+c+u)*h,d=e-(l-p),m=t-(c-p),f=n-(u-p);let g,_,v,y,b,x;d>=m?m>=f?(g=1,_=0,v=0,y=1,b=1,x=0):d>=f?(g=1,_=0,v=0,y=1,b=0,x=1):(g=0,_=0,v=1,y=1,b=0,x=1):m<f?(g=0,_=0,v=1,y=0,b=1,x=1):d<f?(g=0,_=1,v=0,y=0,b=1,x=1):(g=0,_=1,v=0,y=1,b=1,x=0);const T=d-g+h,w=m-_+h,E=f-v+h,S=d-y+2*h,I=m-b+2*h,M=f-x+2*h,A=d-1+.5,R=m-1+.5,D=f-1+.5,C=255&l,O=255&c,P=255&u,N=this.perm[C+this.perm[O+this.perm[P]]]%12,L=this.perm[C+g+this.perm[O+_+this.perm[P+v]]]%12,k=this.perm[C+y+this.perm[O+b+this.perm[P+x]]]%12,F=this.perm[C+1+this.perm[O+1+this.perm[P+1]]]%12;let U=.6-d*d-m*m-f*f;U<0?r=0:(U*=U,r=U*U*this.dot3(this.grad3[N],d,m,f));let B=.6-T*T-w*w-E*E;B<0?i=0:(B*=B,i=B*B*this.dot3(this.grad3[L],T,w,E));let j=.6-S*S-I*I-M*M;j<0?s=0:(j*=j,s=j*j*this.dot3(this.grad3[k],S,I,M));let G=.6-A*A-R*R-D*D;return G<0?a=0:(G*=G,a=G*G*this.dot3(this.grad3[F],A,R,D)),32*(r+i+s+a)}noise4d(e,t,n,r){const i=this.grad4,s=this.simplex,a=this.perm,o=(Math.sqrt(5)-1)/4,l=(5-Math.sqrt(5))/20;let c,u,h,p,d;const m=(e+t+n+r)*o,f=Math.floor(e+m),g=Math.floor(t+m),_=Math.floor(n+m),v=Math.floor(r+m),y=(f+g+_+v)*l,b=e-(f-y),x=t-(g-y),T=n-(_-y),w=r-(v-y),E=(b>x?32:0)+(b>T?16:0)+(x>T?8:0)+(b>w?4:0)+(x>w?2:0)+(T>w?1:0),S=s[E][0]>=3?1:0,I=s[E][1]>=3?1:0,M=s[E][2]>=3?1:0,A=s[E][3]>=3?1:0,R=s[E][0]>=2?1:0,D=s[E][1]>=2?1:0,C=s[E][2]>=2?1:0,O=s[E][3]>=2?1:0,P=s[E][0]>=1?1:0,N=s[E][1]>=1?1:0,L=s[E][2]>=1?1:0,k=s[E][3]>=1?1:0,F=b-S+l,U=x-I+l,B=T-M+l,j=w-A+l,G=b-R+2*l,z=x-D+2*l,V=T-C+2*l,H=w-O+2*l,q=b-P+3*l,W=x-N+3*l,Y=T-L+3*l,X=w-k+3*l,$=b-1+4*l,K=x-1+4*l,Z=T-1+4*l,J=w-1+4*l,Q=255&f,ee=255&g,te=255&_,ne=255&v,re=a[Q+a[ee+a[te+a[ne]]]]%32,ie=a[Q+S+a[ee+I+a[te+M+a[ne+A]]]]%32,se=a[Q+R+a[ee+D+a[te+C+a[ne+O]]]]%32,ae=a[Q+P+a[ee+N+a[te+L+a[ne+k]]]]%32,oe=a[Q+1+a[ee+1+a[te+1+a[ne+1]]]]%32;let le=.6-b*b-x*x-T*T-w*w;le<0?c=0:(le*=le,c=le*le*this.dot4(i[re],b,x,T,w));let ce=.6-F*F-U*U-B*B-j*j;ce<0?u=0:(ce*=ce,u=ce*ce*this.dot4(i[ie],F,U,B,j));let ue=.6-G*G-z*z-V*V-H*H;ue<0?h=0:(ue*=ue,h=ue*ue*this.dot4(i[se],G,z,V,H));let he=.6-q*q-W*W-Y*Y-X*X;he<0?p=0:(he*=he,p=he*he*this.dot4(i[ae],q,W,Y,X));let pe=.6-$*$-K*K-Z*Z-J*J;return pe<0?d=0:(pe*=pe,d=pe*pe*this.dot4(i[oe],$,K,Z,J)),27*(c+u+h+p+d)}}const Ub={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new Xt},cameraProjectionMatrix:{value:new Zn},cameraInverseProjectionMatrix:{value:new Zn},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform sampler2D tNormal;\n\t\tuniform sampler2D tDepth;\n\t\tuniform sampler2D tNoise;\n\n\t\tuniform vec3 kernel[ KERNEL_SIZE ];\n\n\t\tuniform vec2 resolution;\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\n\t\tuniform float kernelRadius;\n\t\tuniform float minDistance; // avoid artifacts caused by neighbour fragments with minimal depth difference\n\t\tuniform float maxDistance; // avoid the influence of fragments which are too far away\n\n\t\tvarying vec2 vUv;\n\n\t\t#include <packing>\n\n\t\tfloat getDepth( const in vec2 screenPosition ) {\n\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t}\n\n\t\tfloat getLinearDepth( const in vec2 screenPosition ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n\t\tfloat getViewZ( const in float depth ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\n\t\t\t#endif\n\n\t\t}\n\n\t\tvec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n\n\t\t\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );\n\n\t\t\tclipPosition *= clipW; // unprojection.\n\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;\n\n\t\t}\n\n\t\tvec3 getViewNormal( const in vec2 screenPosition ) {\n\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tfloat viewZ = getViewZ( depth );\n\n\t\t\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );\n\t\t\tvec3 viewNormal = getViewNormal( vUv );\n\n\t\t\tvec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );\n\t\t\tvec3 random = vec3( texture2D( tNoise, vUv * noiseScale ).r );\n\n\t\t\t// compute matrix used to reorient a kernel vector\n\n\t\t\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );\n\t\t\tvec3 bitangent = cross( viewNormal, tangent );\n\t\t\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );\n\n\t\t float occlusion = 0.0;\n\n\t\t for ( int i = 0; i < KERNEL_SIZE; i ++ ) {\n\n\t\t\t\tvec3 sampleVector = kernelMatrix * kernel[ i ]; // reorient sample vector in view space\n\t\t\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius ); // calculate sample point\n\n\t\t\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 ); // project point and calculate NDC\n\t\t\t\tsamplePointNDC /= samplePointNDC.w;\n\n\t\t\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5; // compute uv coordinates\n\n\t\t\t\tfloat realDepth = getLinearDepth( samplePointUv ); // get linear depth from depth texture\n\t\t\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar ); // compute linear depth of the sample view Z value\n\t\t\t\tfloat delta = sampleDepth - realDepth;\n\n\t\t\t\tif ( delta > minDistance && delta < maxDistance ) { // if fragment is before sample point, increase occlusion\n\n\t\t\t\t\tocclusion += 1.0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );\n\n\t\t\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );\n\n\t\t}"},Bb={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:"varying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"uniform sampler2D tDepth;\n\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\n\t\tvarying vec2 vUv;\n\n\t\t#include <packing>\n\n\t\tfloat getLinearDepth( const in vec2 screenPosition ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat depth = getLinearDepth( vUv );\n\t\t\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );\n\n\t\t}"},jb={uniforms:{tDiffuse:{value:null},resolution:{value:new Xt}},vertexShader:"varying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"uniform sampler2D tDiffuse;\n\n\t\tuniform vec2 resolution;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec2 texelSize = ( 1.0 / resolution );\n\t\t\tfloat result = 0.0;\n\n\t\t\tfor ( int i = - 2; i <= 2; i ++ ) {\n\n\t\t\t\tfor ( int j = - 2; j <= 2; j ++ ) {\n\n\t\t\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;\n\t\t\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );\n\n\t\t}"};class Gb extends Rm{constructor(e,t,n,r){super(),this.width=void 0!==n?n:512,this.height=void 0!==r?r:512,this.clear=!0,this.camera=t,this.scene=e,this.kernelRadius=8,this.kernelSize=32,this.kernel=[],this.noiseTexture=null,this.output=0,this.minDistance=.005,this.maxDistance=.1,this._visibilityCache=new ce,this.generateSampleKernel(),this.generateRandomKernelRotations();const i=new oo;i.format=dt,i.type=ut,this.beautyRenderTarget=new _n(this.width,this.height),this.normalRenderTarget=new _n(this.width,this.height,{minFilter:Qe,magFilter:Qe,depthTexture:i}),this.ssaoRenderTarget=new _n(this.width,this.height),this.blurRenderTarget=this.ssaoRenderTarget.clone(),void 0===Ub&&console.error("THREE.SSAOPass: The pass relies on SSAOShader."),this.ssaoMaterial=new bi({defines:H({},Ub.defines),uniforms:yi.clone(Ub.uniforms),vertexShader:Ub.vertexShader,fragmentShader:Ub.fragmentShader,blending:0}),this.ssaoMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssaoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssaoMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.ssaoMaterial.uniforms.tNoise.value=this.noiseTexture,this.ssaoMaterial.uniforms.kernel.value=this.kernel,this.ssaoMaterial.uniforms.cameraNear.value=this.camera.near,this.ssaoMaterial.uniforms.cameraFar.value=this.camera.far,this.ssaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new cc,this.normalMaterial.blending=0,this.blurMaterial=new bi({defines:H({},jb.defines),uniforms:yi.clone(jb.uniforms),vertexShader:jb.vertexShader,fragmentShader:jb.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new bi({defines:H({},Bb.defines),uniforms:yi.clone(Bb.uniforms),vertexShader:Bb.vertexShader,fragmentShader:Bb.fragmentShader,blending:0}),this.depthRenderMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new bi({uniforms:yi.clone(Ry.uniforms),vertexShader:Ry.vertexShader,fragmentShader:Ry.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:208,blendDst:He,blendEquation:Ve,blendSrcAlpha:206,blendDstAlpha:He,blendEquationAlpha:Ve}),this.fsQuad=new Om(null),this.originalClearColor=new cn}dispose(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(e,t){switch(!1===e.capabilities.isWebGL2&&(this.noiseTexture.format=1024),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.overrideVisibility(),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.restoreVisibility(),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(e,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.output){case Gb.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Gb.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Gb.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Gb.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case Gb.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Gb.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=5,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}renderPass(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.width=e,this.height=t,this.beautyRenderTarget.setSize(e,t),this.ssaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.ssaoMaterial.uniforms.resolution.value.set(e,t),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t)}generateSampleKernel(){const e=this.kernelSize,t=this.kernel;for(let n=0;n<e;n++){const r=new xn;r.x=2*Math.random()-1,r.y=2*Math.random()-1,r.z=Math.random(),r.normalize();let i=n/e;i=Yt.lerp(.1,1,i*i),r.multiplyScalar(i),t.push(r)}}generateRandomKernelRotations(){void 0===Fb&&console.error("THREE.SSAOPass: The pass relies on SimplexNoise.");const e=new Fb,t=new Float32Array(16);for(let n=0;n<16;n++){const r=2*Math.random()-1,i=2*Math.random()-1,s=0;t[n]=e.noise3d(r,i,s)}this.noiseTexture=new Io(t,4,4,1028,lt),this.noiseTexture.wrapS=Ke,this.noiseTexture.wrapT=Ke,this.noiseTexture.needsUpdate=!0}overrideVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse((function(e){t.set(e,e.visible),(e.isPoints||e.isLine)&&(e.visible=!1)}))}restoreVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse((function(e){const n=t.get(e);e.visible=n})),t.clear()}}Gb.OUTPUT={Default:0,SSAO:1,Blur:2,Beauty:3,Depth:4,Normal:5};const zb={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new cn(0)},defaultOpacity:{value:0}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec3 defaultColor;\n\t\tuniform float defaultOpacity;\n\t\tuniform float luminosityThreshold;\n\t\tuniform float smoothWidth;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\n\t\t\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\n\t\t\tfloat v = dot( texel.xyz, luma );\n\n\t\t\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n\t\t\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n\t\t\tgl_FragColor = mix( outputColor, texel, alpha );\n\n\t\t}"};class Vb extends Rm{constructor(e,t,n,r){super(),this.strength=void 0!==t?t:1,this.radius=n,this.threshold=r,this.resolution=void 0!==e?new Xt(e.x,e.y):new Xt(256,256),this.clearColor=new cn(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let i=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new _n(i,s),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.nMips;e++){const t=new _n(i,s);t.texture.name="UnrealBloomPass.h"+e,t.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(t);const n=new _n(i,s);n.texture.name="UnrealBloomPass.v"+e,n.texture.generateMipmaps=!1,this.renderTargetsVertical.push(n),i=Math.round(i/2),s=Math.round(s/2)}void 0===zb&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const a=zb;this.highPassUniforms=yi.clone(a.uniforms),this.highPassUniforms.luminosityThreshold.value=r,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new bi({uniforms:this.highPassUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const o=[3,5,7,9,11];i=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let e=0;e<this.nMips;e++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(o[e])),this.separableBlurMaterials[e].uniforms.texSize.value=new Xt(i,s),i=Math.round(i/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0;this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new xn(1,1,1),new xn(1,1,1),new xn(1,1,1),new xn(1,1,1),new xn(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===Ry&&console.error("THREE.UnrealBloomPass relies on CopyShader");const l=Ry;this.copyUniforms=yi.clone(l.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new bi({uniforms:this.copyUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,blending:2,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new cn,this.oldClearAlpha=1,this.basic=new kr,this.fsQuad=new Om(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.materialCopy.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(e,t){let n=Math.round(e/2),r=Math.round(t/2);this.renderTargetBright.setSize(n,r);for(let e=0;e<this.nMips;e++)this.renderTargetsHorizontal[e].setSize(n,r),this.renderTargetsVertical[e].setSize(n,r),this.separableBlurMaterials[e].uniforms.texSize.value=new Xt(n,r),n=Math.round(n/2),r=Math.round(r/2)}render(e,t,n,r,i){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const s=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),i&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=n.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let a=this.renderTargetBright;for(let t=0;t<this.nMips;t++)this.fsQuad.material=this.separableBlurMaterials[t],this.separableBlurMaterials[t].uniforms.colorTexture.value=a.texture,this.separableBlurMaterials[t].uniforms.direction.value=Vb.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[t]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[t].uniforms.colorTexture.value=this.renderTargetsHorizontal[t].texture,this.separableBlurMaterials[t].uniforms.direction.value=Vb.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[t]),e.clear(),this.fsQuad.render(e),a=this.renderTargetsVertical[t];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,i&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(n),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=s}getSeperableBlurMaterial(e){return new bi({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new Xt(.5,.5)},direction:{value:new Xt(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}getCompositeMaterial(e){return new bi({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}}Vb.BlurDirectionX=new Xt(1,0),Vb.BlurDirectionY=new Xt(0,1);const Hb=new xn,qb=new xn,Wb=new $t;class Yb extends Wo{constructor(e,t=1,n=16711680){const r=new Kr,i=e.geometry.attributes.normal.count,s=new zr(2*i*3,3);r.setAttribute("position",s),super(r,new Fo({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Wb.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const r=n.attributes.position,i=n.attributes.normal;let s=0;for(let n=0,a=r.count;n<a;n++)Hb.fromBufferAttribute(r,n).applyMatrix4(e),qb.fromBufferAttribute(i,n),qb.applyMatrix3(Wb).normalize().multiplyScalar(this.size).add(Hb),t.setXYZ(s,Hb.x,Hb.y,Hb.z),s+=1,t.setXYZ(s,qb.x,qb.y,qb.z),s+=1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class Xb{constructor(){gh(this,"webcamCanvas",void 0),gh(this,"webcam",void 0),gh(this,"canvasCtx",void 0),gh(this,"webcamTexture",void 0),gh(this,"shaderMaterial",void 0),gh(this,"vertexShader","\n varying vec2 vUv;\n void main( void ) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);\n }"),gh(this,"fragmentShader","\n uniform vec3 keyColor;\n uniform float similarity;\n uniform float smoothness;\n varying vec2 vUv;\n uniform sampler2D map;\n void main() {\n vec4 videoColor = texture2D(map, vUv);\n\n float Y1 = 0.299 * keyColor.r + 0.587 * keyColor.g + 0.114 * keyColor.b;\n float Cr1 = keyColor.r - Y1;\n float Cb1 = keyColor.b - Y1;\n \n float Y2 = 0.299 * videoColor.r + 0.587 * videoColor.g + 0.114 * videoColor.b;\n float Cr2 = videoColor.r - Y2; \n float Cb2 = videoColor.b - Y2; \n \n float blend = smoothstep(similarity, similarity + smoothness, distance(vec2(Cr2, Cb2), vec2(Cr1, Cb1)));\n gl_FragColor = vec4(videoColor.rgb, videoColor.a * blend); \n }");const e=document.createElement("video");this.webcam=e;navigator.mediaDevices.getUserMedia({video:{width:600,height:400}}).then((t=>{e.srcObject=t,e.onloadedmetadata=()=>{e.setAttribute("autoplay","true"),e.setAttribute("playsinline","true"),e.play()}})).catch((function(e){alert(e.name+": "+e.message)})),this.webcamCanvas=document.createElement("canvas");const t=this.webcamCanvas.getContext("2d");this.canvasCtx=t,t.fillStyle="#000000",t.fillRect(0,0,this.webcamCanvas.width,this.webcamCanvas.height);const n=new fn(this.webcamCanvas);this.webcamTexture=n,n.minFilter=nt,n.magFilter=nt,this.shaderMaterial=new bi({transparent:!0,uniforms:{map:{value:n},keyColor:{value:[0,1,0]},similarity:{value:.3},smoothness:{value:0}},vertexShader:this.vertexShader,fragmentShader:this.fragmentShader})}getShaderMaterial(){return this.shaderMaterial}createWebCamPlane(e=5,t=4){const n=new ki(e,t);return new mi(n,this.shaderMaterial)}animate(){this.webcam.readyState===this.webcam.HAVE_ENOUGH_DATA&&(this.canvasCtx.drawImage(this.webcam,0,0,this.webcamCanvas.width,this.webcamCanvas.height),this.webcamTexture.needsUpdate=!0)}}var $b=n(59863);class Kb extends Gc{constructor(e){super(e)}parse(e){const t=0,n=1,r=2,i=3,s=9,a=10,o=11,l=48,c=4,u=0,h=1,p=2,d=3;e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let m=0;const f=new Uint8Array(e),g={id_length:f[m++],colormap_type:f[m++],image_type:f[m++],colormap_index:f[m++]|f[m++]<<8,colormap_length:f[m++]|f[m++]<<8,colormap_size:f[m++],origin:[f[m++]|f[m++]<<8,f[m++]|f[m++]<<8],width:f[m++]|f[m++]<<8,height:f[m++]|f[m++]<<8,pixel_size:f[m++],flags:f[m++]};!function(e){switch(e.image_type){case n:case s:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case r:case i:case a:case o:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(g),g.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=g.id_length;let _=!1,v=!1,y=!1;switch(g.image_type){case s:_=!0,v=!0;break;case n:v=!0;break;case a:_=!0;break;case r:break;case o:_=!0,y=!0;break;case i:y=!0}const b=new Uint8Array(g.width*g.height*4),x=function(e,t,n,r,i){let s,a;const o=n.pixel_size>>3,l=n.width*n.height*o;if(t&&(a=i.subarray(r,r+=n.colormap_length*(n.colormap_size>>3))),e){let e,t,n;s=new Uint8Array(l);let a=0;const c=new Uint8Array(o);for(;a<l;)if(e=i[r++],t=1+(127&e),128&e){for(n=0;n<o;++n)c[n]=i[r++];for(n=0;n<t;++n)s.set(c,a+n*o);a+=o*t}else{for(t*=o,n=0;n<t;++n)s[a+n]=i[r++];a+=t}}else s=i.subarray(r,r+=t?n.width*n.height:l);return{pixel_data:s,palettes:a}}(_,v,g,m,f);return function(e,t,n,r,i){let s,a,o,m,f,_;switch(($b(g)&l)>>c){default:case p:s=0,o=1,f=t,a=0,m=1,_=n;break;case u:s=0,o=1,f=t,a=n-1,m=-1,_=-1;break;case d:s=t-1,o=-1,f=-1,a=0,m=1,_=n;break;case h:s=t-1,o=-1,f=-1,a=n-1,m=-1,_=-1}if(y)switch(g.pixel_size){case 8:!function(e,t,n,r,i,s,a,o){let l,c,u,h=0;const p=g.width;for(u=t;u!==r;u+=n)for(c=i;c!==a;c+=s,h++)l=o[h],e[4*(c+p*u)+0]=l,e[4*(c+p*u)+1]=l,e[4*(c+p*u)+2]=l,e[4*(c+p*u)+3]=255}(e,a,m,_,s,o,f,r);break;case 16:!function(e,t,n,r,i,s,a,o){let l,c,u=0;const h=g.width;for(c=t;c!==r;c+=n)for(l=i;l!==a;l+=s,u+=2)e[4*(l+h*c)+0]=o[u+0],e[4*(l+h*c)+1]=o[u+0],e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+3]=o[u+1]}(e,a,m,_,s,o,f,r);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(g.pixel_size){case 8:!function(e,t,n,r,i,s,a,o,l){const c=l;let u,h,p,d=0;const m=g.width;for(p=t;p!==r;p+=n)for(h=i;h!==a;h+=s,d++)u=o[d],e[4*(h+m*p)+3]=255,e[4*(h+m*p)+2]=c[3*u+0],e[4*(h+m*p)+1]=c[3*u+1],e[4*(h+m*p)+0]=c[3*u+2]}(e,a,m,_,s,o,f,r,i);break;case 16:!function(e,t,n,r,i,s,a,o){let l,c,u,h=0;const p=g.width;for(u=t;u!==r;u+=n)for(c=i;c!==a;c+=s,h+=2)l=o[h+0]+(o[h+1]<<8),e[4*(c+p*u)+0]=(31744&l)>>7,e[4*(c+p*u)+1]=(992&l)>>2,e[4*(c+p*u)+2]=(31&l)<<3,e[4*(c+p*u)+3]=32768&l?0:255}(e,a,m,_,s,o,f,r);break;case 24:!function(e,t,n,r,i,s,a,o){let l,c,u=0;const h=g.width;for(c=t;c!==r;c+=n)for(l=i;l!==a;l+=s,u+=3)e[4*(l+h*c)+3]=255,e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+1]=o[u+1],e[4*(l+h*c)+0]=o[u+2]}(e,a,m,_,s,o,f,r);break;case 32:!function(e,t,n,r,i,s,a,o){let l,c,u=0;const h=g.width;for(c=t;c!==r;c+=n)for(l=i;l!==a;l+=s,u+=4)e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+1]=o[u+1],e[4*(l+h*c)+0]=o[u+2],e[4*(l+h*c)+3]=o[u+3]}(e,a,m,_,s,o,f,r);break;default:console.error("THREE.TGALoader: Format not supported.")}}(b,g.width,g.height,x.pixel_data,x.palettes),{data:b,width:g.width,height:g.height,flipY:!0,generateMipmaps:!0,minFilter:it}}}class Zb extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===i.path?su.extractUrlBase(e):i.path,a=new Uc(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(n,s))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e,t){function n(e,t){const n=[],r=e.childNodes;for(let e=0,i=r.length;e<i;e++){const i=r[e];i.nodeName===t&&n.push(i)}return n}function r(e){if(0===e.length)return[];const t=se(e).call(e).split(/\s+/),n=new Array(t.length);for(let e=0,r=t.length;e<r;e++)n[e]=t[e];return n}function i(e){if(0===e.length)return[];const t=se(e).call(e).split(/\s+/),n=new Array(t.length);for(let e=0,r=t.length;e<r;e++)n[e]=O(t[e]);return n}function s(e){if(0===e.length)return[];const t=se(e).call(e).split(/\s+/),n=new Array(t.length);for(let e=0,r=t.length;e<r;e++)n[e]=N(t[e]);return n}function a(e){return e.substring(1)}function o(e){return 0===J(e).length}function l(e){return void 0!==e&&!0===e.hasAttribute("meter")?O(e.getAttribute("meter")):1}function c(e){return void 0!==e?e.textContent:"Y_UP"}function u(e,t,r,i){const s=n(e,t)[0];if(void 0!==s){const e=n(s,r);for(let t=0;t<e.length;t++)i(e[t])}}function h(e,t){for(const n in e){e[n].build=t(e[n])}}function p(e,t){return void 0!==e.build||(e.build=t(e)),e.build}function d(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"input"===r.nodeName){const e=a(r.getAttribute("source")),n=r.getAttribute("semantic");t.inputs[n]=e}}return t}function m(e){const t={};let n=e.getAttribute("target").split("/");const r=n.shift();let i=n.shift();const s=-1!==T(i).call(i,"("),o=-1!==T(i).call(i,".");if(o)n=i.split("."),i=n.shift(),t.member=n.shift();else if(s){const e=i.split("(");i=e.shift();for(let t=0;t<e.length;t++)e[t]=N(e[t].replace(/\)/,""));t.indices=e}return t.id=r,t.sid=i,t.arraySyntax=s,t.memberSyntax=o,t.sampler=a(e.getAttribute("source")),t}function f(e){const t=[],n=e.channels,r=e.samplers,i=e.sources;for(const e in n)if(n.hasOwnProperty(e)){const s=n[e],a=r[s.sampler],o=a.inputs.INPUT,l=a.inputs.OUTPUT;x(_(s,i[o],i[l]),t)}return t}function g(e){return p(ut.animations[e],f)}function _(e,t,n){const r=ut.nodes[e.id],i=Ye(r.id),s=r.transforms[e.sid],a=r.matrix.clone().transpose();let o,l,c,u,h,p;const d={};switch(s){case"matrix":for(c=0,u=t.array.length;c<u;c++)if(o=t.array[c],l=c*n.stride,void 0===d[o]&&(d[o]={}),!0===e.arraySyntax){const t=n.array[l],r=e.indices[0]+4*e.indices[1];d[o][r]=t}else for(h=0,p=n.stride;h<p;h++)d[o][h]=n.array[l+h];break;case"translate":case"rotate":case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',s)}const m=function(e,t){const n=[];for(const t in e)n.push({time:O(t),value:e[t]});ne(n).call(n,r);for(let e=0;e<16;e++)w(n,e,t.elements[e]);return n;function r(e,t){return e.time-t.time}}(d,a);return{name:i.uuid,keyframes:m}}const v=new xn,y=new xn,b=new bn;function x(e,t){const n=e.keyframes,r=e.name,i=[],s=[],a=[],o=[];for(let e=0,t=n.length;e<t;e++){const t=n[e],r=t.time,l=t.value;ke.fromArray(l).transpose(),ke.decompose(v,b,y),i.push(r),s.push(v.x,v.y,v.z),a.push(b.x,b.y,b.z,b.w),o.push(y.x,y.y,y.z)}return s.length>0&&t.push(new Rc(r+".position",i,s)),a.length>0&&t.push(new Mc(r+".quaternion",i,a)),o.length>0&&t.push(new Rc(r+".scale",i,o)),t}function w(e,t,n){let r,i,s,a=!0;for(i=0,s=e.length;i<s;i++)r=e[i],void 0===r.value[t]?r.value[t]=null:a=!1;if(!0===a)for(i=0,s=e.length;i<s;i++)r=e[i],r.value[t]=n;else!function(e,t){let n,r;for(let i=0,s=e.length;i<s;i++){const s=e[i];if(null===s.value[t]){if(n=E(e,i,t),r=S(e,i,t),null===n){s.value[t]=r.value[t];continue}if(null===r){s.value[t]=n.value[t];continue}M(s,n,r,t)}}}(e,t)}function E(e,t,n){for(;t>=0;){const r=e[t];if(null!==r.value[n])return r;t--}return null}function S(e,t,n){for(;t<e.length;){const r=e[t];if(null!==r.value[n])return r;t++}return null}function M(e,t,n,r){n.time-t.time!=0?e.value[r]=(e.time-t.time)*(n.value[r]-t.value[r])/(n.time-t.time)+t.value[r]:e.value[r]=t.value[r]}function A(e){const t=[],n=e.name,r=e.end-e.start||-1,i=e.animations;for(let e=0,n=i.length;e<n;e++){const n=g(i[e]);for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return new Dc(n,r,t)}function R(e){return p(ut.clips[e],A)}function D(e){const t={sources:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=i(r.textContent);break;case"source":const e=r.getAttribute("id");t.sources[e]=me(r);break;case"joints":t.joints=C(r);break;case"vertex_weights":t.vertexWeights=P(r)}}return t}function C(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"input"===r.nodeName){const e=r.getAttribute("semantic"),n=a(r.getAttribute("source"));t.inputs[e]=n}}return t}function P(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=r.getAttribute("semantic"),n=a(r.getAttribute("source")),i=N(r.getAttribute("offset"));t.inputs[e]={id:n,offset:i};break;case"vcount":t.vcount=s(r.textContent);break;case"v":t.v=s(r.textContent)}}return t}function L(e){const t={id:e.id},n=ut.geometries[t.id];return void 0!==e.skin&&(t.skin=function(e){const t=4,n={joints:[],indices:{array:[],stride:t},weights:{array:[],stride:t}},r=e.sources,i=e.vertexWeights,s=i.vcount,a=i.v,o=i.inputs.JOINT.offset,l=i.inputs.WEIGHT.offset,c=e.sources[e.joints.inputs.JOINT],u=e.sources[e.joints.inputs.INV_BIND_MATRIX],h=r[i.inputs.WEIGHT.id].array;let p,d,m,f=0;for(p=0,m=s.length;p<m;p++){const e=s[p],r=[];for(d=0;d<e;d++){const e=a[f+o],t=h[a[f+l]];r.push({index:e,weight:t}),f+=2}for(ne(r).call(r,g),d=0;d<t;d++){const e=r[d];void 0!==e?(n.indices.array.push(e.index),n.weights.array.push(e.weight)):(n.indices.array.push(0),n.weights.array.push(0))}}e.bindShapeMatrix?n.bindMatrix=(new Zn).fromArray(e.bindShapeMatrix).transpose():n.bindMatrix=(new Zn).identity();for(p=0,m=c.array.length;p<m;p++){const e=c.array[p],t=(new Zn).fromArray(u.array,p*u.stride).transpose();n.joints.push({name:e,boneInverse:t})}return n;function g(e,t){return t.weight-e.weight}}(e.skin),n.sources.skinIndices=t.skin.indices,n.sources.skinWeights=t.skin.weights),t}function k(e){return p(ut.controllers[e],L)}function F(e){return void 0!==e.build?e.build:e.init_from}function U(e){const t=ut.images[e];return void 0!==t?p(t,F):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",e),null)}function B(e){const t={surfaces:{},samplers:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"newparam":G(r,t);break;case"technique":t.technique=H(r);break;case"extra":t.extra=K(r)}}return t}function G(e,t){const n=e.getAttribute("sid");for(let r=0,i=e.childNodes.length;r<i;r++){const i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"surface":t.surfaces[n]=z(i);break;case"sampler2D":t.samplers[n]=V(i)}}}function z(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"init_from"===r.nodeName)t.init_from=r.textContent}return t}function V(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"source"===r.nodeName)t.source=r.textContent}return t}function H(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=r.nodeName,t.parameters=q(r);break;case"extra":t.extra=K(r)}}return t}function q(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[r.nodeName]=W(r);break;case"transparent":t[r.nodeName]={opaque:r.hasAttribute("opaque")?r.getAttribute("opaque"):"A_ONE",data:W(r)}}}return t}function W(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"color":t[r.nodeName]=i(r.textContent);break;case"float":t[r.nodeName]=O(r.textContent);break;case"texture":t[r.nodeName]={id:r.getAttribute("texture"),extra:Y(r)}}}return t}function Y(e){const t={technique:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"extra"===r.nodeName)X(r,t)}return t}function X(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique"===r.nodeName)$(r,t)}}function $(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[r.nodeName]=O(r.textContent);break;case"wrapU":case"wrapV":"TRUE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=1:"FALSE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=0:t.technique[r.nodeName]=N(r.textContent);break;case"bump":t[r.nodeName]=Q(r)}}}function K(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique"===r.nodeName)t.technique=Z(r)}return t}function Z(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"double_sided":t[r.nodeName]=N(r.textContent);break;case"bump":t[r.nodeName]=Q(r)}}return t}function Q(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"texture"===r.nodeName)t[r.nodeName]={id:r.getAttribute("texture"),texcoord:r.getAttribute("texcoord"),extra:Y(r)}}return t}function ee(e){return e}function te(e){const t=function(e){return p(ut.effects[e],ee)}(e.url),n=t.profile.technique;let r;switch(n.type){case"phong":case"blinn":r=new lc;break;case"lambert":r=new uc;break;default:r=new kr}function i(e,n=null){const r=t.profile.samplers[e.id];let i=null;if(void 0!==r){i=U(t.profile.surfaces[r.source].init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),i=U(e.id);if(null!==i){const t=function(e){let t,n=I(e).call(e,2+(De(e).call(e,".")-1>>>0));n=n.toLowerCase(),t="tga"===n?st:it;return t}(i);if(void 0!==t){const r=t.load(i),s=e.extra;if(void 0!==s&&void 0!==s.technique&&!1===o(s.technique)){const e=s.technique;r.wrapS=e.wrapU?Ke:Ze,r.wrapT=e.wrapV?Ke:Ze,r.offset.set(e.offsetU||0,e.offsetV||0),j(r).set(e.repeatU||1,e.repeatV||1)}else r.wrapS=Ke,r.wrapT=Ke;return null!==n&&(r.encoding=n),r}return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",i),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",e.id),null}r.name=e.name||"";const s=n.parameters;for(const e in s){const t=s[e];switch(e){case"diffuse":t.color&&r.color.fromArray(t.color),t.texture&&(r.map=i(t.texture,St));break;case"specular":t.color&&r.specular&&r.specular.fromArray(t.color),t.texture&&(r.specularMap=i(t.texture));break;case"bump":t.texture&&(r.normalMap=i(t.texture));break;case"ambient":t.texture&&(r.lightMap=i(t.texture,St));break;case"shininess":t.float&&r.shininess&&(r.shininess=t.float);break;case"emission":t.color&&r.emissive&&r.emissive.fromArray(t.color),t.texture&&(r.emissiveMap=i(t.texture,St))}}r.color.convertSRGBToLinear(),r.specular&&r.specular.convertSRGBToLinear(),r.emissive&&r.emissive.convertSRGBToLinear();let a=s.transparent,l=s.transparency;if(void 0===l&&a&&(l={float:1}),void 0===a&&l&&(a={opaque:"A_ONE",data:{color:[1,1,1,1]}}),a&&l)if(a.data.texture)r.transparent=!0;else{const e=a.data.color;switch(a.opaque){case"A_ONE":r.opacity=e[3]*l.float;break;case"RGB_ZERO":r.opacity=1-e[0]*l.float;break;case"A_ZERO":r.opacity=1-e[3]*l.float;break;case"RGB_ONE":r.opacity=e[0]*l.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',a.opaque)}r.opacity<1&&(r.transparent=!0)}if(void 0!==n.extra&&void 0!==n.extra.technique){const e=n.extra.technique;for(const t in e){const n=e[t];switch(t){case"double_sided":r.side=1===n?2:0;break;case"bump":r.normalMap=i(n.texture),r.normalScale=new Xt(1,1)}}}return r}function re(e){return p(ut.materials[e],te)}function ie(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if("technique_common"===n.nodeName)return ae(n)}return{}}function ae(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"perspective":case"orthographic":t.technique=r.nodeName,t.parameters=oe(r)}}return t}function oe(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[r.nodeName]=O(r.textContent)}}return t}function le(e){let t;switch(e.optics.technique){case"perspective":t=new Ti(e.optics.parameters.yfov,e.optics.parameters.aspect_ratio,e.optics.parameters.znear,e.optics.parameters.zfar);break;case"orthographic":let n=e.optics.parameters.ymag,r=e.optics.parameters.xmag;const i=e.optics.parameters.aspect_ratio;r=void 0===r?n*i:r,n=void 0===n?r/i:n,r*=.5,n*=.5,t=new Wi(-r,r,n,-n,e.optics.parameters.znear,e.optics.parameters.zfar);break;default:t=new Ti}return t.name=e.name||"",t}function ce(e){const t=ut.cameras[e];return void 0!==t?p(t,le):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",e),null)}function ue(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=r.nodeName,t.parameters=he(r)}}return t}function he(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"color":const e=i(r.textContent);t.color=(new cn).fromArray(e).convertSRGBToLinear();break;case"falloff_angle":t.falloffAngle=O(r.textContent);break;case"quadratic_attenuation":const n=O(r.textContent);t.distance=n?Math.sqrt(1/n):0}}return t}function pe(e){let t;switch(e.technique){case"directional":t=new ru;break;case"point":t=new tu;break;case"spot":t=new Kc;break;case"ambient":t=new iu}return e.parameters.color&&t.color.copy(e.parameters.color),e.parameters.distance&&(t.distance=e.parameters.distance),t}function de(e){const t=ut.lights[e];return void 0!==t?p(t,pe):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",e),null)}function me(e){const t={array:[],stride:3};for(let s=0;s<e.childNodes.length;s++){const a=e.childNodes[s];if(1===a.nodeType)switch(a.nodeName){case"float_array":t.array=i(a.textContent);break;case"Name_array":t.array=r(a.textContent);break;case"technique_common":const e=n(a,"accessor")[0];void 0!==e&&(t.stride=N(e.getAttribute("stride")))}}return t}function fe(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];1===r.nodeType&&(t[r.getAttribute("semantic")]=a(r.getAttribute("source")))}return t}function ge(e){const t={type:e.nodeName,material:e.getAttribute("material"),count:N(e.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=a(r.getAttribute("source")),n=r.getAttribute("semantic"),i=N(r.getAttribute("offset")),o=N(r.getAttribute("set")),l=o>0?n+o:n;t.inputs[l]={id:e,offset:i},t.stride=Math.max(t.stride,i+1),"TEXCOORD"===n&&(t.hasUV=!0);break;case"vcount":t.vcount=s(r.textContent);break;case"p":t.p=s(r.textContent)}}return t}function ve(e){let t=0;for(let n=0,r=e.length;n<r;n++){!0===e[n].hasUV&&t++}t>0&&t<e.length&&(e.uvsNeedsFix=!0)}function ye(e){const t={},n=e.sources,r=e.vertices,i=e.primitives;if(0===i.length)return{};const s=function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];void 0===t[r.type]&&(t[r.type]=[]),t[r.type].push(r)}return t}(i);for(const e in s){const i=s[e];ve(i),t[e]=be(i,n,r)}return t}function be(e,t,n){const r={},i={array:[],stride:0},s={array:[],stride:0},a={array:[],stride:0},o={array:[],stride:0},l={array:[],stride:0},c=[],u=4,h=[],p=4,d=new Kr,m=[];let f=0;for(let r=0;r<e.length;r++){const u=e[r],p=u.inputs;let g=0;switch(u.type){case"lines":case"linestrips":g=2*u.count;break;case"triangles":g=3*u.count;break;case"polylist":for(let e=0;e<u.count;e++){const t=u.vcount[e];switch(t){case 3:g+=3;break;case 4:g+=6;break;default:g+=3*(t-2)}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",u.type)}d.addGroup(f,g,r),f+=g,u.material&&m.push(u.material);for(const r in p){const d=p[r];switch(r){case"VERTEX":for(const r in n){const p=n[r];switch(r){case"POSITION":const n=i.array.length;if(xe(u,t[p],d.offset,i.array),i.stride=t[p].stride,t.skinWeights&&t.skinIndices&&(xe(u,t.skinIndices,d.offset,c),xe(u,t.skinWeights,d.offset,h)),!1===u.hasUV&&!0===e.uvsNeedsFix){const e=(i.array.length-n)/i.stride;for(let t=0;t<e;t++)a.array.push(0,0)}break;case"NORMAL":xe(u,t[p],d.offset,s.array),s.stride=t[p].stride;break;case"COLOR":xe(u,t[p],d.offset,l.array),l.stride=t[p].stride;break;case"TEXCOORD":xe(u,t[p],d.offset,a.array),a.stride=t[p].stride;break;case"TEXCOORD1":xe(u,t[p],d.offset,o.array),a.stride=t[p].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',r)}}break;case"NORMAL":xe(u,t[d.id],d.offset,s.array),s.stride=t[d.id].stride;break;case"COLOR":xe(u,t[d.id],d.offset,l.array,!0),l.stride=t[d.id].stride;break;case"TEXCOORD":xe(u,t[d.id],d.offset,a.array),a.stride=t[d.id].stride;break;case"TEXCOORD1":xe(u,t[d.id],d.offset,o.array),o.stride=t[d.id].stride}}}return i.array.length>0&&d.setAttribute("position",new zr(i.array,i.stride)),s.array.length>0&&d.setAttribute("normal",new zr(s.array,s.stride)),l.array.length>0&&d.setAttribute("color",new zr(l.array,l.stride)),a.array.length>0&&d.setAttribute("uv",new zr(a.array,a.stride)),o.array.length>0&&d.setAttribute("uv2",new zr(o.array,o.stride)),c.length>0&&d.setAttribute("skinIndex",new zr(c,u)),h.length>0&&d.setAttribute("skinWeight",new zr(h,p)),r.data=d,r.type=e[0].type,r.materialKeys=m,r}function xe(e,t,n,r,i=!1){const s=e.p,a=e.stride,o=e.vcount;function l(e){let t=s[e+n]*u;const a=t+u;for(;t<a;t++)r.push(c[t]);if(i){const e=r.length-u-1;at.setRGB(r[e+0],r[e+1],r[e+2]).convertSRGBToLinear(),r[e+0]=at.r,r[e+1]=at.g,r[e+2]=at.b}}const c=t.array,u=t.stride;if(void 0!==e.vcount){let e=0;for(let t=0,n=o.length;t<n;t++){const n=o[t];if(4===n){const t=e+1*a,n=e+2*a,r=e+3*a;l(e+0*a),l(t),l(r),l(t),l(n),l(r)}else if(3===n){const t=e+1*a,n=e+2*a;l(e+0*a),l(t),l(n)}else if(n>4)for(let t=1,r=n-2;t<=r;t++){const n=e+a*t,r=e+a*(t+1);l(e+0*a),l(n),l(r)}e+=a*n}}else for(let e=0,t=s.length;e<t;e+=a)l(e)}function Te(e){return p(ut.geometries[e],ye)}function we(e){return void 0!==e.build?e.build:e}function Ee(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"joint":t.joints[r.getAttribute("sid")]=Se(r);break;case"link":t.links.push(Me(r))}}}function Se(e){let t;for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"prismatic":case"revolute":t=Ie(r)}}return t}function Ie(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",axis:new xn,limits:{min:0,max:0},type:e.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"axis":const e=i(r.textContent);t.axis.fromArray(e);break;case"limits":const n=r.getElementsByTagName("max")[0],s=r.getElementsByTagName("min")[0];t.limits.max=O(n.textContent),t.limits.min=O(s.textContent)}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function Me(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"attachment_full":t.attachments.push(Ae(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(Re(r))}}return t}function Ae(e){const t={joint:e.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"link":t.links.push(Me(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(Re(r))}}return t}function Re(e){const t={type:e.nodeName},n=i(e.textContent);switch(t.type){case"matrix":t.obj=new Zn,t.obj.fromArray(n).transpose();break;case"translate":t.obj=new xn,t.obj.fromArray(n);break;case"rotate":t.obj=new xn,t.obj.fromArray(n),t.angle=Yt.degToRad(n[3])}return t}function Ce(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique_common"===r.nodeName)Oe(r,t)}}function Oe(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"inertia":t.inertia=i(r.textContent);break;case"mass":t.mass=i(r.textContent)[0]}}}function Pe(e){const t={target:e.getAttribute("target").split("/").pop()};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"axis"===r.nodeName){const e=r.getElementsByTagName("param")[0];t.axis=e.textContent;const n=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=n.substring(0,n.length-1)}}return t}function Ne(e){return void 0!==e.build?e.build:e}function Le(e){const t=[],n=et.querySelector('[id="'+e.id+'"]');for(let e=0;e<n.childNodes.length;e++){const r=n.childNodes[e];if(1!==r.nodeType)continue;let s,a;switch(r.nodeName){case"matrix":s=i(r.textContent);const e=(new Zn).fromArray(s).transpose();t.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:e});break;case"translate":case"scale":s=i(r.textContent),a=(new xn).fromArray(s),t.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:a});break;case"rotate":s=i(r.textContent),a=(new xn).fromArray(s);const n=Yt.degToRad(s[3]);t.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:a,angle:n})}}return t}const ke=new Zn,Fe=new xn;function Ue(e){const t={name:e.getAttribute("name")||"",type:e.getAttribute("type"),id:e.getAttribute("id"),sid:e.getAttribute("sid"),matrix:new Zn,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1!==r.nodeType)continue;let s;switch(r.nodeName){case"node":t.nodes.push(r.getAttribute("id")),Ue(r);break;case"instance_camera":t.instanceCameras.push(a(r.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Be(r));break;case"instance_light":t.instanceLights.push(a(r.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Be(r));break;case"instance_node":t.instanceNodes.push(a(r.getAttribute("url")));break;case"matrix":s=i(r.textContent),t.matrix.multiply(ke.fromArray(s).transpose()),t.transforms[r.getAttribute("sid")]=r.nodeName;break;case"translate":s=i(r.textContent),Fe.fromArray(s),t.matrix.multiply(ke.makeTranslation(Fe.x,Fe.y,Fe.z)),t.transforms[r.getAttribute("sid")]=r.nodeName;break;case"rotate":s=i(r.textContent);const e=Yt.degToRad(s[3]);t.matrix.multiply(ke.makeRotationAxis(Fe.fromArray(s),e)),t.transforms[r.getAttribute("sid")]=r.nodeName;break;case"scale":s=i(r.textContent),t.matrix.scale(Fe.fromArray(s)),t.transforms[r.getAttribute("sid")]=r.nodeName;break;case"extra":break;default:console.log(r)}}return We(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):ut.nodes[t.id]=t,t}function Be(e){const t={id:a(e.getAttribute("url")),materials:{},skeletons:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"bind_material":const e=r.getElementsByTagName("instance_material");for(let n=0;n<e.length;n++){const r=e[n],i=r.getAttribute("symbol"),s=r.getAttribute("target");t.materials[i]=a(s)}break;case"skeleton":t.skeletons.push(a(r.textContent))}}return t}function je(e,t){const n=[],r=[];let i,s,a;for(i=0;i<e.length;i++){const r=e[i];let s;if(We(r))s=Ye(r),Ge(s,t,n);else if($e(r)){const e=ut.visualScenes[r].children;for(let r=0;r<e.length;r++){const i=e[r];if("JOINT"===i.type){Ge(Ye(i.id),t,n)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",r)}for(i=0;i<t.length;i++)for(s=0;s<n.length;s++)if(a=n[s],a.bone.name===t[i].name){r[i]=a,a.processed=!0;break}for(i=0;i<n.length;i++)a=n[i],!1===a.processed&&(r.push(a),a.processed=!0);const o=[],l=[];for(i=0;i<r.length;i++)a=r[i],o.push(a.bone),l.push(a.boneInverse);return new Ro(o,l)}function Ge(e,t,n){e.traverse((function(e){if(!0===e.isBone){let r;for(let n=0;n<t.length;n++){const i=t[n];if(i.name===e.name){r=i.boneInverse;break}}void 0===r&&(r=new Zn),n.push({bone:e,boneInverse:r,processed:!1})}}))}function ze(e){const t=[],n=e.matrix,r=e.nodes,i=e.type,s=e.instanceCameras,a=e.instanceControllers,o=e.instanceLights,l=e.instanceGeometries,c=e.instanceNodes;for(let e=0,n=r.length;e<n;e++)t.push(Ye(r[e]));for(let e=0,n=s.length;e<n;e++){const n=ce(s[e]);null!==n&&t.push(n.clone())}for(let e=0,n=a.length;e<n;e++){const n=a[e],r=k(n.id),i=qe(Te(r.id),n.materials),s=je(n.skeletons,r.skin.joints);for(let e=0,n=i.length;e<n;e++){const n=i[e];n.isSkinnedMesh&&(_e(n).call(n,s,r.skin.bindMatrix),n.normalizeSkinWeights()),t.push(n)}}for(let e=0,n=o.length;e<n;e++){const n=de(o[e]);null!==n&&t.push(n.clone())}for(let e=0,n=l.length;e<n;e++){const n=l[e],r=qe(Te(n.id),n.materials);for(let e=0,n=r.length;e<n;e++)t.push(r[e])}for(let e=0,n=c.length;e<n;e++)t.push(Ye(c[e]).clone());let u;if(0===r.length&&1===t.length)u=t[0];else{u="JOINT"===i?new So:new io;for(let e=0;e<t.length;e++)u.add(t[e])}return u.name="JOINT"===i?e.sid:e.name,u.matrix.copy(n),u.matrix.decompose(u.position,u.quaternion,u.scale),u}const Ve=new kr({color:16711935});function He(e,t){const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];void 0===i?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",e[r]),n.push(Ve)):n.push(re(i))}return n}function qe(e,t){const n=[];for(const r in e){const i=e[r],s=He(i.materialKeys,t);0===s.length&&("lines"===r||"linestrips"===r?s.push(new Fo):s.push(new lc));const a=void 0!==i.data.attributes.skinIndex,o=1===s.length?s[0]:s;let l;switch(r){case"lines":l=new Wo(i.data,o);break;case"linestrips":l=new Vo(i.data,o);break;case"triangles":case"polylist":l=a?new Eo(i.data,o):new mi(i.data,o)}n.push(l)}return n}function We(e){return void 0!==ut.nodes[e]}function Ye(e){return p(ut.nodes[e],ze)}function Xe(e){const t=new io;t.name=e.name;const n=e.children;for(let e=0;e<n.length;e++){const r=n[e];t.add(Ye(r.id))}return t}function $e(e){return void 0!==ut.visualScenes[e]}function Je(e){return p(ut.visualScenes[e],Xe)}if(0===e.length)return{scene:new mo};const Qe=(new DOMParser).parseFromString(e,"application/xml"),et=n(Qe,"COLLADA")[0],tt=Qe.getElementsByTagName("parsererror")[0];if(void 0!==tt){const e=n(tt,"div")[0];let t;return t=e?e.textContent:function(e){let t="";const n=[e];for(;n.length;){const e=n.shift();e.nodeType===Node.TEXT_NODE?t+=e.textContent:(t+="\n",n.push.apply(n,e.childNodes))}return se(t).call(t)}(tt),console.error("THREE.ColladaLoader: Failed to parse collada file.\n",t),null}const nt=et.getAttribute("version");console.log("THREE.ColladaLoader: File version",nt);const rt=function(e){return{unit:l(n(e,"unit")[0]),upAxis:c(n(e,"up_axis")[0])}}(n(et,"asset")[0]),it=new zc(this.manager);let st;it.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),Kb&&(st=new Kb(this.manager),st.setPath(this.resourcePath||t));const at=new cn,ot=[];let lt={},ct=0;const ut={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};u(et,"library_animations","animation",(function e(t){const n={sources:{},samplers:{},channels:{}};let r=!1;for(let i=0,s=t.childNodes.length;i<s;i++){const s=t.childNodes[i];if(1!==s.nodeType)continue;let a;switch(s.nodeName){case"source":a=s.getAttribute("id"),n.sources[a]=me(s);break;case"sampler":a=s.getAttribute("id"),n.samplers[a]=d(s);break;case"channel":a=s.getAttribute("target"),n.channels[a]=m(s);break;case"animation":e(s),r=!0;break;default:console.log(s)}}!1===r&&(ut.animations[t.getAttribute("id")||Yt.generateUUID()]=n)})),u(et,"library_animation_clips","animation_clip",(function(e){const t={name:e.getAttribute("id")||"default",start:O(e.getAttribute("start")||0),end:O(e.getAttribute("end")||0),animations:[]};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"instance_animation"===r.nodeName)t.animations.push(a(r.getAttribute("url")))}ut.clips[e.getAttribute("id")]=t})),u(et,"library_controllers","controller",(function(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"skin":t.id=a(r.getAttribute("source")),t.skin=D(r);break;case"morph":t.id=a(r.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}ut.controllers[e.getAttribute("id")]=t})),u(et,"library_images","image",(function(e){const t={init_from:n(e,"init_from")[0].textContent};ut.images[e.getAttribute("id")]=t})),u(et,"library_effects","effect",(function(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"profile_COMMON"===r.nodeName)t.profile=B(r)}ut.effects[e.getAttribute("id")]=t})),u(et,"library_materials","material",(function(e){const t={name:e.getAttribute("name")};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"instance_effect"===r.nodeName)t.url=a(r.getAttribute("url"))}ut.materials[e.getAttribute("id")]=t})),u(et,"library_cameras","camera",(function(e){const t={name:e.getAttribute("name")};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"optics"===r.nodeName)t.optics=ie(r)}ut.cameras[e.getAttribute("id")]=t})),u(et,"library_lights","light",(function(e){let t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique_common"===r.nodeName)t=ue(r)}ut.lights[e.getAttribute("id")]=t})),u(et,"library_geometries","geometry",(function(e){const t={name:e.getAttribute("name"),sources:{},vertices:{},primitives:[]},r=n(e,"mesh")[0];if(void 0!==r){for(let e=0;e<r.childNodes.length;e++){const n=r.childNodes[e];if(1!==n.nodeType)continue;const i=n.getAttribute("id");switch(n.nodeName){case"source":t.sources[i]=me(n);break;case"vertices":t.vertices=fe(n);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",n.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(ge(n));break;default:console.log(n)}}ut.geometries[e.getAttribute("id")]=t}})),u(et,"library_nodes","node",Ue),u(et,"library_visual_scenes","visual_scene",(function(e){const t={name:e.getAttribute("name"),children:[]};!function(e){const t=e.getElementsByTagName("node");for(let e=0;e<t.length;e++){const n=t[e];!1===n.hasAttribute("id")&&n.setAttribute("id","three_default_"+ct++)}}(e);const r=n(e,"node");for(let e=0;e<r.length;e++)t.children.push(Ue(r[e]));ut.visualScenes[e.getAttribute("id")]=t})),u(et,"library_kinematics_models","kinematics_model",(function(e){const t={name:e.getAttribute("name")||"",joints:{},links:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique_common"===r.nodeName)Ee(r,t)}ut.kinematicsModels[e.getAttribute("id")]=t})),u(et,"library_physics_models","physics_model",(function(e){const t={name:e.getAttribute("name")||"",rigidBodies:{}};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"rigid_body"===r.nodeName)t.rigidBodies[r.getAttribute("name")]={},Ce(r,t.rigidBodies[r.getAttribute("name")])}ut.physicsModels[e.getAttribute("id")]=t})),u(et,"scene","instance_kinematics_scene",(function(e){const t={bindJointAxis:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"bind_joint_axis"===r.nodeName)t.bindJointAxis.push(Pe(r))}ut.kinematicsScenes[a(e.getAttribute("url"))]=t})),h(ut.animations,f),h(ut.clips,A),h(ut.controllers,L),h(ut.images,F),h(ut.effects,ee),h(ut.materials,te),h(ut.cameras,le),h(ut.lights,pe),h(ut.geometries,ye),h(ut.visualScenes,Xe),function(){const e=ut.clips;if(!0===o(e)){if(!1===o(ut.animations)){const e=[];for(const t in ut.animations){const n=g(t);for(let t=0,r=n.length;t<r;t++)e.push(n[t])}ot.push(new Dc("default",-1,e))}}else for(const t in e)ot.push(R(t))}(),function(){const e=J(ut.kinematicsModels)[0],t=J(ut.kinematicsScenes)[0],n=J(ut.visualScenes)[0];if(void 0===e||void 0===t)return;const r=function(e){return p(ut.kinematicsModels[e],we)}(e),i=function(e){return p(ut.kinematicsScenes[e],Ne)}(t),s=Je(n),a=i.bindJointAxis,o={};for(let e=0,t=a.length;e<t;e++){const t=a[e],n=et.querySelector('[sid="'+t.target+'"]');if(n){const e=n.parentElement;l(t.jointIndex,e)}}function l(e,t){const n=t.getAttribute("name"),i=r.joints[e];s.traverse((function(r){r.name===n&&(o[e]={object:r,transforms:Le(t),joint:i,position:i.zeroPosition})}))}const c=new Zn;lt={joints:r&&r.joints,getJointValue:function(e){const t=o[e];if(t)return t.position;console.warn("THREE.ColladaLoader: Joint "+e+" doesn't exist.")},setJointValue:function(e,t){const n=o[e];if(n){const i=n.joint;if(t>i.limits.max||t<i.limits.min)console.warn("THREE.ColladaLoader: Joint "+e+" value "+t+" outside of limits (min: "+i.limits.min+", max: "+i.limits.max+").");else if(i.static)console.warn("THREE.ColladaLoader: Joint "+e+" is static.");else{const s=n.object,a=i.axis,l=n.transforms;ke.identity();for(let n=0;n<l.length;n++){var r;const s=l[n];if(s.sid&&-1!==T(r=s.sid).call(r,e))switch(i.type){case"revolute":ke.multiply(c.makeRotationAxis(a,Yt.degToRad(t)));break;case"prismatic":ke.multiply(c.makeTranslation(a.x*t,a.y*t,a.z*t));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+i.type)}else switch(s.type){case"matrix":ke.multiply(s.obj);break;case"translate":ke.multiply(c.makeTranslation(s.obj.x,s.obj.y,s.obj.z));break;case"scale":ke.scale(s.obj);break;case"rotate":ke.multiply(c.makeRotationAxis(s.obj,s.angle))}}s.matrix.copy(ke),s.matrix.decompose(s.position,s.quaternion,s.scale),o[e].position=t}}else console.log("THREE.ColladaLoader: "+e+" does not exist.")}}}();const ht=function(e){return Je(a(n(e,"instance_visual_scene")[0].getAttribute("url")))}(n(et,"scene")[0]);return ht.animations=ot,"Z_UP"===rt.upAxis&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ht.quaternion.setFromEuler(new or(-Math.PI/2,0,0))),ht.scale.multiplyScalar(rt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),ot},kinematics:lt,library:ut,scene:ht}}}const Jb=new ee;class Qb extends Lc{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new Uc(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{this.decodeDracoFile(e,t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};return this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){const n=z(t);if(Jb.has(e)){const t=Jb.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,s=e.byteLength,a=this._getWorker(i,s).then((n=>(r=n,new _(((n,s)=>{r._callbacks[i]={resolve:n,reject:s},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return a.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),Jb.set(e,{key:n,promise:a}),a}_createGeometry(e){const t=new Kr;e.index&&t.setIndex(new Br(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,s=r.array,a=r.itemSize;t.setAttribute(i,new Br(s,a))}return t}_loadLibrary(e,t){const n=new Uc(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new _(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=_.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=ex.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(T(r).call(r,"{")+1,De(r).call(r,"}"))].join("\n");this.workerSourceURL=g_.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else{var n;ne(n=this.workerPool).call(n,(function(e,t){return e._taskLoad>t._taskLoad?-1:1}))}const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){var e;console.log("Task load: ",K(e=this.workerPool).call(e,(e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function ex(){let e,t;function n(e,t,n,r,i,s){var a;const o=s.num_components(),l=n.num_points()*o,c=l*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),h=e._malloc(c);t.GetAttributeDataArrayForAllPoints(n,s,u,c,h);const p=I(a=new i(e.HEAPF32.buffer,h,l)).call(a);return e._free(h),{name:r,array:p,itemSize:o}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new _((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,s=i.taskConfig;t.then((e=>{const t=e.draco,a=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(r),r.byteLength);try{var l;const e=function(e,t,r,i){const s=i.attributeIDs,a=i.attributeTypes;let o,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,l=t.DecodeBufferToMesh(r,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const r in s){const l=self[a[r]];let c,h;if(i.useUniqueIDs)h=s[r],c=t.GetAttributeByUniqueId(o,h);else{if(h=t.GetAttributeId(o,e[s[r]]),-1===h)continue;c=t.GetAttribute(o,h)}u.attributes.push(n(e,t,o,r,l,c))}c===e.TRIANGULAR_MESH&&(u.index=function(e,t,n){var r;const i=3*n.num_faces(),s=4*i,a=e._malloc(s);t.GetTrianglesUInt32Array(n,s,a);const o=I(r=new Uint32Array(e.HEAPF32.buffer,a,i)).call(r);return e._free(a),{array:o,itemSize:1}}(e,t,o));return e.destroy(o),u}(t,a,o,s),r=K(l=e.attributes).call(l,(e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(o),t.destroy(a)}}))}}}var tx=n(45181),nx=n.n(tx),rx=n(49804),ix=n.n(rx),sx=n(76501);const ax="function"==typeof atob,ox="function"==typeof Buffer,lx="function"==typeof TextDecoder?new TextDecoder:void 0,cx=("function"==typeof TextEncoder&&new TextEncoder,Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),ux=(e=>{let t={};return e.forEach(((e,n)=>t[e]=n)),t})(cx),hx=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,px=String.fromCharCode.bind(String),dx="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),mx=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),fx=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,gx=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return px(55296+(t>>>10))+px(56320+(1023&t));case 3:return px((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return px((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},_x=e=>e.replace(fx,gx),vx=e=>{if(e=e.replace(/\s+/g,""),!hx.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,i="";for(let s=0;s<e.length;)t=ux[e.charAt(s++)]<<18|ux[e.charAt(s++)]<<12|(n=ux[e.charAt(s++)])<<6|(r=ux[e.charAt(s++)]),i+=64===n?px(t>>16&255):64===r?px(t>>16&255,t>>8&255):px(t>>16&255,t>>8&255,255&t);return i},yx=ax?e=>atob(mx(e)):ox?e=>Buffer.from(e,"base64").toString("binary"):vx,bx=ox?e=>dx(Buffer.from(e,"base64")):e=>dx(yx(e),(e=>e.charCodeAt(0))),xx=ox?e=>Buffer.from(e,"base64").toString("utf8"):lx?e=>lx.decode(bx(e)):e=>_x(yx(e)),Tx=e=>mx(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),wx=e=>xx(Tx(e)),Ex=wx;var Sx=(e,t,n,r,i)=>{const s=n.length,a=n[0].length;if(e<0||e>1)throw new Error("t out of bounds [0,1]: "+e);if(t<1)throw new Error("degree must be at least 1 (linear)");if(t>s-1)throw new Error("degree must be less than or equal to point count - 1");if(r){if(r.length!==s+t+1)throw new Error("bad knot vector length")}else{r=[];for(let e=0;e<s+t+1;e++)r[e]=e}const o=[t,r.length-1-t],l=r[o[0]],c=r[o[1]];let u;for(e=e*(c-l)+l,e=Math.max(e,l),e=Math.min(e,c),u=o[0];u<o[1]&&!(e>=r[u]&&e<=r[u+1]);u++);const h=[];for(let e=0;e<s;e++){h[e]=[];const t=i?i[e]:1;for(let r=0;r<a;r++)h[e][r]=n[e][r]*t;h[e][a]=t}let p;for(let n=1;n<=t+1;n++)for(let i=u;i>u-t-1+n;i--){p=(e-r[i])/(r[i+t+1-n]-r[i]);for(let e=0;e<a+1;e++)h[i][e]=(1-p)*h[i-1][e]+p*h[i][e]}const d=[];for(let e=0;e<a;e++)d[e]=(m=h[u][e]/h[u][a],void 0===(f=-9)||0==+f?Math.round(m):(m=+m,f=+f,isNaN(m)||"number"!=typeof f||f%1!=0?NaN:(m=m.toString().split("e"),+((m=(m=Math.round(+(m[0]+"e"+(m[1]?+m[1]-f:-f)))).toString().split("e"))[0]+"e"+(m[1]?+m[1]+f:f)))));var m,f;return d},Ix=n(40769),Mx=n.n(Ix);const Ax="BYLAYER",Rx="BYBLOCK";let Dx;!function(e){e[e.Mesh=-1]="Mesh",e[e.MeshWithPattern=0]="MeshWithPattern",e[e.LineWithWidth=1]="LineWithWidth",e[e.Line=2]="Line",e[e.LineWithPattern=3]="LineWithPattern",e[e.Point=4]="Point",e[e.Text=5]="Text"}(Dx||(Dx={}));class Cx{constructor(){gh(this,"pointer",0),gh(this,"eof",!1),gh(this,"lastReadGroup",void 0)}}class Ox extends Cx{constructor(e){super(),gh(this,"data",void 0),this.data=e}next(){var e;if(!this.hasNext())throw this.eof?new Error("Cannot call 'next' after EOF group has been read"):new Error("Unexpected end of input: EOF group not read before end of file. Ended on code "+this.data[this.pointer]);const t={code:L()(this.data[this.pointer])};var n,r;return this.pointer++,t.value=(n=t.code,r=ae()(e=this.data[this.pointer]).call(e),n>=0&&n<=9?r:n>=10&&n<=59?P()(r):n>=60&&n<=99?L()(r):n>=100&&n<=109?r:n>=110&&n<=149?P()(r):n>=160&&n<=179?L()(r):n>=210&&n<=239?P()(r):n>=270&&n<=289?L()(r):n>=290&&n<=299?function(e){if("0"===e)return!1;if("1"===e)return!0;throw TypeError("String '"+e+"' cannot be cast to Boolean type")}(r):n>=300&&n<=369?r:n>=370&&n<=389?L()(r):n>=390&&n<=399?r:n>=400&&n<=409?L()(r):n>=410&&n<=419?r:n>=420&&n<=429?L()(r):n>=430&&n<=439?r:n>=440&&n<=459?L()(r):n>=460&&n<=469?P()(r):n>=470&&n<=481||999===n||n>=1e3&&n<=1009?r:n>=1010&&n<=1059?P()(r):n>=1060&&n<=1071?L()(r):(im.info("WARNING: Group code does not have a defined type: %j",{code:n,value:r}),r)),this.pointer++,0===t.code&&"EOF"===t.value&&(this.eof=!0),this.lastReadGroup=t,t}hasNext(){return!this.eof&&!(this.pointer>this.data.length-2)}isEOF(){return this.eof}}var Px=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215];function Nx(e){return Px[e]}function Lx(e){const t={};let n=e.lastReadGroup,r=n.code;if(t.x=n.value,r+=10,n=e.next(),n.code!=r)throw new Error(`Expected code for point value to be ${r} but got ${n.code}`);return t.y=n.value,r+=10,n=e.next(),n.code!=r||(t.z=n.value,e.next()),t}function kx(e,t){let n=e.lastReadGroup;const r=[];for(let i=0;i<16;i++){if(n.code!==t)throw new Error(`Expected code for matrix value to be ${t} but got ${n.code}`);r.push(n.value),n=e.next()}return r}function Fx(e,t){var n;switch(t.code){case 0:e.type=t.value;break;case 5:e.handle=t.value;break;case 6:e.lineType=t.value.toUpperCase();break;case 8:e.layer=t.value;break;case 48:e.lineTypeScale=t.value,e.lineTypeScale<=0&&(e.lineTypeScale=1);break;case 60:e.visible=0===t.value;break;case 62:e.isTrueColor||(e.colorIndex=t.value,e.colorIndex<0&&im.warn("[DxfParser] a negative value of colorIndex indicates that the layer is turned off"),e.color=Nx(Math.abs(t.value)));break;case 67:e.inPaperSpace=0!==t.value;break;case 100:case 1001:break;case 330:e.ownerHandle=t.value;break;case 347:e.materialObjectHandle=t.value;break;case 370:e.lineweight=t.value;break;case 410:e.layoutName=t.value;break;case 420:e.isTrueColor=!0,e.color=t.value;break;case 1e3:if(t.value&&cp()(n=t.value).call(n,"OriginalHandle")){var r;const n=Z()(r=t.value.split(":")).call(r,(e=>ae()(e).call(e)));e.extendedData||(e.extendedData={}),e.extendedData.originalHandle=n[1]}break;default:return!1}return!0}function Ux(e,t){switch(t.code){case 0:e.type=t.value;break;case 5:e.handle=t.value;break;case 330:e.ownerHandle=t.value;break;case 1e3:case 1001:break;default:return!1}return!0}class Bx{constructor(){gh(this,"ForEntityName","3DFACE")}parseEntity(e,t){const n={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 70:n.shape=1==(1&t.value),n.hasContinuousLinetypePattern=128==(128&t.value),t=e.next();break;case 10:n.vertices=jx(e,t),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}function jx(e,t){const n=[];let r=!1,i=!1;for(let s=0;s<=4;s++){const s={};for(;!e.isEOF()&&0!==t.code&&!i;){switch(t.code){case 10:case 11:case 12:case 13:if(r){i=!0;continue}s.x=t.value,r=!0;break;case 20:case 21:case 22:case 23:s.y=t.value;break;case 30:case 31:case 32:case 33:s.z=t.value;break;default:return n}t=e.next()}n.push(s),r=!1,i=!1}return n}class Gx{constructor(){gh(this,"ForEntityName","ARC")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.center=Lx(e),t=e.lastReadGroup;break;case 40:n.radius=t.value,t=e.next();break;case 50:n.startAngle=Math.PI/180*t.value,t=e.next();break;case 51:n.endAngle=Math.PI/180*t.value,n.angleLength=n.endAngle-n.startAngle,t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class zx{constructor(){gh(this,"ForEntityName","ATTDEF")}parseEntity(e,t){const n={type:t.value,xScale:1,textStyle:"STANDARD"};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 1:n.text=t.value,t=e.next();break;case 2:n.tag=t.value,t=e.next();break;case 3:n.prompt=t.value,t=e.next();break;case 7:n.textStyle=t.value,t=e.next();break;case 10:n.startPoint=Lx(e),t=e.lastReadGroup;break;case 11:n.endPoint=Lx(e),t=e.lastReadGroup;break;case 39:n.thickness=t.value,t=e.next();break;case 40:n.textHeight=t.value,t=e.next();break;case 41:n.xScale=t.value,t=e.next();break;case 50:n.rotation=t.value,t=e.next();break;case 51:n.obliqueAngle=t.value,t=e.next();break;case 70:n.invisible=!!(1&t.value),n.constant=!!(2&t.value),n.verificationRequired=!!(4&t.value),n.preset=!!(8&t.value),t=e.next();break;case 71:n.backwards=!!(2&t.value),n.mirrored=!!(4&t.value),t=e.next();break;case 72:n.horizontalJustification=t.value,t=e.next();break;case 73:n.fieldLength=t.value,t=e.next();break;case 74:n.verticalJustification=t.value,t=e.next();break;case 100:t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class Vx{constructor(){gh(this,"ForEntityName","ATTRIB")}parseEntity(e,t){const n={type:t.value,xScale:1,textStyle:"STANDARD"};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 1:n.text=t.value,t=e.next();break;case 2:n.tag=t.value,t=e.next();break;case 3:n.prompt=t.value,t=e.next();break;case 7:n.textStyle=t.value,t=e.next();break;case 10:n.startPoint=Lx(e),t=e.lastReadGroup;break;case 11:n.endPoint=Lx(e),t=e.lastReadGroup;break;case 39:n.thickness=t.value,t=e.next();break;case 40:n.textHeight=t.value,t=e.next();break;case 41:n.xScale=t.value,t=e.next();break;case 50:n.rotation=t.value,t=e.next();break;case 51:n.obliqueAngle=t.value,t=e.next();break;case 70:n.invisible=!!(1&t.value),n.constant=!!(2&t.value),n.verificationRequired=!!(4&t.value),n.preset=!!(8&t.value),t=e.next();break;case 71:n.backwards=!!(2&t.value),n.mirrored=!!(4&t.value),t=e.next();break;case 72:n.horizontalJustification=t.value,t=e.next();break;case 73:n.fieldLength=t.value,t=e.next();break;case 74:n.verticalJustification=t.value,t=e.next();break;case 100:t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class Hx{constructor(){gh(this,"ForEntityName","CIRCLE")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.center=Lx(e),t=e.lastReadGroup;break;case 40:n.radius=t.value,t=e.next();break;case 50:n.startAngle=Math.PI/180*t.value,t=e.next();break;case 51:const r=Math.PI/180*t.value;r<n.startAngle?n.angleLength=r+2*Math.PI-n.startAngle:n.angleLength=r-n.startAngle,n.endAngle=r,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class qx{constructor(){gh(this,"ForEntityName","DIMENSION")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 2:n.block=t.value,t=e.next();break;case 3:n.dimStyleName=t.value,t=e.next();break;case 10:n.anchorPoint=Lx(e),t=e.lastReadGroup;break;case 11:n.middleOfText=Lx(e),t=e.lastReadGroup;break;case 12:n.insertionPoint=Lx(e),t=e.lastReadGroup;break;case 13:n.linearOrAngularPoint1=Lx(e),t=e.lastReadGroup;break;case 14:n.linearOrAngularPoint2=Lx(e),t=e.lastReadGroup;break;case 15:n.diameterOrRadiusPoint=Lx(e),t=e.lastReadGroup;break;case 16:n.arcPoint=Lx(e),t=e.lastReadGroup;break;case 70:n.dimensionType=t.value,t=e.next();break;case 71:n.attachmentPoint=t.value,t=e.next();break;case 42:n.actualMeasurement=t.value,t=e.next();break;case 1:n.text=t.value,t=e.next();break;case 50:n.angle=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class Wx{constructor(){gh(this,"ForEntityName","MULTILEADER")}parseEntity(e,t){const n={type:t.value};function r(){for(;!e.isEOF();)switch(t.code){case 40:n.contextData.contentScale=t.value,t=e.next();break;case 10:n.contextData.contentBasePosition=Lx(e),t=e.lastReadGroup;break;case 145:n.contextData.landingGap=t.value,t=e.next();break;case 290:n.contextData.hasMText=t.value,t=e.next();break;case 304:n.contextData.defaultTextContents=t.value,t=e.next();break;case 11:n.contextData.textNormalDirection=Lx(e),t=e.lastReadGroup;break;case 12:n.contextData.textLocation=Lx(e),t=e.lastReadGroup;break;case 13:n.contextData.textDirection=Lx(e),t=e.lastReadGroup;break;case 140:n.contextData.arrowHeadSize=t.value,t=e.next();break;case 41:n.contextData.textHeight=t.value,t=e.next();break;case 42:n.contextData.textRotation=t.value,t=e.next();break;case 43:n.contextData.textWidth=t.value,t=e.next();break;case 44:default:t=e.next();break;case 45:n.contextData.textLineSpacingFactor=t.value,t=e.next();break;case 90:n.contextData.textColor=t.value,t=e.next();break;case 170:n.contextData.textLineSpacingStyle=t.value,t=e.next();break;case 171:n.contextData.textAttachment=t.value,t=e.next();break;case 172:n.contextData.textFlowDirection=t.value,t=e.next();break;case 141:n.contextData.textBackgroundScaleFactor=t.value,t=e.next();break;case 92:n.contextData.textBackgroundTransparency=t.value,t=e.next();break;case 291:n.contextData.textBackgroundColorOn=t.value,t=e.next();break;case 292:n.contextData.textBackgroundFillOn=t.value,t=e.next();break;case 293:n.contextData.textUseAutoHeight=t.value,t=e.next();break;case 173:n.contextData.textColumnType=t.value,t=e.next();break;case 142:n.contextData.textColumnWidth=t.value,t=e.next();break;case 143:n.contextData.textColumnGutterWidth=t.value,t=e.next();break;case 144:n.contextData.textColumnHeight=t.value,t=e.next();break;case 295:n.contextData.textUseWordBreak=t.value,t=e.next();break;case 296:n.contextData.hasBlock=t.value,t=e.next();break;case 341:n.contextData.blockContentId=t.value,t=e.next();break;case 14:n.contextData.blockContentNormalDirection=Lx(e),t=e.lastReadGroup;break;case 15:n.contextData.blockContentPosition=Lx(e),t=e.lastReadGroup;break;case 16:n.contextData.blockContentScale=t.value,t=e.next();break;case 46:n.contextData.blockContentRotation=t.value,t=e.next();break;case 93:n.contextData.blockContentColor=t.value,t=e.next();break;case 47:n.contextData.blockTransformationMatrix=kx(e,47),t=e.lastReadGroup;break;case 110:n.contextData.planeOriginPoint=Lx(e),t=e.lastReadGroup;break;case 111:n.contextData.planeXAxisDirection=Lx(e),t=e.lastReadGroup;break;case 112:n.contextData.planeYAxisDirection=Lx(e),t=e.lastReadGroup;break;case 297:n.contextData.planeNormalReversed=t.value,t=e.next();break;case 301:return;case 302:i(),t=e.lastReadGroup}}function i(){const r={leaderLines:[]};for(n.contextData.leaders.push(r);!e.isEOF();)switch(t.code){case 290:r.hasSetLastLeaderLinePoint=t.value,t=e.next();break;case 291:r.hasSetDoglegVector=t.value,t=e.next();break;case 10:r.lastLeaderLinePoint=Lx(e),t=e.lastReadGroup;break;case 11:r.doglegVector=Lx(e),t=e.lastReadGroup;break;case 90:r.leaderBranchIndex=t.value,t=e.next();break;case 40:r.doglegLength=t.value,t=e.next();break;case 303:return;case 304:s(),t=e.lastReadGroup;break;default:t=e.next()}}function s(){const r={vertices:[[]]};for(n.contextData.leaders[n.contextData.leaders.length-1].leaderLines.push(r);!e.isEOF();)switch(t.code){case 10:r.vertices[0].push(Lx(e)),t=e.lastReadGroup;break;case 305:return;default:t=e.next()}}return n.contextData={leaders:[]},t=e.next(),function(){for(;!e.isEOF();)switch(t.code){case 0:return;case 340:n.leaderStyleId=t.value,t=e.next();break;case 170:n.leaderLineType=t.value,t=e.next();break;case 91:n.leaderLineColor=t.value,t=e.next();break;case 341:n.leaderLineTypeId=t.value,t=e.next();break;case 171:n.leaderLineWeight=t.value,t=e.next();break;case 41:n.doglegLength=t.value,t=e.next();break;case 290:n.enableLanding=t.value,t=e.next();break;case 291:n.enableDogLeg=t.value,t=e.next();break;case 342:n.arrowHeadId=t.value,t=e.next();break;case 42:n.arrowHeadSize=t.value,t=e.next();break;case 172:n.contentType=t.value,t=e.next();break;case 173:case 95:n.textLeftAttachmentType=t.value,t=e.next();break;case 174:n.textAngleType=t.value,t=e.next();break;case 175:n.textAlignmentType=t.value,t=e.next();break;case 343:n.textStyleId=t.value,t=e.next();break;case 92:n.textColor=t.value,t=e.next();break;case 292:n.enableFrameText=t.value,t=e.next();break;case 344:n.blockContentId=t.value,t=e.next();break;case 93:n.blockContentColor=t.value,t=e.next();break;case 10:n.blockContentScale=Lx(e),t=e.lastReadGroup;break;case 43:n.blockContentRotation=t.value,t=e.next();break;case 176:n.blockContentConnectionType=t.value,t=e.next();break;case 293:n.enableAnotationScale=t.value,t=e.next();break;case 94:n.arrowHeadIndex=t.value,t=e.next();break;case 177:n.blockAttributeIndex=t.value,t=e.next();break;case 44:n.blockAttributeWidth=t.value,t=e.next();break;case 302:n.blockAttributeTextString=t.value,t=e.next();break;case 294:n.textDirectionNegative=t.value,t=e.next();break;case 178:n.textAlignInIPE=t.value,t=e.next();break;case 179:n.textAttachmentPoint=t.value,t=e.next();break;case 271:n.textAttachmentDirectionMText=t.value,t=e.next();break;case 272:n.textAttachmentDirectionBottom=t.value,t=e.next();break;case 273:n.textAttachmentDirectionTop=t.value,t=e.next();break;case 300:r(),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}}(),n}}class Yx{constructor(){gh(this,"ForEntityName","ELLIPSE")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.center=Lx(e),t=e.lastReadGroup;break;case 11:n.majorAxisEndPoint=Lx(e),t=e.lastReadGroup;break;case 40:n.axisRatio=t.value,t=e.next();break;case 41:n.startAngle=t.value,t=e.next();break;case 42:n.endAngle=t.value,t=e.next();break;case 210:n.extrusionDirection=Lx(e),t=e.lastReadGroup;break;case 2:n.name=t.value,t=e.next();break;default:Fx(n,t),t=e.next()}return n}}let Xx,$x,Kx,Zx,Jx;!function(e){e[e.Default=0]="Default",e[e.External=1]="External",e[e.Polyline=2]="Polyline",e[e.Derived=4]="Derived",e[e.Textbox=8]="Textbox",e[e.Outermost=16]="Outermost",e[e.MaxFlags=31]="MaxFlags"}(Xx||(Xx={})),function(e){e[e.Polyline=0]="Polyline",e[e.Line=1]="Line",e[e.Arc=2]="Arc",e[e.Ellipse=3]="Ellipse",e[e.Spline=4]="Spline"}($x||($x={}));class Qx{constructor(e){gh(this,"type",void 0),this.type=e}}class eT extends Qx{constructor(){super($x.Polyline),gh(this,"points",[]),gh(this,"isClosed",!0)}}class tT extends Qx{constructor(){super($x.Line),gh(this,"startPoint",void 0),gh(this,"endPoint",void 0),this.startPoint={x:0,y:0,z:0},this.endPoint={x:0,y:0,z:0}}}class nT extends Qx{constructor(){super($x.Arc),gh(this,"center",void 0),gh(this,"radius",void 0),gh(this,"startAngle",void 0),gh(this,"endAngle",void 0),gh(this,"bCounterclockwise",void 0),this.center={x:0,y:0,z:0},this.radius=0,this.startAngle=0,this.endAngle=0,this.bCounterclockwise=!1}}class rT extends Qx{constructor(){super($x.Ellipse),gh(this,"center",void 0),gh(this,"majorAxisEndPoint",void 0),gh(this,"minorRatio",void 0),gh(this,"startAngle",void 0),gh(this,"endAngle",void 0),gh(this,"bCounterclockwise",void 0),this.center={x:0,y:0,z:0},this.majorAxisEndPoint={x:0,y:0,z:0},this.minorRatio=0,this.startAngle=0,this.endAngle=0,this.bCounterclockwise=!1}}class iT extends Qx{constructor(){super($x.Spline),gh(this,"controlPoints",void 0),gh(this,"numControlPoints",void 0),gh(this,"knotValues",void 0),gh(this,"numKnots",void 0),gh(this,"bPeriodic",void 0),gh(this,"bRational",void 0),gh(this,"degreeOfSplineCurve",void 0),this.controlPoints=[],this.numControlPoints=0,this.knotValues=[],this.numKnots=0,this.bPeriodic=!1,this.bRational=!1,this.degreeOfSplineCurve=0}}!function(e){e[e.Normal=0]="Normal",e[e.Outer=1]="Outer",e[e.Ignore=2]="Ignore"}(Kx||(Kx={})),function(e){e[e.UserDefined=0]="UserDefined",e[e.Predefined=1]="Predefined",e[e.Custom=2]="Custom"}(Zx||(Zx={}));class sT{constructor(){gh(this,"ForEntityName","HATCH")}parseEntity(e,t){const n={type:t.value,boundaryPaths:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 2:n.patternName=t.value,t=e.next();break;case 10:n.elevationX=t.value,t=e.next();break;case 20:n.elevationY=t.value,t=e.next();break;case 30:n.elevationZ=t.value,t=e.next();break;case 41:n.patternScale=t.value,t=e.next();break;case 47:n.pixelSize=t.value,t=e.next();break;case 52:n.patternAngle=t.value,t=e.next();break;case 63:n.patternFillColor=t.value,t=e.next();break;case 70:n.solidFill=0!=(1&t.value),t=e.next();break;case 71:n.associativity=0!=(1&t.value),t=e.next();break;case 73:n.annotatedBoundary=0!=(1&t.value),t=e.next();break;case 75:n.style=t.value,t=e.next();break;case 76:n.patternType=t.value,t=e.next();break;case 78:n.patternLines=cT(t.value,e),t=e.lastReadGroup;break;case 91:n.boundaryPathsCount=t.value,n.boundaryPaths=lT(n.boundaryPathsCount,e),t=e.lastReadGroup;break;case 98:n.seedPointsCount=t.value,t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 450:n.isGradientColor=1===t.value,t=e.next();break;case 451:case 452:case 460:case 461:case 462:case 463:case 470:t=e.next();break;case 453:n.gradientColorCount=t.value,n.gradientColors=uT(n.gradientColorCount,e),t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}function aT(e){const t=new eT;let n=e.next();const r=0!==n.value;n=e.next(),t.isClosed=0!==n.value,n=e.next();const i=n.value;n=e.next();for(let s=0;s<i;s++){const i=Lx(e);n=e.lastReadGroup,r&&(i.bulge=n.value,n=e.next()),t.points.push(i)}n=e.lastReadGroup,console.assert(97===n.code,"The reference count code 97 was expected.");const s=n.value;n=e.next();for(let t=0;t<s;t++)console.assert(330===n.code,"The reference handle code 330 was expected."),n=e.next();return{edges:[t],pathTypeFlag:-1}}function oT(e,t){const n=[];let r=t.next();for(;n.length<e;){if(72!==r.code){r=t.next();continue}switch(r.value){case $x.Line:{r=t.next();const e=new tT;e.startPoint=Lx(t),e.endPoint=Lx(t),r=t.lastReadGroup,n.push(e);break}case $x.Arc:{r=t.next();const e=new nT;e.center=Lx(t),r=t.lastReadGroup,e.radius=r.value,r=t.next(),e.startAngle=r.value,r=t.next(),e.endAngle=r.value,r=t.next(),e.bCounterclockwise=0!==r.value,r=t.next(),n.push(e);break}case $x.Ellipse:{r=t.next();const e=new rT;e.center=Lx(t),e.majorAxisEndPoint=Lx(t),r=t.lastReadGroup,e.minorRatio=r.value,r=t.next(),e.startAngle=r.value,r=t.next(),e.endAngle=r.value,r=t.next(),e.bCounterclockwise=0!==r.value,r=t.next(),n.push(e);break}case $x.Spline:{r=t.next();const e=new iT;e.degreeOfSplineCurve=r.value,r=t.next(),e.bRational=0!==r.value,r=t.next(),e.bPeriodic=0!==r.value,r=t.next(),e.numKnots=r.value,r=t.next(),e.numControlPoints=r.value,r=t.next();for(let n=0;n<e.numKnots;n++)e.knotValues.push(r.value),r=t.next();for(let n=0;n<e.numControlPoints;n++){const n=r.value;r=t.next();const i=r.value;let s=1;r=t.next(),42===r.code&&(s=r.value,r=t.next()),e.controlPoints.push({x:n,y:i,z:s})}n.push(e);break}}}r=t.lastReadGroup,console.assert(97===r.code,"The reference count code 97 was expected.");const i=r.value;r=t.next();for(let e=0;e<i;e++)console.assert(330===r.code,"The reference handle code 330 was expected."),r=t.next();return{edges:n,pathTypeFlag:-1}}function lT(e,t){const n=[];let r=-1,i=t.next();for(;n.length<e;){let e;switch(i.code){case 92:if(r=i.value,r&Xx.Polyline){if(e=aT(t),!e)throw new Error("[Hatch] Failed to parse hatch polyline boundary path !");e.pathTypeFlag=r,n.push(e),i=t.lastReadGroup}else i=t.next();break;case 93:e=oT(i.value,t),e.pathTypeFlag=r,n.push(e),i=t.lastReadGroup;break;default:i=t.next()}}return n}function cT(e,t){if(e<=0)return;const n=[];let r=t.next();for(let i=0;i<e;i++){let e=0;const i={x:0,y:0},s={x:0,y:0};let a=-1;const o=[];for(;!t.isEOF()&&0!==r.code;){let n=!1;switch(r.code){case 53:e=r.value;break;case 43:i.x=r.value;break;case 44:i.y=r.value;break;case 45:s.x=r.value;break;case 46:s.y=r.value;break;case 79:a=r.value;break;case 49:o.push(r.value);break;default:n=!0}if(r=t.next(),n||o.length===a)break}a>=0&&n.push({angle:e,origin:i,delta:s,dashPattern:o})}return n}function uT(e,t){const n=[];let r=t.next();for(;n.length<e;)switch(r.code){case 63:default:r=t.next();break;case 421:n.push(r.value),r=t.next()}return n}class hT{constructor(){gh(this,"ForEntityName","INSERT")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 2:n.block=t.value,t=e.next();break;case 66:n.attributesFollow=0!=t.value,t=e.next();break;case 41:n.xScale=t.value,t=e.next();break;case 42:n.yScale=t.value,t=e.next();break;case 43:n.zScale=t.value,t=e.next();break;case 10:n.position=Lx(e),t=e.lastReadGroup;break;case 50:n.rotation=t.value,t=e.next();break;case 70:n.columnCount=t.value,t=e.next();break;case 71:n.rowCount=t.value,t=e.next();break;case 44:n.columnSpacing=t.value,t=e.next();break;case 45:n.rowSpacing=t.value,t=e.next();break;case 210:n.extrusionDirection=Lx(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class pT{constructor(){gh(this,"ForEntityName","LEADER")}parseEntity(e,t){const n={type:t.value,arrowFlag:1,vertices:[]};t=e.next();let r=!1;for(;!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.vertices.push(Lx(e)),t=e.lastReadGroup;break;case 3:n.dimensionStyle=t.value,t=e.next();break;case 40:n.textHeight=t.value,t=e.next();break;case 41:n.textWidth=t.value,t=e.next();break;case 71:n.arrowFlag=t.value,t=e.next();break;case 72:n.pathType=t.value,t=e.next();break;case 73:n.creationFlag=t.value,t=e.next();break;case 74:n.direction=t.value,t=e.next();break;case 75:n.hasHookline=1===t.value,t=e.next();break;case 1001:r="ACAD"===t.value,t=e.next();break;case 1070:if(r){const r=dT(t.value);r&&(1005!=(t=e.next()).code&&1040!=t.code&&1070!=t.code||("DIMLDRBLK"===r&&(n.arrowHeadBlockHandle=t.value),"DIMASZ"===r&&(n.arrowHeight=t.value),"DIMSCALE"===r&&(n.arrowHeadScale=t.value),"DIMCLRD"===r&&t.value>0&&(n.colorIndex=t.value,n.color=Nx(Math.abs(t.value)))))}t=e.next();break;default:Fx(n,t),t=e.next()}return n}}function dT(e){switch(e){case 40:return"DIMSCALE";case 41:return"DIMASZ";case 42:return"DIMEXO";case 44:return"DIMEXE";case 75:return"DIMSE1";case 76:return"DIMSE2";case 77:return"DIMTAD";case 140:return"DIMTXT";case 144:return"DIMLFAC";case 147:return"DIMGAP";case 176:return"DIMCLRD";case 178:return"DIMCLRT";case 271:return"DIMDEC";case 341:return"DIMLDRBLK";default:return null}}class mT{constructor(){gh(this,"ForEntityName","LINE")}parseEntity(e,t){const n={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.vertices.unshift(Lx(e)),t=e.lastReadGroup;break;case 11:n.vertices.push(Lx(e)),t=e.lastReadGroup;break;case 210:n.extrusionDirection=Lx(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class fT{constructor(){gh(this,"ForEntityName","LWPOLYLINE")}parseEntity(e,t){const n={type:t.value,vertices:[]};let r=0;for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 38:n.elevation=t.value,t=e.next();break;case 39:n.thickness=t.value,t=e.next();break;case 70:n.shape=1==(1&t.value),n.hasContinuousLinetypePattern=128==(128&t.value),t=e.next();break;case 90:r=t.value,t=e.next();break;case 10:n.vertices.push(...gT(r,e)),t=e.lastReadGroup;break;case 43:0!==t.value&&(n.constantWidth=t.value),t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}function gT(e,t){if(!e||e<=0)throw Error("n must be greater than 0 verticies");const n=[];let r=!1,i=!1,s=t.lastReadGroup;const a={};for(;!t.isEOF()&&0!==s.code&&!i;)switch(s.code){case 10:if(r){i=!0;continue}a.x=s.value,r=!0,s=t.next();break;case 20:a.y=s.value,s=t.next();break;case 30:a.z=s.value,s=t.next();break;case 40:a.startWidth=s.value,s=t.next();break;case 41:a.endWidth=s.value,s=t.next();break;case 42:0!=s.value&&(a.bulge=s.value),s=t.next();break;default:return r&&n.push(a),n}return n.push(a),r=!1,i=!1,n}class _T{constructor(){gh(this,"ForEntityName","MTEXT")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 3:case 1:n.text?n.text+=t.value:n.text=t.value,t=e.next();break;case 10:n.position=Lx(e),t=e.lastReadGroup;break;case 7:n.textStyle=t.value,t=e.next();break;case 44:n.lineSpaceFactor=t.value,t=e.next();break;case 11:n.directionVector=Lx(e),t=e.lastReadGroup;break;case 40:n.height=t.value,t=e.next();break;case 41:n.width=t.value,t=e.next();break;case 50:n.rotation=t.value,t=e.next();break;case 71:n.attachmentPoint=t.value,t=e.next();break;case 72:n.drawingDirection=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class vT{constructor(){gh(this,"ForEntityName","OLE2FRAME")}parseEntity(e,t){const n={type:t.value,binaryData:""};for(t=e.next();"OLE"!==t.value&&0!==t.code;)switch(t.code){case 3:n.documentType=t.value,t=e.next();break;case 70:n.version=t.value,t=e.next();break;case 10:n.leftUpX=t.value,t=e.next();break;case 20:n.leftUpY=t.value,t=e.next();break;case 30:n.leftUpZ=t.value,t=e.next();break;case 11:n.rightDownX=t.value,t=e.next();break;case 21:n.rightDownY=t.value,t=e.next();break;case 31:n.rightDownZ=t.value,t=e.next();break;case 90:n.lengthOfBinaryData=t.value,t=e.next();break;case 310:n.binaryData+=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class yT{constructor(){gh(this,"ForEntityName","POINT")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.position=Lx(e),t=e.lastReadGroup;break;case 39:n.thickness=t.value,t=e.next();break;case 210:n.extrusionDirection=Lx(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class bT{constructor(){gh(this,"ForEntityName","VERTEX")}parseEntity(e,t){var n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.x=t.value,t=e.next();break;case 20:n.y=t.value,t=e.next();break;case 30:n.z=t.value,t=e.next();break;case 40:case 41:case 50:t=e.next();break;case 42:0!=t.value&&(n.bulge=t.value),t=e.next();break;case 70:n.curveFittingVertex=0!=(1&t.value),n.curveFitTangent=0!=(2&t.value),n.splineVertex=0!=(8&t.value),n.splineControlPoint=0!=(16&t.value),n.threeDPolylineVertex=0!=(32&t.value),n.threeDPolylineMesh=0!=(64&t.value),n.polyfaceMeshVertex=0!=(128&t.value),t=e.next();break;case 71:n.faceA=t.value,t=e.next();break;case 72:n.faceB=t.value,t=e.next();break;case 73:n.faceC=t.value,t=e.next();break;case 74:n.faceD=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class xT{constructor(){gh(this,"ForEntityName","POLYLINE")}parseEntity(e,t){var n={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:case 20:case 30:case 40:case 41:case 71:case 72:case 73:case 74:case 75:t=e.next();break;case 39:t=e.next(),n.thickness=t.value;break;case 70:n.shape=0!=(1&t.value),n.includesCurveFitVertices=0!=(2&t.value),n.includesSplineFitVertices=0!=(4&t.value),n.is3dPolyline=0!=(8&t.value),n.is3dPolygonMesh=0!=(16&t.value),n.is3dPolygonMeshClosed=0!=(32&t.value),n.isPolyfaceMesh=0!=(64&t.value),n.hasContinuousLinetypePattern=0!=(128&t.value),t=e.next();break;case 210:n.extrusionDirection=Lx(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n.vertices=function(e,t){const n=new bT,r=[];for(;!e.isEOF();)if(0===t.code)if("VERTEX"===t.value)r.push(n.parseEntity(e,t)),t=e.lastReadGroup;else if("SEQEND"===t.value){TT(e,t);break}return r}(e,t),n}}function TT(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)if(101===t.code)for(;0!=t.code;)t=e.next();else Fx(n,t),t=e.next();return n}class wT{constructor(){gh(this,"ForEntityName","RAY")}parseEntity(e,t){const n={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.vertices.unshift(Lx(e)),t=e.lastReadGroup;break;case 11:n.directionVector=Lx(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class ET{constructor(){gh(this,"ForEntityName","SEQEND")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)if(-2===t.code);else Fx(n,t),t=e.next();return n}}class ST{constructor(){gh(this,"ForEntityName","SOLID")}parseEntity(e,t){const n={type:t.value,points:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.points[0]=Lx(e),t=e.lastReadGroup;break;case 11:n.points[1]=Lx(e),t=e.lastReadGroup;break;case 12:n.points[2]=Lx(e),t=e.lastReadGroup;break;case 13:n.points[3]=Lx(e),t=e.lastReadGroup;break;case 210:n.extrusionDirection=Lx(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class IT{constructor(){gh(this,"ForEntityName","SPLINE")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.controlPoints||(n.controlPoints=[]),n.controlPoints.push(Lx(e)),t=e.lastReadGroup;break;case 11:n.fitPoints||(n.fitPoints=[]),n.fitPoints.push(Lx(e)),t=e.lastReadGroup;break;case 12:n.startTangent=Lx(e),t=e.lastReadGroup;break;case 13:n.endTangent=Lx(e),t=e.lastReadGroup;break;case 40:n.knotValues||(n.knotValues=[]),n.knotValues.push(t.value),t=e.next();break;case 70:0!=(1&t.value)&&(n.closed=!0),0!=(2&t.value)&&(n.periodic=!0),0!=(4&t.value)&&(n.rational=!0),0!=(8&t.value)&&(n.planar=!0),0!=(16&t.value)&&(n.planar=!0,n.linear=!0),t=e.next();break;case 71:n.degreeOfSplineCurve=t.value,t=e.next();break;case 72:n.numberOfKnots=t.value,t=e.next();break;case 73:n.numberOfControlPoints=t.value,t=e.next();break;case 74:n.numberOfFitPoints=t.value,t=e.next();break;case 210:n.normalVector=Lx(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class MT{constructor(){gh(this,"ForEntityName","TEXT")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.startPoint=Lx(e),t=e.lastReadGroup;break;case 11:n.endPoint=Lx(e),t=e.lastReadGroup;break;case 40:n.textHeight=t.value,t=e.next();break;case 41:n.xScale=t.value,t=e.next();break;case 50:n.rotation=t.value,t=e.next();break;case 1:n.text=t.value,t=e.next();break;case 72:n.halign=t.value,t=e.next();break;case 73:n.valign=t.value,t=e.next();break;case 7:n.textStyle=t.value,t=e.next();break;case 71:n.mirrored=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class AT{constructor(){gh(this,"ForEntityName","VIEWPORT")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 68:n.viewportStatus=t.value,t=e.next();break;case 40:n.width_paperSpace=t.value,t=e.next();break;case 41:n.height_paperSpace=t.value,t=e.next();break;case 69:n.viewportId=t.value,t=e.next();break;case 10:n.centerPoint=Lx(e),t=e.lastReadGroup;break;case 12:n.centerPoint_dcs=Lx(e),t=e.lastReadGroup;break;case 13:n.snapBasePoint_dcs=Lx(e),t=e.lastReadGroup;break;case 14:n.snapSpacing_dcs=Lx(e),t=e.lastReadGroup;break;case 15:n.gridSpacing_dcs=Lx(e),t=e.lastReadGroup;break;case 16:n.viewDirection=Lx(e),t=e.lastReadGroup;break;case 17:n.viewTarget=Lx(e),t=e.lastReadGroup;break;case 42:n.perspectiveLens=t.value,t=e.next();break;case 43:n.frontClippingPlaneZ=t.value,t=e.next();break;case 44:n.backClippingPlaneZ=t.value,t=e.next();break;case 45:n.viewHeight=t.value,t=e.next();break;case 50:n.snapAngle=t.value,t=e.next();break;case 51:n.viewTwistAngle=t.value,t=e.next();break;case 72:n.circleZoomPercent=t.value,t=e.next();break;case 331:n.frozenLayerHandles=n.frozenLayerHandles||[],n.frozenLayerHandles.push(t.value),t=e.next();break;case 90:n.viewportStatusFlags=t.value,t=e.next();break;case 340:n.viewportClippingBoundaryhandleId=t.value,t=e.next();break;case 1:n.plotStyleSheetName=t.value,t=e.next();break;case 281:n.renderMode=t.value,t=e.next();break;case 71:n.viewportFlag_ucs=t.value,t=e.next();break;case 74:n.ucsIcon=t.value,t=e.next();break;case 110:n.ucsOrigin=Lx(e),t=e.lastReadGroup;break;case 111:n.ucsXAxis=Lx(e),t=e.lastReadGroup;break;case 112:n.ucsYAxis=Lx(e),t=e.lastReadGroup;break;case 345:n.ucsTableRecordHandle=t.value,t=e.next();break;case 346:n.baseUcsTableRecordHandle=t.value,t=e.next();break;case 79:n.orthographicType=t.value,t=e.next();break;case 146:n.elevation=t.value,t=e.next();break;case 170:n.shadePlotMode=t.value,t=e.next();break;case 61:n.frequency=t.value,t=e.next();break;case 292:n.lightingFlag=t.value,t=e.next();break;case 282:n.lightingType=t.value,t=e.next();break;case 141:n.viewBrightness=t.value,t=e.next();break;case 142:n.viewContrast=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class RT{constructor(){gh(this,"ForEntityName","XLINE")}parseEntity(e,t){const n={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:n.vertices.unshift(Lx(e)),t=e.lastReadGroup;break;case 11:n.directionVector=Lx(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class DT{constructor(){gh(this,"ForObjectName","LAYOUT")}parseObject(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 100:t=e.next();break;case 1:n.layoutName=t.value,t=e.next();break;case 70:n.flag=t.value,t=e.next();break;case 71:n.tabOrder=t.value,t=e.next();break;case 76:n.orthographicType=t.value,t=e.next();break;case 10:n.minLimit=Lx(e),t=e.lastReadGroup;break;case 11:n.maxLimit=Lx(e),t=e.lastReadGroup;break;case 12:n.basePoint=Lx(e),t=e.lastReadGroup;break;case 13:n.origin=Lx(e),t=e.lastReadGroup;break;case 14:n.minExtent=Lx(e),t=e.lastReadGroup;break;case 15:n.maxExtent=Lx(e),t=e.lastReadGroup;break;case 16:n.XAxis=Lx(e),t=e.lastReadGroup;break;case 17:n.YAxis=Lx(e),t=e.lastReadGroup;break;case 146:n.elevation=t.value,t=e.next();break;case 331:n.viewportHandle=t.value,t=e.next();break;default:Ux(n,t),t=e.next()}return n.blockTableHandle=n.ownerHandle,n}}class CT{constructor(){gh(this,"ForObjectName","SORTENTSTABLE")}parseObject(e,t){const n={type:t.value};let r=!1;n.sortEntsObject={},n.sortEntsObject.entityHandles=[];let i=[];for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 5:r?(i.push(t.value),n.sortEntsObject.entityHandles.push(i),i=[]):n.handle=t.value,t=e.next();break;case 100:t=e.next(),r=!0;break;case 102:t=e.next();break;case 330:r?n.sortEntsObject.ownerHandle=t.value:n.ownerHandle=t.value,t=e.next();break;case 331:i.push(t.value),t=e.next();break;default:Ux(n,t),t=e.next()}return n}}class OT{constructor(){gh(this,"ForObjectName","SPATIAL_FILTER")}parseObject(e,t){const n={type:t.value};let r,i;for(n.vertices=[],t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 11:n.origin=Lx(e),t=e.lastReadGroup;break;case 70:n.numberOfPointsOnClipBoundary=t.value,2===n.numberOfPointsOnClipBoundary?(t=e.next(),r=Lx(e),t=e.lastReadGroup,i=Lx(e),t=e.lastReadGroup,n.vertices.push(r,{x:i.x,y:r.y},i,{x:r.x,y:i.y},r)):n.numberOfPointsOnClipBoundary>2?(n.vertices=PT(n.numberOfPointsOnClipBoundary,e),t=e.lastReadGroup):t=e.next();break;case 71:n.clipBoundaryVisible=1===t.value,t=e.next();break;case 72:n.frontClippingPlaneFlag=1===t.value,t=e.next(),n.frontClippingPlaneFlag&&40===t.code&&(n.frontClippingPlaneDistance=t.value,t=e.next());break;case 73:n.backClippingPlaneFlag=1===t.value,t=e.next(),n.backClippingPlaneFlag&&41===t.code&&(n.backClippingPlaneDistance=t.value,t=e.next());break;case 100:case 102:t=e.next();break;case 210:n.extrusionDirectionX=t.value,t=e.next();break;case 220:n.extrusionDirectionY=t.value,t=e.next();break;case 230:n.extrusionDirectionZ=t.value,t=e.next();break;case 40:n.invertBlockMatrix=NT(e,40),n.matrix=NT(e,40),t=e.lastReadGroup;break;default:Ux(n,t),t=e.next()}return n}}function PT(e,t){t.next();const n=[];for(;n.length<e;)n.push(Lx(t));return n}function NT(e,t){let n=e.lastReadGroup;const r=[];for(let i=0;i<12;i++){if(n.code!==t)throw new Error(`Expected code for matrix value to be ${t} but got ${n.code}`);r.push(n.value),n=e.next()}return r}!function(e){e[e.NotApplicable=0]="NotApplicable",e[e.KeepExisting=1]="KeepExisting",e[e.UseClone=2]="UseClone",e[e.XrefName=3]="XrefName",e[e.Name=4]="Name",e[e.UnmangleName=5]="UnmangleName"}(Jx||(Jx={}));class LT{constructor(){gh(this,"ForObjectName","DICTIONARY")}parseObject(e,t){const n={type:t.value},r=[],i=[];for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 280:n.isHardOwner=1===t.value,t=e.next();break;case 281:n.cloningFlag=t.value,t=e.next();break;case 3:r.push(t.value),t=e.next();break;case 350:case 360:i.push(t.value),t=e.next();break;case 100:case 102:t=e.next();break;default:Ux(n,t),t=e.next()}if(r.length!==i.length)throw new Error("The number of Dictionary entries does not match !");return n.entries={},ge()(r).call(r,((e,t)=>{u_()(n)[i[t]]=e})),n}}var kT=n(15514),FT=n.n(kT);class UT{constructor(e,t){gh(this,"endian",void 0),gh(this,"position",void 0),gh(this,"data",void 0),gh(this,"decoder",void 0),this.endian=t&&"big"===t?"big":"little",this.position=0,this.data=new DataView(e)}readAsciiString(e){if(this.data.byteLength<this.position+e)throw"range error";let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(this.data.getInt8(this.position+n));return this.position+=e,t}readUtf8String(e){const t=this.readBytes(e);return this.decoder||(this.decoder=new TextDecoder("utf-8")),this.decoder.decode(t)}readBytes(e=1){if(this.data.byteLength<this.position+e)throw"range error";const t=new Uint8Array(e);for(let n=0;n<e;n++)t[n]=this.data.getUint8(this.position+n);return this.position+=e,t}readUint8(){if(this.data.byteLength<this.position+1)throw"range error";const e=this.data.getUint8(this.position);return this.position+=1,e}readInt8(){if(this.data.byteLength<this.position+1)throw"range error";const e=this.data.getInt8(this.position);return this.position+=1,e}readUint16(){if(this.data.byteLength<this.position+2)throw"range error";const e=this.data.getUint16(this.position,"little"===this.endian);return this.position+=2,e}readInt16(){if(this.data.byteLength<this.position+2)throw"range error";const e=this.data.getInt16(this.position,"little"===this.endian);return this.position+=2,e}readUint32(){if(this.data.byteLength<this.position+4)throw"range error";const e=this.data.getUint32(this.position,"little"===this.endian);return this.position+=4,e}readInt32(){if(this.data.byteLength<this.position+4)throw"range error";const e=this.data.getInt32(this.position,"little"===this.endian);return this.position+=4,e}readFloat32(){if(this.data.byteLength<this.position+4)throw"range error";const e=this.data.getFloat32(this.position,"little"===this.endian);return this.position+=4,e}readFloat64(){if(this.data.byteLength<this.position+8)throw"range error";const e=this.data.getFloat64(this.position,"little"===this.endian);return this.position+=8,e}readInt64(){if(this.data.byteLength<this.position+8)throw"range error";const e=FT().DataViewGetBigInt64(this.data,this.position,"little"===this.endian);return this.position+=8,e}readUint64(){if(this.data.byteLength<this.position+8)throw"range error";const e=FT().DataViewGetBigUint64(this.data,this.position,"little"===this.endian);return this.position+=8,e}getPosition(){return this.position}setPosition(e){if(this.data.byteLength<e)throw"range error";this.position=e}IsEnd(){return this.position===this.data.byteLength-1}}class BT extends Cx{constructor(e){super(),gh(this,"reader",void 0),gh(this,"decoder",void 0),this.reader=new UT(e);const t=this.reader.readBytes(22);let n="";for(let e=0;e<18;e++)n+=String.fromCharCode(t[e]);if("AutoCAD Binary DXF"!=n)throw new Error("Invalid DXF file")}next(){if(!this.hasNext())throw this.eof?new Error("Cannot call 'next' after EOF group has been read"):new Error("Unexpected end of input: EOF group not read before end of file.");const e={code:this.reader.readInt16()};return e.value=this.parseGroupValue(e.code),0===e.code&&"EOF"===e.value&&(this.eof=!0),this.lastReadGroup=e,e}hasNext(){return!this.eof&&!this.reader.IsEnd()}isEOF(){return this.eof}parseGroupValue(e){if(e>=0&&e<=9)return this.readNullTerminatedString();if(e>=10&&e<=59)return this.reader.readFloat64();if(e>=60&&e<=79)return this.reader.readInt16();if(e>=90&&e<=99)return this.reader.readInt32();if(e>=100&&e<=109)return this.readNullTerminatedString();if(e>=110&&e<=149)return this.reader.readFloat64();if(e>=160&&e<=169)return this.reader.readInt64();if(e>=170&&e<=179)return this.reader.readInt16();if(e>=210&&e<=239)return this.reader.readFloat64();if(e>=270&&e<=289)return this.reader.readInt16();if(e>=290&&e<=299)return this.reader.readInt8()>0;if(e>=300&&e<=309)return this.readNullTerminatedString();if(e>=310&&e<=319){return jT(this.ReadBinaryData())}if(e>=320&&e<=369)return this.readNullTerminatedString();if(e>=370&&e<=389)return this.reader.readInt16();if(e>=390&&e<=399)return this.readNullTerminatedString();if(e>=400&&e<=409)return this.reader.readInt16();if(e>=410&&e<=419)return this.readNullTerminatedString();if(e>=420&&e<=429)return this.reader.readInt32();if(e>=430&&e<=439)return this.readNullTerminatedString();if(e>=440&&e<=459)return this.reader.readInt32();if(e>=460&&e<=469)return this.reader.readFloat64();if(e>=470&&e<=481)return this.readNullTerminatedString();if(999===e)throw new Error("The comment group 999, is not used in binary DXF files at byte address!");if(1004===e){return jT(this.ReadBinaryData())}return e>=1e3&&e<=1009?this.readNullTerminatedString():e>=1010&&e<=1059?this.reader.readFloat64():e>=1060&&e<=1070?this.reader.readInt16():1071===e?this.reader.readInt32():void im.warn(`[DxfBinReader] Invalid code '${e}' at byte address ${this.reader.getPosition()}`)}readNullTerminatedString(){var e;this.decoder||(this.decoder=new TextDecoder("utf-8"));const t=[];let n=this.reader.readInt8();for(;0!==n;)t.push(n),n=this.reader.readInt8();return null===(e=this.decoder)||void 0===e?void 0:e.decode(new Int8Array(t))}ReadBinaryData(){const e=this.reader.readUint8();return this.reader.readBytes(e)}}function jT(e){return Z()(Array.prototype).call(e,(e=>{var t;return M()(t="00"+e.toString(16)).call(t,-2)})).join("")}class GT{constructor(){gh(this,"ForEntityName","REGION")}parseEntity(e,t){const n={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 70:n.modelerVersion=t.value,t=e.next();break;case 1:n.proprietaryData=t.value,t=e.next();break;case 3:n.proprietaryData+=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:Fx(n,t),t=e.next()}return n}}class zT{constructor(){gh(this,"ForObjectName","XRECORD")}parseObject(e,t){const n={type:t.value,binaryData:""};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 100:case 311:t=e.next();break;case 280:n.cloningFlag=t.value,t=e.next();break;case 310:n.binaryData+=t.value,t=e.next();break;default:Ux(n,t),t=e.next()}return n}}let VT;!function(e){e[e.None=0]="None",e[e.AnonymousBlock=1]="AnonymousBlock",e[e.NonConstantAttributeDefinitions=2]="NonConstantAttributeDefinitions",e[e.XRef=4]="XRef",e[e.XRefOverlay=8]="XRefOverlay",e[e.ExternallyDependent=16]="ExternallyDependent",e[e.ResolvedExternalReference=32]="ResolvedExternalReference",e[e.DefinitionExternalReference=64]="DefinitionExternalReference"}(VT||(VT={}));let HT={},qT={},WT={},YT={};class XT{constructor(){var e;gh(this,"_entityHandlers",{}),gh(this,"_objectHandlers",{}),gh(this,"_layoutBlocks",{}),(e=this).registerEntityHandler(Bx),e.registerEntityHandler(Gx),e.registerEntityHandler(zx),e.registerEntityHandler(Vx),e.registerEntityHandler(Hx),e.registerEntityHandler(qx),e.registerEntityHandler(Wx),e.registerEntityHandler(Yx),e.registerEntityHandler(sT),e.registerEntityHandler(hT),e.registerEntityHandler(pT),e.registerEntityHandler(mT),e.registerEntityHandler(fT),e.registerEntityHandler(_T),e.registerEntityHandler(vT),e.registerEntityHandler(yT),e.registerEntityHandler(xT),e.registerEntityHandler(GT),e.registerEntityHandler(wT),e.registerEntityHandler(ET),e.registerEntityHandler(ST),e.registerEntityHandler(IT),e.registerEntityHandler(MT),e.registerEntityHandler(AT),e.registerEntityHandler(RT),function(e){e.registerObjectHandler(LT),e.registerObjectHandler(DT),e.registerObjectHandler(CT),e.registerObjectHandler(OT),e.registerObjectHandler(zT)}(this)}parse(e){if("string"==typeof e){const t=e.split(/\r\n|\r|\n/g),n=new Ox(t);return this._parse(n)}{let t;if(function(e){const t=new UT(e).readBytes(22);let n="";for(let e=0;e<18;e++)n+=String.fromCharCode(t[e]);return"AutoCAD Binary DXF"===n}(e))t=new BT(e);else{const n=(new TextDecoder).decode(e).split(/\r\n|\r|\n/g);t=new Ox(n)}return this._parse(t)}}registerEntityHandler(e){const t=new e;this._entityHandlers[t.ForEntityName]=t}registerObjectHandler(e){const t=new e;this._objectHandlers[t.ForObjectName]=t}parseSync(e){return this.parse(e)}parseStream(e){let t="";const n=this;return new(v())(((r,i)=>{e.on("data",(e=>{t+=e})),e.on("end",(()=>{try{r(n.parse(t))}catch(e){i(e)}})),e.on("error",(e=>{i(e)}))}))}_parse(e){const t={};let n=0;if(!e.hasNext())throw Error("Empty file");const r=this;let i;function s(){let t=null,n=null;const r={};for(i=e.next();;){if($T(i,0,"ENDSEC")){t&&(r[t]=n);break}9===i.code?(t&&(r[t]=n),t=i.value):10===i.code?n={x:i.value}:20===i.code?n.y=i.value:30===i.code?n.z=i.value:n=i.value,i=e.next()}return i=e.next(),r}function a(){const t={};for(i=e.next();"EOF"!==i.value&&!$T(i,0,"ENDSEC");)if($T(i,0,"BLOCK")){im.trace("block {");const e=o();im.trace("}"),f(e),e.name?t[e.name]=e:im.error("block with handle ",e.handle," is missing a name.")}else KT(i),i=e.next();return t}function o(){const t={};for(i=e.next();"EOF"!==i.value;){switch(i.code){case 1:t.xrefPath=i.value,i=e.next();break;case 2:t.name=i.value,i=e.next();break;case 3:t.name2=i.value,i=e.next();break;case 4:t.description=i.value,i=e.next();break;case 5:t.handle=i.value,i=e.next();break;case 8:t.layer=i.value,i=e.next();break;case 10:t.position=m(i),i=e.lastReadGroup;break;case 67:t.paperSpace=!(!i.value||1!==i.value),i=e.next();break;case 70:t.blockType=i.value,i=e.next();break;case 100:i=e.next();break;case 330:t.ownerHandle=i.value,i=e.next();break;case 0:if("ENDBLK"==i.value)break;t.entities=p(!0);break;default:KT(i),i=e.next()}if($T(i,0,"ENDBLK")){i=e.next();break}}return t}function l(){const t={};for(i=e.next();"EOF"!==i.value&&!$T(i,0,"ENDSEC");)if($T(i,0,"TABLE")){i=e.next();h[i.value]?(im.trace(i.value+" Table {"),t[h[i.value].tableName]=u(i),im.trace("}")):im.trace("Unhandled Table "+i.value)}else i=e.next();return i=e.next(),t}const c="ENDTAB";function u(t){const n=h[t.value],r={};let s=0;for(i=e.next();!$T(i,0,c);)switch(i.code){case 5:r.handle=i.value,i=e.next();break;case 330:r.ownerHandle=i.value,i=e.next();break;case 100:"AcDbSymbolTable"===i.value||KT(i),i=e.next();break;case 70:s=i.value,i=e.next();break;case 0:i.value===n.dxfSymbolName?r[n.tableRecordsProperty]=n.parseTableRecords():(KT(i),i=e.next());break;default:KT(i),i=e.next()}const a=r[n.tableRecordsProperty];if(a){const e=a.constructor===Array?a.length:"object"==typeof a?Q()(a).length:void 0;s!==e&&im.warn(`[DxfParser] Parsed ${e} ${n.dxfSymbolName}s but expected ${s}`)}return i=e.next(),r}const h={VPORT:{tableRecordsProperty:"viewPorts",tableName:"viewPort",dxfSymbolName:"VPORT",parseTableRecords:function(){const t=[];let n={};for(im.trace("ViewPort {"),i=e.next();!$T(i,0,c);)switch(i.code){case 2:n.name=i.value,i=e.next();break;case 10:n.lowerLeftCorner=m(i),i=e.lastReadGroup;break;case 11:n.upperRightCorner=m(i),i=e.lastReadGroup;break;case 12:n.center=m(i),i=e.lastReadGroup;break;case 13:n.snapBasePoint=m(i),i=e.lastReadGroup;break;case 14:n.snapSpacing=m(i),i=e.lastReadGroup;break;case 15:n.gridSpacing=m(i),i=e.lastReadGroup;break;case 16:n.viewDirectionFromTarget=m(i),i=e.lastReadGroup;break;case 17:n.viewTarget=m(i),i=e.lastReadGroup;break;case 40:case 45:n.viewHeight=i.value,i=e.next();break;case 41:n.aspectRatio=i.value,i=e.next();break;case 42:n.lensLength=i.value,i=e.next();break;case 43:n.frontClippingPlane=i.value,i=e.next();break;case 44:n.backClippingPlane=i.value,i=e.next();break;case 50:n.snapRotationAngle=i.value,i=e.next();break;case 51:n.viewTwistAngle=i.value,i=e.next();break;case 79:n.orthographicType=i.value,i=e.next();break;case 110:n.ucsOrigin=m(i),i=e.lastReadGroup;break;case 111:n.ucsXAxis=m(i),i=e.lastReadGroup;break;case 112:n.ucsYAxis=m(i),i=e.lastReadGroup;break;case 281:n.renderMode=i.value,i=e.next();break;case 282:n.defaultLightingType=i.value,i=e.next();break;case 292:n.defaultLightingOn=i.value,i=e.next();break;case 330:n.ownerHandle=i.value,i=e.next();break;case 63:case 421:case 431:n.ambientColor=i.value,i=e.next();break;case 0:"VPORT"===i.value&&(im.trace("}"),t.push(n),im.trace("ViewPort {"),n={},i=e.next());break;default:KT(i),i=e.next()}return im.trace("}"),t.push(n),t}},LTYPE:{tableRecordsProperty:"lineTypes",tableName:"lineType",dxfSymbolName:"LTYPE",parseTableRecords:function(){const t={};let n={},r=0,s="",a=!1;for(im.trace("LType {"),i=e.next();!$T(i,0,"ENDTAB");)switch(i.code){case 2:n.name=i.value.toUpperCase(),s=n.name,i=e.next();break;case 3:n.description=i.value,i=e.next();break;case 9:case 44:case 45:case 46:case 70:case 75:default:i=e.next();break;case 40:n.patternLength=i.value,i=e.next();break;case 49:let o=i.value;a&&(o=Math.abs(o),a=!1),n.pattern.push(o),i=e.next();break;case 73:r=i.value,r>0&&(n.pattern=[]),i=e.next();break;case 74:0!==i.value&&(a=!0,YT[n.name]?YT[n.name]++:YT[n.name]=1),i=e.next();break;case 0:im.trace("}"),r>0&&r!==n.pattern.length&&im.warn("[DxfParser] lengths do not match on LTYPE pattern"),t[s]=n,n={},im.trace("LType {"),i=e.next()}return im.trace("}"),t[s]=n,t}},LAYER:{tableRecordsProperty:"layers",tableName:"layer",dxfSymbolName:"LAYER",parseTableRecords:function(){const t={};let n,r={};for(im.trace("Layer {"),i=e.next();!$T(i,0,"ENDTAB");)switch(i.code){case 2:r.name=i.value,n=i.value,i=e.next();break;case 5:r.handle=i.value,i=e.next();break;case 62:r.visible=i.value>=0,r.colorIndex=Math.abs(i.value),r.color=JT(r.colorIndex),i=e.next();break;case 70:r.flag=i.value,r.frozen=(1&r.flag)>0,i=e.next();break;case 420:r.color=Math.abs(i.value),i=e.next();break;case 6:r.lineType=i.value.toUpperCase(),i=e.next();break;case 370:r.lineweight=i.value,i=e.next();break;case 0:"LAYER"===i.value&&(im.trace("}"),n&&(t[n]=r),im.trace("Layer {"),r={},n=void 0,i=e.next());break;default:KT(i),i=e.next()}return im.trace("}"),n&&(t[n]=r),t}},BLOCK_RECORD:{tableRecordsProperty:"blockRecords",tableName:"blockRecord",dxfSymbolName:"BLOCK_RECORD",parseTableRecords:function(){const t={};let n,s={};for(im.trace("BlockRecord {"),i=e.next();!$T(i,0,"ENDTAB");)switch(i.code){case 5:s.handle=i.value,i=e.next();break;case 330:s.ownerHandle=i.value,i=e.next();break;case 2:s.blockName=i.value,n=s.blockName,i=e.next();break;case 340:s.layoutHandle=i.value,i=e.next();break;case 70:s.blockInsertUnits=i.value,i=e.next();break;case 280:s.blockExplodability=i.value,i=e.next();break;case 281:s.blockScalability=i.value,i=e.next();break;case 310:s.bitmap=i.value,i=e.next();break;case 0:if("BLOCK_RECORD"===i.value){im.trace("}"),n&&(t[n]=s);const a=s.layoutHandle;n&&a&&a.length>0&&"0"!==a&&(r._layoutBlocks[a]=s),im.trace("BlockRecord {"),s={},n=void 0,i=e.next()}else KT(i),i=e.next();break;default:KT(i),i=e.next()}im.trace("}"),n&&(t[n]=s);const a=s.layoutHandle;return n&&a&&a.length>0&&"0"!==a&&(r._layoutBlocks[a]=s),t}},STYLE:{tableRecordsProperty:"styles",tableName:"style",dxfSymbolName:"STYLE",parseTableRecords:function(){const t={};let n,r={};for(im.trace("Style {"),i=e.next();!$T(i,0,"ENDTAB");)switch(i.code){case 2:r.styleName=i.value,n=i.value,i=e.next();break;case 3:r.fontFile=i.value,i=e.next();break;case 4:r.bigFontFile=i.value,i=e.next();break;case 5:r.handle=i.value,i=e.next();break;case 7:r.textStyle=i.value,i=e.next();break;case 40:r.textHeight=i.value,i=e.next();break;case 41:r.xScale=i.value,i=e.next();break;case 42:r.priorTextHeight=i.value,i=e.next();break;case 50:r.rotation=i.value,i=e.next();break;case 70:default:i=e.next();break;case 71:r.mirroreType=i.value,i=e.next();break;case 330:r.ownerHandle=i.value,i=e.next();break;case 0:"STYLE"===i.value&&(im.trace("}"),n&&(t[n]=r),im.trace("Style {"),r={},n=void 0,i=e.next())}return im.trace("}"),n&&(t[n]=r),t}},DIMSTYLE:{tableRecordsProperty:"dimStyles",tableName:"dimStyle",dxfSymbolName:"DIMSTYLE",parseTableRecords:function(){const t={};let n,r={};for(im.trace("DimStyle {"),i=e.next();!$T(i,0,"ENDTAB");)switch(i.code){case 2:r.styleName=i.value,n=i.value,i=e.next();break;case 40:r.DIMSCALE=i.value,i=e.next();break;case 41:r.DIMASZ=i.value,i=e.next();break;case 42:r.DIMEXO=i.value,i=e.next();break;case 44:r.DIMEXE=i.value,i=e.next();break;case 75:r.DIMSE1=i.value,i=e.next();break;case 76:r.DIMSE2=i.value,i=e.next();break;case 77:r.DIMTAD=i.value,i=e.next();break;case 140:r.DIMTXT=i.value,i=e.next();break;case 144:r.DIMLFAC=i.value,i=e.next();break;case 147:r.DIMGAP=i.value,i=e.next();break;case 176:r.DIMCLRD=i.value,i=e.next();break;case 178:r.DIMCLRT=i.value,i=e.next();break;case 271:r.DIMDEC=i.value,i=e.next();break;case 341:r.DIMLDRBLK=i.value,i=e.next();break;case 70:default:i=e.next();break;case 0:"DIMSTYLE"===i.value&&(im.trace("}"),n&&(t[n]=r),im.trace("DimStyle {"),r={},n=void 0,i=e.next())}return im.trace("}"),n&&(t[n]=r),t}}};function p(t){const n=[],s=t?"ENDBLK":"ENDSEC";for(t||(i=e.next());;)if(0===i.code){if(i.value===s)break;const t=r._entityHandlers[i.value];if(null==t){const t=i.value;WT[t]||(WT[t]=0),WT[t]++,i=e.next();continue}{im.trace(i.value+" {");const r=t.parseEntity(e,i);r&&(r.layer||(r.layer="0"),void 0===r.colorIndex&&(r.colorIndex=256),r.lineType||(r.lineType=Ax)),i=e.lastReadGroup,im.trace("}"),f(r),n.push(r)}}else i=e.next();return"ENDSEC"==s&&(i=e.next()),n}function d(){const t={};for(i=e.next();"EOF"!==i.value;)if(0===i.code){if("ENDSEC"===i.value)break;const n=r._objectHandlers[i.value];if(null==n){const t=i.value;qT[t]||(qT[t]=0),qT[t]++,i=e.next();continue}{im.trace(i.value+" {");const r=n.parseObject(e,i),s=i.value;i=e.lastReadGroup,im.trace("}"),f(r),t[s]||(t[s]=[]),t[s].push(r)}}else i=e.next();var n,s;(i=e.next(),t.LAYOUT)&&(Q()(r._layoutBlocks).length!==t.LAYOUT.length&&im.warn("[DxfParser] The number of layout and block associations does not match!"),ge()(n=t.LAYOUT).call(n,(e=>{r._layoutBlocks[e.handle]&&(e.associatedBlockName=r._layoutBlocks[e.handle].blockName)})),re()(s=t.LAYOUT).call(s,((e,t)=>e.tabOrder-t.tabOrder)));return t}function m(t){const n={};let r=t.code;if(n.x=t.value,r+=10,(t=e.next()).code!=r)throw new Error(`Expected code for point value to be ${r} but got ${t.code}.`);return n.y=t.value,r+=10,(t=e.next()).code!=r||(n.z=t.value,t=e.next()),n}function f(e){if(!e)throw new TypeError("entity cannot be undefined or null");e.handle||(e.handle=(n++).toString())}return function(){for(i=e.next();999===i.code;)i=e.next();for(;!e.isEOF();)if(0===i.code&&"SECTION"===i.value){if(i=e.next(),2!==i.code){im.error("Unexpected code %s after 0:SECTION",ZT(i)),i=e.next();continue}if("HEADER"===i.value)im.trace("> HEADER"),t.header=s(),im.trace("<");else if("TABLES"===i.value)im.trace("> TABLES"),t.tables=l(),im.trace("<");else if("BLOCKS"===i.value)im.trace("> BLOCKS"),t.blocks=a(),im.trace("<");else if("ENTITIES"===i.value)im.trace("> ENTITIES"),t.entities=p(!1),im.trace("<");else if("OBJECTS"===i.value)im.trace("> OBJECTS"),t.objects=d(),im.trace("<");else if("EOF"===i.value)im.trace("EOF");else{const e=i.value;HT[e]?HT[e]++:HT[e]=1}}else i=e.next();HT={},WT={},qT={},YT={}}(),t}}function $T(e,t,n){return e.code===t&&e.value===n}function KT(e){im.trace("unhandled group "+ZT(e))}function ZT(e){return e.code+":"+e.value}function JT(e){return Px[e]}const QT="0.1.94",ew="VERSION",tw=()=>window.localStorage.getItem(ew)!==QT&&(window.localStorage.setItem(ew,QT),!0);class nw{constructor(){gh(this,"DATABASE_NAME","gemini_viewer_db"),gh(this,"TABLES",[{name:"viewpoint",options:{keyPath:"id",autoIncrement:!0},indexArray:[]},{name:"annotation",options:{keyPath:"id",autoIncrement:!0},indexArray:[]},{name:"dxfdata",options:{keyPath:"dxfDataId",autoIncrement:!1},indexArray:[]},{name:"fontdata",options:{keyPath:"url",autoIncrement:!0},indexArray:[]}]),gh(this,"db",void 0)}static instance(){return nw._instance||(nw._instance=new nw),nw._instance}getDatabase(){try{const e=this;return v().resolve(e.getDB(e.DATABASE_NAME)).then((function(t){function n(){return t.onclose=()=>{e.db=void 0,im.log(`[DB] Db ${t.name} is closed.`)},t.onerror=n=>{e.db=void 0,im.log(`[DB] Db ${t.name} encountered error.`,n)},t.onabort=n=>{e.db=void 0,im.log(`[DB] Db ${t.name} aborted.`,n)},t.onversionchange=e=>{im.log("onversionchange",e)},e.db=t,v().resolve(e.db)}const r=function(){if(!e.db){function n(){return v().resolve(e.getUpgradedDB(t)).then((function(e){t=e}))}t.close();const r=function(){if(tw())return v().resolve(e.deleteDataBase(e.DATABASE_NAME)).then((function(){}))}();return r&&r.then?r.then(n):n()}}();return r&&r.then?r.then(n):n()}))}catch(e){return v().reject(e)}}closeDatabase(){this.db&&this.db.close()}deleteDataBase(e){return new(v())(((t,n)=>{const r=window.indexedDB.deleteDatabase(e);r.onerror=e=>{im.log(e),n(e)},r.onsuccess=n=>{const r=n.target;im.log(`[DB] Db ${e} delete old version ${n.oldVersion}.`),t(r)}}))}getDB(e){try{return v().resolve(new(v())(((t,n)=>{const r=window.indexedDB.open(e);r.onerror=n,r.onsuccess=e=>{const n=e.target.result;im.log(`[DB] Db ${n.name} opened (version ${n.version}).`),t(n)}})))}catch(e){return v().reject(e)}}getUpgradedDB(e){try{const t=this;return v().resolve(new(v())(((n,r)=>{im.log(`[DB] Upgrading db ${e.name} (version ${e.version})`);const i=window.indexedDB.open(e.name,e.version+1);i.onerror=r,i.onblocked=e=>{im.log("onblocked",e)},i.onupgradeneeded=e=>{e.target.transaction.oncomplete=()=>{im.log(`[DB] Upgrade is done (new version: ${n.version}).`)};const n=e.target.result,r=[];for(let e=0;e<t.TABLES.length;++e){const i=t.TABLES[e];if(!n.objectStoreNames.contains(i.name)){im.log(`[DB] Creating table ${i.name}...`);const e=t.createTable(n,i.name,i.options,i.indexArray);r.push(e)}}r.length>0&&v().all(r).then((()=>{im.log(`[DB] All(${r.length}) tables created.`)}))},i.onsuccess=e=>{const t=e.target.result;im.log(`[DB] Db ${t.name} opened (version ${t.version}).`),n(t)}})))}catch(e){return v().reject(e)}}createTable(e,t,n,r){try{return v().resolve(new(v())((i=>{const s=e.createObjectStore(t,n);r&&ge()(r).call(r,(e=>{s.createIndex(e.name,e.fields,{unique:e.unique})})),im.log(`[DB] Table ${t} created.`),i(e)})))}catch(e){return v().reject(e)}}}gh(nw,"_instance",void 0);class rw{constructor(){var e;gh(this,"db",void 0),gh(this,"isCreatingTable",!1);const t=sp()(e=nw.instance().TABLES).call(e,(e=>e.name===this.tableName()));if(-1===t)throw new Error(`Make sure to add table '${this.tableName()}' to IndexedDbManager.TABLES!`)}tableName(){throw new Error("Derived class have to override 'tableName', and set a proper table name!")}add(e,t,n){const r=this.tableName();nw.instance().getDatabase().then((i=>{const s=i.transaction([r],"readwrite").objectStore(r).add(e);s.onsuccess=t,s.onerror=n})).finally((()=>{nw.instance().closeDatabase()})).catch((e=>{n&&n(e)}))}save(e,t,n){const r=this.tableName();nw.instance().getDatabase().then((i=>{const s=i.transaction([r],"readwrite").objectStore(r).put(e);s.onsuccess=t,s.onerror=n})).finally((()=>{nw.instance().closeDatabase()}))}delete(e,t,n){const r=this.tableName();nw.instance().getDatabase().then((i=>{const s=i.transaction([r],"readwrite").objectStore(r).delete(e);s.onsuccess=t,s.onerror=n})).finally((()=>{nw.instance().closeDatabase()}))}update(){nw.instance().getDatabase().then((()=>{}))}query(e,t){const n=this.tableName();nw.instance().getDatabase().then((r=>{const i=r.transaction([n],"readonly").objectStore(n).openCursor();i.onsuccess=t=>{const n=t.target.result;n&&n.continue(),e&&e(n)},i.onerror=t})).finally((()=>{nw.instance().closeDatabase()}))}queryAll(e,t){const n=this.tableName();nw.instance().getDatabase().then((r=>{const i=r.transaction([n],"readonly").objectStore(n).getAll();i.onsuccess=t=>{e&&e(i.result)},i.onerror=t})).finally((()=>{nw.instance().closeDatabase()}))}clearAll(e,t){const n=this.tableName();nw.instance().getDatabase().then((r=>{const i=r.transaction([n],"readwrite").objectStore(n).clear();i.onsuccess=t=>{e&&e(t)},i.onerror=e=>{t&&t(e)}})).finally((()=>{nw.instance().closeDatabase()}))}}class iw extends rw{tableName(){return"dxfdata"}static instance(){return iw._instance||(iw._instance=new iw),iw._instance}query(e,t,n){const r=[],i=this.tableName();nw.instance().getDatabase().then((s=>{const a=s.transaction([i],"readonly").objectStore(i).get(e);a.onerror=e=>{n&&n(e),im.info("[DxfDataTable] Failed to query !",e)},a.onsuccess=()=>{a.result&&r.push(a.result),t&&t(r)}})).finally((()=>{nw.instance().closeDatabase()}))}}let sw;gh(iw,"_instance",void 0),function(e){e.Added="Added",e.Removed="Removed",e.Modified="Modified",e.NoChange="NoChange"}(sw||(sw={}));class aw{constructor(e,t){if(gh(this,"dxf1",void 0),gh(this,"dxf2",void 0),gh(this,"changes",{}),gh(this,"blockHandles",[]),gh(this,"comparedBlocks",new(pe())),this.dxf1=e,this.dxf2=t,!e||!t)throw new Error("Invalid dxf data to compare!")}compare(){var e,t;this.changes={},this.comparedBlocks=new(pe());const n=[],r=[];return ge()(e=this.dxf1.entities).call(e,(e=>{var t;!0!==e.inPaperSpace&&n.push(e.handle),cp()(t=["INSERT","DIMENSION"]).call(t,e.type)&&this.blockHandles.push(e.handle)})),ge()(t=this.dxf2.entities).call(t,(e=>{var t;!0!==e.inPaperSpace&&r.push(e.handle),cp()(t=["INSERT","DIMENSION"]).call(t,e.type)&&this.blockHandles.push(e.handle)})),this.compareEntities(n,r),this.changes}compareInsertOrDemensionEntities(e,t){var n,r,i,s;if(!e.block||!t.block)return;const a=e.block,o=(null===(n=e.extendedData)||void 0===n?void 0:n.originalHandle)||e.handle;if(this.comparedBlocks.has(o))return;this.comparedBlocks.add(o);const l=[],c=[];null===(r=this.dxf1.blocks[a].entities)||void 0===r||ge()(r).call(r,(e=>{l.push(e.handle)})),null===(i=this.dxf2.blocks[a])||void 0===i||null===(s=i.entities)||void 0===s||ge()(s).call(s,(e=>{c.push(e.handle)})),this.compareEntities(l,c,a,o)}compareEntities(e,t,n,r){re()(e).call(e,this.compareHexStrings),re()(t).call(t,this.compareHexStrings);const i=[...t],s=n?this.dxf1.blocks[n]:this.dxf1,a=n?this.dxf2.blocks[n]:this.dxf2;let o=!1;for(let t=0;t<e.length;t++){const m=e[t];if(-1===w()(i).call(i,m)){var l;if(cp()(l=this.blockHandles).call(l,m)&&a){var c,u,h;const e=Se()(c=s.entities).call(c,(e=>e.handle===m)),t=null===(u=e.extendedData)||void 0===u?void 0:u.originalHandle,n=Se()(h=a.entities).call(h,(n=>{var r;return(null===(r=n.extendedData)||void 0===r?void 0:r.originalHandle)===t&&n.block!==e.block}));e&&n&&this.compareInsertOrDemensionEntities(e,n),S()(i).call(i,w()(i).call(i,m),1)}else this.changes[e[t]]={type:sw.Removed,handle:e[t],blockHandle:r};n&&(o=!0)}else{var p,d;const e=Se()(p=s.entities).call(p,(e=>e.handle===m)),t=Se()(d=a.entities).call(d,(e=>e.handle===m));this.entitiesEqual(e,t)?"INSERT"!==e.type&&"DIMENSION"!==e.type||this.compareInsertOrDemensionEntities(e,t):(this.changes[m]={type:sw.Modified,handle:m,blockHandle:r},n&&(o=!0)),S()(i).call(i,w()(i).call(i,m),1)}}for(const e of i)this.changes[e]={type:sw.Added,handle:e,blockHandle:r},n&&(o=!0);o&&r&&delete this.changes[r]}entitiesEqual(e,t){if(!this.baseEntitiesEqual(e,t))return!1;const n=e.type;let r=!0;return"CIRCLE"===n||"ARC"===n?r=this.arcsEqual(e,t):"LWPOLYLINE"===n||"LINE"===n?r=this.linesEqual(e,t):"POLYLINE"===n?r=this.polylinesEqual(e,t):"TEXT"===n?r=this.textsEqual(e,t):"SOLID"===n?r=this.solidsEqual(e,t):"POINT"===n?r=this.pointEntitiesEqual(e,t):"INSERT"===n?r=this.insertsEqual(e,t):"SPLINE"===n?r=this.splinesEqual(e,t):"MTEXT"===n?r=this.mtextsEqual(e,t):"ELLIPSE"===n?r=this.ellipsesEqual(e,t):"DIMENSION"===n?r=this.dimensionsEqual(e,t):"REGION"===n||("ATTDEF"===n?r=this.attDefsEqual(e,t):"ATTRIB"===n?r=this.attribsEqual(e,t):"HATCH"===n?r=this.hatchesEqual(e,t):"VIEWPORT"===n?r=this.viewportsEqual(e,t):"LEADER"===n?r=this.leadersEqual(e,t):"MULTILEADER"===n?r=this.mleadersEqual(e,t):"OLE2FRAME"===n&&(r=this.ole2framesEqual(e,t))),r}baseEntitiesEqual(e,t){return e.handle===t.handle&&(e.ownerHandle===t.ownerHandle&&e.type===t.type)}arcsEqual(e,t){return!!this.vectorsEqual(e.center,t.center)&&(e.radius===t.radius&&(e.startAngle===t.startAngle&&e.endAngle===t.endAngle))}linesEqual(e,t){return!!this.verticesEqual(e.vertices,t.vertices)&&e.shape===t.shape}polylinesEqual(e,t){return!!this.vertexEntitiesEqual(e.vertices,t.vertices)&&(e.shape===t.shape&&e.isPolyfaceMesh===t.isPolyfaceMesh)}textsEqual(e,t){return!!this.pointsEqual(e.startPoint,t.startPoint)&&(!!this.pointsEqual(e.endPoint,t.endPoint)&&(e.xScale===t.xScale&&(e.rotation===t.rotation&&e.text===t.text)))}solidsEqual(e,t){return!!this.verticesEqual(e.points,t.points)}pointEntitiesEqual(e,t){return!!this.pointsEqual(e.position,t.position)}splinesEqual(e,t){return!!this.verticesEqual(e.controlPoints,t.controlPoints)&&(!!this.numbersEqual(e.knotValues,t.knotValues)&&e.degreeOfSplineCurve===t.degreeOfSplineCurve)}mtextsEqual(e,t){return!!this.pointsEqual(e.position,t.position)&&(e.text===t.text&&e.rotation===t.rotation)}ellipsesEqual(e,t){return!!this.pointsEqual(e.center,t.center)&&(!!this.pointsEqual(e.majorAxisEndPoint,t.majorAxisEndPoint)&&(e.axisRatio===t.axisRatio&&(e.startAngle===t.startAngle&&e.endAngle===t.endAngle)))}attDefsEqual(e,t){return!!this.pointsEqual(e.startPoint,t.startPoint)&&(!!this.pointsEqual(e.endPoint,t.endPoint)&&(e.xScale===t.xScale&&(e.text===t.text&&(e.tag===t.tag&&e.prompt===t.prompt))))}attribsEqual(e,t){return this.attDefsEqual(e,t)}hatchesEqual(e,t){const n=e,r=t;return n.elevationX===r.elevationX&&(n.elevationY===r.elevationY&&(n.elevationZ===r.elevationZ&&!!this.hatchBoundaryPathArraysEqual(n.boundaryPaths,r.boundaryPaths)))}viewportsEqual(e,t){const n=e,r=t;return!!this.pointsEqual(n.centerPoint,r.centerPoint)&&(!!this.pointsEqual(n.centerPoint_dcs,r.centerPoint_dcs)&&(!!this.pointsEqual(n.viewDirection,r.viewDirection)&&(n.viewHeight===r.viewHeight&&(n.width_paperSpace===r.width_paperSpace&&n.height_paperSpace===r.height_paperSpace))))}leadersEqual(e,t){return!!this.pointsEqual(e.position,t.position)&&(!!this.verticesEqual(e.vertices,t.vertices)&&(e.arrowHeadBlockHandle===t.arrowHeadBlockHandle&&(e.arrowHeadSize===t.arrowHeadSize&&(e.rotation===t.rotation&&e.block===t.block))))}mleadersEqual(e,t){return e.arrowHeadId===t.arrowHeadId&&(e.arrowHeadSize===t.arrowHeadSize&&this.mleaderContextEqual(e.contextData,t.contextData))}ole2framesEqual(e,t){return e.leftUpX===t.leftUpX&&(e.leftUpY===t.leftUpY&&(e.leftUpZ===t.leftUpZ&&(e.rightDownX===t.rightDownX&&(e.rightDownY===t.rightDownY&&e.rightDownZ===t.rightDownZ))))}insertsEqual(e,t){var n,r;return!!this.pointsEqual(e.position,t.position)&&(e.xScale===t.xScale&&(e.yScale===t.yScale&&(e.zScale===t.zScale&&(e.block===t.block&&(null===(n=e.entities)||void 0===n?void 0:n.length)===(null===(r=t.entities)||void 0===r?void 0:r.length)))))}dimensionsEqual(e,t){return!!this.pointsEqual(e.anchorPoint,t.anchorPoint)&&e.block===t.block}regionsEqual(e,t){const n=t;return e.proprietaryData===n.proprietaryData}vectorsEqual(e,t){return!e&&!t||!(!e||!t)&&(e.x===t.x&&e.y===t.y&&e.z===t.z)}pointsEqual(e,t){return!e&&!t||!(!e||!t)&&(e.x===t.x&&e.y===t.y&&e.z===t.z&&e.bulge===t.bulge)}vertexEntityEqual(e,t){return!e&&!t||!(!e||!t)&&(!!this.pointsEqual(e,t)&&(e.polyfaceMeshVertex===t.polyfaceMeshVertex&&(e.threeDPolylineMesh===t.threeDPolylineMesh&&e.polyfaceMeshVertex===t.polyfaceMeshVertex)))}numbersEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}return!1}vectorArraysEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.vectorsEqual(e[n],t[n]))return!1;return!0}return!1}verticesEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.pointsEqual(e[n],t[n]))return!1;return!0}return!1}verticesArrayEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.verticesEqual(e[n],t[n]))return!1;return!0}return!1}vertexEntitiesEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.vertexEntityEqual(e[n],t[n]))return!1;return!0}return!1}hatchEdgesEqual(e,t){return!e&&!t||!(!e||!t)&&e.type===t.type}hatchEdgeArraysEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.hatchEdgesEqual(e[n],t[n]))return!1;return!0}return!1}hatchBoundaryPathsEqual(e,t){return!e&&!t||!(!e||!t)&&(e.pathTypeFlag===t.pathTypeFlag&&this.hatchEdgeArraysEqual(e.edges,t.edges))}hatchBoundaryPathArraysEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.hatchBoundaryPathsEqual(e[n],t[n]))return!1;return!0}return!1}mleaderLineEqual(e,t){return!e&&!t||!(!e||!t)&&(!!this.verticesArrayEqual(e.vertices,t.vertices)&&e.leaderLineIndex===t.leaderLineIndex)}mleaderLinesEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.mleaderLineEqual(e[n],t[n]))return!1;return!0}return!1}mleaderLeaderEqual(e,t){return!e&&!t||!(!e||!t)&&(!!this.pointsEqual(e.lastLeaderLinePoint,t.lastLeaderLinePoint)&&(!!this.pointsEqual(e.doglegVector,t.doglegVector)&&!!this.mleaderLinesEqual(e.leaderLines,t.leaderLines)))}mleaderLeadersEqual(e,t){if(!e&&!t)return!0;if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!this.mleaderLeaderEqual(e[n],t[n]))return!1;return!0}return!1}mleaderContextEqual(e,t){return!e&&!t||!(!e||!t)&&(!!this.pointsEqual(e.contentBasePosition,t.contentBasePosition)&&(!!this.pointsEqual(e.blockContentPosition,t.blockContentPosition)&&!!this.mleaderLeadersEqual(e.leaders,t.leaders)))}compareHexStrings(e,t){return L()(e,16)-L()(t,16)}}gh(aw,"ENTITY_COLOR_ADDED",65280),gh(aw,"ENTITY_COLOR_REMOVED",16711680),gh(aw,"ENTITY_COLOR_NO_CHANGE",10066329),gh(aw,"ENTITY_COLOR_MARKUP",16744231);var ow=n(17975),lw=n.n(ow);const cw={d:"°",c:"⌀",p:"±"},uw=(e,t)=>{e=e.replace(/%%(.)/g,((e,t)=>cw[t]||t));const n=null==t?void 0:t.encoding;let r,i=n instanceof TextDecoder?n:void 0,s="";const a=[],o=e=>{s&&(a.push(s),s=""),a.push(e)};for(let t=0;t<e.length;t++)switch(r=e[t]){default:s+=r;break;case"\\":switch(r=e[++t]){default:let a="";for(a+=r;r=e[++t];)if(a+=r,";"===r){o(a);break}break;case"P":s+="\n";break;case"f":case"F":{let n="";for(;r=e[++t];){if(";"===r){o({f:n});break}if("|"===r){const r={f:n},i=w()(e).call(e,";",++t);for(const n of M()(e).call(e,t,i).split("|"))r[n[0]]=+M()(n).call(n,1);t=i,o(r);break}n+="\\"===r?e[++t]:r}break}case"S":{let n,i="",s="";for(;r=e[++t];){if(";"===r){n&&o({S:[i,n,s]});break}"\\"===r?n?s+=e[++t]:i+=e[++t]:n?s+=r:"^"===r||"/"===r||"#"===r?n=r:i+=r}break}case"H":case"W":const l=++t,[,c,u]=M()(e).call(e,l,t=w()(e).call(e,";",t)).match(/^(\d*(?:\.\d+)?)(\D*)$/);o({[r]:[+c,u]});break;case"Q":case"A":case"C":case"c":case"T":{const n=++t;o({[r]:+M()(e).call(e,n,t=w()(e).call(e,";",t))});break}case"L":case"O":case"K":o({[r]:1});break;case"l":case"o":case"k":o({[r.toUpperCase()]:0});break;case"U":case"u":"+"===e[t+1]?(s+=lw()(L()(e.substr(t+2,4),16)),t+=5):s+=r;break;case"M":case"m":n?"+"!==e[t+1]||"0"!==e[t+2]&&"1"!==e[t+2]?s+=r:(s+=(i=i||new TextDecoder(n)).decode(new Uint8Array([L()(e.substr(t+3,2),16),L()(e.substr(t+5,2),16)])),t+=6):s+="\\"+r}break;case"{":{let n=1;const i=t;for(;r=e[++t];)if("{"===r)n++;else if("}"===r){if(0==--n){o(uw(M()(e).call(e,i+1,t)));break}}else"\\"===r&&t++;break}}return s&&a.push(s),a};let hw;!function(e){e.Unitless="Unitless",e.Inches="Inches",e.Feet="Feet",e.Millimeters="Millimeters",e.Centimeters="Centimeters",e.Meters="Meters"}(hw||(hw={}));const pw=e=>e===hw.Unitless?1:e===hw.Inches?.0254:e===hw.Feet?.3048:e===hw.Millimeters?.001:e===hw.Centimeters?.01:(e===hw.Meters||console.warn(`[Units] Unsupported unit '${e}', will return 1 for unit scale.`),1),dw=(e,t)=>pw(e)/pw(t);class mw{static GetBytes(e){switch(typeof e){case"string":{const t=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return new Uint8Array(t.buffer)}case"number":return e-Math.floor(e)==0?e>4294967295?((t=new Float64Array(1))[0]=e,new Uint8Array(t.buffer)):function(t){return t[0]=e,new Uint8Array(t.buffer)}(new Int32Array(1)):function(t){return t[0]=e,new Uint8Array(t.buffer)}(new Float64Array(1));case"boolean":return function(t){return t[0]=Number(e),t}(new Uint8Array(1));default:if(e instanceof Array){const t=[];for(let n=0;n<e.length;n++)t.push(mw.GetBytes(e[n]));let n=0;for(let e=0;e<t.length;e++)n+=t[e].length;const r=new Uint8Array(n);let i=0;for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)r[i++]=t[e][n];return r}throw"Can't Convert To Bytes!!"}var t}static Get1Bytes(e){switch(typeof e){case"number":case"boolean":return new Uint8Array([Number(e)]);default:if(e instanceof Array){const t=[];for(let n=0;n<e.length;n++)t.push(this.Get1Bytes(e[n]));let n=0;for(let e=0;e<t.length;e++)n+=t[e].length;const r=new Uint8Array(n);let i=0;for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)r[i++]=t[e][n];return r}throw"Can't Convert To Bytes!!"}}static byteTosbyte(e){return(127&e)-(128&e?128:0)}static ToBoolean(e,t){return!!e[t=t||0]}static ToInt8(e,t){return 128&e[t=t||0]?-(1+(255^e[t])):e[t]}static ToUInt8(e,t){return e[t=t||0]}static ToInt16(e,t){t=t||0;const n=M()(e).call(e,t,t+2);return new Int16Array(n.buffer,0,1)[0]}static ToInt32(e,t){t=t||0;const n=M()(e).call(e,t,t+4);return new Int32Array(n.buffer,0,1)[0]}static ToUInt16(e,t){t=t||0;const n=M()(e).call(e,t,t+2);return new Uint16Array(n.buffer,0,1)[0]}static ToUInt32(e,t){t=t||0;const n=M()(e).call(e,t,t+4);return new Uint32Array(n.buffer,0,1)[0]}static ToChar(e,t){t=t||0;const n=M()(e).call(e,t,t+2);return String.fromCharCode(new Uint16Array(n.buffer,0,1)[0])}static ToAscii(e,t){return t=t||0,String.fromCharCode(e[t])}static ToAsciiString(e,t,n){t=t||0,(n=n||e.length)+t>e.length&&(n-=t);let r="";for(let i=0;i<n;i++)r+=String.fromCharCode(e[t+i]||0);return r}static ToUTF16String(e,t,n){t=t||0,(n=n||e.length)+t>e.length&&(n-=t);const r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e[t+i]||0;return String.fromCharCode.apply(null,F()(new Uint16Array(r.buffer,0,n/2)))}static ToFloat32(e,t){t=t||0;const n=M()(e).call(e,t,t+4);return new Float32Array(n.buffer,0,1)[0]}static ToFloat64(e,t){t=t||0;const n=M()(e).call(e,t,t+8);return new Float64Array(n.buffer,0,1)[0]}}let fw;function gw(e){fw||function(){const e=[[161,169,161,254],[176,247,161,254],[129,160,64,254],[170,254,64,160],[168,169,64,160],[170,175,161,254],[248,254,161,254],[161,167,64,160]],t=new Uint16Array(23940);let n=0;for(const[r,i,s,a]of e)for(let e=s;e<=a;e++)if(127!==e)for(let s=r;s<=i;s++)t[n++]=e<<8|s;const r=new TextDecoder("gbk").decode(t);for(fw=new Uint16Array(65536),n=0;n<r.length;n++)fw[r.charCodeAt(n)]=t[n]}();const t=new Uint8Array(2*e.length);let n=0;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);if(i<128)t[n++]=i;else{const e=fw[i];t[n++]=255&e,t[n++]=e>>8}}return t.subarray(0,n)}const _w="啊阿埃挨哎唉哀皚癌藹矮艾礙愛隘鞍氨安俺按暗岸胺案骯昂盎凹敖熬翺襖傲奧懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙壩霸罷爸白柏百擺佰敗拜稗斑班搬扳般頒板版扮拌伴瓣半辦絆邦幫梆榜膀綁棒磅蚌鎊傍謗苞胞包褒剝薄雹保堡飽寶抱報暴豹鮑爆杯碑悲卑北輩背貝鋇倍狽備憊焙被奔苯本笨崩繃甭泵蹦迸逼鼻比鄙筆彼碧蓖蔽畢斃毖幣庇痹閉敝弊必辟壁臂避陛鞭邊編貶扁便變卞辨辯辮遍標彪膘表鱉憋別癟彬斌瀕濱賓擯兵冰柄丙秉餅炳病並玻菠播撥缽波博勃搏鉑箔伯帛舶脖膊渤泊駁捕蔔哺補埠不布步簿部怖擦猜裁材才財睬踩采彩菜蔡餐參蠶殘慚慘燦蒼艙倉滄藏操糙槽曹草廁策側冊測層蹭插叉茬茶查碴搽察岔差詫拆柴豺攙摻蟬饞讒纏鏟產闡顫昌猖場嘗常長償腸廠敞暢唱倡超抄鈔朝嘲潮巢吵炒車扯撤掣徹澈郴臣辰塵晨忱沈陳趁襯撐稱城橙成呈乘程懲澄誠承逞騁秤吃癡持匙池遲弛馳恥齒侈尺赤翅斥熾充沖蟲崇寵抽酬疇躊稠愁籌仇綢瞅醜臭初出櫥廚躇鋤雛滁除楚礎儲矗搐觸處揣川穿椽傳船喘串瘡窗幢床闖創吹炊捶錘垂春椿醇唇淳純蠢戳綽疵茨磁雌辭慈瓷詞此刺賜次聰蔥囪匆從叢湊粗醋簇促躥篡竄摧崔催脆瘁粹淬翠村存寸磋撮搓措挫錯搭達答瘩打大呆歹傣戴帶殆代貸袋待逮怠耽擔丹單鄲撣膽旦氮但憚淡誕彈蛋當擋黨蕩檔刀搗蹈倒島禱導到稻悼道盜德得的蹬燈登等瞪凳鄧堤低滴迪敵笛狄滌翟嫡抵底地蒂第帝弟遞締顛掂滇碘點典靛墊電佃甸店惦奠澱殿碉叼雕雕刁掉吊釣調跌爹碟蝶叠諜疊丁盯叮釘頂鼎錠定訂丟東冬董懂動棟侗恫凍洞兜抖鬥陡豆逗痘都督毒犢獨讀堵睹賭杜鍍肚度渡妒端短鍛段斷緞堆兌隊對墩噸蹲敦頓囤鈍盾遁掇哆多奪垛躲朵跺舵剁惰墮蛾峨鵝俄額訛娥惡厄扼遏鄂餓恩而兒耳爾餌洱二貳發罰筏伐乏閥法琺藩帆番翻樊礬釩繁凡煩反返範販犯飯泛坊芳方肪房防妨仿訪紡放菲非啡飛肥匪誹吠肺廢沸費芬酚吩氛分紛墳焚汾粉奮份忿憤糞豐封楓蜂峰鋒風瘋烽逢馮縫諷奉鳳佛否夫敷膚孵扶拂輻幅氟符伏俘服浮涪福袱弗甫撫輔俯釜斧脯腑府腐赴副覆賦復傅付阜父腹負富訃附婦縛咐噶嘎該改概鈣蓋溉幹甘桿柑竿肝趕感稈敢贛岡剛鋼缸肛綱崗港杠篙臯高膏羔糕搞鎬稿告哥歌擱戈鴿胳疙割革葛格蛤閣隔鉻個各給根跟耕更庚羹埂耿梗工攻功恭龔供躬公宮弓鞏汞拱貢共鉤勾溝茍狗垢構購夠辜菇咕箍估沽孤姑鼓古蠱骨谷股故顧固雇刮瓜剮寡掛褂乖拐怪棺關官冠觀管館罐慣灌貫光廣逛瑰規圭矽歸龜閨軌鬼詭癸桂櫃跪貴劊輥滾棍鍋郭國果裹過哈骸孩海氦亥害駭酣憨邯韓含涵寒函喊罕翰撼捍旱憾悍焊汗漢夯杭航壕嚎豪毫郝好耗號浩呵喝荷菏核禾和何合盒貉閡河涸赫褐鶴賀嘿黑痕很狠恨哼亨橫衡恒轟哄烘虹鴻洪宏弘紅喉侯猴吼厚候後呼乎忽瑚壺葫胡蝴狐糊湖弧虎唬護互滬戶花嘩華猾滑畫劃化話槐徊懷淮壞歡環桓還緩換患喚瘓豢煥渙宦幻荒慌黃磺蝗簧皇凰惶煌晃幌恍謊灰揮輝徽恢蛔回毀悔慧卉惠晦賄穢會燴匯諱誨繪葷昏婚魂渾混豁活夥火獲或惑霍貨禍擊圾基機畸稽積箕肌饑跡激譏雞姬績緝吉極棘輯籍集及急疾汲即嫉級擠幾脊己薊技冀季伎祭劑悸濟寄寂計記既忌際繼紀嘉枷夾佳家加莢頰賈甲鉀假稼價架駕嫁殲監堅尖箋間煎兼肩艱奸緘繭檢柬堿鹼揀撿簡儉剪減薦檻鑒踐賤見鍵箭件健艦劍餞漸濺澗建僵姜將漿江疆蔣槳獎講匠醬降蕉椒礁焦膠交郊澆驕嬌嚼攪鉸矯僥腳狡角餃繳絞剿教酵轎較叫窖揭接皆稭街階截劫節莖睛晶鯨京驚精粳經井警景頸靜境敬鏡徑痙靖竟競凈炯窘揪究糾玖韭久灸九酒廄救舊臼舅咎就疚鞠拘狙疽居駒菊局咀矩舉沮聚拒據巨具距踞鋸俱句懼炬劇捐鵑娟倦眷卷絹撅攫抉掘倔爵桔傑捷睫竭潔結解姐戒藉芥界借介疥誡屆巾筋斤金今津襟緊錦僅謹進靳晉禁近燼浸盡勁荊兢覺決訣絕均菌鈞軍君峻俊竣浚郡駿喀咖卡咯開揩楷凱慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕顆科殼咳可渴克刻客課肯啃墾懇坑吭空恐孔控摳口扣寇枯哭窟苦酷庫褲誇垮挎跨胯塊筷儈快寬款匡筐狂框礦眶曠況虧盔巋窺葵奎魁傀饋愧潰坤昆捆困括擴廓闊垃拉喇蠟臘辣啦萊來賴藍婪欄攔籃闌蘭瀾讕攬覽懶纜爛濫瑯榔狼廊郎朗浪撈勞牢老佬姥酪烙澇勒樂雷鐳蕾磊累儡壘擂肋類淚棱楞冷厘梨犁黎籬貍離漓理李裏鯉禮莉荔吏栗麗厲勵礫歷利傈例俐痢立粒瀝隸力璃哩倆聯蓮連鐮廉憐漣簾斂臉鏈戀煉練糧涼梁粱良兩輛量晾亮諒撩聊僚療燎寥遼潦了撂鐐廖料列裂烈劣獵琳林磷霖臨鄰鱗淋凜賃吝拎玲菱零齡鈴伶羚淩靈陵嶺領另令溜琉榴硫餾留劉瘤流柳六龍聾嚨籠窿隆壟攏隴樓婁摟簍漏陋蘆盧顱廬爐擄鹵虜魯麓碌露路賂鹿潞祿錄陸戮驢呂鋁侶旅履屢縷慮氯律率濾綠巒攣孿灤卵亂掠略掄輪倫侖淪綸論蘿螺羅邏鑼籮騾裸落洛駱絡媽麻瑪碼螞馬罵嘛嗎埋買麥賣邁脈瞞饅蠻滿蔓曼慢漫謾芒茫盲氓忙莽貓茅錨毛矛鉚卯茂冒帽貌貿麽玫枚梅酶黴煤沒眉媒鎂每美昧寐妹媚門悶們萌蒙檬盟錳猛夢孟瞇醚靡糜迷謎彌米秘覓泌蜜密冪棉眠綿冕免勉娩緬面苗描瞄藐秒渺廟妙蔑滅民抿皿敏憫閩明螟鳴銘名命謬摸摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌謀牟某拇牡畝姆母墓暮幕募慕木目睦牧穆拿哪吶鈉那娜納氖乃奶耐奈南男難囊撓腦惱鬧淖呢餒內嫩能妮霓倪泥尼擬妳匿膩逆溺蔫拈年碾攆撚念娘釀鳥尿捏聶孽嚙鑷鎳涅您檸獰凝寧擰濘牛扭鈕紐膿濃農弄奴努怒女暖虐瘧挪懦糯諾哦歐鷗毆藕嘔偶漚啪趴爬帕怕琶拍排牌徘湃派攀潘盤磐盼畔判叛乓龐旁耪胖拋咆刨炮袍跑泡呸胚培裴賠陪配佩沛噴盆砰抨烹澎彭蓬棚硼篷膨朋鵬捧碰坯砒霹批披劈琵毗啤脾疲皮匹痞僻屁譬篇偏片騙飄漂瓢票撇瞥拼頻貧品聘乒坪蘋萍平憑瓶評屏坡潑頗婆破魄迫粕剖撲鋪仆莆葡菩蒲埔樸圃普浦譜曝瀑期欺棲戚妻七淒漆柒沏其棋奇歧畦崎臍齊旗祈祁騎起豈乞企啟契砌器氣迄棄汽泣訖掐洽牽扡釬鉛千遷簽仟謙乾黔錢鉗前潛遣淺譴塹嵌欠歉槍嗆腔羌墻薔強搶橇鍬敲悄橋瞧喬僑巧鞘撬翹峭俏竅切茄且怯竊欽侵親秦琴勤芹擒禽寢沁青輕氫傾卿清擎晴氰情頃請慶瓊窮秋丘邱球求囚酋泅趨區蛆曲軀屈驅渠取娶齲趣去圈顴權醛泉全痊拳犬券勸缺炔瘸卻鵲榷確雀裙群然燃冉染瓤壤攘嚷讓饒擾繞惹熱壬仁人忍韌任認刃妊紉扔仍日戎茸蓉榮融熔溶容絨冗揉柔肉茹蠕儒孺如辱乳汝入褥軟阮蕊瑞銳閏潤若弱撒灑薩腮鰓塞賽三三傘散桑嗓喪搔騷掃嫂瑟色澀森僧莎砂殺剎沙紗傻啥煞篩曬珊苫杉山刪煽衫閃陜擅贍膳善汕扇繕墑傷商賞晌上尚裳梢捎稍燒芍勺韶少哨邵紹奢賒蛇舌舍赦攝射懾涉社設砷申呻伸身深娠紳神沈審嬸甚腎慎滲聲生甥牲升繩省盛剩勝聖師失獅施濕詩屍虱十石拾時什食蝕實識史矢使屎駛始式示士世柿事拭誓逝勢是嗜噬適仕侍釋飾氏市恃室視試收手首守壽授售受瘦獸蔬樞梳殊抒輸叔舒淑疏書贖孰熟薯暑曙署蜀黍鼠屬術述樹束戍豎墅庶數漱恕刷耍摔衰甩帥栓拴霜雙爽誰水睡稅吮瞬順舜說碩朔爍斯撕嘶思私司絲死肆寺嗣四伺似飼巳松聳慫頌送宋訟誦搜艘擻嗽蘇酥俗素速粟僳塑溯宿訴肅酸蒜算雖隋隨綏髓碎歲穗遂隧祟孫損筍蓑梭唆縮瑣索鎖所塌他它她塔獺撻蹋踏胎苔擡臺泰酞太態汰坍攤貪癱灘壇檀痰潭譚談坦毯袒碳探嘆炭湯塘搪堂棠膛唐糖倘躺淌趟燙掏濤滔絳萄桃逃淘陶討套特藤騰疼謄梯剔踢銻提題蹄啼體替嚏惕涕剃屜天添填田甜恬舔腆挑條迢眺跳貼鐵帖廳聽烴汀廷停亭庭挺艇通桐酮瞳同銅彤童桶捅筒統痛偷投頭透凸禿突圖徒途塗屠土吐兔湍團推頹腿蛻褪退吞屯臀拖托脫鴕陀馱駝橢妥拓唾挖哇蛙窪娃瓦襪歪外豌彎灣玩頑丸烷完碗挽晚皖惋宛婉萬腕汪王亡枉網往旺望忘妄威巍微危韋違桅圍唯惟為濰維葦萎委偉偽尾緯未蔚味畏胃餵魏位渭謂尉慰衛瘟溫蚊文聞紋吻穩紊問嗡翁甕撾蝸渦窩我斡臥握沃巫嗚鎢烏汙誣屋無蕪梧吾吳毋武五捂午舞伍侮塢戊霧晤物勿務悟誤昔熙析西硒矽晰嘻吸錫犧稀息希悉膝夕惜熄烯溪汐犀檄襲席習媳喜銑洗系隙戲細瞎蝦匣霞轄暇峽俠狹下廈夏嚇掀鍁先仙鮮纖鹹賢銜舷閑涎弦嫌顯險現獻縣腺餡羨憲陷限線相廂鑲香箱襄湘鄉翔祥詳想響享項巷橡像向象蕭硝霄削哮囂銷消宵淆曉小孝校肖嘯笑效楔些歇蠍鞋協挾攜邪斜脅諧寫械卸蟹懈泄瀉謝屑薪芯鋅欣辛新忻心信釁星腥猩惺興刑型形邢行醒幸杏性姓兄兇胸匈洶雄熊休修羞朽嗅銹秀袖繡墟戌需虛噓須徐許蓄酗敘旭序畜恤絮婿緒續軒喧宣懸旋玄選癬眩絢靴薛學穴雪血勛熏循旬詢尋馴巡殉汛訓訊遜迅壓押鴉鴨呀丫芽牙蚜崖衙涯雅啞亞訝焉咽閹煙淹鹽嚴研蜒巖延言顏閻炎沿奄掩眼衍演艷堰燕厭硯雁唁彥焰宴諺驗殃央鴦秧楊揚佯瘍羊洋陽氧仰癢養樣漾邀腰妖瑤搖堯遙窯謠姚咬舀藥要耀椰噎耶爺野冶也頁掖業葉曳腋夜液壹壹醫揖銥依伊衣頤夷遺移儀胰疑沂宜姨彜椅蟻倚已乙矣以藝抑易邑屹億役臆逸肄疫亦裔意毅憶義益溢詣議誼譯異翼翌繹茵蔭因殷音陰姻吟銀淫寅飲尹引隱印英櫻嬰鷹應纓瑩螢營熒蠅迎贏盈影穎硬映喲擁傭臃癰庸雍踴蛹詠泳湧永恿勇用幽優悠憂尤由郵鈾猶油遊酉有友右佑釉誘又幼迂淤於盂榆虞愚輿余俞逾魚愉渝漁隅予娛雨與嶼禹宇語羽玉域芋郁籲遇喻峪禦愈欲獄育譽浴寓裕預豫馭鴛淵冤元垣袁原援轅園員圓猿源緣遠苑願怨院曰約越躍鑰嶽粵月悅閱耘雲鄖勻隕允運蘊醞暈韻孕匝砸雜栽哉災宰載再在咱攢暫贊贓臟葬遭糟鑿藻棗早澡蚤躁噪造皂竈燥責擇則澤賊怎增憎曾贈紮喳渣劄軋鍘閘眨柵榨咋乍炸詐摘齋宅窄債寨瞻氈詹粘沾盞斬輾嶄展蘸棧占戰站湛綻樟章彰漳張掌漲杖丈帳賬仗脹瘴障招昭找沼趙照罩兆肇召遮折哲蟄轍者鍺蔗這浙珍斟真甄砧臻貞針偵枕疹診震振鎮陣蒸掙睜征猙爭怔整拯正政幀癥鄭證芝枝支吱蜘知肢脂汁之織職直植殖執值侄址指止趾只旨紙誌摯擲至致置幟峙制智秩稚質炙痔滯治窒中盅忠鐘衷終種腫重仲眾舟周州洲謅粥軸肘帚咒皺宙晝驟珠株蛛朱豬諸誅逐竹燭煮拄矚囑主著柱助蛀貯鑄築住註祝駐抓爪拽專磚轉撰賺篆樁莊裝妝撞壯狀椎錐追贅墜綴諄準捉拙卓桌琢茁酌啄著灼濁茲咨資姿滋淄孜紫仔籽滓子自漬字鬃棕蹤宗綜總縱鄒走奏揍租足卒族祖詛阻組鉆纂嘴醉最罪尊遵昨左佐柞做作坐座錒噯嬡璦曖靄諳銨鵪媼驁鰲鈀唄鈑鴇齙鵯賁錛蓽嗶潷鉍篳蹕芐緶籩驃颮飆鏢鑣鰾儐繽檳殯臏鑌髕鬢稟餑鈸鵓鈽驂黲惻鍤儕釵囅諂讖蕆懺嬋驏覘禪鐔倀萇悵閶鯧硨傖諶櫬磣齔棖檉鋮鐺飭鴟銃儔幬讎芻絀躕釧愴綞鶉輟齪鶿蓯驄樅輳攛銼鹺噠韃駘紿殫賧癉簞讜碭襠燾鐙糴詆諦綈覿鏑巔鈿癲銚鯛鰈鋌銩崠鶇竇瀆櫝牘篤黷籪懟鐓燉躉鐸諤堊閼軛鋨鍔鶚顎顓鱷誒邇鉺鴯鮞鈁魴緋鐨鯡僨灃鳧駙紱紼賻麩鮒鰒釓賅尷搟紺戇睪誥縞鋯紇鎘潁亙賡綆鯁詬緱覯詁轂鈷錮鴣鵠鶻鴰摑詿摜鸛鰥獷匭劌媯檜鮭鱖袞緄鯀堝咼幗槨蟈鉿闞絎頡灝顥訶闔蠣黌訌葒閎鱟滸鶘驊樺鏵奐繯鍰鯇鰉詼薈噦澮繢琿暉諢餛閽鈥鑊訐詰薺嘰嚌驥璣覬齏磯羈蠆躋霽鱭鯽郟浹鋏鎵蟯諫縑戔戩瞼鶼筧鰹韉絳韁撟嶠鷦鮫癤頜鮚巹藎饉縉贐覲剄涇逕弳脛靚鬮鳩鷲詎屨櫸颶鉅鋦窶齟錈鐫雋譎玨皸剴塏愾愷鎧鍇龕閌鈧銬騍緙軻鈳錁頷齦鏗嚳鄶噲膾獪髖誆誑鄺壙纊貺匱蕢憒聵簣閫錕鯤蠐崍徠淶瀨賚睞錸癩籟嵐欖斕鑭襤閬鋃嘮嶗銠鐒癆鰳誄縲儷酈壢藶蒞蘺嚦邐驪縭櫪櫟轢礪鋰鸝癘糲躒靂鱺鱧蘞奩瀲璉殮褳襝鰱魎繚釕鷯藺廩檁轔躪綾欞蟶鯪瀏騮綹鎦鷚蘢瀧瓏櫳朧礱僂蔞嘍嶁鏤瘺耬螻髏壚擼嚕閭瀘淥櫨櫓轤輅轆氌臚鸕鷺艫鱸臠孌欒鸞鑾圇犖玀濼欏腡鏍櫚褸鋝嘸嘜嬤榪勱縵鏝顙鰻麼捫燜懣鍆羋謐獼禰澠靦黽緲繆閔緡謨驀饃歿鏌鉬鐃訥鈮鯢輦鯰蔦裊隉蘗囁顢躡苧嚀聹儂噥駑釹儺謳慪甌蹣皰轡紕羆鈹諞駢縹嬪釙鏷鐠蘄騏綺榿磧頎頏鰭僉蕁慳騫繾槧鈐嬙檣戧熗錆鏘鏹羥蹌誚譙蕎繰磽蹺愜鍥篋鋟撳鯖煢蛺巰賕蟣鰍詘嶇闃覷鴝詮綣輇銓闋闕愨蕘嬈橈飪軔嶸蠑縟銣顰蜆颯毿糝繅嗇銫穡鎩鯊釃訕姍騸釤鱔坰殤觴厙灄畬詵諗瀋謚塒蒔弒軾貰鈰鰣綬攄紓閂鑠廝駟緦鍶鷥藪餿颼鎪謖穌誶蓀猻嗩脧闥鉈鰨鈦鮐曇鉭錟頇儻餳鐋鏜韜鋱緹鵜闐糶齠鰷慟鈄釷摶飩籜鼉媧膃紈綰輞諉幃闈溈潿瑋韙煒鮪閿萵齷鄔廡憮嫵騖鵡鶩餼鬩璽覡硤莧薟蘚峴獫嫻鷴癇蠔秈躚薌餉驤緗饗嘵瀟驍綃梟簫褻擷紲纈陘滎饈鵂詡頊諼鉉鏇謔澩鱈塤潯鱘埡婭椏氬厴贗儼兗讞懨閆釅魘饜鼴煬軺鷂鰩靨謁鄴曄燁詒囈嶧飴懌驛縊軼貽釔鎰鐿瘞艤銦癮塋鶯縈鎣攖嚶瀅瀠瓔鸚癭頦罌鏞蕕銪魷傴俁諛諭蕷崳飫閾嫗紆覦歟鈺鵒鷸齬櫞鳶黿鉞鄆蕓惲慍紜韞殞氳瓚趲鏨駔賾嘖幘簀譖繒譫詔釗謫輒鷓湞縝楨軫賑禎鴆諍崢鉦錚箏騭櫛梔軹輊贄鷙螄縶躓躑觶鍾紂縐佇櫧銖囀饌顳騅縋諑鐲諮緇輜貲眥錙齜鯔傯諏騶鯫鏃纘躦鱒訁譾郤猛氹阪壟堖垵墊檾蕒葤蓧蒓菇槁摣咤唚哢噝噅撅劈謔襆嶴脊仿僥獁麅餘餷饊饢楞怵懍爿漵灩混濫瀦淡寧糸絝緔瑉梘棬案橰櫫軲軤賫膁腖飈糊煆溜湣渺碸滾瞘鈈鉕鋣銱鋥鋶鐦鐧鍩鍀鍃錇鎄鎇鎿鐝鑥鑹鑔穭鶓鶥鸌癧屙瘂臒襇繈耮顬蟎麯鮁鮃鮎鯗鯝鯴鱝鯿鰠鰵鱅鞽韝齇";function vw(e){return"啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸尽劲荆兢觉决诀绝均菌钧军君峻俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座锕嗳嫒瑷暧霭谙铵鹌媪骜鳌钯呗钣鸨龅鹎贲锛荜哔滗铋筚跸苄缏笾骠飑飙镖镳鳔傧缤槟殡膑镔髌鬓禀饽钹鹁钸骖黪恻锸侪钗冁谄谶蒇忏婵骣觇禅镡伥苌怅阊鲳砗伧谌榇碜龀枨柽铖铛饬鸱铳俦帱雠刍绌蹰钏怆缍鹑辍龊鹚苁骢枞辏撺锉鹾哒鞑骀绐殚赕瘅箪谠砀裆焘镫籴诋谛绨觌镝巅钿癫铫鲷鲽铤铥岽鸫窦渎椟牍笃黩簖怼镦炖趸铎谔垩阏轭锇锷鹗颚颛鳄诶迩铒鸸鲕钫鲂绯镄鲱偾沣凫驸绂绋赙麸鲋鳆钆赅尴擀绀戆睾诰缟锆纥镉颍亘赓绠鲠诟缑觏诂毂钴锢鸪鹄鹘鸹掴诖掼鹳鳏犷匦刿妫桧鲑鳜衮绲鲧埚呙帼椁蝈铪阚绗颉灏颢诃阖蛎黉讧荭闳鲎浒鹕骅桦铧奂缳锾鲩鳇诙荟哕浍缋珲晖诨馄阍钬镬讦诘荠叽哜骥玑觊齑矶羁虿跻霁鲚鲫郏浃铗镓蛲谏缣戋戬睑鹣笕鲣鞯绛缰挢峤鹪鲛疖颌鲒卺荩馑缙赆觐刭泾迳弪胫靓阄鸠鹫讵屦榉飓钜锔窭龃锩镌隽谲珏皲剀垲忾恺铠锴龛闶钪铐骒缂轲钶锞颔龈铿喾郐哙脍狯髋诓诳邝圹纩贶匮蒉愦聩篑阃锟鲲蛴崃徕涞濑赉睐铼癞籁岚榄斓镧褴阆锒唠崂铑铹痨鳓诔缧俪郦坜苈莅蓠呖逦骊缡枥栎轹砺锂鹂疠粝跞雳鲡鳢蔹奁潋琏殓裢裣鲢魉缭钌鹩蔺廪檩辚躏绫棂蛏鲮浏骝绺镏鹨茏泷珑栊胧砻偻蒌喽嵝镂瘘耧蝼髅垆撸噜闾泸渌栌橹轳辂辘氇胪鸬鹭舻鲈脔娈栾鸾銮囵荦猡泺椤脶镙榈褛锊呒唛嬷杩劢缦镘颡鳗麽扪焖懑钔芈谧猕祢渑腼黾缈缪闵缗谟蓦馍殁镆钼铙讷铌鲵辇鲶茑袅陧蘖嗫颟蹑苎咛聍侬哝驽钕傩讴怄瓯蹒疱辔纰罴铍谝骈缥嫔钋镤镨蕲骐绮桤碛颀颃鳍佥荨悭骞缱椠钤嫱樯戗炝锖锵镪羟跄诮谯荞缲硗跷惬锲箧锓揿鲭茕蛱巯赇虮鳅诎岖阒觑鸲诠绻辁铨阕阙悫荛娆桡饪轫嵘蝾缛铷颦蚬飒毵糁缫啬铯穑铩鲨酾讪姗骟钐鳝垧殇觞厍滠畲诜谂渖谥埘莳弑轼贳铈鲥绶摅纾闩铄厮驷缌锶鸶薮馊飕锼谡稣谇荪狲唢睃闼铊鳎钛鲐昙钽锬顸傥饧铴镗韬铽缇鹈阗粜龆鲦恸钭钍抟饨箨鼍娲腽纨绾辋诿帏闱沩涠玮韪炜鲔阌莴龌邬庑怃妩骛鹉鹜饩阋玺觋硖苋莶藓岘猃娴鹇痫蚝籼跹芗饷骧缃飨哓潇骁绡枭箫亵撷绁缬陉荥馐鸺诩顼谖铉镟谑泶鳕埙浔鲟垭娅桠氩厣赝俨兖谳恹闫酽魇餍鼹炀轺鹞鳐靥谒邺晔烨诒呓峄饴怿驿缢轶贻钇镒镱瘗舣铟瘾茔莺萦蓥撄嘤滢潆璎鹦瘿颏罂镛莸铕鱿伛俣谀谕蓣嵛饫阈妪纡觎欤钰鹆鹬龉橼鸢鼋钺郓芸恽愠纭韫殒氲瓒趱錾驵赜啧帻箦谮缯谵诏钊谪辄鹧浈缜桢轸赈祯鸩诤峥钲铮筝骘栉栀轵轾贽鸷蛳絷踬踯觯锺纣绉伫槠铢啭馔颞骓缒诼镯谘缁辎赀眦锱龇鲻偬诹驺鲰镞缵躜鳟讠谫郄勐凼坂垅垴埯埝苘荬荮莜莼菰藁揸吒吣咔咝咴噘噼嚯幞岙嵴彷徼犸狍馀馇馓馕愣憷懔丬溆滟溷漤潴澹甯纟绔绱珉枧桊桉槔橥轱轷赍肷胨飚煳煅熘愍淼砜磙眍钚钷铘铞锃锍锎锏锘锝锪锫锿镅镎镢镥镩镲稆鹋鹛鹱疬疴痖癯裥襁耢颥螨麴鲅鲆鲇鲞鲴鲺鲼鳊鳋鳘鳙鞒鞴齄".charAt(w()(_w).call(_w,e.charAt(0)))}class yw extends Il{constructor(e,t){super(),gh(this,"width",0),gh(this,"lastPoint",void 0),gh(this,"polyLines",void 0),this.lastPoint=e,this.polyLines=t,this.width=this.calcWidth(t)}offset(e){const t=[];for(let n=0;n<this.polyLines.length;n++){const r=this.polyLines[n],i=[];for(let t=0;t<r.length;t++){const n=r[t];i.push(n.clone().add(e))}t.push(i)}return new yw(this.lastPoint,t)}transform(e){const t=[];for(let n=0;n<this.polyLines.length;n++){const r=this.polyLines[n],i=[];for(let t=0;t<r.length;t++){const n=r[t];i.push(n.clone().applyMatrix3(e))}t.push(i)}return new yw(this.lastPoint.clone().applyMatrix3(e),t)}calcWidth(e){const t=new xu(new Xt,new Xt);for(let n=0;n<e.length;n++){const r=e[n];for(let e=0;e<r.length;e++){const n=r[e];t.expandByPoint(n)}}const n=t.min.x||0;return(t.max.x||0)-n}toThreeGeometry(){const e=this.polyLines,t=[],n=[];let r=0;const i=new Kr;for(let i=0;i<e.length;i++){const s=e[i];for(let e=0;e<s.length;e++){const i=s[e];t.push(i.x,i.y,0),e===s.length-1||n.push(r,r+1),r++}}return i.setAttribute("position",new zr(t,3)),i.setIndex(n),i}}class bw{static parserHeader(e,t){let n="",r=!1,i=0;for(;;){const s=e.readInt8(),a=String.fromCharCode(s);if(r)a===t[i]?i++:(r=!1,i=0);else{if(a===t[i]){r=!0,i++;continue}n+=a}if(r&&i===t.length)break}return n}static getCode(e){const t=gw(e);return t.length<2?t[0]:t.length<4?mw.ToUInt16(t,0):mw.ToUInt32(t,0)}static parserCode(e,t,n){let r=new Xt;const i=[];let s=[];const a=[];let o=!1;for(let c=0;c<t.length;c++){const u=t[c];switch(u){case 0:break;case 1:o=!0,s.push(r.clone());break;case 2:o=!1,s.length>1&&(i.push(M()(s).call(s)),s=[]);break;case 3:c++,n/=t[c];break;case 4:c++,n*=t[c];break;case 5:if(4===a.length)throw"The position stack is only four locations deep";a.push(r);break;case 6:r=a.pop(),s.length>1&&(i.push(M()(s).call(s)),s=[]),o&&s.push(r.clone());break;case 7:{let a,o=0,u=n*e.baseUp;const h=r.clone();switch(s.length>1&&(i.push(M()(s).call(s)),s=[]),e.type){case Ew.Shapes:c++,o=t[c];break;case Ew.Bigfont:if(c++,o=t[c],0==o){c++,o=mw.ToUInt16(new Uint8Array([t[c++],t[c++]]),0),h.x=t[c++]*n,h.y=t[c++]*n;u=t[c]*n}break;case Ew.Unifont:c+=2,o=mw.ToUInt16(new Uint8Array([t[c-1],t[c]]),0)}var l;if(0!==o)if(a=e.getGraphicTextShape(o,u,h),a)i.push(...M()(l=a.polyLines).call(l)),r=a.lastPoint.clone()}break;case 8:{const e=new Xt;e.x=mw.byteTosbyte(t[++c]),e.y=mw.byteTosbyte(t[++c]),r.add(e.multiplyScalar(n)),o&&s.push(r.clone())}break;case 9:{const e=!0;for(;e;){const e=new Xt;if(e.x=mw.byteTosbyte(t[++c]),e.y=mw.byteTosbyte(t[++c]),0==e.x&&0==e.y)break;r.add(e.multiplyScalar(n)),o&&s.push(r.clone())}}break;case 10:{const e=t[++c]*n,i=mw.byteTosbyte(t[++c]),a=(112&i)>>4;let l=7&i;0==l&&(l=8);const u=Math.PI/4;let h=u*l,p=bw.CICLESPAN;i<0&&(p=-p,h=-h);const d=u*a,m=d+h,f=r.clone().sub(new Xt(Math.cos(d)*e,Math.sin(d)*e));if(r=f.clone().add(new Xt(Math.cos(m)*e,Math.sin(m)*e)),o){let t=d;const n=!0;for(;n&&(t+=p,i>=0&&t<m||i<0&&t>m);)s.push(f.clone().add(new Xt(e*Math.cos(t),e*Math.sin(t))));s.push(r.clone())}}break;case 11:{const e=t[++c],i=t[++c],a=(255*t[++c]+t[++c])*n,l=mw.byteTosbyte(t[++c]),u=(112&l)>>4;let h=7&l;0==h&&(h=8),0!=i&&h--;const p=Math.PI/4;let d=p*h,m=bw.CICLESPAN,f=1;l<0&&(m=-m,d=-d,f=-1);let g=p*u,_=g+d;g+=p*e/256*f,_+=p*i/256*f;const v=r.clone().sub(new Xt(a*Math.cos(g),a*Math.sin(g)));if(r=v.clone().add(new Xt(a*Math.cos(_),a*Math.sin(_))),o){let e=g;const t=!0;for(;t&&(e+=m,l>0&&e<_||l<0&&e>_);)s.push(v.clone().add(new Xt(a*Math.cos(e),a*Math.sin(e))));s.push(r.clone())}}break;case 12:{const e=new Xt;e.x=mw.byteTosbyte(t[++c])*n,e.y=mw.byteTosbyte(t[++c])*n;let i=mw.byteTosbyte(t[++c]);i<-127&&(i=-127),o&&(0==i?s.push(r.clone().add(e)):s.push(bw._generateArcPoints(r,e,i/127))),r.add(e)}break;case 13:{const e=!0;for(;e;){const e=new Xt;if(e.x=mw.byteTosbyte(t[++c])*n,e.y=mw.byteTosbyte(t[++c])*n,0==e.x&&0==e.y)break;let i=mw.byteTosbyte(t[++c]);i<-127&&(i=-127),o&&(0==i?s.push(r.clone().add(e)):s.push(bw._generateArcPoints(r.clone(),e,i/127))),r.add(e)}}break;case 14:c=bw.skipCode(e,t,++c);break;default:if(u>15){const e=(240&u)>>4,t=15&u,i=new Xt;switch(t){case 0:i.x=1;break;case 1:i.x=1,i.y=.5;break;case 2:i.x=1,i.y=1;break;case 3:i.x=.5,i.y=1;break;case 4:i.y=1;break;case 5:i.x=-.5,i.y=1;break;case 6:i.x=-1,i.y=1;break;case 7:i.x=-1,i.y=.5;break;case 8:i.x=-1;break;case 9:i.x=-1,i.y=-.5;break;case 10:i.x=-1,i.y=-1;break;case 11:i.x=-.5,i.y=-1;break;case 12:i.y=-1;break;case 13:i.x=.5,i.y=-1;break;case 14:i.x=1,i.y=-1;break;case 15:i.x=1,i.y=-.5}r.add(i.multiplyScalar(e*n)),o&&s.push(r.clone())}}}return new yw(r,i)}static skipCode(e,t,n){switch(t[n]){case 0:case 1:case 2:case 5:case 6:case 14:default:break;case 3:case 4:n++;break;case 7:switch(e.type){case Ew.Shapes:n++;break;case Ew.Bigfont:0==t[++n]&&(n+=6);break;case Ew.Unifont:n+=2}break;case 8:case 10:n+=2;break;case 9:{const e=!0;for(;e;){const e=t[++n],r=t[++n];if(0==e&&0==r)break}}break;case 11:n+=5;break;case 12:n+=3;break;case 13:{const e=!0;for(;e;){const e=t[++n],r=t[++n];if(0==e&&0==r)break;t[++n]}}}return n}static _generateArcPoints(e,t,n){const r=e.clone().add(t),i=n<0;n=Math.abs(n);const s=t.length()/2,a=s*n,o=2*Math.atan(1/n),l=new Xt(t.y,-t.x);l.normalize(),l.multiplyScalar(a);const c=Math.abs(s/Math.sin(o/2)),u=e.add(t.divideScalar(2));!1!==i?u.add(l):u.sub(l);const h=e.sub(u),p=r.sub(u);let d=Math.atan2(h.y,h.x);const m=Math.atan2(p.y,p.x);let f=bw.CICLESPAN;i?(f=-f,d<m&&(d+=2*Math.PI)):d>m&&(d-=2*Math.PI);let g=d;for(;;){if(g+=f,!i&&g<m||i&&g>m)return u.add(new Xt(c*Math.cos(g),c*Math.sin(g)));break}return r}}gh(bw,"stopFlag","0x00"),gh(bw,"FILE_STOP_FLAG",["\r","\n",""]),gh(bw,"CICLESPAN",Math.PI/18);class xw extends rw{tableName(){return"fontdata"}static instance(){return xw._instance||(xw._instance=new xw),xw._instance}query(e,t,n){let r;super.query((n=>{n?n.value&&n.value.url===e&&(r=n.value):t&&t(r)}),(e=>{n&&n(),console.log(e)}))}queryAll(){try{return v().resolve(new(v())(((e,t)=>{super.queryAll((t=>{e(t)}),(e=>{t(e)}))})))}catch(e){return v().reject(e)}}}gh(xw,"_instance",void 0);const Tw={130:[[[5,0],[5,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]]],131:[[[3,0],[7,0]],[[5,0],[5,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]]],132:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]]],133:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[3,9.5],[7,9.5]]],134:[[[3,0],[7,0]],[[5,0],[5,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[12,10],[9,10],[9,6]],[[9,8],[11,8]]],135:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[12,10],[9,10],[9,6]],[[9,8],[11,8]]],136:[[[3,0],[7,0]],[[4,0],[4,9.5]],[[6,0],[6,9.5]],[[4,7.1],[2.6,6.6],[2.1,6.2],[1.7,5.4],[1.6,4],[2.1,3],[2.6,2.6],[3.9,2.2],[6.1,2.2],[7.5,2.6],[8,3.1],[8.4,3.9],[8.4,5.2],[7.9,6.1],[7.5,6.6],[6.1,7.1],[4,7.1]],[[3,9.5],[7,9.5]],[[12,10],[9,10],[9,6]],[[9,8],[11,8]]],178:[[[1.142,9.285],[1.142,9.428],[1.285,9.714],[1.428,9.857],[1.714,10],[2.285,10],[2.571,9.857],[2.714,9.714],[2.857,9.428],[2.857,9.142],[2.714,8.857],[2.428,8.428],[1,7],[3,7]]],8960:[[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]],[[0,0],[8,8]]],20393:[[[0,0],[0,6.666]],[[0,4.761],[1.428,6.19],[2.38,6.666],[3.809,6.666],[4.761,6.19],[5.238,4.761],[5.238,0]],[[5.238,4.761],[6.666,6.19],[7.619,6.666],[9.047,6.666],[10,6.19],[10.476,4.761],[10.476,0]],[[11.142,9.285],[11.142,9.428],[11.285,9.714],[11.428,9.857],[11.714,10],[12.285,10],[12.571,9.857],[12.714,9.714],[12.857,9.428],[12.857,9.142],[12.714,8.857],[12.428,8.428],[11,7],[13,7]]],41123:[],55714:[[[2,5.9],[2.6,6.1],[3.4,7],[3.4,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],55970:[[[2.3,5.6],[2.3,5.9],[2.6,6.4],[2.9,6.7],[3.4,7],[4.6,7],[5.1,6.7],[5.4,6.4],[5.7,5.9],[5.7,5.3],[5.4,4.7],[4.9,3.9],[2,1],[6,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56226:[[[2.6,7],[5.7,7],[4,4.7],[4.9,4.7],[5.4,4.4],[5.7,4.1],[6,3.3],[6,2.7],[5.7,1.9],[5.1,1.3],[4.3,1],[3.4,1],[2.6,1.3],[2.3,1.6],[2,2.1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56482:[[[4.9,7],[2,3],[6.3,3]],[[4.9,7],[4.9,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56738:[[[5.4,7],[2.6,7],[2.3,4.4],[2.6,4.7],[3.4,5],[4.3,5],[5.1,4.7],[5.7,4.1],[6,3.3],[6,2.7],[5.7,1.9],[5.1,1.3],[4.3,1],[3.4,1],[2.6,1.3],[2.3,1.6],[2,2.1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],56994:[[[5.4,6.1],[5.1,6.7],[4.3,7],[3.7,7],[2.9,6.7],[2.3,5.9],[2,4.4],[2,3],[2.3,1.9],[2.9,1.3],[3.7,1],[4,1],[4.9,1.3],[5.4,1.9],[5.7,2.7],[5.7,3],[5.4,3.9],[4.9,4.4],[4,4.7],[3.7,4.7],[2.9,4.4],[2.3,3.9],[2,3]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],57250:[[[2,7],[6,7],[3.1,1]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],57506:[[[3.4,7],[2.6,6.7],[2.3,6.1],[2.3,5.6],[2.6,5],[3.1,4.7],[4.3,4.4],[5.1,4.1],[5.7,3.6],[6,3],[6,2.1],[5.7,1.6],[5.4,1.3],[4.6,1],[3.4,1],[2.6,1.3],[2.3,1.6],[2,2.1],[2,3],[2.3,3.6],[2.9,4.1],[3.7,4.4],[4.9,4.7],[5.4,5],[5.7,5.6],[5.7,6.1],[5.4,6.7],[4.6,7],[3.4,7]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],57762:[[[5.7,5],[5.4,4.1],[4.9,3.6],[4,3.3],[3.7,3.3],[2.9,3.6],[2.3,4.1],[2,5],[2,5.3],[2.3,6.1],[2.9,6.7],[3.7,7],[4,7],[4.9,6.7],[5.4,6.1],[5.7,5],[5.7,3.6],[5.4,2.1],[4.9,1.3],[4,1],[3.4,1],[2.6,1.3],[2.3,1.9]],[[2.9,8],[1.7,7.4],[.6,6.3],[0,4.6],[0,3.4],[.6,1.7],[1.7,.6],[2.9,0],[4.6,0],[5.7,.6],[6.9,1.7],[7.4,3.4],[7.4,4.6],[6.9,6.3],[5.7,7.4],[4.6,8],[2.9,8]]],60070:[[[0,6],[10,6],[10,4]]],60326:[[[0,7],[0,5],[10,5]]]};let ww,Ew;!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.All=2]="All"}(ww||(ww={})),function(e){e[e.Shapes=0]="Shapes",e[e.Bigfont=1]="Bigfont",e[e.Unifont=2]="Unifont"}(Ew||(Ew={}));const Sw=new $t;class Iw{constructor(e){gh(this,"type",Ew.Bigfont),gh(this,"info",""),gh(this,"orientation",ww.Horizontal),gh(this,"baseUp",0),gh(this,"baseDown",0),gh(this,"fileHeader",""),gh(this,"fileVersion",""),gh(this,"url",void 0),gh(this,"datas",{}),gh(this,"graphicData",new(ue())),this.url=e}getGraphicDataByCode(e,t){if(0===e)return;const n=this.datas;if(!this.graphicData.has(e)){if(!n[e]){if(Tw[e]){const n=[];for(let t=0;t<Tw[e].length;t++){var r;n.push(Z()(r=Tw[e][t]).call(r,(e=>new Xt(e[0],e[1]))))}const i=new yw(new Xt,n),s=t/kw.DEFAULT_SIZE;return Sw.identity().scale(s,s),i.transform(Sw)}return}{const t=n[e],r=kw.DEFAULT_SIZE/this.baseUp,i=bw.parserCode(this,t,r);this.graphicData.set(e,i)}}if(this.graphicData.has(e)){const n=t/kw.DEFAULT_SIZE;return Sw.identity().scale(n,n),this.graphicData.get(e).transform(Sw)}}getGraphicTextShape(e,t,n){var r;return null===(r=this.getGraphicDataByCode(e,t))||void 0===r?void 0:r.offset(n)}getFontFile(){return{url:this.url,type:this.type,datas:this.datas,info:this.info,orientation:this.orientation,baseUp:this.baseUp,baseDown:this.baseDown,fileHeader:this.fileHeader,fileVersion:this.fileVersion}}setFontFile(e){this.url=e.url,this.type=e.type,this.datas=e.datas,this.info=e.info,this.orientation=e.orientation,this.baseUp=e.baseUp,this.baseDown=e.baseDown,this.fileHeader=e.fileHeader,this.fileVersion=e.fileVersion}releaseFontData(){this.datas={},this.graphicData.clear()}setFontDataToIndexedDb(){try{const e=this,t=e.getFontFile();return v().resolve(new(v())(((n,r)=>{xw.instance().save(t,(()=>{console.log(`[FontFile] Saved '${e.url}' (${e.fileHeader}) to indexedDb`),n()}),(t=>r(`[FontFile] Failed to save '${e.url}' (${e.fileHeader}) to indexedDb! ${t}`)))})))}catch(e){return v().reject(e)}}getFontDataByIndexedDb(){try{const e=this;return v().resolve(new(v())(((t,n)=>{xw.instance().query(e.url,(e=>{t(e)}),(()=>n("[FontFile] Failed to get FontData from IndexedDB")))})))}catch(e){return v().reject(e)}}}class Mw extends Iw{constructor(e){super(e),gh(this,"isExtend",!1),gh(this,"type",Ew.Bigfont)}init(e){mw.ToInt16(e.readBytes(2),0);const t=mw.ToInt16(e.readBytes(2),0),n=mw.ToInt16(e.readBytes(2),0);for(let t=0;t<n;t++)e.readBytes(2),e.readBytes(2);const r=[];for(let n=0;n<t;n++){const t=e.readBytes(8),n=mw.ToUInt16(new Uint8Array([t[1],t[0]]),0),i=mw.ToUInt16(t,2),s=mw.ToUInt32(t,4);if(0===n&&0===i&&0===s)continue;const a=new Aw;a.code=n,a.length=i,a.offset=s,r.push(a)}const i={};for(const t of r)e.setPosition(t.offset),i[t.code]=e.readBytes(t.length);const s=i[0],a=this.info=function(e){let t,n,r,i,s;t="";const a=e.length;n=0;for(;n<a;)switch(r=e[n++],r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(r);break;case 12:case 13:i=e[n++],t+=String.fromCharCode((31&r)<<6|63&i);break;case 14:i=e[n++],s=e[n++],t+=String.fromCharCode((15&r)<<12|(63&i)<<6|(63&s)<<0)}return t}(s);let o=w()(a).call(a,"\0")+1;s.length-o==4?(this.baseUp=s[o++],this.baseDown=s[o++],this.orientation=s[o++]):(this.baseUp=s[o++],o++,this.orientation=s[o++],this.baseDown=s[o++],this.isExtend=!0),this.datas=i}}class Aw{constructor(){gh(this,"code",0),gh(this,"length",0),gh(this,"offset",0)}}class Rw extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Uc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){const n=i.parse(JSON.parse(e));t&&t(n)}),n,r)}parse(e){return new Dw(e)}}class Dw{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(e,t,n){const r=k(e),i=t/n.resolution,s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[];let o=0,l=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)o=0,l-=s;else{const e=Cw(t,i,o,l,n);o+=e.offsetX,a.push(e.path)}}return a}(e,t,this.data);for(let e=0,t=r.length;e<t;e++)n.push(...r[e].toShapes());return n}}function Cw(e,t,n,r,i){const s=i.glyphs[e]||i.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");const a=new Ru;let o,l,c,u,h,p,d,m;if(s.o){const e=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let i=0,s=e.length;i<s;){switch(e[i++]){case"m":o=e[i++]*t+n,l=e[i++]*t+r,a.moveTo(o,l);break;case"l":o=e[i++]*t+n,l=e[i++]*t+r,a.lineTo(o,l);break;case"q":c=e[i++]*t+n,u=e[i++]*t+r,h=e[i++]*t+n,p=e[i++]*t+r,a.quadraticCurveTo(h,p,c,u);break;case"b":c=e[i++]*t+n,u=e[i++]*t+r,h=e[i++]*t+n,p=e[i++]*t+r,d=e[i++]*t+n,m=e[i++]*t+r,a.bezierCurveTo(h,p,d,m,c,u)}}}return{offsetX:s.ha*t,path:a}}class Ow extends Iw{constructor(e){super(e),gh(this,"type",Ew.Shapes)}init(e){e.readBytes(2),e.readBytes(2);const t=mw.ToInt16(e.readBytes(2),0),n=[];for(let r=0;r<t;r++){const t=new Pw;t.code=mw.ToUInt16(e.readBytes(2),0),t.length=mw.ToUInt16(e.readBytes(2),0),n.push(t)}const r={};for(const t of n)r[t.code]=e.readBytes(t.length);const i=r[0],s=this.info=(new TextDecoder).decode(i);let a=w()(s).call(s,"\0");this.baseUp=i[++a],this.baseDown=i[++a],this.orientation=i[++a],this.datas=r}}class Pw{constructor(){gh(this,"code",0),gh(this,"length",0)}}class Nw extends Iw{constructor(e){super(e),gh(this,"type",Ew.Unifont),gh(this,"isUniCode",!0),gh(this,"isEmbedded",!1)}init(e){const t=mw.ToInt32(e.readBytes(4),0),n=mw.ToInt16(e.readBytes(2),0),r=e.readBytes(n),i=this.info=(new TextDecoder).decode(r);let s=w()(i).call(i,"\0");this.baseUp=r[++s],this.baseDown=r[++s],this.orientation=r[++s],this.isUniCode=0==r[++s],this.isEmbedded=0==r[++s];const a={},o=[];for(let n=0;n<t-1;n++){const t=new Lw;t.code=mw.ToUInt16(e.readBytes(2),0),t.length=mw.ToUInt16(e.readBytes(2),0),a[t.code]=e.readBytes(t.length),o.push(t)}this.datas=a}}class Lw{constructor(){gh(this,"code",0),gh(this,"length",0)}}class kw extends Dw{constructor(e){super(""),gh(this,"files",void 0),gh(this,"filesMap",void 0),gh(this,"unsupportedChars",{}),gh(this,"textShapesCache",new(ue())),this.files=[],this.filesMap=new(ue()),e&&this.loadFiles(e)}loadFiles(e){try{const t=this;for(let n=0;n<e.length;n++){const r=e[n];t.files.push(t.loadFile(r))}return v().resolve(t.saveFontDataToIndexdb()).then((function(){t.releaseFontData()}))}catch(e){return v().reject(e)}}loadFile(e){const{url:t,arrayBuffer:n}=e,r=new UT(n),i=bw.parserHeader(r,bw.FILE_STOP_FLAG).split(" ");let s=null;switch(i[1]){case"shapes":s=new Ow(t);break;case"bigfont":s=new Mw(t);break;case"unifont":s=new Nw(t)}return s&&(s.fileHeader=i[0],s.fileVersion=i[2],s.init(r),this.filesMap.set(t,s)),im.info(`[ShxFont] shx font loaded.The font file is ${i[0]} ${i[2]}`),s}getGraphicDataByChar(e,t){let n=bw.getCode(e);return 0===n&&(n=e.charCodeAt(0)),this.getGraphicDataByCode(n,t)}getGraphicDataByCode(e,t){const n=`${e}_${t}`;if(this.textShapesCache.has(n))return this.textShapesCache.get(n);let r;for(let n=0;n<this.files.length;n++){if(r=this.files[n].getGraphicDataByCode(e,t),r)break}return r&&this.textShapesCache.set(n,r),r}getGraphicTextShape(e,t,n){var r;return null===(r=this.getGraphicDataByCode(e,t))||void 0===r?void 0:r.offset(n)}getGraphicData(e,t=kw.DEFAULT_SIZE,n=0,r=0,i=0,s,a=!1){const o=[],l=e.split("\n");let c=(l.length-1)*(r+n),u=0,h=!1;for(let e=0;e<l.length;e++){const a=l[e];for(let e=0;e<a.length;e++){let l=a[e];p=l,cp()(_w).call(_w,p)&&(l=vw(l));let d=this.getGraphicDataByChar(l,t);if(d||(d=this.getNotFoundTextShape(t),this.addUnsupportedChar(l)),d)if(0===d.polyLines.length&&(d.width=t,u+=i),h||s&&u+d.width>s){h?(u+=d.width+i,h=!1):(h=!0,u=0,c-=r+n);const e=d.offset(new Xt(u,c));o.push(e),!h&&(u+=d.width+i)}else{const e=d.offset(new Xt(u,c));o.push(e),u+=d.width+i}else this.addUnsupportedChar(l)}h=!1,u=0,c-=r+n}var p;return o}getNotFoundTextShape(e){const t=bw.getCode("");return this.getGraphicDataByCode(t,e)}generateShapes(e,t=kw.DEFAULT_SIZE,n=0,r=0,i=0){return this.getGraphicData(e,t,n,r,i)}addUnsupportedChar(e){this.unsupportedChars[e]||(this.unsupportedChars[e]=0),this.unsupportedChars[e]++}static checkFontIsLoaded(e){try{let t=!1;return v().resolve(xw.instance().queryAll()).then((function(n){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r];if(i.datas instanceof ue()){t=!1;break}if(0===Q()(i.datas).length){t=!1;break}if(!cp()(e).call(e,i.url)){t=!1;break}t=!0}return t}))}catch(e){return v().reject(e)}}saveFontDataToIndexdb(){try{var e;const t=this;xw.instance().clearAll();const n=Z()(e=t.files).call(e,(e=>e.setFontDataToIndexedDb()));return v().resolve(v().all(n).then((()=>{im.log("[ShxFont] Saves font data to IndexDB")})))}catch(e){return v().reject(e)}}getFontData(){try{const e=this;return v().resolve(xw.instance().queryAll()).then((function(t){const n=[],r=new(ue());for(let e=0;e<t.length;e++){const i=t[e];let s;switch(i.type){case Ew.Bigfont:s=new Mw(i.url);break;case Ew.Shapes:s=new Ow(i.url);break;case Ew.Unifont:s=new Nw(i.url)}s&&(s.setFontFile(i),n.push(s),r.set(i.url,s))}e.files=n,e.filesMap=r,im.log("[ShxFont] Loaded font data from cache.")}))}catch(e){return v().reject(e)}}releaseFontData(){for(let e=0;e<this.files.length;e++){this.files[e].releaseFontData()}this.files=[],this.filesMap.clear(),this.textShapesCache.clear()}destroy(){}}gh(kw,"DEFAULT_SIZE",12);class Fw extends tc{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}var Uw=n(92399),Bw=n.n(Uw);function jw(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gw(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=jw(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=jw(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}const zw={d:"°",c:"⌀",p:"±"},Vw=e=>e.replace(/\\[uU]\+([0-9a-fA-F]{4})/g,((e,t)=>lw()(L()(t,16)))),Hw=(e,t)=>{let n=t instanceof TextDecoder?t:new TextDecoder(t);return e.replace(/\\[mM]\+[0|1]([0-9a-fA-F]{2})([0-9a-fA-F]{2})/g,((e,r,i)=>(n=n||new TextDecoder(t)).decode(new Uint8Array([L()(r,16),L()(i,16)]))))},qw=(e,t)=>{e=((e,t)=>(e=Vw(e),t?Hw(e,t):e))(e,null==t?void 0:t.encoding);let n=0,r={text:""};const i=[r];for(const t of Bw()(e).call(e,/%%(\d\d\d|.)/g)){r.text+=M()(e).call(e,n,t.index);const s=t[1].toLowerCase(),a=zw[s];a?r.text+=a:3===s.length?r.text+=lw()(+s):"k"===s||"o"===s||"u"===s?(r=Gw(Gw({},r),{},{text:""}),r[s]?delete r[s]:r[s]=1,i.push(r)):r.text+=s,n=t.index+t[0].length}return r.text+=M()(e).call(e,n),le()(i).call(i,(e=>e.text))};function Ww(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function Yw(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xw(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=Yw(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=Yw(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}const $w=new xn(1,0,0),Kw=new xn(0,1,0),Zw=new xn(0,0,1),Jw=new xn(0,0,0),Qw=new Xo({color:0}),eE=new Fo({color:0}),tE=new kr({color:0}),nE=new Zn,rE=(new Zn,new Zn),iE=new Zn,sE=new xn,aE=new xn,oE=new Xt,lE=new bn,cE={Math:{}};cE.Math.angle2=function(e,t){const n=new Xt(e.x,e.y),r=new Xt(t.x,t.y);return r.sub(n),r.normalize(),r.y<0?-Math.acos(r.x):Math.acos(r.x)},cE.Math.polar=function(e,t,n){return{x:e.x+t*Math.cos(n),y:e.y+t*Math.sin(n)}};const uE=(e,t,n,r)=>{const i=e?new Xt(e.x,e.y):new Xt(0,0),s=t?new Xt(t.x,t.y):new Xt(1,0);n=n||1;const a=4*Math.atan(n),o=i.distanceTo(s)/2/Math.sin(a/2),l=cE.Math.polar(e,o,cE.Math.angle2(i,s)+(Math.PI/2-a/2));r=r||Math.max(Math.abs(Math.ceil(a/(Math.PI/18))),6);const c=cE.Math.angle2(l,i),u=a/r,h=[];h.push(new xn(i.x,i.y,0));for(let e=1;e<=r-1;e++){const t=cE.Math.polar(l,Math.abs(o),c+u*e);h.push(new xn(t.x,t.y,0))}return h},hE=(e,t=!1)=>{const n=[],r=e.length;for(let i=0;i<r;i++){const s=e[i];if(s.bulge&&(i!==r-1||t)){const t=s.bulge,a=i+1<r?e[i+1]:n[0],o=uE(s,a,t);n.push(...o)}else n.push(new xn(s.x,s.y,0))}return n};class pE extends Lc{constructor(e=!1){super(),gh(this,"MODEL_LAYOUT_NAME","Model"),gh(this,"timer",Yh()()),gh(this,"ignorePaperSpace",!1),gh(this,"font",void 0),gh(this,"angBase",0),gh(this,"angDir",0),gh(this,"header",void 0),gh(this,"pointsMaterials",{}),gh(this,"lineBasicMaterials",{}),gh(this,"lineShaderMaterials",{}),gh(this,"meshBasicMaterials",{}),gh(this,"meshTextureMaterials",{}),gh(this,"hatchShaderMaterials",[]),gh(this,"entityCount",0),gh(this,"curveCount",0),gh(this,"averageCurveSize",0),gh(this,"enableRenderOrder",!1),gh(this,"enableLocalCache",!0),gh(this,"enableReleaseData",!0),gh(this,"enableMerge",!0),gh(this,"enableSimplify",!0),gh(this,"enableRTC",!0),gh(this,"enableWidthLine",!1),gh(this,"dxfDataId",void 0),gh(this,"compareContext",void 0),gh(this,"statsInfo",{unsupportedEntity:{},unsupportedEntityTypes:{},unsupportedTextStyles:{},unsupportedHatchPatterns:{},invisibleEntities:{},ignoredFrozenLayersAndEntityCount:{},ignoredInserts:{},entityTypesAndMeshCount:{},ignoredPaperSpaceEntityTypesAndCount:{},rebasedEntityCount:0}),gh(this,"blockReferencesCache",{}),gh(this,"blockRecordsCache",void 0),gh(this,"entitiesCache",void 0),gh(this,"blocksCache",void 0),gh(this,"dictionaryOwnerHandleAndSpatialFilterHandlesCache",void 0),gh(this,"spatialFiltersCache",void 0),gh(this,"entityThreejsCache",void 0),gh(this,"entityTypesAndTimes",void 0),gh(this,"nonSnapableTypes",new(pe())(["ATTDEF","ATTRIB","LEADER","MTEXT","MULTILEADER","OLE2FRAME","TEXT"])),gh(this,"entityHandlesWithRenderOrder",{}),gh(this,"addViewport",((e,t)=>{if("VIEWPORT"===e.type){t[e.ownerHandle]||(t[e.ownerHandle]=[]);const n=e;t[e.ownerHandle].push(n)}})),this.ignorePaperSpace=e,this.pointsMaterials[0]=Qw,this.lineBasicMaterials[0]=eE,this.meshBasicMaterials[0]=tE}setFont(e){return this.font=e,this}download(e,t){try{const n=this;let r=(e=>{if(e){const t=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);if(t&&t.length>0){const n=t[1],r=e.replace("data:"+n+";","").split(",");if(r&&2===r.length&&"base64"===r[0]){const e=r[1];return Ex(e)}}}return null})(e);const i=function(){if(!r){n.timer=Yh()();const i=new Uc(n.manager);return i.setResponseType("arraybuffer"),i.setPath(n.path),v().resolve(i.loadAsync(e,t)).then((function(e){r=e,im.info(`[DxfLoader] Dxf file downloaded in ${(Yh()()-n.timer)/1e3}s`)}))}}();return v().resolve(i&&i.then?i.then((function(){return r})):r)}catch(e){return v().reject(e)}}load(e,t,n){try{const r=this;return r.enableLocalCache&&t&&(t=ae()(t).call(t)).length>0&&(r.dxfDataId=t),v().resolve(r.loadAsync(e,n))}catch(e){return v().reject(e)}}loadAsync(e,t){try{let n=!1;const r=this;function i(i){return n?i:v().resolve(r.parse(e,t)).then((function(e){return r.loadEntities(e,t)}))}const s=function(){if(r.enableLocalCache&&r.dxfDataId){let e;return Ww((function(){return r.timer=Yh()(),v().resolve(r.getDxfDataFromIndexedDb(r.dxfDataId)).then((function(i){if(e=i,e){im.info(`[DxfLoader] Loaded DxfData from indexedDb in ${(Yh()()-r.timer)/1e3}s`);const i=r.loadEntities(e,t),s=v().resolve(i);return n=!0,s}}))}),(function(e){im.warn("[DxfLoader] Failed to parse data from indexedDb",e)}))}}();return v().resolve(s&&s.then?s.then(i):i(s))}catch(a){return v().reject(a)}}parse(e,t){try{const n=this;return v().resolve(n.download(e,t)).then((function(t){t||v().reject(`[DxfLoader] Failed to download ${e}`),n.timer=Yh()(),im.info("[DxfLoader] Start parsing...");const r=(new XT).parseSync(t);im.info(`[DxfLoader] Parsed in ${(Yh()()-n.timer)/1e3}s, creating entities...`);const i=function(){if(r){n.parseHeader(r.header);const e=function(){if(n.enableLocalCache&&n.dxfDataId){const e=Yh()(),t=Ww((function(){return v().resolve(n.setDxfDataToIndexedDb(n.dxfDataId,r)).then((function(){im.info(`[DxfLoader] Saved to indexedDb in ${(Yh()()-e)/1e3}s`)}))}),(function(e){im.warn(`[DxfLoader] Failed to save '${n.dxfDataId}' to indexedDb!`,e)}));if(t&&t.then)return t.then((function(){}))}}();if(e&&e.then)return e.then((function(){}))}}();return i&&i.then?i.then((function(){return r})):r}))}catch(e){return v().reject(e)}}parseHeader(e){if(!e)return void im.error("[DxfLoader]: Invalid header!");this.header=e;const t=e.$ACADVER.toString();"AC1032"!==t&&im.warn(`[DxfLoader] Unexpected version: ${t}. But we'll try to continue.`),this.angBase=e.$ANGBASE||0,this.angDir=e.$ANGDIR||0}loadEntities(e,t){var n,r,i;const s=Yh()();this.enableRenderOrder&&(this.initRenderOrderInfo(e),this.enableMerge=!1);let a=0;const o=e.entities.length;this.entityCount=o,ge()(n=Q()(e.blocks)).call(n,(t=>{var n;this.entityCount+=(null===(n=e.blocks[t].entities)||void 0===n?void 0:n.length)||0}));const l=Math.round(Math.pow(o,.5)),c={};ge()(r=e.objects.LAYOUT).call(r,(e=>{const t=e;c[t.layoutName]=t}));const u={},h=e=>{const t=e.userData.layerName;let n=u[t];n||(n=[],u[t]=n),n.push(e)},p={},d={},m=new io;uf.setSharedVariablesOfObject(m);for(let n=0;n<o;n++){var f;const r=e.entities[n];this.addViewport(r,p);const i=this.drawEntity(r,e);if(!i)continue;if(this.enableMerge){const e=!1;df.merge(i,e)}const s=this.getLayout(e,r).layoutName;let u=Se()(f=m.children).call(f,(e=>e.name===s));u||(u=new io,uf.setSharedVariablesOfObject(u),u.name=s,u.userData.isLayoutLevelObject=!0,m.add(u)),a++,d[s]||(d[s]={object:u,layerObjects:{}});const g=d[s];let _;if(s!==this.MODEL_LAYOUT_NAME){const e=c[s];e.directAssociatedLeafObjectSet||(e.directAssociatedLeafObjectSet=new(pe())),_=e.directAssociatedLeafObjectSet}if(this.enableMerge&&i.geometry){uf.setSharedVariablesOfObject(i);const t=i.userData.layerName;!1===this.getLayerVisible(e,t)&&(i.visible=!1),g.layerObjects[t]||(g.layerObjects[t]=[]),g.layerObjects[t].push(i)}else u.add(i),i.traverse((t=>{if(uf.setSharedVariablesOfObject(t),t.geometry){const n=t.userData.layerName;!1===this.getLayerVisible(e,n)&&(t.visible=!1),h(t),_&&_.add(t)}}));if(t&&(n%l==0||n===o-1)){t(new ProgressEvent("parseProgress",{lengthComputable:!0,loaded:n+1,total:o}))}}const g=e.objects.LAYOUT;ge()(g).call(g,(t=>{const n=t,r=n.layoutName;if(this.ignorePaperSpace&&"Model"!==r)return;const i=n.associatedBlockName,s=e.blocks[i];s&&this.drawLayout(s,e,n,m,u,p)})),im.debug(`[DxfLoader] drawEntities in ${(Yh()()-s)/1e3}s`);for(const e in d){const t=d[e],n=t.object;let r;if(e!==this.MODEL_LAYOUT_NAME){const t=c[e];t.directAssociatedLeafObjectSet||(t.directAssociatedLeafObjectSet=new(pe())),r=t.directAssociatedLeafObjectSet}for(const e in t.layerObjects){const i=t.layerObjects[e],s=df.deepMerge(i,void 0,!1,!1,!0),a=s.added,o=s.removed;if(o.length!==i.length){let e=o;o.length>=100&&(e=new(pe())(o));const t=t=>x()(e)?w()(e).call(e,t)>=0:e.has(t);for(let e=0,s=i.length;e<s;e++){const s=i[e];t(s)||(n.add(s),h(s),r&&r.add(s))}}for(let e=0;e<a.length;e++){const t=a[e];uf.setSharedVariablesOfObject(t),n.add(t),h(t),r&&r.add(t)}t.layerObjects[e]=[]}}for(const e in this.entityTypesAndTimes)this.entityTypesAndTimes[e].averageTime=this.entityTypesAndTimes[e].totalTime/this.entityTypesAndTimes[e].createCount;if(im.info("[DxfLoader] Entity types and cost times in ms:",this.entityTypesAndTimes),im.info("[DxfLoader] Entity types and mesh count:",this.statsInfo.entityTypesAndMeshCount),this.enableSimplify){const e=kv.simplifiedInfo;im.info(`[DxfLoader] Totally simplified/removed ${e.removed}(out of ${e.total}) points`)}let _=0;if(ge()(i=tp()(this.statsInfo.entityTypesAndMeshCount)).call(i,(e=>{_+=e})),this.enableRTC&&im.info(`[DxfLoader] Totally rebased ${this.statsInfo.rebasedEntityCount}(out of ${_}) entities`),this.enableMerge){const e=df.mergeInfo;im.info(`[DxfLoader] Inner merged ${e.removedObjects} objects to ${e.mergedMeshes} meshes, ${e.mergedLines} lines, ${e.mergedPoints} points, ${e.mergedUnknownTypeObjects?e.mergedUnknownTypeObjects+" unknown type,":""} in ${e.elapsedTime/1e3}s`)}const v=(e,t,...n)=>{Q()(t).length,0};v(0,this.statsInfo.unsupportedEntityTypes),v(0,this.statsInfo.unsupportedTextStyles),v(0,this.statsInfo.unsupportedHatchPatterns),v(0,this.statsInfo.invisibleEntities),v(0,this.statsInfo.ignoredFrozenLayersAndEntityCount),v(0,this.statsInfo.ignoredInserts),this.ignorePaperSpace&&v(0,this.statsInfo.ignoredPaperSpaceEntityTypesAndCount),this.font.unsupportedChars&&v(0,this.font.unsupportedChars),this.enableReleaseData&&(this.releaseCachedData(),this.releaseDxfData(e)),im.info(`[DxfLoader] LoadEntities() done in ${(Yh()()-s)/1e3}s`);return Xw(Xw({},e),{},{threejsObject:m,layersAndThreejsObjects:u,loadedEntityCount:a,layoutViewportsMap:p})}loadEntitiesForCompare(e,t,n,r){let i=0;const s=(e,t)=>{var r;const s=new io;i+=e.entities.length;const a=e.entities.length;this.entityCount=a,ge()(r=Q()(e.blocks)).call(r,(t=>{var n;this.entityCount+=(null===(n=e.blocks[t].entities)||void 0===n?void 0:n.length)||0}));const o={};for(let r=0;r<a;r++){const i=e.entities[r];if(this.getLayout(e,i).layoutName!==this.MODEL_LAYOUT_NAME)continue;const a=this.setEntityCompareChangeType(i,n,e);if(!t&&a===sw.NoChange)continue;const l=this.drawEntity(i,e);if(!l)continue;if(this.enableMerge){const e=!1;df.merge(l,e)}let c=s.children[0];c||(c=new io,c.name=this.MODEL_LAYOUT_NAME,c.userData.isLayoutLevelObject=!0,s.add(c)),c.add(l),l.traverse((t=>{if(t.geometry){const n=t.userData.layerName;!1===this.getLayerVisible(e,n)&&(t.visible=!1);let r=o[n];r||(r=[],o[n]=r),r.push(t)}}))}for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const r=n[e],i=this.entityThreejsCache&&this.entityThreejsCache[r.handle];if(r.blockHandle&&this.entityThreejsCache&&this.entityThreejsCache[r.blockHandle]&&!this.entityThreejsCache[r.blockHandle].visible)continue;if(r.type!==sw.NoChange&&i){if("INSERT"===i.userData.entityType&&r.blockHandle)continue;if(!i.parent)continue;if(r.type===sw.Added?!t&&(r.box=(new En).setFromObject(i,!0)):r.type===sw.Removed?t&&(r.box=(new En).setFromObject(i,!0)):r.type===sw.Modified&&(r.box?r.box.union((new En).setFromObject(i,!0)):r.box=(new En).setFromObject(i,!0)),r.box){const e=r.box.getSize(sE);if((e.x<1||e.y<1)&&r.box.expandByScalar(Math.max(e.x,e.y,e.z)/20),r.blockHandle){const e=this.entityThreejsCache&&this.entityThreejsCache[r.blockHandle];e&&r.box.applyMatrix4(e.matrix)}}}}const l=e;l.threejsObject=s,l.layersAndThreejsObjects=o,l.layoutViewportsMap={}};this.compareContext={changes:n,isTheFirstFile:!0},s(e,!0),this.statsInfo.unsupportedEntity={},this.entityThreejsCache={},this.blockRecordsCache={},this.blockReferencesCache={},this.compareContext.isTheFirstFile=!1,s(t,!1);const a=Math.round(Math.pow(i,.5));for(let e=0;e<i;e++)if(r&&(e%a==0||e===i-1)){r(new ProgressEvent("parseProgress",{lengthComputable:!0,loaded:e+1,total:i}))}this.enableReleaseData&&(this.releaseCachedData(),this.releaseDxfData(e),this.releaseDxfData(t))}setEntityCompareChangeType(e,t,n){if("INSERT"!==e.type&&"DIMENSION"!==e.type){var r;const n=t[e.handle],i=null!==(r=null==n?void 0:n.type)&&void 0!==r?r:sw.NoChange;return e.compareChangeType=i,i}{if(!e.block)return sw.NoChange;const r=n.blocks[e.block],s=t[e.handle];if(s){var i;const e=null!==(i=s.type)&&void 0!==i?i:sw.NoChange;if(r.entities)for(const t of r.entities)"ATTDEF"!==t.type&&this.setBlockEntityCompareChangeType(t,e,n);return e}if(r.entities)for(const e of r.entities)"ATTDEF"!==e.type&&this.setEntityCompareChangeType(e,t,n)}return sw.NoChange}setBlockEntityCompareChangeType(e,t,n){if("INSERT"!==e.type&&"DIMENSION"!==e.type)e.compareChangeType=t;else{if(!e.block)return;const r=n.blocks[e.block];if(r.entities)for(const e of r.entities)"ATTDEF"!==e.type&&this.setBlockEntityCompareChangeType(e,t,n)}}releaseCachedData(){this.header=void 0,this.pointsMaterials={},this.lineBasicMaterials={},this.lineShaderMaterials={},this.meshBasicMaterials={},this.meshTextureMaterials={},this.hatchShaderMaterials=[],this.blockReferencesCache={},this.blockRecordsCache=void 0,this.blocksCache=void 0,this.entitiesCache=void 0,this.dictionaryOwnerHandleAndSpatialFilterHandlesCache=void 0,this.spatialFiltersCache=void 0,this.entityThreejsCache=void 0,this.entityTypesAndTimes=void 0,this.entityHandlesWithRenderOrder={},this.statsInfo={unsupportedEntity:{},unsupportedEntityTypes:{},unsupportedTextStyles:{},unsupportedHatchPatterns:{},invisibleEntities:{},ignoredFrozenLayersAndEntityCount:{},ignoredInserts:{},entityTypesAndMeshCount:{},ignoredPaperSpaceEntityTypesAndCount:{},rebasedEntityCount:0}}releaseEntity(e){e.vertices&&(e.vertices=void 0),e.knotValues&&(e.knotValues=void 0),e.controlPoints&&(e.controlPoints=void 0),e.binaryData&&(e.binaryData=void 0),e.text&&(e.text=void 0),e.extendedData&&(e.extendedData=void 0),e.contextData&&(e.contextData=void 0);const t=e;t.boundaryPaths&&(t.boundaryPaths=[]),t.patternLines&&(t.patternLines=void 0)}releaseDxfData(e){delete e.objects.DICTIONARY,delete e.objects.SORTENTSTABLE,delete e.objects.XRECORD,delete e.tables.dimStyle,delete e.tables.lineType,delete e.tables.style,delete e.tables.blockRecord,e.entities=[],e.blocks={}}drawEntity(e,t,n){if(!0===this.getLayerFrozen(t,e)){const t=e.layer;return this.statsInfo.ignoredFrozenLayersAndEntityCount[t]||(this.statsInfo.ignoredFrozenLayersAndEntityCount[t]=0),void this.statsInfo.ignoredFrozenLayersAndEntityCount[t]++}if(!1===e.visible||e.invisible)return this.statsInfo.invisibleEntities[e.type]||(this.statsInfo.invisibleEntities[e.type]=0),void this.statsInfo.invisibleEntities[e.type]++;if(this.ignorePaperSpace&&e.inPaperSpace)return this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]||(this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]=0),void this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]++;this.entityThreejsCache||(this.entityThreejsCache={});const r=Yh()();let i,s=!1;if(this.entityThreejsCache[e.handle])i=this.entityThreejsCache[e.handle].clone(),s=!0;else if(!this.statsInfo.unsupportedEntity[e.handle]){if("CIRCLE"===e.type||"ARC"===e.type)i=this.drawArc(e,t,n);else if("LINE"===e.type||"POLYLINE"===e.type)i=this.drawLine(e);else if("XLINE"===e.type)i=this.drawXLine(e);else if("SEQEND"===e.type);else if("RAY"===e.type)i=this.drawRay(e);else if("LWPOLYLINE"===e.type)i=this.drawLWPolyline(e,t,n);else if("TEXT"===e.type)i=this.drawText(e,t,n);else if("SOLID"===e.type)i=this.drawSolid(e,t,n);else if("POINT"===e.type)i=this.drawPoint(e,t,n);else if("INSERT"===e.type)i=this.drawInsert(e,t);else if("SPLINE"===e.type)i=this.drawSpline(e);else if("MTEXT"===e.type)i=this.drawMText(e,t,n);else if("ELLIPSE"===e.type)i=this.drawEllipse(e,t,n);else if("DIMENSION"===e.type)i=this.drawDimension(e,t);else if("REGION"===e.type);else if("ATTDEF"===e.type)i=this.drawAttDef(e,t,n);else if("ATTRIB"===e.type){if(!n)for(let r=0;r<t.entities.length;r++){const i=t.entities[r];if(e.ownerHandle===i.handle&&(n=i).attributesFollow)break}i=this.drawAttrib(e,t,n)}else"HATCH"===e.type?i=this.drawHatch(e,t,n):"VIEWPORT"===e.type?i=this.drawViewport(e,t,n):"LEADER"===e.type?i=this.drawLeader(e,t,n):"MULTILEADER"===e.type?i=this.drawMLeader(e,t,n):"OLE2FRAME"===e.type&&(i=this.drawOle2frame(e,t));i&&(this.entityThreejsCache[e.handle]=i),this.enableReleaseData&&this.releaseEntity(e)}if(i){i.matrixAutoUpdate=Ih,i.updateMatrix();const r=this.getLayerName(e,t,n),a=this.getLayerVisible(t,r);i.userData.handle=e.handle,uf.setSharedVariablesOfObject(i),"INSERT"!==e.type&&"DIMENSION"!==e.type&&i.traverse((i=>{uf.setSharedVariablesOfObject(i),i.matrixAutoUpdate=Ih,i.updateMatrix(),i.geometry&&(!1===a&&(i.userData.layerVisible=!1),i.userData.layerName=r,this.setMaterial(i,e,t,n))})),s||(this.nonSnapableTypes.has(e.type)&&i.traverse((e=>{e.layers.set(Ah)})),this.enableRenderOrder&&(this.entityHandlesWithRenderOrder[e.handle]?i.renderOrder=L()(this.entityHandlesWithRenderOrder[e.handle],16)+.1:i.renderOrder=L()(e.handle,16)))}return"INSERT"!==e.type&&"DIMENSION"!==e.type&&(this.entityTypesAndTimes||(this.entityTypesAndTimes={}),this.entityTypesAndTimes[e.type]||(this.entityTypesAndTimes[e.type]={createCount:0,totalTime:0,averageTime:0}),this.entityTypesAndTimes[e.type].createCount++,this.entityTypesAndTimes[e.type].totalTime+=Yh()()-r),i?this.statsInfo.entityTypesAndMeshCount[e.type]?this.statsInfo.entityTypesAndMeshCount[e.type]++:this.statsInfo.entityTypesAndMeshCount[e.type]=1:(this.statsInfo.unsupportedEntityTypes[e.type]?this.statsInfo.unsupportedEntityTypes[e.type]++:this.statsInfo.unsupportedEntityTypes[e.type]=1,this.statsInfo.unsupportedEntity[e.handle]?this.statsInfo.unsupportedEntity[e.handle]++:this.statsInfo.unsupportedEntity[e.handle]=1),i}drawEllipse(e,t,n){if(!e.majorAxisEndPoint||!e.center||void 0===e.axisRatio||void 0===e.startAngle||void 0===e.endAngle)return;let r=e.startAngle,i=e.endAngle;if(e.extrusionDirection&&e.extrusionDirection.z<0&&(r=2*Math.PI-e.endAngle,i=2*Math.PI-e.startAngle),Gm.AreNumbersEqual(r,i,1e-5))return void im.warn("[DxfLoader] Ellipse entity (handle '%s') contains the same start and end angle, ignored!",e.handle);let s=i-r;for(;s>2*Math.PI;)s-=2*Math.PI;Math.abs(s)<=1e-5&&(i=Gm.floorNumber(r+2*Math.PI,5));const a=Math.sqrt(Math.pow(e.majorAxisEndPoint.x,2)+Math.pow(e.majorAxisEndPoint.y,2)),o=a*e.axisRatio,l=Math.atan2(e.majorAxisEndPoint.y,e.majorAxisEndPoint.x),c=new nl(e.center.x,e.center.y,a,o,r,i,!1,l);let u=1;const h=n;null!=h&&h.xScale&&null!=h&&h.yScale&&(u=Math.max(Math.abs(h.xScale),Math.abs(h.yScale)));const p=this.getDivision(r,i,Math.max(a,o)*u),d=c.getPoints(p),m=[],f=d.length;for(let e=0;e<f-1;e++)Gm.AreVector2sEqual(d[e],d[e+1],1e-9)||m.push(d[e]);if(m.push(d[f-1]),m.length<2)return void im.warn("[DxfLoader] Ellipse entity (handle '%s') contains less than 2 points, ignored!",e.handle);const g=new xn;let _=!1;this.enableRTC&&(_=ef.checkAndRebasePositionsOnRTC(m,g));const v=(new Kr).setFromPoints(m),y=new Vo(v,eE);return _&&(this.setRTCUserData(y),y.position.x+=g.x,y.position.y+=g.y),y}drawMText(e,t,n){if(!e.text)return;if(!this.font)return void im.info("[DxfLoader] Font parameter not set. Ignoring text entity.");const r=t.tables.style.styles[e.textStyle]||this.getDefaultTextStyle(t),i=uw(e.text,{encoding:this.getTextEncoding(r)}),s=this.mtextContentAndFormattingToTextAndStyle(i,e),a=this.getMTextGroup(s.text,e,t,n,s);if(!a)return;e.position&&(a.position.x+=e.position.x,a.position.y+=e.position.y);const o=(new En).setFromObject(a).getSize(sE),l=o.x,c=o.y;let u=0,h=0;switch(e.attachmentPoint){case 1:u=0,h=0;break;case 2:u-=l/2,h=0;break;case 3:u-=l,h=0;break;case 4:u=0,h+=c/2;break;case 5:u-=l/2,h+=c/2;break;case 6:u-=l,h+=c/2;break;case 7:u=0,h+=c;break;case 8:u-=l/2,h+=c;break;case 9:u-=l,h+=c;break;default:return}switch(s.style.horizontalAlignment){case"left":u=0;break;case"center":u=0,u-=l/2;break;case"right":u=0,u-=l}if(a.traverse((e=>{e.geometry&&e.geometry.translate(u,h,0)})),e.rotation&&(a.rotation.z=e.rotation*Math.PI/180),e.directionVector){const t=e.directionVector,n=new xn(t.x,t.y,t.z),r=n.clone().cross($w),i=new xn(1,0,0).angleTo(n);a.rotateZ(r.z>0?-i:i)}return s.lineLength>1?a.position.y-=o.y+s.style.textHeight:a.position.y-=o.y,a}getMTextGroup(e,t,n,r,i){if(0===e.length)return;let s=(i?i.style.textHeight:t.textHeight)||0;if(t.textStyle){const e=n.tables.style.styles[t.textStyle];s=s||e.textHeight}const a=s/1.5,o=s/2,l=new io;for(let s=0;s<e.length;s++){var c;const{text:u,colorIndex:h,lineNum:p}=e[s],d=this.getTextMesh(u,t,n,r,i);if(!d)continue;const m=(null===(c=u.match(new RegExp("\\n","g")))||void 0===c?void 0:c.length)||0;d.position.y-=(p+m)*(a+o),void 0!==h&&256!==h&&(t.color=Nx(h),t.colorIndex=h);const f=this.getColor(t,n,r);d.material instanceof kr?d.material=this.getMeshBasicMaterial(f):d.material instanceof Fo&&(d.material=this.getLineBasicMaterial(f)),l.add(d)}return 0!==l.children.length?(df.merge(l,!1),i&&l.translateY(i.lineLength*(a+o)),l):void 0}mtextContentAndFormattingToTextAndStyle(e,t){const n={horizontalAlignment:"",textHeight:t.height||t.contextData&&t.contextData.textHeight};let r=1;const i=[];for(let a=0;a<e.length;a++){const o=e[a];if("string"==typeof o)if(nx()(o).call(o,"pxq")&&vp()(o).call(o,";"))-1!==w()(o).call(o,"c")?n.horizontalAlignment="center":-1!==w()(o).call(o,"l")?n.horizontalAlignment="left":-1!==w()(o).call(o,"r")?n.horizontalAlignment="right":-1!==w()(o).call(o,"j")&&(n.horizontalAlignment="justify");else if(nx()(o).call(o,"pi"));else if(nx()(o).call(o,"pxt"));else if(nx()(o).call(o,"pt"));else{const e=this.getTextLineNum(o);i&&i[i.length-1]&&void 0===i[i.length-1].colorIndex?i[i.length-1].text+=o:i.push({text:o,lineNum:r}),r+=e}else if(x()(o)){var s;const e=this.mtextContentAndFormattingToTextAndStyle(o,t);ge()(s=e.text).call(s,(e=>{i&&i[i.length-1]&&i[i.length-1].colorIndex===e.colorIndex?i[i.length-1].text+=e.text:i.push(e)})),r=e.lineLength}else if("object"==typeof o)if(o.S&&3===o.S.length){const e=o.S[0]+"/"+o.S[2],t=this.getTextLineNum(e);i&&i[i.length-1]&&void 0===i[i.length-1].colorIndex?i[i.length-1].text+=e:i.push({text:o.S[0]+"/"+o.S[2],lineNum:r}),r+=t}else if(void 0!==o.C&&(a++,"string"==typeof e[a])){const t=this.getTextLineNum(e[a]);i&&i[i.length-1]&&i[i.length-1].colorIndex===o.C?i[i.length-1].text+=e[a]:i.push({colorIndex:o.C,text:e[a],lineNum:r}),r+=t}}return{text:i,lineLength:r,style:n}}getTextLineNum(e){const t=e.match(new RegExp("\\n","g"));return t?t.length:0}drawSpline(e){if(!e.controlPoints||!e.degreeOfSplineCurve||!e.knotValues)return;let t=e.controlPoints;if(this.enableSimplify){const e=this.getSimplifyTolerance();t=kv.simplifyPoints(t,e)}const n=new xn;let r=!1;this.enableRTC&&(r=ef.checkAndRebasePositionsOnRTC(t,n));const i=ef.getAdjacentNonRepeatPoints(t);if(i.length<2)return void im.warn("[DxfLoader] Spline entity (handle '%s') contains less than 2 points, ignored!",e.handle);const s=(new Kr).setFromPoints(i),a=new Vo(s,eE);return r&&(this.setRTCUserData(a),a.position.x+=n.x,a.position.y+=n.y),a}getBSplinePolyline(e,t,n,r,i){const s=[],a=Z()(e).call(e,(e=>[e.x,e.y])),o=[n[t]],l=[n[t],n[n.length-1-t]];for(let e=t+1;e<n.length-t;++e)o[o.length-1]!==n[e]&&o.push(n[e]);r=r||2;for(let e=1;e<o.length;++e){const c=o[e-1],u=o[e];for(let e=0;e<=r;++e){let o=(e/r*(u-c)+c-l[0])/(l[1]-l[0]);o=Math.max(o,0),o=Math.min(o,1);const h=Sx(o,t,a,n,i);s.push(new Xt(h[0],h[1]))}}return s}drawXLine(e){if(!e.vertices||0===e.vertices.length)return void im.warn("[DxfLoader] Entity is missing vertices:",e.handle);const t=cm.arrayOrObjectToVector3(e.directionVector),n=new xn(e.vertices[0].x,e.vertices[0].y,0),r=[];if(r.push(t.clone().multiplyScalar(-1e6).add(n)),r.push(t.clone().multiplyScalar(1e6).add(n)),0===r.length)return;const i=new xn;let s=!1;this.enableRTC&&(s=ef.checkAndRebasePositionsOnRTC(r,i));const a=(new Kr).setFromPoints(r),o=new Vo(a,eE);return s&&(this.setRTCUserData(o),o.position.x+=i.x,o.position.y+=i.y),o.renderOrder=Dx.Line,o}drawRay(e){var t;if(!e.vertices||0===e.vertices.length)return void im.warn("[DxfLoader] Entity is missing vertices:",e.handle);const n=cm.arrayOrObjectToVector3(e.directionVector),r=Z()(t=e.vertices).call(t,(e=>new xn(e.x,e.y,0)));if(r.push(n.multiplyScalar(1e6).add(r[0])),0===r.length)return;const i=new xn;let s=!1;this.enableRTC&&(s=ef.checkAndRebasePositionsOnRTC(r,i));const a=(new Kr).setFromPoints(r),o=new Vo(a,eE);return s&&(this.setRTCUserData(o),o.position.x+=i.x,o.position.y+=i.y),o.renderOrder=Dx.Line,o}drawLine(e){if(!e.vertices||0===e.vertices.length)return void im.warn("[DxfLoader] Entity is missing vertices:",e.handle);let t=[];if(e.isPolyfaceMesh)t=(e=>{const t=[],n=[];ge()(e).call(e,(e=>{e.polyfaceMeshVertex&&(e.threeDPolylineMesh?t.push(new xn(e.x,e.y,e.z)):n.push((e=>{const t=[];return e.faceA&&t.push(e.faceA),e.faceB&&t.push(e.faceB),e.faceC&&t.push(e.faceC),e.faceD&&t.push(e.faceD),t})(e)))}));const r=[];for(let e=0;e<n.length;e++){const i=n[e];if(0===i.length)continue;const s=[];let a=!0;for(let e=0;e<i.length;e++){const n=i[e]-1;if(n>=t.length||n<0){a=!1;break}s.push(t[n])}a&&0!==s.length&&(s.push(s[0]),r.push(s))}return r})(e.vertices);else{const n=hE(e.vertices,e.shape);e.shape&&n.length>0&&n.push(n[0]),n.length>0&&(t=[n])}if(0===t.length)return;const n=[];for(let e=0;e<t.length;){const[r,i]=t[e];Gm.AreVector3sEqual(r,i)?(n.push(r),S()(t).call(t,e,1)):e++}const r=new xn;let i,s=!1;if(t.length>0){if(this.enableRTC){let e=0;ge()(t).call(t,(t=>{ge()(t).call(t,(t=>{r.add(t),e++}))})),r.divideScalar(e),s=ef.shouldRebasePositionOnRTC(r)}const e=[],n=[];let a=0,o=0,l=0,c=0;ge()(t).call(t,(t=>{for(let i=0;i<t.length;i++)s?(o=t[i].x-r.x,l=t[i].y-r.y,c=t[i].z-r.z,e.push(new xn(o,l,c))):e.push(t[i]),i>0&&n.push(a+i-1,a+i);a=t.length}));const u=(new Kr).setFromPoints(e);u.setIndex(n),i=new Wo(u,eE)}if(n.length>0){this.enableRTC&&(s=ef.checkAndRebasePositionsOnRTC(n,r));const e=(new Kr).setFromPoints(n);i=new Qo(e,Qw)}return i?(s&&(this.setRTCUserData(i),i.position.x+=r.x,i.position.y+=r.y),i):void 0}drawLWPolyline(e,t,n){if(!e.vertices||e.vertices.length<2)return void im.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);const r=e;if(void 0!==r.extrusionDirectionX&&void 0!==r.extrusionDirectionY&&void 0!==r.extrusionDirectionZ){var i;sE.set(r.extrusionDirectionX,r.extrusionDirectionY,r.extrusionDirectionZ);const e=pE.getOcsMatrix(sE).invert();let t=0;void 0!==r.elevation&&r.elevation>0&&(t=r.elevation),ge()(i=r.vertices).call(i,(n=>{const r=sE.set(n.x,n.y,t).applyMatrix4(e);n.x=r.x,n.y=r.y}))}const s=hE(e.vertices,e.shape);if(e.shape&&s.length>0&&!Gm.AreVector3sEqual(s[0],s[s.length-1])&&s.push(s[0]),s.length<2)return void im.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);const a=new xn;let o=!1;this.enableRTC&&(o=ef.checkAndRebasePositionsOnRTC(s,a));const l=ef.getAdjacentNonRepeatPoints(s);if(l.length<2)return void im.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);let c;if(this.enableWidthLine&&void 0!==r.constantWidth&&r.constantWidth>1){const i=t.tables.lineType.lineTypes[this.getLineType(e,t,n)];if(!i||!i.pattern||0===i.pattern.length){const t=ef.convertWidthLineToMeshGeometry(l,r.constantWidth);if(t){const e=new mi(t,tE);c=new io,c.add(e);const n=uf.createOutlineSync(t,e.matrix,eE);n.layers.set(Ah),c.add(n)}else im.warn("[DxfLoader] Failed to convert width line to mesh geometry: %s ",e.handle)}}return c||(c=new Vo((new Kr).setFromPoints(l),eE)),o&&(this.setRTCUserData(c),c.position.x+=a.x,c.position.y+=a.y,c.position.z+=a.z),c}drawMLeader(e,t,n){var r,i;const s=t.tables.dimStyle.dimStyles[e.dimensionStyle]||this.getDefaultDimensionStyle(t),a=new io,o=uw(null===(r=e.contextData)||void 0===r?void 0:r.defaultTextContents),l=this.mtextContentAndFormattingToTextAndStyle(o,e),c=this.getMTextGroup(l.text,e,t,n,l);if(c){var u,h,p,d;null!==(u=e.contextData)&&void 0!==u&&u.textLocation&&(c.position.x+=e.contextData.textLocation.x,c.position.y+=e.contextData.textLocation.y);const t=(null===(h=e.contextData)||void 0===h?void 0:h.textWidth)||1;switch(l.style.horizontalAlignment){case"left":default:break;case"center":t&&(c.position.x+=t/2);break;case"right":t&&(c.position.x+=t)}const n=(new En).setFromObject(c).getSize(sE),r=n.x,s=n.y;let o=0,m=0;switch(null===(i=e.contextData)||void 0===i?void 0:i.textAttachment){case 1:o=0,m=0;break;case 2:o-=r/2,m=0;break;case 3:o-=r,m=0;break;case 4:o=0,m+=s/2;break;case 5:o-=r/2,m+=s/2;break;case 6:o-=r,m+=s/2;break;case 7:o=0,m+=s;break;case 8:o-=r/2,m+=s;break;case 9:o-=r,m+=s;break;default:return}if(c.traverse((e=>{e.geometry&&e.geometry.translate(o,m,0)})),null!==(p=e.contextData)&&void 0!==p&&p.textRotation&&(c.rotation.z=e.contextData.textRotation*Math.PI/180),null!==(d=e.contextData)&&void 0!==d&&d.textDirection){const t=e.contextData.textDirection,n=new xn(t.x,t.y,t.z),r=n.clone().cross(new xn(1,0,0)),i=new xn(1,0,0).angleTo(n);c.rotateZ(r.z>0?-i:i)}c.renderOrder=Dx.Text,a.add(c)}if(0===e.leaderLineType)return c;{var m,f;const n=[],r=null===(m=e.contextData)||void 0===m?void 0:m.leaders[0];if(!r)return a;const i=r.lastLeaderLinePoint;if(e.enableDogLeg){const e=new xn(i.x,i.y,i.z),t=r.doglegLength,s=new xn(r.doglegVector.x,r.doglegVector.y,r.doglegVector.z).multiplyScalar(t),a=e.clone().add(s);n.push(a,e)}const o=(null===(f=e.contextData)||void 0===f?void 0:f.leaders[0].leaderLines)||[];for(let r=0;r<o.length;r++){var g;const l=o[r].vertices[0],c=Z()(g=Te()(l).call(l)).call(g,(e=>new xn(e.x,e.y,e.z)));let u=new xn(i.x,i.y,i.z);for(let e=0;e<c.length;e++)n.push(u,c[e]),u=c[e];const h=sE.subVectors(n[0],n[1]).length(),p=(e.arrowHeadSize||s.DIMASZ||2.5)*(e.arrowHeadScale||s.DIMSCALE||1);e.leaderLineType;let d="";if(e.arrowHeadId?d=e.arrowHeadId:s&&s.DIMLDRBLK&&(d=s.DIMLDRBLK),d){const r=this.getBlockByHandle(t.blocks,d);if(r&&r.entities)for(let i=0;i<r.entities.length;i++){const s=this.drawEntity(r.entities[i],t,e);if(s){const e=new xn(n[n.length-1].x,n[n.length-1].y,n[n.length-1].z),t=new xn(n[n.length-2].x,n[n.length-2].y,n[n.length-2].z),r=Math.atan2(e.y-t.y,e.x-t.x);s.position.copy(e),s.quaternion.identity(),s.scale.setScalar(p),s.rotateZ(r),s.updateMatrix(),a.add(s)}}}else this.drawDefaultLeadArrow(n[n.length-2],n[n.length-1],h/2e3,n)}const l=new xn;let c=!1;this.enableRTC&&(c=ef.checkAndRebasePositionsOnRTC(n,l));const u=(new Kr).setFromPoints(n),h=new Wo(u,eE);h.renderOrder=Dx.Line,c?(this.setRTCUserData(h),h.position.x+=l.x,h.position.y+=l.y):ef.shouldRebasePositionOnRTC(h.position)&&this.setRTCUserData(h),a.add(h)}return df.merge(a,!1),a}drawLeader(e,t,n){const r=[];if(!e.vertices)return void im.warn("[DxfLoader] Entity is missing vertices:",e.handle);if(e.vertices.length<2)return void im.warn("leader's vertices number must be greater than 2");const i=t.tables.dimStyle.dimStyles[e.dimensionStyle]||this.getDefaultDimensionStyle(t);let s=e.vertices;if(1===e.pathType){s=new gl(e.vertices).getPoints(50)}if(e.textWidth){const t=e.textWidth,n=new xn(s[s.length-1].x,s[s.length-1].y,s[s.length-1].z);if(0===e.direction){const e=new xn(1,0,0).multiplyScalar(t);s.push(e.add(n))}else{const e=new xn(-1,0,0).multiplyScalar(t);s.push(e.add(n))}}for(let e=0;e<s.length-1;e++){const t=s[e],n=s[e+1];r.push(t,n)}const a=sE.subVectors(r[0],r[1]).setZ(0).length(),o=(e.arrowHeight||i.DIMASZ||2.5)*(e.arrowHeadScale||i.DIMSCALE||1),l=new io;if(1===e.arrowFlag){let n="";e.arrowHeadBlockHandle?n=e.arrowHeadBlockHandle:i&&i.DIMLDRBLK&&(n=i.DIMLDRBLK);const s=this.getBlockByHandle(t.blocks,n);if(s&&s.entities){i&&(e.colorIndex=i.DIMCLRD||256,e.color=Nx(e.colorIndex));for(let n=0;n<s.entities.length;n++){const i=this.drawEntity(s.entities[n],t,e);if(i){const e=new xn(r[0].x,r[0].y,r[0].z),t=new xn(r[1].x,r[1].y,r[1].z),n=Math.atan2(e.y-t.y,e.x-t.x);i.position.copy(e),i.quaternion.identity(),i.scale.setScalar(o),i.rotateZ(n),i.updateMatrix(),l.add(i)}}}else this.drawDefaultLeadArrow(r[1],r[0],o/a/2,r)}if(0===r.length)return;const c=new xn;let u=!1;this.enableRTC&&(u=ef.checkAndRebasePositionsOnRTC(r,c));const h=(new Kr).setFromPoints(r),p=new Wo(h,eE);return p.renderOrder=Dx.Line,u?(this.setRTCUserData(p),p.position.x+=c.x,p.position.y+=c.y):ef.shouldRebasePositionOnRTC(p.position)&&this.setRTCUserData(p),l.children.length>0?(l.add(p),df.merge(l,!1),l):p}drawDefaultLeadArrow(e,t,n,r){const i=n*(e.x-t.x),s=n*(e.y-t.y),a=s,o=-i,l=new xn(t.x+i+a/6,t.y+s+o/6,0),c=new xn(t.x+i-a/6,t.y+s-o/6,0);r.push(t,l),r.push(t,c),r.push(l,c)}getBlockByHandle(e,t){if(!this.blocksCache){this.blocksCache={};for(const t in e){const n=e[t];this.blocksCache[n.ownerHandle]||(this.blocksCache[n.ownerHandle]=n)}}return this.blocksCache[t]}static transformAngleByOcsMatrix(e,t){const n=sE.set(1*Math.cos(t),1*Math.sin(t),0).applyMatrix4(e);return Math.atan2(n.y,n.x)}static getArcAnglesByOcsMatrix(e,t,n){let r=Gm.getArcAngleSpanRad(t,n);const i=pE.transformAngleByOcsMatrix(e,t),s=pE.transformAngleByOcsMatrix(e,n);let a;if(Gm.areNumbersClose(r,Math.PI)){r=1;const n=pE.transformAngleByOcsMatrix(e,t+r);a=Gm.getArcAngleSpanRad(i,n)}else{if(Gm.areNumbersClose(r,2*Math.PI))return[i,i+2*Math.PI];a=Gm.getArcAngleSpanRad(i,s)}return Gm.areNumbersClose(r,a,1e-8)?[i,s]:[s,i]}drawArc(e,t,n){var r,i,s;if(!e.radius||e.radius<.001)return void im.warn(`[DxfLoader] The radius of arc (handle '${e.handle}') is undefined, ignored!`);if(!e.radius||e.radius<.001)return void im.warn(`[DxfLoader] The radius of arc (handle '${e.handle}') is too small, ignored!`);const a=new xn(0,0,1);void 0!==e.extrusionDirectionX&&void 0!==e.extrusionDirectionY&&void 0!==e.extrusionDirectionZ&&a.set(e.extrusionDirectionX,e.extrusionDirectionY,e.extrusionDirectionZ);const o=pE.getOcsMatrix(a);let l,c;if("CIRCLE"===e.type)l=e.startAngle||0,c=l+2*Math.PI;else{if(null==e.startAngle||null==e.endAngle)return;if(l=e.startAngle,c=e.endAngle,Gm.AreNumbersEqual(l,c,.001))return;if(!Gm.areNumbersClose(Gm.getArcAngleSpanRad(l,c),2*Math.PI)){const e=pE.getArcAnglesByOcsMatrix(o,l,c);l=e[0],c=e[1]}}const u=new rl(0,0,e.radius,l,c,0!==this.angBase);let h=1;const p=n;null!=p&&p.xScale&&null!=p&&p.yScale&&(h=Math.max(Math.abs(p.xScale),Math.abs(p.yScale)));const d=this.getDivision(l,c,e.radius*h),m=u.getPoints(d),f=new xn;let g=!1;this.enableRTC&&(g=ef.checkAndRebasePositionsOnRTC(m,f));const _=(new Kr).setFromPoints(m),v=new Vo(_,eE),y=new xn;e.center&&(y.x=e.center.x,y.y=e.center.y);const b=new xn(null===(r=e.center)||void 0===r?void 0:r.x,null===(i=e.center)||void 0===i?void 0:i.y,null===(s=e.center)||void 0===s?void 0:s.z).applyMatrix4(o.invert());return y.x=b.x,y.y=b.y,v.position.copy(y),g?(this.setRTCUserData(v),v.position.x+=f.x,v.position.y+=f.y):ef.shouldRebasePositionOnRTC(v.position)&&this.setRTCUserData(v),v}addTriangleFacingCamera(e,t,n,r){const i=new xn,s=new xn;i.subVectors(n,t),s.subVectors(r,t),i.cross(s);const a=new xn(t.x,t.y,t.z),o=new xn(n.x,n.y,n.z),l=new xn(r.x,r.y,r.z);i.z<0?e.push(l,o,a):e.push(a,o,l)}drawSolid(e,t,n){const r=e.points;if(!r||r.length<4)return;if(e.extrusionDirection&&e.extrusionDirection.z){sE.set(0,0,e.extrusionDirection.z);const t=pE.getOcsMatrix(sE).invert();ge()(r).call(r,(e=>{const n=sE.set(e.x,e.y,0).applyMatrix4(t);e.x=n.x,e.y=n.y}))}const i=[],s=[];this.addTriangleFacingCamera(i,r[0],r[1],r[2]),s.push(0,1,2),this.addTriangleFacingCamera(i,r[1],r[2],r[3]),s.push(3,4,5);const a=new xn;let o=!1;this.enableRTC&&(o=ef.checkAndRebasePositionsOnRTC(i,a));const l=(new Kr).setFromPoints(i);l.setIndex(s);const c=new mi(l,tE);return o&&(this.setRTCUserData(c),c.position.x+=a.x,c.position.y+=a.y),c}getDefaultTextStyle(e){return e.tables.style.styles.STANDARD||e.tables.style.styles.Standard||{}}getDefaultDimensionStyle(e){return e.tables.dimStyle.dimStyles.STANDARD||e.tables.dimStyle.dimStyles.Standard||{}}getTextEncoding(e){var t;return e.bigFontFile&&nx()(t=e.bigFontFile.toUpperCase()).call(t,"GB")?"gbk":"utf8"}getTextMesh(e,t,n,r,i){if(!e)return;let s;t.textStyle&&(this.statsInfo.unsupportedTextStyles[t.textStyle]||(this.statsInfo.unsupportedTextStyles[t.textStyle]=0),this.statsInfo.unsupportedTextStyles[t.textStyle]++);let a=(i?i.style.textHeight:t.textHeight)||0,o=.67;if(t.xScale&&(o*=t.xScale),t.textStyle){const e=n.tables.style.styles[t.textStyle];o*=(null==e?void 0:e.xScale)||1,a=a||e.textHeight}let l=0;if(t.width&&(l=t.width/o+2),t.contextData&&t.contextData.textWidth&&t.contextData.textHeight<t.contextData.textWidth&&(l=t.contextData.textWidth),this.font instanceof kw){const n=this.font.getGraphicData(e,a,a/1.5,a/2,a/8,l,3===t.drawingDirection);if(0===n.length)return;const r=fm(Z()(n).call(n,(e=>e.toThreeGeometry())));r.scale(o,1,1),s=new Wo(r,eE)}else if(this.font instanceof Dw){const t={font:this.font,height:0,size:a||12,curveSegments:3,bevelSegments:3},n=new Fw(e,t);s=new mi(n,tE)}return s}transformTextMesh(e,t){const n=(new En).setFromObject(t).getSize(new xn),{halign:r,valign:i}=e,s=e.width||n.x,a=n.y;var o;void 0===r&&void 0===i&&e.startPoint?(t.position.x+=e.startPoint.x,t.position.y+=e.startPoint.y,t.position.z+=e.startPoint.z):cp()(o=[3,5]).call(o,r)&&e.startPoint?(t.position.x+=e.startPoint.x,t.position.y+=e.startPoint.y,t.position.z+=e.startPoint.z):e.endPoint&&(t.position.x+=e.endPoint.x,t.position.y+=e.endPoint.y,t.position.z+=e.endPoint.z);if(3!==r&&5!==r){if(e.rotation){const n=e.rotation*Math.PI/180;t.rotateZ(n)}2===e.mirrored?t.rotateY(Math.PI):4===e.mirrored&&t.rotateX(Math.PI)}switch(r){case 0:default:break;case 1:t.translateX(-s/2);break;case 2:t.translateX(-s);break;case 3:if(e.startPoint&&e.endPoint){const n=new xn(e.startPoint.x,e.startPoint.y,e.startPoint.z),r=new xn(e.endPoint.x,e.endPoint.y,e.endPoint.z),i=(new xn).subVectors(n,r),a=i.length()/s;t.scale.multiplyScalar(a);const o=i.clone().cross($w),l=i.angleTo($w);t.rotateZ(o.z>0?Math.PI-l:l-Math.PI),(2===e.mirrored||4===e.mirrored)&&t.rotateX(Math.PI)}break;case 4:t.translateX(-s/2),t.translateY(-a/2);break;case 5:if(e.startPoint&&e.endPoint){const n=new xn(e.startPoint.x,e.startPoint.y,e.startPoint.z),r=new xn(e.endPoint.x,e.endPoint.y,e.endPoint.z),i=(new xn).subVectors(n,r),a=i.length()/s;t.scale.setX(a);const o=i.clone().cross($w),l=i.angleTo($w);t.rotateZ(o.z>0?Math.PI-l:l-Math.PI),(2===e.mirrored||4===e.mirrored)&&t.rotateX(Math.PI)}}switch(i){case 0:case 1:default:break;case 2:t.translateY(-a/2);break;case 3:t.translateY(-a)}return t.position.z=0,t}drawText(e,t,n){let r=e.text;if(!r||!this.font)return;const i=t.tables.style.styles[e.textStyle]||this.getDefaultTextStyle(t),s=qw(r,{encoding:this.getTextEncoding(i)});r=Z()(s).call(s,(e=>e.text)).join("");const a=this.getTextMesh(r,e,t,n);if(!a)return;const o=a.geometry;if(a instanceof mi&&!o.getIndex()){const e=o.getAttribute("position"),t=[];for(let n=0;n<e.count;n+=3)t.push(n,n+1,n+2);o.setIndex(t)}if(o.hasAttribute("uv")&&o.deleteAttribute("uv"),o.hasAttribute("normal")&&o.deleteAttribute("normal"),this.transformTextMesh(e,a),ef.shouldRebasePositionOnRTC(a.position))this.setRTCUserData(a);else{const e=ef.caculateGeometryCenter(o);e&&ef.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(a)}return a}drawAttDef(e,t,n){let r=e.tag||e.text||e.prompt;if(!r||!this.font)return;const i=qw(r);r=Z()(i).call(i,(e=>e.text)).join();const s=this.getTextMesh(r,e,t,n);if(!s)return;const a=s.geometry;if(a.hasAttribute("uv")&&a.deleteAttribute("uv"),a.hasAttribute("normal")&&a.deleteAttribute("normal"),this.transformTextMesh(e,s),ef.shouldRebasePositionOnRTC(s.position))this.setRTCUserData(s);else{const e=ef.caculateGeometryCenter(a);e&&ef.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(s)}return s}drawAttrib(e,t,n){let r=e.text;if(!r||!this.font)return;const i=qw(r);r=Z()(i).call(i,(e=>e.text)).join();const s=this.getTextMesh(r,e,t,n);if(!s)return;const a=s.geometry;if(a.hasAttribute("uv")&&a.deleteAttribute("uv"),a.hasAttribute("normal")&&a.deleteAttribute("normal"),this.transformTextMesh(e,s),ef.shouldRebasePositionOnRTC(s.position))this.setRTCUserData(s);else{const e=ef.caculateGeometryCenter(a);e&&ef.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(s)}return s}drawPoint(e,t,n){if(!e.position)return;const r=new Kr,i=[new xn(e.position.x,e.position.y,e.position.z)];sE.set(0,0,0);const s=sE;let a=!1;this.enableRTC&&(a=ef.checkAndRebasePositionsOnRTC(i,s)),r.setFromPoints(i);const o=new Qo(r,Qw);return a&&(this.setRTCUserData(o),o.position.x+=s.x,o.position.y+=s.y),o}drawDimension(e,t){if(!e.block)return;const n=t.blocks[e.block];if(!n||!n.entities)return;const r=t.tables.dimStyle.dimStyles[e.dimStyleName]||this.getDefaultDimensionStyle(t);r&&r.DIMCLRD>0&&(e.colorIndex=r.DIMCLRD,e.color=Nx(e.colorIndex));let i=new io;for(let r=0;r<n.entities.length;r++){const s=this.drawEntity(n.entities[r],t,e);s&&i.add(s)}if(0===i.children.length){i=void 0;const t=e.name||e.block;return this.statsInfo.ignoredInserts[t]||(this.statsInfo.ignoredInserts[t]=0),void this.statsInfo.ignoredInserts[t]++}this.blockReferencesCache[e.block]||(this.blockReferencesCache[e.block]={referenceCount:0});this.blockReferencesCache[e.block].referenceCount++;i.name=`${e.type}<${n.name}>`,i.userData.entityType=e.type;const s=null==e?void 0:e.insertionPoint;return s&&(i.position.x+=s.x,i.position.y+=s.y),i}drawInsert(e,t){if(!e.block)return;const n=t.blocks[e.block];if(!n.entities)return;e.blockPosition=n.position;let r=new io;for(let i=0;i<n.entities.length;i++){if("ATTDEF"===n.entities[i].type)continue;const s=this.drawEntity(n.entities[i],t,e);s&&r.add(s)}if(0===r.children.length){r=void 0;const t=e.name||e.block;return this.statsInfo.ignoredInserts[t]||(this.statsInfo.ignoredInserts[t]=0),void this.statsInfo.ignoredInserts[t]++}this.blockReferencesCache[e.block]||(this.blockReferencesCache[e.block]={referenceCount:0});this.blockReferencesCache[e.block].referenceCount++;r.name=`${e.type}<${n.name}>`,r.userData.entityType=e.type,null!=e&&e.blockPosition&&(r.position.x-=e.blockPosition.x,r.position.y-=e.blockPosition.y,r.updateMatrix());const i=sE.set(1,1,1);e.xScale&&(i.x=e.xScale),e.yScale&&(i.y=e.yScale);const s=new or;e.rotation&&(s.z=e.rotation*Math.PI/180),lE.setFromEuler(s,!1);const a=aE.set(0,0,0);e.position&&(a.x=e.position.x,a.y=e.position.y),iE.compose(a,lE,i),e.extrusionDirection&&e.extrusionDirection.z<0&&iE.premultiply(nE.identity().makeScale(-1,1,1)),rE.copy(r.matrix),r.applyMatrix4(iE);const o=this.findSpatialFilterByHandle(e.handle,t);if(o){const t=this.drawSpatialFilter(o),n=o;n&&n.clipPolylines&&n.clipPolylines.length>0&&(r.userData.spatialFilterHandle=o.handle,this.cloneMaterialsForSpatialFilter(r),t&&t.applyMatrix4(rE.invert()),im.debug("[DxfLoader] Spatial filter:",e.associatedSpatialFilter))}return r}drawSpatialFilter(e){var t;const n=e;if(n.threejsObject)return n.threejsObject.clone();const r=e.invertBlockMatrix;iE.set(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],0,0,0,1);const i=[];ge()(t=e.vertices).call(t,(e=>{i.push(new xn(e.x,e.y,0))}));const s={polyline:[],bConcave:!1,bReversed:!1};if(2===e.numberOfPointsOnClipBoundary)s.polyline=i;else{const t=e.numberOfPointsOnClipBoundary,n=3;if(t<n)return void im.warn(`[DxfLoader] Invalid clipBoundary: ${e.handle} !`);let r=[],a=-1;for(let e=0;e<t;e++){const n=i[e];for(let s=t-1;s>e;s--){const o=i[s];if(Gm.AreVector3sEqual(n,o)&&e+1<s-1&&e+1<t-1&&Gm.AreVector3sEqual(i[e+1],i[s-1])){r.push(n),a=s;break}}if(a>0)break;r.push(n)}if(a>0)for(let e=a+1;e<t;e++)r.push(i[e]);if(r.length<n)return void im.warn(`[DxfLoader] Invalid clipBoundary: ${e.handle}!`);const o=[],l=[];if(ge()(r).call(r,(e=>{o.push(new Xt(e.x,e.y)),l.push([e.x,e.y])})),!ef.isConvex(o)){im.warn(`[DxfLoader] Concave polygon is not supported for spatial filter (handle '${e.handle}'), converting to convex polygon!`);const t=Mx()(l,1/0);r=[],ge()(t).call(t,(e=>{r.push(new xn(e[0],e[1],0))}))}Gm.AreVector3sEqual(r[0],r[r.length-1])||r.push(r[0]),s.polyline=r,s.bReversed=a>0}this.enableReleaseData&&(e.vertices=[],e.matrix=[],e.invertBlockMatrix=[]),n.localMatrix=iE.clone(),n.clipPolylines=[],n.clipPolylines.push(s)}drawLayout(e,t,n,r,i,s){var a;if(!e.entities)return;let o;if(n.layoutName!==this.MODEL_LAYOUT_NAME){const e=n;e.directAssociatedLeafObjectSet||(e.directAssociatedLeafObjectSet=new(pe())),o=e.directAssociatedLeafObjectSet}const l=new io;uf.setSharedVariablesOfObject(l);for(let n=0;n<e.entities.length;n++){const r=e.entities[n];this.addViewport(r,s);const a=this.drawEntity(r,t);if(a){if(this.enableMerge){const e=!1;df.merge(a,e)}l.add(a),a.traverse((e=>{if(e.geometry){const n=e.userData.layerName;!1===this.getLayerVisible(t,n)&&(e.visible=!1);let r=i[n];r||(r=[],i[n]=r),r.push(e),o&&o.add(e)}}))}}if(0===l.children.length)return;l.userData.layerName=e.layer;const c=n.layoutName;let u=Se()(a=r.children).call(a,(e=>e.name===c));u||(u=new io,uf.setSharedVariablesOfObject(u),u.name=c,u.userData.isLayoutLevelObject=!0,r.add(u)),u.add(l),e.position&&l.position.set(e.position.x,e.position.y,e.position.z||0),l.matrixAutoUpdate=Ih,l.updateMatrix()}convertEdgeToPoints(e){const t=[];switch(e.type){case $x.Line:{const n=e;t.push(new Xt(n.startPoint.x,n.startPoint.y)),t.push(new Xt(n.endPoint.x,n.endPoint.y));break}case $x.Arc:{const n=e;let r=n.startAngle*Yt.DEG2RAD,i=n.endAngle*Yt.DEG2RAD;n.bCounterclockwise||(r=2*Math.PI-r,i=2*Math.PI-i);const s=new rl(n.center.x,n.center.y,n.radius,r,i,!n.bCounterclockwise),a=this.getDivision(r,i,n.radius);t.push(...s.getPoints(a));break}case $x.Ellipse:{const n=e,r=Math.sqrt(Math.pow(n.majorAxisEndPoint.x,2)+Math.pow(n.majorAxisEndPoint.y,2)),i=r*n.minorRatio,s=Math.atan2(n.majorAxisEndPoint.y,n.majorAxisEndPoint.x);let a=n.startAngle*Yt.DEG2RAD,o=n.endAngle*Yt.DEG2RAD;n.bCounterclockwise||(a=2*Math.PI-a,o=2*Math.PI-o);const l=new nl(n.center.x,n.center.y,r,i,a,o,!n.bCounterclockwise,s),c=this.getDivision(a,o,Math.max(r,i));t.push(...l.getPoints(c));break}case $x.Spline:{const n=e;t.push(...n.controlPoints);break}case $x.Polyline:{const n=e;t.push(...hE(n.points,n.isClosed));break}}return t}drawHatch(e,t,n){var r,i;const s=e;if(0==s.boundaryPaths.length)return;const a=[],o=[],l=[];if(ge()(r=s.boundaryPaths).call(r,((e,t)=>{if(this.IsfilteredByPathTypeFlag(e.pathTypeFlag)){const n="[DxfLoader] The %d path type flag is filtered at the %dth boundrayPath (hatch handle '%s')";return void im.info(n,e.pathTypeFlag,t,s.handle)}const n=e.edges;if(0===n.length)return;const r=[];for(let e=0;e<n.length;e++){const i=this.convertEdgeToPoints(n[e]);if(i.length<2){const n="[DxfLoader] The %dth edge of the %dth boundaryPath (hatch handle '%s') has less than 2 points, ignored!";im.warn(n,e,t,s.handle)}else r.push(...i)}if(r.length<3){const e="[DxfLoader] The %dth boundaryPath (hatch handle '%s') has less than 3 points, ignored!";return void im.warn(e,t,s.handle)}if(e.pathTypeFlag>Xx.MaxFlags){const n=e=>{for(let t=1;t<e.length;++t){const n=e[t-1].endPoint,r=e[t].startPoint;if(!n||!r)return!1;if(!Gm.AreVector2sEqual(n,r))return!1}return!0};if(!n(e.edges)){const e="[DxfLoader] The %dth boundaryPath (hatch handle '%s') has unknown path, ignored!";return void im.warn(e,t,s.handle)}}Gm.AreVector2sEqual(r[0],r[r.length-1])||r.push(r[0]);const i=Z()(r).call(r,(e=>new Xt(cm.roundNumber(e.x,7),cm.roundNumber(e.y,7))));if((null==i?void 0:i.length)>0){a.push(i);const e=(new xu).setFromPoints(i);o.push(e);const t=e.getSize(oE),n=t.x*t.y;l.push({area:n,index:a.length-1})}})),0===a.length)return;const c=new Xt,u=this.checkAndRebasePolygonsOnRTC(a,c);re()(l).call(l,((e,t)=>e.area-t.area));const h=[];ge()(l).call(l,(e=>{h.push(e.index)}));const p=this.buildContainHierarchyTree(a,o,h),d=[];let m;if(this.buildHatchGeometry(a,p,d),d.length>0&&(m=fm(d)),!m||!m.getIndex()||0===(null===(i=m.getIndex())||void 0===i?void 0:i.count))return void im.warn("[DxfLoader] Failed to convert hatch boundaries!");const f=new mi(m,tE);f.layers.set(Ah),this.setHatchMaterial(f,s,t,c,n);const g=f;return u?(this.setRTCUserData(f),g.position.x+=c.x,g.position.y+=c.y):ef.shouldRebasePositionOnRTC(g.position)&&this.setRTCUserData(g),g}drawOle2frame(e,t){const{leftUpX:n,leftUpY:r,rightDownX:i,rightDownY:s}=e;if(!(n&&r&&i&&s))return;const a=[new Xt(n,r),new Xt(n,s),new Xt(i,s),new Xt(i,r),new Xt(n,r)],o=new xn;let l=!1;this.enableRTC&&(l=ef.checkAndRebasePositionsOnRTC(a,o));const c=(new Kr).setFromPoints(a),u=this.getLineBasicMaterial(16777215),h=new Vo(c,u);l&&(this.setRTCUserData(h),h.position.x+=o.x,h.position.y+=o.y);const p=new io;let d;p.add(h);const m=t.objects.DICTIONARY;for(const t of m){const n=t;for(const t in u_()(n))if(u_()(n)[t]===e.handle){d=t;break}}let f;if(d)if(this.meshTextureMaterials[d])f=this.meshTextureMaterials[d];else for(let e=0;e<t.objects.XRECORD.length;e++){const n=t.objects.XRECORD[e];if(n.handle===d){const e=n.binaryData,t="data:image/jpg;base64,"+cm.hexToBase64(e),r=new kr({transparent:!0,map:new zc(this.manager).load(t)});this.meshTextureMaterials[d]=r,f=r;break}}if(f){const e=(new xu).setFromPoints(a),t=e.getSize(oE),n=new ki(t.x,t.y),r=new mi(n,f),i=e.getCenter(oE);r.position.set(i.x,i.y,0),l&&(this.setRTCUserData(r),r.position.x+=o.x,r.position.y+=o.y),p.add(r)}return p.children.length>1?p:h}static getOcsMatrix(e){let t=$w,n=Kw,r=Zw;const i=new xn(0,1,0),s=new xn(0,0,1);if(!Gm.areVectorsClose(e,s)){r=e.clone().normalize();return Gm.areVectorsClose(r,s)||(t=Math.abs(r.x)<1/64&&Math.abs(r.y)<1/64?i.cross(r).normalize():s.cross(r).normalize(),n=r.clone().cross(t).normalize()),iE.set(t.x,t.y,t.z,0,n.x,n.y,n.z,0,r.x,r.y,r.z,0,0,0,0,1)}return iE.identity()}static getDcs2WcsMatrix(e,t){let n;n=void 0!==e.viewDirectionFromTarget?e.viewDirectionFromTarget:e.viewDirection;const r=new xn(n.x,n.y,n.z),i=new xn(e.viewTarget.x,e.viewTarget.y,e.viewTarget.z),s=e.viewTwistAngle;let a,o,l;l=r.clone().normalize(),a=Zw.clone().cross(r),a.length()>0?(a.normalize(),o=l.clone().cross(a)):l.z<0?(a=$w.clone().negate(),o=Kw,l=Zw.clone().negate()):(a=$w,o=Kw,l=Zw);const c=new Zn,u=iE.identity();return u.makeBasis(a,o,l),c.premultiply(u),c.premultiply(iE.identity().compose(i.clone(),(new bn).setFromAxisAngle(new xn(0,0,1),Yt.degToRad(t?s:-s)),new xn(1,1,1))),c}getViewportMsToPsMatrix(e){const t=new xn(e.centerPoint_dcs.x,e.centerPoint_dcs.y,0),n=new xn(e.centerPoint.x,e.centerPoint.y,e.centerPoint.z),r=e.viewHeight/e.height_paperSpace,i=pE.getDcs2WcsMatrix(e,this.angDir),s=new Zn;s.setPosition(Jw.clone().sub(n));const a=nE.identity();a.scale(sE.set(r,r,r));const o=rE.identity().setPosition(Jw.clone().sub(n));a.premultiply(o.clone().invert()).multiply(o),s.multiply(a);const l=iE.identity();l.setPosition(t),i.multiply(l);const c=iE.identity();return s.invert().multiply(c).multiply(i.invert())}drawViewport(e,t,n){const r=e;if("1"==r.viewportId)return e.psBBox=new En,void(e.msToPsMatrix=new Zn);const i=[],s=r.centerPoint,a=r.width_paperSpace/2,o=r.height_paperSpace/2;i.push(new xn(s.x-a,s.y-o,0)),i.push(new xn(s.x-a,s.y+o,0)),i.push(new xn(s.x+a,s.y+o,0)),i.push(new xn(s.x+a,s.y-o,0)),i.push(i[0]),e.psBBox=new En(i[0],i[2]),e.msToPsMatrix=this.getViewportMsToPsMatrix(r);const l=new xn;let c=!1;this.enableRTC&&(c=ef.checkAndRebasePositionsOnRTC(i,l));const u=(new Kr).setFromPoints(i),h=new Vo(u,eE);c&&(this.setRTCUserData(h),h.position.x+=l.x,h.position.y+=l.y),h.userData.entityType=e.type;const p=new io;p.add(h);const d=e.psBBox.clone();d.applyMatrix4(e.msToPsMatrix.clone().invert()),d.min.z=0,d.max.z=0;const m=[];m.push(d.min),m.push(new xn(d.min.x,d.max.y,0)),m.push(d.max),m.push(new xn(d.max.x,d.min.y,0)),m.push(m[0]);const f=new xn;let g=!1;this.enableRTC&&(g=ef.checkAndRebasePositionsOnRTC(m,f));const _=(new Kr).setFromPoints(m),v=new Vo(_,eE);return g&&(this.setRTCUserData(v),v.position.x+=f.x,v.position.y+=f.y),v.userData.entityType=e.type,v.userData.inPaperSpace=!0,p.add(v),h}getColor(e,t,n){if(this.compareContext){const t=e.compareChangeType;if(t===sw.Added)return aw.ENTITY_COLOR_ADDED;if(t===sw.Removed)return aw.ENTITY_COLOR_REMOVED;if(t===sw.Modified){return this.compareContext.isTheFirstFile?aw.ENTITY_COLOR_REMOVED:aw.ENTITY_COLOR_ADDED}return aw.ENTITY_COLOR_NO_CHANGE}const r=e;if(r&&r.isGradientColor){const t=r.gradientColors;if(t&&t.length>=2){if(t[0]!==t[1]){const t=`[DxfLoader] Gradient colors are not supported for hatch '${e.handle}', will use the first color!`;im.warn(t)}return t[0]}}if(e.isTrueColor)return e.color;if(e.colorIndex>0&&e.colorIndex<256)return e.color;var i,s;if(0===e.colorIndex)return n?this.getColor(n,t):null===(i=t.tables)||void 0===i||null===(s=i.layer)||void 0===s?void 0:s.layers[0].color;if(256===e.colorIndex){var a,o;const r=null===(a=t.tables)||void 0===a||null===(o=a.layer)||void 0===o?void 0:o.layers,i=r&&r[e.layer],s=r&&n&&r[n.layer];let u=0;if(i&&"0"!==i.name)u=i.color;else if(s)u=s.color;else if(i)u=i.color;else{var l,c;u=null===(l=t.tables)||void 0===l||null===(c=l.layer)||void 0===c?void 0:c.layers[0].color}return u}return im.warn("[DxfLoader] Unknown colorIndex"),0}getLineType(e,t,n){var r,i;if(n&&"DIMENSION"===n.type)return this.getLineType(n,t);if(e.lineType!==Ax&&e.lineType!==Rx)return e.lineType;if(e.lineType===Rx)return n?this.getLineType(n,t):e.lineType;const s=null===(r=t.tables)||void 0===r||null===(i=r.layer)||void 0===i?void 0:i.layers;if("0"!==e.layer){const t=s&&s[e.layer];if(t)return t.lineType}else if(n){const e=s&&s[n.layer];if(e)return e.lineType}return"CONTINUOUS"}getLayerName(e,t,n){var r,i;const s=null===(r=t.tables)||void 0===r||null===(i=r.layer)||void 0===i?void 0:i.layers,a=s&&s[e.layer],o=s&&n&&s[n.layer];let l=a.name;return a&&"0"===a.name&&o&&(l=o.name),l||"0"}setMaterial(e,t,n,r){const i=e;if(!i.geometry)return;if(this.setRenderOrderByObjectType(e),"OLE2FRAME"===t.type)return;if("MTEXT"===t.type)return void(e.renderOrder=Dx.Text);if("HATCH"===t.type)return oE.set(0,0),void this.setHatchMaterial(e,t,n,oE,r);let s;const a=this.getColor(t,n,r);if("LWPOLYLINE"===t.type&&(i.isMesh?(s=this.getMeshBasicMaterial(a),e.renderOrder=Dx.LineWithWidth):e.userData.isOutline&&(s=this.getLineBasicMaterial(a),e.renderOrder=Dx.LineWithPattern),s))i.material=s;else{if("SOLID"===t.type)s=this.getMeshBasicMaterial(a);else if("TEXT"===t.type||"ATTDEF"===t.type||"ATTRIB"===t.type)s=this.getLineBasicMaterial(a),e.renderOrder=Dx.Text;else if("LEADER"===t.type||"MULTILEADER"===t.type||"VIEWPORT"===t.type)s=this.getLineBasicMaterial(a);else if("POINT"===t.type)s=this.getPointsMaterial(a);else{if(e.material instanceof Xo)return s=this.getPointsMaterial(a),void(i.material=s);const o=n.tables.lineType.lineTypes[this.getLineType(t,n,r)],l=t.lineTypeScale||1;o&&o.pattern&&0!==o.pattern.length?(s=this.getLineShaderMaterial(o,a,l),e.renderOrder=Dx.LineWithPattern):s=this.getLineBasicMaterial(a)}i.material=s}}setHatchMaterial(e,t,n,r,i){const s=e;if(!s.geometry)return;const a=this.getColor(t,n,i);if(s.isLine)return void(s.material=this.getLineBasicMaterial(a));let o,l=Dx.Mesh;if(t.solidFill)o=this.getMeshBasicMaterial(a);else{if(s.material instanceof bi){o=s.material;const e=new cn(a);s.material.uniforms.u_color.value.equals(e)||(o=s.material.clone(),o.uniforms.u_color.value=e)}else o=this.getHatchShaderMaterial(t,a,r);l=Dx.MeshWithPattern}o||(o=this.getMeshBasicMaterial(a),l=Dx.Mesh),s.material=o,s.renderOrder=l}setRenderOrderByObjectType(e){const t=e;let n=0;t.isMesh?n=Dx.Mesh:t.isLine?n=Dx.Line:t.isPoints&&(n=Dx.Point),e.renderOrder=n}getPointsMaterial(e){return this.pointsMaterials[e]||(this.pointsMaterials[e]=new Xo({size:.2,color:e})),this.pointsMaterials[e]}getLineBasicMaterial(e){return this.lineBasicMaterials[e]||(this.lineBasicMaterials[e]=new Fo({color:e})),this.lineBasicMaterials[e]}getLineShaderMaterial(e,t,n){const r=`${e.name}_${t}_${n}`;if(!this.lineShaderMaterials[r]){const i=this.getLineTypeScales(),s=i.ltScale*i.celtScale*n;this.lineShaderMaterials[r]=class{static createLineShaderMaterial(e,t,n,r,i){let s=0;const a=[];for(let t=0;t<e.length;t++)a[t]=e[t],0===a[t]&&(a[t]=.5),a[t]*=n,s+=Math.abs(a[t]);const o=yi.merge([Ui.common,{pattern:{type:"fv1",value:a},patternLength:{type:"f",value:s},u_color:{value:new cn(t)}}]);o.u_viewportScale=r,o.u_cameraZoom=i;const l=`\n uniform mat4 modelMatrix;\n uniform vec3 diffuse;\n uniform vec3 u_color;\n uniform float opacity;\n uniform float pattern[${e.length}];\n uniform float patternLength;\n uniform float u_viewportScale;\n uniform float u_cameraZoom;\n varying float vLineDistance;\n\n #include <clipping_planes_pars_fragment>\n\n vec2 getWorldScale() {\n return vec2(length(modelMatrix[0].xyz), length(modelMatrix[1].xyz));\n }\n\n void main() {\n\n #include <clipping_planes_fragment>\n\n // vec2 worldScale = getWorldScale();\n // float averageScale = (abs(worldScale.x) + abs(worldScale.y))/2.0;\n // When zoomed out to a certain extent, it is displayed as a solid line.\n if(patternLength * u_viewportScale * u_cameraZoom/1.5 < 1.0){\n gl_FragColor = vec4(u_color, opacity);\n return;\n }\n\n float pos = mod(vLineDistance, patternLength * u_viewportScale);\n\n for ( int i = 0; i < ${e.length}; i++ ) {\n pos = pos - abs(pattern[i] * u_viewportScale);\n if ( pos < 0.0 ) {\n if ( pattern[i] > 0.0 ) {\n gl_FragColor = vec4(u_color, opacity);\n break;\n }\n discard;\n }\n }\n }`;return new bi({uniforms:o,vertexShader:"\n attribute float lineDistance;\n varying float vLineDistance;\n\n #include <clipping_planes_pars_vertex>\n\n void main() {\n vLineDistance = lineDistance;\n\n #include <begin_vertex>\n #include <project_vertex>\n #include <clipping_planes_vertex>\n }",fragmentShader:l,clipping:!0})}}.createLineShaderMaterial(e.pattern,t,s,pE.viewportScaleUniform,pE.cameraZoomUniform)}return this.lineShaderMaterials[r]}getMeshBasicMaterial(e){return this.meshBasicMaterials[e]||(this.meshBasicMaterials[e]=new kr({color:e})),this.meshBasicMaterials[e]}getHatchShaderMaterial(e,t,n){var r;if(!e.patternLines||e.patternLines.length<1)return;const i=this.findMatchedHatchShaderMaterial(e,t);if(i)return i;let s=2;ge()(r=e.patternLines).call(r,(e=>{s=Math.max(e.dashPattern.length,s)}));let a=0;const o=[],l=new Xt;for(const t of e.patternLines){const r=new Xt(t.origin.x,t.origin.y).sub(n).rotateAround(l,-Yt.degToRad(e.patternAngle)),i=new Xt(t.delta.x,t.delta.y).rotateAround(l,-Yt.degToRad(t.angle));if(0===i.y)return void im.warn("[DxfLoader] delta.y is equal to zero !");const c=t.dashPattern.length;let u=!0,h=0;for(let e=0;e<c;++e){const n=t.dashPattern[e];n>0&&(u=!1),h+=Math.abs(n)}const p=u?.05:.005,d=[],m=[];let f=0;m[0]=f;for(let e=0;e<c;++e)d[e]=t.dashPattern[e],0===d[e]&&(d[e]=p*h),f+=Math.abs(d[e]),m[e+1]=f;for(let e=c;e<s;++e)d[e]=0;for(let e=m.length;e<s+1;++e)m[e]=f;const g={origin:r,delta:i,angle:t.angle-e.patternAngle,pattern:d,patternSum:m,patternLength:f};if(a+=4,a+=s,a+=s+1,a>pE.maxFragmentUniforms){im.warn("[DxfLoader] There will be warning in fragment shader when number of uniforms exceeds 1024, so extra hatch line patterns are ignored here!");break}o.push(g)}const c=function(e,t,n,r){const i={u_cameraZoom:n,u_patternLines:{value:e},u_patternAngle:{value:t},u_color:{value:r}},s=`\n uniform mat4 modelMatrix;\n uniform float u_cameraZoom;\n uniform vec3 u_color;\n varying vec3 v_pos;\n\n struct PatternLine {\n vec2 origin;\n vec2 delta;\n float angle;\n float pattern[MAX_PATTERN_SEGMENT_COUNT];\n float patternSum[MAX_PATTERN_SEGMENT_COUNT+1];\n float patternLength;\n };\n\n uniform PatternLine u_patternLines[${e.length}];\n uniform float u_patternAngle;\n\n #include <clipping_planes_pars_fragment>\n\n // Clamp [0..1] range\n #define saturate(a) clamp(a, 0.0, 1.0)\n\n const float EPS = 0.000001;\n\n vec2 getWorldScale() {\n return vec2(length(modelMatrix[0].xyz), length(modelMatrix[1].xyz));\n }\n\n vec2 rotate(vec2 st, float rotation) {\n const float PI = 3.1415926;\n float angle = rotation * PI/180.0;\n float sine = sin(angle), cosine = cos(angle);\n return vec2(cosine * st.x - sine * st.y, cosine * st.y + sine * st.x);\n }\n\n vec2 translate(vec2 samplePosition, vec2 offset) {\n //move samplepoint in the opposite direction that we want to move shapes in\n return samplePosition - offset;\n }\n\n vec2 scale(vec2 samplePosition, float scale) {\n return samplePosition / scale;\n }\n\n float sdfLine(vec2 st, vec2 a, vec2 b) {\n vec2 ap = st - a;\n vec2 ab = b - a;\n return abs(((ap.x * ab.y) - (ab.x * ap.y))) / length(ab);\n }\n\n float drawSpaceLine(vec2 st, float distanceBetweenLines, float thick) {\n float dist = sdfLine(st , vec2(0.0, 0.0) , vec2(1.0, 0.0));\n \n //vec2 tt = dFdy(st);\n //float scale = (abs(tt.x)+abs(tt.y))/2.0;\n //float scale = length(fwidth(st)) * 0.5;\n // close to a pixel\n //float thick = 2.0;\n //thick = (thick * 0.5 - 0.5) * scale;\n\n float lineDistance = abs(fract(dist / distanceBetweenLines + 0.5) - 0.5) * distanceBetweenLines;\n //float distanceChange = fwidth(dist) * 0.5;\n //float thresold = smoothstep(thick - distanceChange, thick + distanceChange, lineDistance);\n //float thresold = step(thick,lineDistance);\n // remove gradient\n float thresold = step(thick,lineDistance);\n\n return saturate(thresold);\n }\n\n float drawSolidLine(PatternLine patternLine, float thick) {\n vec2 origin = patternLine.origin;\n vec2 delta = patternLine.delta;\n float distanceBetweenLines = length(delta);\n\n origin = rotate(origin,u_patternAngle);\n vec2 st = rotate(v_pos.xy - origin, -(patternLine.angle + u_patternAngle));\n\n return drawSpaceLine(st, distanceBetweenLines , thick);\n }\n\n int getPatternIndex(PatternLine patternLine, float u ) {\n u = mod(u, patternLine.patternLength);\n float distance = 0.0;\n\n #pragma unroll_loop_start\n for(int i = 1; i < patternLine.patternSum.length(); i++){\n if(u < patternLine.patternSum[i]) {\n distance = u - patternLine.patternSum[i-1];\n return i - 1;\n }\n }\n #pragma unroll_loop_end\n\n return -1;\n }\n\n float drawDashedLine(PatternLine patternLine, float thick){\n float thresold = 1.0;\n vec2 origin = patternLine.origin;\n vec2 delta = patternLine.delta; \n float distanceBetweenLines = length(delta.y);\n\n origin = rotate(origin, u_patternAngle);\n vec2 st = rotate(v_pos.xy - origin, -(patternLine.angle + u_patternAngle));\n\n float offsetX = st.y * delta.x/delta.y;\n float u = st.x - offsetX;\n int index = getPatternIndex(patternLine, u);\n if(index < 0){\n return thresold;\n }\n\n float size = patternLine.pattern[index];\n if(size >= 0.0) {\n thresold = drawSpaceLine(st, distanceBetweenLines , thick);\n }\n \n return thresold;\n }\n\n float drawLine(PatternLine patternLine, float thick) {\n float t = 0.0;\n if(patternLine.patternLength > 0.0) {\n t = drawDashedLine(patternLine, thick);\n } else {\n t = drawSolidLine(patternLine, thick);\n }\n return t;\n }\n\n void main() {\n #include <clipping_planes_fragment>\n \n if(u_cameraZoom < EPS){\n gl_FragColor = vec4(u_color, 1.0);\n return;\n }\n\n vec2 worldScale = getWorldScale();\n float averageScale = (abs(worldScale.x) + abs(worldScale.y))/2.0;\n float thick = (0.7 / averageScale) / u_cameraZoom;\n\n float total = 0.0;\n\n#if ${e.length} > 1\n #pragma unroll_loop_start\n for (int i = 0; i < u_patternLines.length(); i++) {\n PatternLine pl = u_patternLines[i];\n float t = drawLine(pl, thick);\n total += (1.0 - t);\n }\n #pragma unroll_loop_end\n#else\n float t = drawLine(u_patternLines[0], thick);\n total += (1.0 - t);\n#endif\n\n total = saturate(total);\n if (total < 0.01) {\n discard;\n }\n\n gl_FragColor = vec4(u_color * total, 1.0);\n }\n `;return new bi({uniforms:i,vertexShader:"\n varying vec3 v_pos;\n\n #include <clipping_planes_pars_vertex>\n void main() {\n //vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n v_pos = position;\n\n #include <begin_vertex>\n #include <project_vertex>\n #include <clipping_planes_vertex>\n }",fragmentShader:s,clipping:!0})}(o,e.patternAngle,pE.cameraZoomUniform,new cn(t));return c.defines={MAX_PATTERN_SEGMENT_COUNT:s},this.hatchShaderMaterials.push({patternLines:e.patternLines,patternAngle:e.patternAngle,color:t,material:c}),c}getDivision(e,t,n){let r=Math.round(5e4/this.entityCount);r=Math.max(r,2),r=Math.min(r,10);const i=5*r;let s=2*r;if(this.averageCurveSize){s*=Math.pow(n/this.averageCurveSize,.5),s=Math.max(s,r),s=Math.min(s,i)}let a=t-e;a<0&&(a+=2*Math.PI),s=Math.ceil(s*(a/Math.PI));let o=8;return a<.087?o=2:a<.174?o=3:a<.52?o=4:a<1.57?o=5:a<3.14?o=6:a<4.71&&(o=7),s=Math.max(s,o),this.averageCurveSize=(this.averageCurveSize*this.curveCount+n)/(this.curveCount+1),this.curveCount++,Math.max(s,12)}getSimplifyTolerance(){return.03}setDxfDataToIndexedDb(e,t){try{const n={dxfDataId:e,dxf:t};return v().resolve(new(v())(((t,r)=>{iw.instance().add(n,(()=>{im.info(`[DxfLoader] Saved '${e}' to indexedDb`),t()}),(e=>{r(e)}))})))}catch(e){return v().reject(e)}}getDxfDataFromIndexedDb(e){try{return v().resolve(new(v())(((t,n)=>{iw.instance().query(e,(e=>{e&&e.length>0&&t(e[0].dxf),t(void 0)}),(()=>n()))})))}catch(e){return v().reject(e)}}buildContainHierarchyTree(e,t,n){const r=new(ue()),i=n.length;for(let e=0;e<i;e++)r.set(n[e],{index:n[e],children:[]});const s={index:-1,children:[]};for(let o=0;o<i;o++){const l=n[o],c=e[l],u=t[l];let h=o+1;for(;h<i;h++){const i=n[h],s=e[i];if(t[i].containsBox(u)&&ef.isPointInPolygon(c[cm.generateRandomInt(0,c.length-1)],s)){var a;null===(a=r.get(i))||void 0===a||a.children.push(r.get(l));break}}h===i&&s.children.push(r.get(l))}return s}buildHatchGeometry(e,t,n){var r,i;if(0===t.children.length)return;const s=[],a=new(ue());ge()(r=t.children).call(r,(e=>{var t;0===e.children.length?s.push(e.index):a.set(e.index,Z()(t=e.children).call(t,(e=>e.index)))}));const o=e=>{try{const t=new rc(e);t.hasAttribute("uv")&&t.deleteAttribute("uv"),t.hasAttribute("normal")&&t.deleteAttribute("normal"),n.push(t)}catch(n){var t;im.warn(`[DxfLoader] triangulate shape error: ${Z()(t=e.getPoints()).call(t,(e=>e.toArray())).toString()}`)}};ge()(s).call(s,(t=>{const n=e[t];if(0===n.length)return;const r=new Il(n);o(r)}));const l=e=>Z()(e).call(e,(e=>e.toArray()));for(const t of a){const n=new Il(e[t[0]]);let r={regions:[],inverted:!1};const i=this.findIntersectHole(e,t[1]);ge()(i).call(i,(t=>{let i={regions:[],inverted:!1};try{ge()(t).call(t,((t,s)=>{if(sx.epsilon(Gm.getVector2RelativeEps(e[t][0]),1e-6),0===s)i=sx.segments({regions:[l(e[t])],inverted:!1});else{const s=sx.segments({regions:[l(e[t])],inverted:!1}),o=sx.combine(i,s);var a;if(r=sx.polygon(sx.selectUnion(o)),r.regions.length>0)ge()(a=r.regions).call(a,(e=>{if(0===e.length)return;const t=Z()(e).call(e,(e=>new Xt(e[0],e[1])));n.holes.push(new yl(t))}));else im.warn("[DxfLoader] mergedHoles.regions is empty")}}))}catch(e){im.warn(`[DxfLoader] polybooljs has error: ${e}, epsilon is ${sx.epsilon()}`)}}));const s=ix()(i).call(i,2);for(let r=0;r<t[1].length;r++){const i=t[1][r];cp()(s).call(s,i)||n.holes.push(new yl(e[i]))}o(n)}ge()(i=t.children).call(i,(t=>{var r;ge()(r=t.children).call(r,(t=>{this.buildHatchGeometry(e,t,n)}))}))}findIntersectHole(e,t){const n=t.length,r=[];for(let i=0;i<n;i++){const s=e[t[i]];let a=!1;const o=[];for(let r=i+1;r<n;r++){const n=e[t[r]];ef.arePolygonsIntersect(s,n)&&(a=!0,o.push(t[r]))}a&&(o.push(t[i]),r.push(o))}return r}checkAndRebasePolygonsOnRTC(e,t){if(!this.enableRTC||0===e.length)return!1;let n=0;ge()(e).call(e,(e=>{ge()(e).call(e,(e=>{t.add(e),n++}))})),t.divideScalar(n);let r=!1;if(this.enableRTC&&ef.shouldRebasePositionOnRTC(t)){r=!0;for(let n=0;n<e.length;n++){const r=e[n];for(let e=0;e<r.length;e++){const n=r[e].x-t.x,i=r[e].y-t.y;r[e]=new Xt(n,i)}}}else t.set(0,0);return r}setRTCUserData(e){e.userData.relativeToCenter=!0,this.statsInfo.rebasedEntityCount++}IsfilteredByPathTypeFlag(e){return e<0}findSpatialFilterByHandle(e,t){const n=t.objects.DICTIONARY;if(!this.dictionaryOwnerHandleAndSpatialFilterHandlesCache){this.dictionaryOwnerHandleAndSpatialFilterHandlesCache={};for(const e of n){const t=e;let n="";for(const e in u_()(t))if("ACAD_FILTER"===u_()(t)[e]){n=e;break}n&&(this.dictionaryOwnerHandleAndSpatialFilterHandlesCache[e.ownerHandle]&&im.warn("[DxfLoader] Why this.dictionaryObjectsCache[obj.ownerHandle] already exist?",e.ownerHandle),this.dictionaryOwnerHandleAndSpatialFilterHandlesCache[e.ownerHandle]=n)}}const r=this.dictionaryOwnerHandleAndSpatialFilterHandlesCache[e];if(r){if(!this.spatialFiltersCache){this.spatialFiltersCache={};const e=t.objects.SPATIAL_FILTER||[];for(const t of e){const e=t;e.numberOfPointsOnClipBoundary<2||(this.spatialFiltersCache[e.ownerHandle]&&im.warn("[DxfLoader] Why this.spatialFiltersCache[spatialFilterObj.ownerHandle] already exist?",r),this.spatialFiltersCache[e.ownerHandle]=e)}}return this.spatialFiltersCache[r]}}initRenderOrderInfo(e){const t=new(pe()),n=e.objects.DICTIONARY;for(const e of n){var r;const n=e;ge()(r=Q()(u_()(n))).call(r,(e=>{u_()(n)[e]&&"ACAD_SORTENTS"===u_()(n)[e]&&t.add(e)}))}if(0===t.size)return;const i=e.objects.SORTENTSTABLE;if(i)for(let e=0;e<i.length;++e){const n=i[e];if(t.has(n.handle)){for(let e=0;e<n.sortEntsObject.entityHandles.length;++e){const t=n.sortEntsObject.entityHandles[e];2!==t.length||this.entityHandlesWithRenderOrder[t[0]]?im.warn(`[DxfLoader] Failed to handle sortEntsTable: ${n.handle}.`):this.entityHandlesWithRenderOrder[t[0]]=t[1]}break}}}findMatchedHatchShaderMaterial(e,t){var n;const r=e.patternLines;if(!r||r.length<1)return;const i=(e,t)=>Math.abs(e-t)<1e-5,s=(e,t)=>i(e.angle,t.angle)&&i(e.delta.x,t.delta.x)&&i(e.delta.y,t.delta.y)&&i(e.origin.x,t.origin.x)&&i(e.origin.y,t.origin.y)&&((e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!i(e[n],t[n]))return!1;return!0})(e.dashPattern,t.dashPattern),a=Se()(n=this.hatchShaderMaterials).call(n,(n=>n.color===t&&n.patternAngle===e.patternAngle&&((e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!s(e[n],t[n]))return!1;return!0})(n.patternLines,r)));return null==a?void 0:a.material}getLayout(e,t){var n;if(!this.blockRecordsCache){var r;this.blockRecordsCache={};const t=this.blockRecordsCache,n=e.tables.blockRecord.blockRecords;ge()(r=tp()(n)).call(r,(e=>{t[e.handle]=e.layoutHandle}))}const i=this.blockRecordsCache[t.ownerHandle];if(i){const t=e.objects.LAYOUT,n=Se()(t).call(t,(e=>e.handle===i));if(n)return n}if(!this.entitiesCache){var s;this.entitiesCache={};const t=this.entitiesCache;ge()(s=tp()(e.entities)).call(s,(e=>{t[e.handle]=e}))}const a=this.entitiesCache[t.ownerHandle];return a?this.getLayout(e,a):(im.warn("[DxfLoader] Failed to find layout name for entity:",t),Se()(n=e.objects.LAYOUT).call(n,(e=>e.layoutName===this.MODEL_LAYOUT_NAME)))}getLayerVisible(e,t){var n,r,i;const s=null===(n=e.tables)||void 0===n||null===(r=n.layer)||void 0===r?void 0:r.layers;return s&&(null===(i=s[t])||void 0===i?void 0:i.visible)}getLayerFrozen(e,t){var n,r,i;const s=null===(n=e.tables)||void 0===n||null===(r=n.layer)||void 0===r?void 0:r.layers;return s&&(null===(i=s[t.layer])||void 0===i?void 0:i.frozen)}cloneMaterialsForSpatialFilter(e){const t=e=>{e instanceof bi&&(e.uniforms.u_cameraZoom&&(e.uniforms.u_cameraZoom=pE.cameraZoomUniform),e.uniforms.u_viewportScale&&(e.uniforms.u_viewportScale=pE.viewportScaleUniform))},n=new(ue());e.traverse((e=>{e.material&&(e.material=(e=>{let r;return x()(e)?(r=[],ge()(e).call(e,(e=>{if(n.has(e.id))r.push(n.get(e.id));else{const i=e.clone();t(i),n.set(e.id,i),r.push(i)}}))):e&&(n.has(e.id)?r=n.get(e.id):(r=e.clone(),t(r),n.set(e.id,r))),r})(e.material))}))}getLineTypeScales(){const e={ltScale:1,celtScale:1};return this.header?(e.ltScale=this.header.$LTSCALE||1,e.celtScale=this.header.$CELTSCALE||1,e):e}static getDxfUnits(e){switch(e||0){case 0:return hw.Unitless;case 1:return hw.Inches;case 2:return hw.Feet;case 4:return hw.Millimeters;case 5:return hw.Centimeters;case 6:return hw.Meters;default:im.warn(`[DxfLoader] Unsupported $INSUNITS '${e}'`)}return hw.Unitless}static computeLineDistance(e){const t=!0===e.isLineSegments;let n=e.geometry;const r=e.matrixWorld;if(n.index&&(im.info(`[DxfLoader] Line with id '${e.id}' contains index buffer, going to convert it to non-indexed.`),n=ef.convertGeometryWithIndexedToNonIndexed(n)),null===n.index){const e=n.attributes.position;if(!e||0===e.count)return;const i=[];if(t)for(let t=0,n=e.count;t<n;t+=2)sE.fromBufferAttribute(e,t).applyMatrix4(r),aE.fromBufferAttribute(e,t+1).applyMatrix4(r),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+sE.distanceTo(aE);else{i[0]=0;for(let t=1,n=e.count;t<n;t++)sE.fromBufferAttribute(e,t-1).applyMatrix4(r),aE.fromBufferAttribute(e,t).applyMatrix4(r),i[t]=i[t-1],i[t]+=sE.distanceTo(aE)}n.setAttribute("lineDistance",new zr(i,1))}else im.warn("[DxfLoader] computeLineDistances only possible with non-indexed BufferGeometry.")}static computeLineDistances(e){const t=Yh()();e.traverse((e=>{let t=e;t.isLine&&t.material instanceof bi&&pE.computeLineDistance(t)})),im.info(`[DxfLoader] Computed line distances in ${(Yh()()-t)/1e3}s`)}}gh(pE,"cameraZoomUniform",{value:1}),gh(pE,"viewportScaleUniform",{value:1}),gh(pE,"transformMatrixUniform",{value:new Zn}),gh(pE,"resolutionUniform",{value:new Xt}),gh(pE,"maxFragmentUniforms",1024);var dE={},mE=function(e){return g_.createObjectURL(new Blob([e],{type:"text/javascript"}))},fE=function(e){return new Worker(e)};try{g_.revokeObjectURL(mE(""))}catch(e){mE=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},fE=function(e){return new Worker(e,{type:"module"})}}var gE=Uint8Array,_E=Uint16Array,vE=Uint32Array,yE=new gE([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),bE=new gE([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xE=new gE([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),TE=function(e,t){for(var n=new _E(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new vE(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},wE=TE(yE,2),EE=wE[0],SE=wE[1];EE[28]=258,SE[258]=28;for(var IE=TE(bE,0),ME=IE[0],AE=IE[1],RE=new _E(32768),DE=0;DE<32768;++DE){var CE=(43690&DE)>>>1|(21845&DE)<<1;CE=(61680&(CE=(52428&CE)>>>2|(13107&CE)<<2))>>>4|(3855&CE)<<4,RE[DE]=((65280&CE)>>>8|(255&CE)<<8)>>>1}var OE=function(e,t,n){for(var r=e.length,i=0,s=new _E(t);i<r;++i)++s[e[i]-1];var a,o=new _E(t);for(i=0;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;if(n){a=new _E(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],h=o[e[i]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)a[RE[h]>>>l]=c}else for(a=new _E(r),i=0;i<r;++i)e[i]&&(a[i]=RE[o[e[i]-1]++]>>>15-e[i]);return a},PE=new gE(288);for(DE=0;DE<144;++DE)PE[DE]=8;for(DE=144;DE<256;++DE)PE[DE]=9;for(DE=256;DE<280;++DE)PE[DE]=7;for(DE=280;DE<288;++DE)PE[DE]=8;var NE=new gE(32);for(DE=0;DE<32;++DE)NE[DE]=5;var LE=OE(PE,9,0),kE=OE(PE,9,1),FE=OE(NE,5,0),UE=OE(NE,5,1),BE=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},jE=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},GE=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},zE=function(e){return(e/8|0)+(7&e&&1)},VE=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof _E?_E:e instanceof vE?vE:gE)(n-t);return r.set(e.subarray(t,n)),r},HE=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new gE(0);var i=!t||n,s=!n||n.i;n||(n={}),t||(t=new gE(3*r));var a=function(e){var n=t.length;if(e>n){var r=new gE(Math.max(2*n,e));r.set(t),t=r}},o=n.f||0,l=n.p||0,c=n.b||0,u=n.l,h=n.d,p=n.m,d=n.n,m=8*r;do{if(!u){n.f=o=jE(e,l,1);var f=jE(e,l+1,3);if(l+=3,!f){var g=e[(M=zE(l)+4)-4]|e[M-3]<<8,_=M+g;if(_>r){if(s)throw"unexpected EOF";break}i&&a(c+g),t.set(e.subarray(M,_),c),n.b=c+=g,n.p=l=8*_;continue}if(1==f)u=kE,h=UE,p=9,d=5;else{if(2!=f)throw"invalid block type";var v=jE(e,l,31)+257,y=jE(e,l+10,15)+4,b=v+jE(e,l+5,31)+1;l+=14;for(var x=new gE(b),T=new gE(19),w=0;w<y;++w)T[xE[w]]=jE(e,l+3*w,7);l+=3*y;var E=BE(T),S=(1<<E)-1,I=OE(T,E,1);for(w=0;w<b;){var M,A=I[jE(e,l,S)];if(l+=15&A,(M=A>>>4)<16)x[w++]=M;else{var R=0,D=0;for(16==M?(D=3+jE(e,l,3),l+=2,R=x[w-1]):17==M?(D=3+jE(e,l,7),l+=3):18==M&&(D=11+jE(e,l,127),l+=7);D--;)x[w++]=R}}var C=x.subarray(0,v),O=x.subarray(v);p=BE(C),d=BE(O),u=OE(C,p,1),h=OE(O,d,1)}if(l>m){if(s)throw"unexpected EOF";break}}i&&a(c+131072);for(var P=(1<<p)-1,N=(1<<d)-1,L=l;;L=l){var k=(R=u[GE(e,l)&P])>>>4;if((l+=15&R)>m){if(s)throw"unexpected EOF";break}if(!R)throw"invalid length/literal";if(k<256)t[c++]=k;else{if(256==k){L=l,u=null;break}var F=k-254;if(k>264){var U=yE[w=k-257];F=jE(e,l,(1<<U)-1)+EE[w],l+=U}var B=h[GE(e,l)&N],j=B>>>4;if(!B)throw"invalid distance";l+=15&B;O=ME[j];if(j>3){U=bE[j];O+=GE(e,l)&(1<<U)-1,l+=U}if(l>m){if(s)throw"unexpected EOF";break}i&&a(c+131072);for(var G=c+F;c<G;c+=4)t[c]=t[c-O],t[c+1]=t[c+1-O],t[c+2]=t[c+2-O],t[c+3]=t[c+3-O];c=G}}n.l=u,n.p=L,n.b=c,u&&(o=1,n.m=p,n.d=h,n.n=d)}while(!o);return c==t.length?t:VE(t,0,c)},qE=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},WE=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},YE=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=I(n).call(n);if(!i)return[eS,0];if(1==i){var a=new gE(n[0].s+1);return a[n[0].s]=1,[a,1]}ne(n).call(n,(function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],c=0,u=1,h=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=i-1;)o=n[n[c].f<n[h].f?c++:h++],l=n[c!=u&&n[c].f<n[h].f?c++:h++],n[u++]={s:-1,f:o.f+l.f,l:o,r:l};var p=s[0].s;for(r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var d=new _E(p+1),m=XE(n[u-1],d,0);if(m>t){r=0;var f=0,g=m-t,_=1<<g;for(ne(s).call(s,(function(e,t){return d[t.s]-d[e.s]||e.f-t.f}));r<i;++r){var v=s[r].s;if(!(d[v]>t))break;f+=_-(1<<m-d[v]),d[v]=t}for(f>>>=g;f>0;){var y=s[r].s;d[y]<t?f-=1<<t-d[y]++-1:++r}for(;r>=0&&f;--r){var b=s[r].s;d[b]==t&&(--d[b],++f)}m=t}return[new gE(d),m]},XE=function(e,t,n){return-1==e.s?Math.max(XE(e.l,t,n+1),XE(e.r,t,n+1)):t[e.s]=n},$E=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new _E(++t),r=0,i=e[0],s=1,a=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return[n.subarray(0,r),t]},KE=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ZE=function(e,t,n){var r=n.length,i=zE(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return 8*(i+4+r)},JE=function(e,t,n,r,i,s,a,o,l,c,u){qE(t,u++,n),++i[256];for(var h=YE(i,15),p=h[0],d=h[1],m=YE(s,15),f=m[0],g=m[1],_=$E(p),v=_[0],y=_[1],b=$E(f),x=b[0],T=b[1],w=new _E(19),E=0;E<v.length;++E)w[31&v[E]]++;for(E=0;E<x.length;++E)w[31&x[E]]++;for(var S=YE(w,7),I=S[0],M=S[1],A=19;A>4&&!I[xE[A-1]];--A);var R,D,C,O,P=c+5<<3,N=KE(i,PE)+KE(s,NE)+a,L=KE(i,p)+KE(s,f)+a+14+3*A+KE(w,I)+(2*w[16]+3*w[17]+7*w[18]);if(P<=N&&P<=L)return ZE(t,u,e.subarray(l,l+c));if(qE(t,u,1+(L<N)),u+=2,L<N){R=OE(p,d,0),D=p,C=OE(f,g,0),O=f;var k=OE(I,M,0);qE(t,u,y-257),qE(t,u+5,T-1),qE(t,u+10,A-4),u+=14;for(E=0;E<A;++E)qE(t,u+3*E,I[xE[E]]);u+=3*A;for(var F=[v,x],U=0;U<2;++U){var B=F[U];for(E=0;E<B.length;++E){var j=31&B[E];qE(t,u,k[j]),u+=I[j],j>15&&(qE(t,u,B[E]>>>5&127),u+=B[E]>>>12)}}}else R=LE,D=PE,C=FE,O=NE;for(E=0;E<o;++E)if(r[E]>255){j=r[E]>>>18&31;WE(t,u,R[j+257]),u+=D[j+257],j>7&&(qE(t,u,r[E]>>>23&31),u+=yE[j]);var G=31&r[E];WE(t,u,C[G]),u+=O[G],G>3&&(WE(t,u,r[E]>>>5&8191),u+=bE[G])}else WE(t,u,R[r[E]]),u+=D[r[E]];return WE(t,u,R[256]),u+D[256]},QE=new vE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eS=new gE(0),tS=function(e,t,n,r,i,s){var a=e.length,o=new gE(r+a+5*(1+Math.ceil(a/7e3))+i),l=o.subarray(r,o.length-i),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var h=u+65535;h<a?c=ZE(l,c,e.subarray(u,h)):(l[u]=s,c=ZE(l,c,e.subarray(u,a)))}else{for(var p=QE[t-1],d=p>>>13,m=8191&p,f=(1<<n)-1,g=new _E(32768),_=new _E(f+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&f},x=new vE(25e3),T=new _E(288),w=new _E(32),E=0,S=0,I=(u=0,0),M=0,A=0;u<a;++u){var R=b(u),D=32767&u,C=_[R];if(g[D]=C,_[R]=D,M<=u){var O=a-u;if((E>7e3||I>24576)&&O>423){c=JE(e,l,0,x,T,w,S,I,A,u-A,c),I=E=S=0,A=u;for(var P=0;P<286;++P)T[P]=0;for(P=0;P<30;++P)w[P]=0}var N=2,L=0,k=m,F=D-C&32767;if(O>2&&R==b(u-F))for(var U=Math.min(d,O)-1,B=Math.min(32767,u),j=Math.min(258,O);F<=B&&--k&&D!=C;){if(e[u+N]==e[u+N-F]){for(var G=0;G<j&&e[u+G]==e[u+G-F];++G);if(G>N){if(N=G,L=F,G>U)break;var z=Math.min(F,G-2),V=0;for(P=0;P<z;++P){var H=u-F+P+32768&32767,q=H-g[H]+32768&32767;q>V&&(V=q,C=H)}}}F+=(D=C)-(C=g[D])+32768&32767}if(L){x[I++]=268435456|SE[N]<<18|AE[L];var W=31&SE[N],Y=31&AE[L];S+=yE[W]+bE[Y],++T[257+W],++w[Y],M=u+N,++E}else x[I++]=e[u],++T[e[u]]}}c=JE(e,l,s,x,T,w,S,I,A,u-A,c),!s&&7&c&&(c=ZE(l,c+1,eS))}return VE(o,0,r+zE(c)+i)},nS=function(){for(var e=new vE(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),rS=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=nS[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},iS=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=n[a];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},sS=function(e,t,n,r,i){return tS(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},aS=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},oS=function(e,t,n){for(var r=e(),i=e.toString(),s=I(i).call(i,T(i).call(i,"[")+1,De(i).call(i,"]")).replace(/ /g,"").split(","),a=0;a<r.length;++a){var o=r[a],l=s[a];if("function"==typeof o){t+=";"+l+"=";var c=o.toString();if(o.prototype)if(-1!=T(c).call(c,"[native code]")){var u=T(c).call(c," ",8)+1;t+=I(c).call(c,u,T(c).call(c,"(",u))}else for(var h in t+=c,o.prototype)t+=";"+l+".prototype."+h+"="+o.prototype[h].toString();else t+=c}else n[l]=o}return[t,n]},lS=[],cS=function(e,t,n,r){var i;if(!lS[n]){for(var s="",a={},o=e.length-1,l=0;l<o;++l)s=(i=oS(e[l],s,a))[0],a=i[1];lS[n]=oS(e[o],s,a)}var c=aS({},lS[n][1]);return function(e,t,n,r,i){var s=fE(dE[t]||(dE[t]=mE(e)));return s.onerror=function(e){return i(e.error,null)},s.onmessage=function(e){return i(null,e.data)},s.postMessage(n,r),s}(lS[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,c,function(e){var t=[];for(var n in e)(e[n]instanceof gE||e[n]instanceof _E||e[n]instanceof vE)&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(c),r)},uS=function(){return[gE,_E,vE,yE,bE,xE,EE,ME,kE,UE,RE,OE,BE,jE,GE,zE,VE,HE,BS,gS,_S]},hS=function(){return[gE,_E,vE,yE,bE,xE,SE,AE,LE,PE,FE,NE,RE,QE,eS,OE,qE,WE,YE,XE,$E,KE,ZE,JE,zE,VE,tS,sS,LS,gS]},pS=function(){return[SS,AS,ES,rS,nS]},dS=function(){return[IS,MS]},mS=function(){return[RS,ES,iS]},fS=function(){return[DS]},gS=function(e){return postMessage(e,[e.buffer])},_S=function(e){return e&&e.size&&new gE(e.size)},vS=function(e,t,n,r,i,s){var a=cS(n,r,i,(function(e,t){a.terminate(),s(e,t)}));return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},yS=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},bS=function(e,t,n,r,i){var s,a=cS(e,r,i,(function(e,n){e?(a.terminate(),t.ondata.call(t,e)):(n[1]&&a.terminate(),t.ondata.call(t,e,n[0],n[1]))}));a.postMessage(n),t.push=function(e,n){if(s)throw"stream finished";if(!t.ondata)throw"no stream handler";a.postMessage([e,s=n],[e.buffer])},t.terminate=function(){a.terminate()}},xS=function(e,t){return e[t]|e[t+1]<<8},TS=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},wS=function(e,t){return TS(e,t)+4294967296*TS(e,t+4)},ES=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},SS=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ES(e,4,Math.floor(new Date(t.mtime||Wh())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},IS=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},MS=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},AS=function(e){return 10+(e.filename&&e.filename.length+1||0)},RS=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},DS=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function CS(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var OS=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(sS(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}(),PS=function(){return function(e,t){bS([hS,function(){return[yS,OS]}],this,CS.call(this,e,t),(function(e){var t=new OS(e.data);onmessage=yS(t)}),6)}}();function NS(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return vS(e,t,[hS],(function(e){return gS(LS(e.data[0],e.data[1]))}),0,n)}function LS(e,t){return sS(e,t||{},0,0)}var kS=function(){function e(e){this.s={},this.p=new gE(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,n=new gE(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=HE(this.p,this.o,this.s);this.ondata(VE(n,t,this.s.b),this.d),this.o=VE(n,this.s.b-32768),this.s.b=this.o.length,this.p=VE(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),FS=function(){return function(e){this.ondata=e,bS([uS,function(){return[yS,kS]}],this,0,(function(){var e=new kS;onmessage=yS(e)}),7)}}();function US(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return vS(e,t,[uS],(function(e){return gS(BS(e.data[0],_S(e.data[1])))}),1,n)}function BS(e,t){return HE(e,t)}var jS=function(){function e(e,t){this.c=rS(),this.l=0,this.v=1,OS.call(this,e,t)}return e.prototype.push=function(e,t){OS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=sS(e,this.o,this.v&&AS(this.o),t&&8,!t);this.v&&(SS(n,this.o),this.v=0),t&&(ES(n,n.length-8,this.c.d()),ES(n,n.length-4,this.l)),this.ondata(n,t)},e}(),GS=function(){return function(e,t){bS([hS,pS,function(){return[yS,OS,jS]}],this,CS.call(this,e,t),(function(e){var t=new jS(e.data);onmessage=yS(t)}),8)}}();function zS(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return vS(e,t,[hS,pS,function(){return[VS]}],(function(e){return gS(VS(e.data[0],e.data[1]))}),2,n)}function VS(e,t){t||(t={});var n=rS(),r=e.length;n.p(e);var i=sS(e,t,AS(t),8),s=i.length;return SS(i,t),ES(i,s-8,n.d()),ES(i,s-4,r),i}var HS=function(){function e(e){this.v=1,kS.call(this,e)}return e.prototype.push=function(e,t){if(kS.prototype.e.call(this,e),this.v){var n=this.p.length>3?IS(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}kS.prototype.c.call(this,t)},e}(),qS=function(){return function(e){this.ondata=e,bS([uS,dS,function(){return[yS,kS,HS]}],this,0,(function(){var e=new HS;onmessage=yS(e)}),9)}}();function WS(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return vS(e,t,[uS,dS,function(){return[YS]}],(function(e){return gS(YS(e.data[0]))}),3,n)}function YS(e,t){return HE(e.subarray(IS(e),-8),t||new gE(MS(e)))}var XS=function(){function e(e,t){this.c=iS(),this.v=1,OS.call(this,e,t)}return e.prototype.push=function(e,t){OS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=sS(e,this.o,this.v&&2,t&&4,!t);this.v&&(RS(n,this.o),this.v=0),t&&ES(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),$S=function(){return function(e,t){bS([hS,mS,function(){return[yS,OS,XS]}],this,CS.call(this,e,t),(function(e){var t=new XS(e.data);onmessage=yS(t)}),10)}}();function KS(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return vS(e,t,[hS,mS,function(){return[ZS]}],(function(e){return gS(ZS(e.data[0],e.data[1]))}),4,n)}function ZS(e,t){t||(t={});var n=iS();n.p(e);var r=sS(e,t,2,4);return RS(r,t),ES(r,r.length-4,n.d()),r}var JS=function(){function e(e){this.v=1,kS.call(this,e)}return e.prototype.push=function(e,t){if(kS.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}kS.prototype.c.call(this,t)},e}(),QS=function(){return function(e){this.ondata=e,bS([uS,fS,function(){return[yS,kS,JS]}],this,0,(function(){var e=new JS;onmessage=yS(e)}),11)}}();function eI(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return vS(e,t,[uS,fS,function(){return[tI]}],(function(e){return gS(tI(e.data[0],_S(e.data[1])))}),5,n)}function tI(e,t){return HE((DS(e),e.subarray(2,-4)),t)}var nI=function(){function e(e){this.G=HS,this.I=kS,this.Z=JS,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new gE(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var r=this,i=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,t),this.p=null}}},e}(),rI=function(){function e(e){this.G=qS,this.I=FS,this.Z=QS,this.ondata=e}return e.prototype.push=function(e,t){nI.prototype.push.call(this,e,t)},e}();function iI(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return 31==e[0]&&139==e[1]&&8==e[2]?WS(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?US(e,t,n):eI(e,t,n)}function sI(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?YS(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?BS(e,t):tI(e,t)}var aI=function(e,t,n,r){for(var i in e){var s=e[i],a=t+i;s instanceof gE?n[a]=[s,r]:b(s)?n[a]=[s[0],aS(r,s[1])]:aI(s,a+"/",n,r)}},oI="undefined"!=typeof TextEncoder&&new TextEncoder,lI="undefined"!=typeof TextDecoder&&new TextDecoder,cI=0;try{lI.decode(eS,{stream:!0}),cI=1}catch(e){}var uI=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return[t,VE(e,n-1)];i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},hI=function(){function e(e){this.ondata=e,cI?this.t=new TextDecoder:this.p=eS}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new gE(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=uI(n),i=r[0],s=r[1];if(t){if(s.length)throw"invalid utf-8 data";this.p=null}else this.p=s;this.ondata(i,t)}},e}(),pI=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(dI(e),this.d=t||!1)},e}();function dI(e,t){if(t){for(var n=new gE(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(oI)return oI.encode(e);var i=e.length,s=new gE(e.length+(e.length>>1)),a=0,o=function(e){s[a++]=e};for(r=0;r<i;++r){if(a+5>s.length){var l=new gE(a+8+(i-r<<1));l.set(s),s=l}var c=e.charCodeAt(r);c<128||t?o(c):c<2048?(o(192|c>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++r))>>18),o(128|c>>12&63),o(128|c>>6&63),o(128|63&c)):(o(224|c>>12),o(128|c>>6&63),o(128|63&c))}return VE(s,0,a)}function mI(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(lI)return lI.decode(e);var i=uI(e),s=i[0];if(i[1].length)throw"invalid utf-8 data";return s}var fI=function(e){return 1==e?3:e<6?2:9==e?1:0},gI=function(e,t){return t+30+xS(e,t+26)+xS(e,t+28)},_I=function(e,t,n){var r=xS(e,t+28),i=mI(e.subarray(t+46,t+46+r),!(2048&xS(e,t+8))),s=t+46+r,a=TS(e,t+20),o=n&&4294967295==a?vI(e,s):[a,TS(e,t+24),TS(e,t+42)],l=o[0],c=o[1],u=o[2];return[xS(e,t+10),l,c,i,s+xS(e,t+30)+xS(e,t+32),u]},vI=function(e,t){for(;1!=xS(e,t);t+=4+xS(e,t+2));return[wS(e,t+12),wS(e,t+4),wS(e,t+20)]},yI=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;if(r>65535)throw"extra field too long";t+=r+4}return t},bI=function(e,t,n,r,i,s,a,o){var l=r.length,c=n.extra,u=o&&o.length,h=yI(c);ES(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==s&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var p=new Date(null==n.mtime?Wh():n.mtime),d=p.getFullYear()-1980;if(d<0||d>119)throw"date not in range 1980-2099";if(ES(e,t,d<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),t+=4,null!=s&&(ES(e,t,n.crc),ES(e,t+4,s),ES(e,t+8,n.size)),ES(e,t+12,l),ES(e,t+14,h),t+=16,null!=a&&(ES(e,t,u),ES(e,t+6,n.attrs),ES(e,t+10,a),t+=14),e.set(r,t),t+=l,h)for(var m in c){var f=c[m],g=f.length;ES(e,t,+m),ES(e,t+2,g),e.set(f,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},xI=function(e,t,n,r,i){ES(e,t,101010256),ES(e,t+8,n),ES(e,t+10,n),ES(e,t+12,r),ES(e,t+16,i)},TI=function(){function e(e){this.filename=e,this.c=rS(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),wI=function(){function e(e,t){var n=this;t||(t={}),TI.call(this,e),this.d=new OS(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=fI(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){TI.prototype.push.call(this,e,t)},e}(),EI=function(){function e(e,t){var n=this;t||(t={}),TI.call(this,e),this.d=new PS(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=fI(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){TI.prototype.push.call(this,e,t)},e}(),SI=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var n=dI(e.filename),r=n.length,i=e.comment,s=i&&dI(i),a=r!=e.filename.length||s&&i.length!=s.length,o=r+yI(e.extra)+30;if(r>65535)throw"filename too long";var l=new gE(o);bI(l,0,e,n,a);var c=[l],u=function(){for(var e=0,n=c;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=aS(e,{f:n,u:a,o:s,t:function(){e.terminate&&e.terminate()},r:function(){if(u(),h){var e=t.u[p+1];e?e.r():t.d=1}h=1}}),m=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(m+=r.length,c.push(r),i){var s=new gE(16);ES(s,0,134695760),ES(s,4,e.crc),ES(s,8,m),ES(s,12,e.size),c.push(s),d.c=m,d.b=o+m+16,d.crc=e.crc,d.size=e.size,h&&d.r(),h=1}else h&&u()},this.u.push(d)},e.prototype.end=function(){var e=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){var t;1&e.d&&(E(t=e.u).call(t,-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+yI(l.extra)+(l.o?l.o.length:0)}for(var s=new gE(n+22),a=0,o=this.u;a<o.length;a++){var l=o[a];bI(s,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+yI(l.extra)+(l.o?l.o.length:0),t+=l.b}xI(s,e,this.u.length,n,t),this.ondata(null,s,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}();function II(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";var r={};aI(e,"",r,t);var i=J(r),s=i.length,a=0,o=0,l=s,c=new Array(s),u=[],h=function(){for(var e=0;e<u.length;++e)u[e]()},p=function(){var e=new gE(o+22),t=a,r=o-a;o=0;for(var i=0;i<l;++i){var s=c[i];try{var u=s.c.length;bI(e,o,s,s.f,s.u,u);var h=30+s.f.length+yI(s.extra),p=o+h;e.set(s.c,p),bI(e,a,s,s.f,s.u,u,o,s.m),a+=16+h+(s.m?s.m.length:0),o=p+u}catch(e){return n(e,null)}}xI(e,a,c.length,r,t),n(null,e)};s||p();for(var d=function(e){var t=i[e],l=r[t],d=l[0],m=l[1],f=rS(),g=d.length;f.p(d);var _=dI(t),v=_.length,y=m.comment,b=y&&dI(y),x=b&&b.length,T=yI(m.extra),w=0==m.level?0:8,E=function(r,i){if(r)h(),n(r,null);else{var l=i.length;c[e]=aS(m,{size:g,crc:f.d(),c:i,f:_,m:b,u:v!=t.length||b&&y.length!=x,compression:w}),a+=30+v+T+l,o+=76+2*(v+T)+(x||0)+l,--s||p()}};if(v>65535&&E("filename too long",null),w)if(g<16e4)try{E(null,LS(d,m))}catch(e){E(e,null)}else u.push(NS(d,m,E));else E(null,d)},m=0;m<l;++m)d(m);return h}function MI(e,t){t||(t={});var n={},r=[];aI(e,"",n,t);var i=0,s=0;for(var a in n){var o=n[a],l=o[0],c=o[1],u=0==c.level?0:8,h=(w=dI(a)).length,p=c.comment,d=p&&dI(p),m=d&&d.length,f=yI(c.extra);if(h>65535)throw"filename too long";var g=u?LS(l,c):l,_=g.length,v=rS();v.p(l),r.push(aS(c,{size:l.length,crc:v.d(),c:g,f:w,m:d,u:h!=a.length||d&&p.length!=m,o:i,compression:u})),i+=30+h+f+_,s+=76+2*(h+f)+(m||0)+_}for(var y=new gE(s+22),b=i,x=s-i,T=0;T<r.length;++T){var w=r[T];bI(y,w.o,w,w.f,w.u,w.c.length);var E=30+w.f.length+yI(w.extra);y.set(w.c,w.o+E),bI(y,i,w,w.f,w.u,w.c.length,w.o,w.m),i+=16+E+(w.m?w.m.length:0)}return xI(y,i,r.length,x,b),y}var AI=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),RI=function(){function e(){var e=this;this.i=new kS((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(n){this.ondata(n,e,t)}},e.compression=8,e}(),DI=function(){function e(e,t){var n=this;t<32e4?this.i=new kS((function(e,t){n.ondata(null,e,t)})):(this.i=new FS((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=VE(e,0)),this.i.push(e,t)},e.compression=8,e}(),CI=function(){function e(e){this.onfile=e,this.k=[],this.o={0:AI},this.p=eS}return e.prototype.push=function(e,t){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(e=e.subarray(r)).length)return this.push(e,t)}else{var s=0,a=0,o=void 0,l=void 0;this.p.length?e.length?((l=new gE(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var c=l.length,u=this.c,h=u&&this.d,p=function(){var e,t=TS(l,a);if(67324752==t){s=1,o=a,d.d=null,d.c=0;var r=xS(l,a+6),i=xS(l,a+8),h=2048&r,p=8&r,m=xS(l,a+26),f=xS(l,a+28);if(c>a+30+m+f){var g=[];d.k.unshift(g),s=2;var _,v=TS(l,a+18),y=TS(l,a+22),b=mI(l.subarray(a+30,a+=30+m),!h);4294967295==v?(e=p?[-2]:vI(l,a),v=e[0],y=e[1]):p&&(v=-1),a+=f,d.c=v;var x={name:b,compression:i,start:function(){if(!x.ondata)throw"no callback";if(v){var e=n.o[i];if(!e)throw"unknown compression type "+i;(_=v<0?new e(b):new e(b,v,y)).ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var s=r[t];_.push(s,!1)}n.k[0]==g&&n.c?n.d=_:_.push(eS,!0)}else x.ondata(null,eS,!0)},terminate:function(){_&&_.terminate&&_.terminate()}};v>=0&&(x.size=v,x.originalSize=y),d.onfile(x)}return"break"}if(u){if(134695760==t)return o=a+=12+(-2==u&&8),s=3,d.c=0,"break";if(33639248==t)return o=a-=4,s=3,d.c=0,"break"}},d=this;a<c-4;++a){if("break"===p())break}if(this.p=eS,u<0){var m=s?l.subarray(0,o-12-(-2==u&&8)-(134695760==TS(l,o-16)&&4)):l.subarray(0,a);h?h.push(m,!!s):this.k[+(2==s)].push(m)}if(2&s)return this.push(l.subarray(a),t);this.p=l.subarray(a)}if(t){if(this.c)throw"invalid zip file";this.p=null}},e.prototype.register=function(e){this.o[e.compression]=e},e}();function OI(e,t){if("function"!=typeof t)throw"no callback";for(var n=[],r=function(){for(var e=0;e<n.length;++e)n[e]()},i={},s=e.length-22;101010256!=TS(e,s);--s)if(!s||e.length-s>65558)return void t("invalid zip file",null);var a=xS(e,s+8);a||t(null,{});var o=a,l=TS(e,s+16),c=4294967295==l;if(c){if(s=TS(e,s-12),101075792!=TS(e,s))return void t("invalid zip file",null);o=a=TS(e,s+32),l=TS(e,s+48)}for(var u=function(s){var o=_I(e,l,c),u=o[0],h=o[1],p=o[2],d=o[3],m=o[4],f=o[5],g=gI(e,f);l=m;var _=function(e,n){e?(r(),t(e,null)):(i[d]=n,--a||t(null,i))};if(u)if(8==u){var v=e.subarray(g,g+h);if(h<32e4)try{_(null,BS(v,new gE(p)))}catch(e){_(e,null)}else n.push(US(v,{size:p},_))}else _("unknown compression type "+u,null);else _(null,VE(e,g,g+h))},h=0;h<o;++h)u();return r}function PI(e){for(var t={},n=e.length-22;101010256!=TS(e,n);--n)if(!n||e.length-n>65558)throw"invalid zip file";var r=xS(e,n+8);if(!r)return{};var i=TS(e,n+16),s=4294967295==i;if(s){if(n=TS(e,n-12),101075792!=TS(e,n))throw"invalid zip file";r=TS(e,n+32),i=TS(e,n+48)}for(var a=0;a<r;++a){var o=_I(e,i,s),l=o[0],c=o[1],u=o[2],h=o[3],p=o[4],d=o[5],m=gI(e,d);if(i=p,l){if(8!=l)throw"unknown compression type "+l;t[h]=BS(e.subarray(m,m+c),new gE(u))}else t[h]=VE(e,m,m+c)}return t}function NI(e,t,n){const r=n.length-e-1;if(t>=n[r])return r-1;if(t<=n[e])return e;let i=e,s=r,a=Math.floor((i+s)/2);for(;t<n[a]||t>=n[a+1];)t<n[a]?s=a:i=a,a=Math.floor((i+s)/2);return a}function LI(e,t,n,r){const i=[],s=[],a=[];i[0]=1;for(let o=1;o<=n;++o){s[o]=t-r[e+1-o],a[o]=r[e+o]-t;let n=0;for(let e=0;e<o;++e){const t=a[e+1],r=s[o-e],l=i[e]/(t+r);i[e]=n+t*l,n=r*l}i[o]=n}return i}function kI(e,t,n,r,i){const s=i<e?i:e,a=[],o=NI(e,r,t),l=function(e,t,n,r,i){const s=[];for(let e=0;e<=n;++e)s[e]=0;const a=[];for(let e=0;e<=r;++e)a[e]=I(s).call(s,0);const o=[];for(let e=0;e<=n;++e)o[e]=I(s).call(s,0);o[0][0]=1;const l=I(s).call(s,0),c=I(s).call(s,0);for(let r=1;r<=n;++r){l[r]=t-i[e+1-r],c[r]=i[e+r]-t;let n=0;for(let e=0;e<r;++e){const t=c[e+1],i=l[r-e];o[r][e]=t+i;const s=o[e][r-1]/o[r][e];o[e][r]=n+t*s,n=i*s}o[r][r]=n}for(let e=0;e<=n;++e)a[0][e]=o[e][n];for(let e=0;e<=n;++e){let t=0,i=1;const l=[];for(let e=0;e<=n;++e)l[e]=I(s).call(s,0);l[0][0]=1;for(let s=1;s<=r;++s){let r=0;const c=e-s,u=n-s;e>=s&&(l[i][0]=l[t][0]/o[u+1][c],r=l[i][0]*o[c][u]);const h=e-1<=u?s-1:n-e;for(let e=c>=-1?1:-c;e<=h;++e)l[i][e]=(l[t][e]-l[t][e-1])/o[u+1][c+e],r+=l[i][e]*o[c+e][u];e<=u&&(l[i][s]=-l[t][s-1]/o[u+1][e],r+=l[i][s]*o[e][u]),a[s][e]=r;const p=t;t=i,i=p}}let u=n;for(let e=1;e<=r;++e){for(let t=0;t<=n;++t)a[e][t]*=u;u*=n-e}return a}(o,r,e,s,t),c=[];for(let e=0;e<n.length;++e){const t=n[e].clone(),r=t.w;t.x*=r,t.y*=r,t.z*=r,c[e]=t}for(let t=0;t<=s;++t){const n=c[o-e].clone().multiplyScalar(l[t][0]);for(let r=1;r<=e;++r)n.add(c[o-e+r].clone().multiplyScalar(l[t][r]));a[t]=n}for(let e=s+1;e<=i+1;++e)a[e]=new gn(0,0,0);return a}function FI(e,t){let n=1;for(let t=2;t<=e;++t)n*=t;let r=1;for(let e=2;e<=t;++e)r*=e;for(let n=2;n<=e-t;++n)r*=n;return n/r}function UI(e,t,n,r,i){return function(e){const t=e.length,n=[],r=[];for(let i=0;i<t;++i){const t=e[i];n[i]=new xn(t.x,t.y,t.z),r[i]=t.w}const i=[];for(let e=0;e<t;++e){const t=n[e].clone();for(let n=1;n<=e;++n)t.sub(i[e-n].clone().multiplyScalar(FI(e,n)*r[n]));i[e]=t.divideScalar(r[0])}return i}(kI(e,t,n,r,i))}class BI extends tl{constructor(e,t,n,r,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=r||0,this.endKnot=i||this.knots.length-1;for(let e=0;e<n.length;++e){const t=n[e];this.controlPoints[e]=new gn(t.x,t.y,t.z,t.w)}}getPoint(e,t=new xn){const n=t,r=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=function(e,t,n,r){const i=NI(e,r,t),s=LI(i,r,e,t),a=new gn(0,0,0,0);for(let t=0;t<=e;++t){const r=n[i-e+t],o=s[t],l=r.w*o;a.x+=r.x*l,a.y+=r.y*l,a.z+=r.z*l,a.w+=r.w*o}return a}(this.degree,this.knots,this.controlPoints,r);return 1!==i.w&&i.divideScalar(i.w),n.set(i.x,i.y,i.z)}getTangent(e,t=new xn){const n=t,r=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=UI(this.degree,this.knots,this.controlPoints,r,1);return n.copy(i[1]).normalize(),n}}let jI,GI,zI;class VI extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===i.path?su.extractUrlBase(e):i.path,a=new Uc(this.manager);a.setPath(i.path),a.setResponseType("arraybuffer"),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(n,s))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===aM(e,0,t.length)}(e))jI=(new XI).parse(e);else{const t=aM(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function r(t){const r=e[t-1];return e=I(e).call(e,n+t),n++,r}for(let e=0;e<t.length;++e){if(r(1)===t[e])return!1}return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(ZI(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+ZI(t));jI=(new YI).parse(t)}const n=new zc(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new HI(n,this.manager).parse(jI)}}class HI{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){GI=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),r=this.parseDeformers(),i=(new qI).parse(r);return this.parseScene(r,i,n),zI}parseConnections(){const e=new ce;if("Connections"in jI){const t=jI.Connections.connections;fe(t).call(t,(function(t){const n=t[0],r=t[1],i=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const s={ID:r,relationship:i};e.get(n).parents.push(s),e.has(r)||e.set(r,{parents:[],children:[]});const a={ID:n,relationship:i};e.get(r).children.push(a)}))}return e}parseImages(){const e={},t={};if("Video"in jI.Objects){const n=jI.Objects.Video;for(const r in n){const i=n[r];if(e[N(r)]=i.RelativeFilename||i.Filename,"Content"in i){const e=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,s="string"==typeof i.Content&&""!==i.Content;if(e||s){const e=this.parseImage(n[r]);t[i.RelativeFilename||i.Filename]=e}}}}for(const n in e){const r=e[n];void 0!==t[r]?e[n]=t[r]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,r=I(n).call(n,De(n).call(n,".")+1).toLowerCase();let i;switch(r){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),i="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof t)return"data:"+i+";base64,"+t;{const e=new Uint8Array(t);return g_.createObjectURL(new Blob([e],{type:i}))}}parseTextures(e){const t=new ce;if("Texture"in jI.Objects){const n=jI.Objects.Texture;for(const r in n){const i=this.parseTexture(n[r],e);t.set(N(r),i)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const r=e.WrapModeU,i=e.WrapModeV,s=void 0!==r?r.value:0,a=void 0!==i?i.value:0;if(n.wrapS=0===s?Ke:Ze,n.wrapT=0===a?Ke:Ze,"Scaling"in e){const t=e.Scaling.value;j(n).x=t[0],j(n).y=t[1]}if("Translation"in e){const t=e.Translation.value;n.offset.x=t[0],n.offset.y=t[1]}return n}loadTexture(e,t){var n;let r;const i=this.textureLoader.path,s=GI.get(e.id).children;let a;void 0!==s&&s.length>0&&void 0!==t[s[0].ID]&&(r=t[s[0].ID],0!==T(r).call(r,"blob:")&&0!==T(r).call(r,"data:")||this.textureLoader.setPath(void 0));const o=I(n=e.FileName).call(n,-3).toLowerCase();if("tga"===o){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),a=new fn):(t.setPath(this.textureLoader.path),a=t.load(r))}else"psd"===o?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),a=new fn):a=this.textureLoader.load(r);return this.textureLoader.setPath(i),a}parseMaterials(e){const t=new ce;if("Material"in jI.Objects){const n=jI.Objects.Material;for(const r in n){const i=this.parseMaterial(n[r],e);null!==i&&t.set(N(r),i)}}return t}parseMaterial(e,t){const n=e.id,r=e.attrName;let i=e.ShadingModel;if("object"==typeof i&&(i=i.value),!GI.has(n))return null;const s=this.parseParameters(e,t,n);let a;switch(i.toLowerCase()){case"phong":a=new lc;break;case"lambert":a=new uc;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),a=new lc}return a.setValues(s),a.name=r,a}parseParameters(e,t,n){var r;const i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=(new cn).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(i.color=(new cn).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=(new cn).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(i.emissive=(new cn).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(i.emissiveIntensity=O(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=O(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=(new cn).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(i.specular=(new cn).fromArray(e.SpecularColor.value));const s=this;return fe(r=GI.get(n).children).call(r,(function(e){const n=e.relationship;switch(n){case"Bump":i.bumpMap=s.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":i.aoMap=s.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=s.getTexture(t,e.ID),void 0!==K(i)&&(K(i).encoding=St);break;case"DisplacementColor":i.displacementMap=s.getTexture(t,e.ID);break;case"EmissiveColor":i.emissiveMap=s.getTexture(t,e.ID),void 0!==i.emissiveMap&&(i.emissiveMap.encoding=St);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=s.getTexture(t,e.ID);break;case"ReflectionColor":i.envMap=s.getTexture(t,e.ID),void 0!==i.envMap&&(i.envMap.mapping=Ye,i.envMap.encoding=St);break;case"SpecularColor":i.specularMap=s.getTexture(t,e.ID),void 0!==i.specularMap&&(i.specularMap.encoding=St);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=s.getTexture(t,e.ID),i.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n)}})),i}getTexture(e,t){return"LayeredTexture"in jI.Objects&&t in jI.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=GI.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in jI.Objects){const n=jI.Objects.Deformer;for(const r in n){const i=n[r],s=GI.get(N(r));if("Skin"===i.attrType){const t=this.parseSkeleton(s,n);t.ID=r,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=s.parents[0].ID,e[r]=t}else if("BlendShape"===i.attrType){const e={id:r};e.rawTargets=this.parseMorphTargets(s,n),e.id=r,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){var n;const r=[];return fe(n=e.children).call(n,(function(e){const n=t[e.ID];if("Cluster"!==n.attrType)return;const i={ID:e.ID,indices:[],weights:[],transformLink:(new Zn).fromArray(n.TransformLink.a)};"Indexes"in n&&(i.indices=n.Indexes.a,i.weights=n.Weights.a),r.push(i)})),{rawBones:r,bones:[]}}parseMorphTargets(e,t){const n=[];for(let i=0;i<e.children.length;i++){var r;const s=e.children[i],a=t[s.ID],o={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if("BlendShapeChannel"!==a.attrType)return;o.geoID=oe(r=GI.get(N(s.ID)).children).call(r,(function(e){return void 0===e.relationship}))[0].ID,n.push(o)}return n}parseScene(e,t,n){zI=new io;const r=this.parseModels(e.skeletons,t,n),i=jI.Objects.Model,s=this;fe(r).call(r,(function(e){const t=i[e.ID];s.setLookAtProperties(e,t);const n=GI.get(e.ID).parents;fe(n).call(n,(function(t){const n=r.get(t.ID);void 0!==n&&n.add(e)})),null===e.parent&&zI.add(e)})),this.bindSkeleton(e.skeletons,t,r),this.createAmbientLight(),zI.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=rM(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const a=(new WI).parse();1===zI.children.length&&zI.children[0].isGroup&&(zI.children[0].animations=a,zI=zI.children[0]),zI.animations=a}parseModels(e,t,n){const r=new ce,i=jI.Objects.Model;for(const s in i){const a=N(s),o=i[s],l=GI.get(a);let c=this.buildSkeleton(l,e,a,o.attrName);if(!c){switch(o.attrType){case"Camera":c=this.createCamera(l);break;case"Light":c=this.createLight(l);break;case"Mesh":c=this.createMesh(l,t,n);break;case"NurbsCurve":c=this.createCurve(l,t);break;case"LimbNode":case"Root":c=new So;break;default:c=new io}c.name=o.attrName?fu.sanitizeNodeName(o.attrName):"",c.ID=a}this.getTransformData(c,o),r.set(a,c)}return r}buildSkeleton(e,t,n,r){var i;let s=null;return fe(i=e.parents).call(i,(function(e){for(const a in t){var i;const o=t[a];fe(i=o.rawBones).call(i,(function(t,i){if(t.ID===e.ID){const e=s;s=new So,s.matrixWorld.copy(t.transformLink),s.name=r?fu.sanitizeNodeName(r):"",s.ID=n,o.bones[i]=s,null!==e&&s.add(e)}}))}})),s}createCamera(e){var t;let n,r;if(fe(t=e.children).call(t,(function(e){const t=jI.Objects.NodeAttribute[e.ID];void 0!==t&&(r=t)})),void 0===r)n=new Tr;else{let e=0;void 0!==r.CameraProjectionType&&1===r.CameraProjectionType.value&&(e=1);let t=1;void 0!==r.NearPlane&&(t=r.NearPlane.value/1e3);let i=1e3;void 0!==r.FarPlane&&(i=r.FarPlane.value/1e3);let s=window.innerWidth,a=window.innerHeight;void 0!==r.AspectWidth&&void 0!==r.AspectHeight&&(s=r.AspectWidth.value,a=r.AspectHeight.value);const o=s/a;let l=45;void 0!==r.FieldOfView&&(l=r.FieldOfView.value);const c=r.FocalLength?r.FocalLength.value:null;switch(e){case 0:n=new Ti(l,o,t,i),null!==c&&n.setFocalLength(c);break;case 1:n=new Wi(-s/2,s/2,a/2,-a/2,t,i);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),n=new Tr}}return n}createLight(e){var t;let n,r;if(fe(t=e.children).call(t,(function(e){const t=jI.Objects.NodeAttribute[e.ID];void 0!==t&&(r=t)})),void 0===r)n=new Tr;else{let e;e=void 0===r.LightType?0:r.LightType.value;let t=16777215;void 0!==r.Color&&(t=(new cn).fromArray(r.Color.value));let i=void 0===r.Intensity?1:r.Intensity.value/100;void 0!==r.CastLightOnObject&&0===r.CastLightOnObject.value&&(i=0);let s=0;void 0!==r.FarAttenuationEnd&&(s=void 0!==r.EnableFarAttenuation&&0===r.EnableFarAttenuation.value?0:r.FarAttenuationEnd.value);const a=1;switch(e){case 0:n=new tu(t,i,s,a);break;case 1:n=new ru(t,i);break;case 2:let e=Math.PI/3;void 0!==r.InnerAngle&&(e=Yt.degToRad(r.InnerAngle.value));let o=0;void 0!==r.OuterAngle&&(o=Yt.degToRad(r.OuterAngle.value),o=Math.max(o,1)),n=new Kc(t,i,s,e,o,a);break;default:console.warn("THREE.FBXLoader: Unknown light type "+r.LightType.value+", defaulting to a PointLight."),n=new tu(t,i)}void 0!==r.CastShadows&&1===r.CastShadows.value&&(n.castShadow=!0)}return n}createMesh(e,t,n){var r;let i,s=null,a=null;const o=[];return fe(r=e.children).call(r,(function(e){t.has(e.ID)&&(s=t.get(e.ID)),n.has(e.ID)&&o.push(n.get(e.ID))})),o.length>1?a=o:o.length>0?a=o[0]:(a=new lc({color:13421772}),o.push(a)),"color"in s.attributes&&fe(o).call(o,(function(e){e.vertexColors=!0})),s.FBX_Deformer?(i=new Eo(s,a),i.normalizeSkinWeights()):i=new mi(s,a),i}createCurve(e,t){var n;const r=yp(n=e.children).call(n,(function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),i=new Fo({color:3342591,linewidth:1});return new Vo(r,i)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=N(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?iM(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){if("LookAtProperty"in t){const t=GI.get(e.ID).children;fe(t).call(t,(function(t){if("LookAtProperty"===t.relationship){const n=jI.Objects.Model[t.ID];if("Lcl_Translation"in n){const t=n.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),zI.add(e.target)):e.lookAt((new xn).fromArray(t))}}}))}}bindSkeleton(e,t,n){const r=this.parsePoseNodes();for(const i in e){const s=e[i],a=GI.get(N(s.ID)).parents;fe(a).call(a,(function(e){if(t.has(e.ID)){var i;const t=e.ID,a=GI.get(t);fe(i=a.parents).call(i,(function(e){if(n.has(e.ID)){const t=n.get(e.ID);_e(t).call(t,new Ro(s.bones),r[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in jI.Objects){const t=jI.Objects.Pose;for(const n in t)if("BindPose"===t[n].attrType&&t[n].NbPoseNodes>0){const r=t[n].PoseNode;b(r)?fe(r).call(r,(function(t){e[t.Node]=(new Zn).fromArray(t.Matrix.a)})):e[r.Node]=(new Zn).fromArray(r.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in jI&&"AmbientColor"in jI.GlobalSettings){const e=jI.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],r=e[2];if(0!==t||0!==n||0!==r){const e=new cn(t,n,r);zI.add(new iu(e,1))}}}}class qI{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new ce;if("Geometry"in jI.Objects){const n=jI.Objects.Geometry;for(const r in n){const i=GI.get(N(r)),s=this.parseGeometry(i,n[r],e);t.set(N(r),s)}}return!0===this.negativeMaterialIndices&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){var r,i,s;const a=n.skeletons,o=[],l=K(r=e.parents).call(r,(function(e){return jI.Objects.Model[e.ID]}));if(0===l.length)return;const c=yp(i=e.children).call(i,(function(e,t){return void 0!==a[t.ID]&&(e=a[t.ID]),e}),null);fe(s=e.children).call(s,(function(e){void 0!==n.morphTargets[e.ID]&&o.push(n.morphTargets[e.ID])}));const u=l[0],h={};"RotationOrder"in u&&(h.eulerOrder=iM(u.RotationOrder.value)),"InheritType"in u&&(h.inheritType=N(u.InheritType.value)),"GeometricTranslation"in u&&(h.translation=u.GeometricTranslation.value),"GeometricRotation"in u&&(h.rotation=u.GeometricRotation.value),"GeometricScaling"in u&&(h.scale=u.GeometricScaling.value);const p=rM(h);return this.genGeometry(t,c,o,p)}genGeometry(e,t,n,r){var i;const s=new Kr;e.attrName&&(s.name=e.attrName);const a=this.parseGeoNode(e,t),o=this.genBuffers(a),l=new zr(o.vertex,3);if(l.applyMatrix4(r),s.setAttribute("position",l),o.colors.length>0&&s.setAttribute("color",new zr(o.colors,3)),t&&(s.setAttribute("skinIndex",new jr(o.weightsIndices,4)),s.setAttribute("skinWeight",new zr(o.vertexWeights,4)),s.FBX_Deformer=t),o.normal.length>0){const e=(new $t).getNormalMatrix(r),t=new zr(o.normal,3);t.applyNormalMatrix(e),s.setAttribute("normal",t)}if(fe(i=o.uvs).call(i,(function(e,t){let n="uv"+(t+1).toString();0===t&&(n="uv"),s.setAttribute(n,new zr(o.uvs[t],2))})),a.material&&"AllSame"!==a.material.mappingType){var c;let e=o.materialIndex[0],t=0;if(fe(c=o.materialIndex).call(c,(function(n,r){n!==e&&(s.addGroup(t,r-t,e),e=n,t=r)})),s.groups.length>0){const t=s.groups[s.groups.length-1],n=t.start+t.count;n!==o.materialIndex.length&&s.addGroup(n,o.materialIndex.length-n,e)}0===s.groups.length&&s.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(s,e,n,r),s}parseGeoNode(e,t){const n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}var r;(n.weightTable={},null!==t)&&(n.skeleton=t,fe(r=t.rawBones).call(r,(function(e,t){var r;fe(r=e.indices).call(r,(function(r,i){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:t,weight:e.weights[i]})}))})));return n}genBuffers(e){var t;const n={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let r=0,i=0,s=!1,a=[],o=[],l=[],c=[],u=[],h=[];const p=this;return fe(t=e.vertexIndices).call(t,(function(t,d){let m,f=!1;t<0&&(t^=-1,f=!0);let g=[],_=[];if(a.push(3*t,3*t+1,3*t+2),e.color){const n=eM(d,r,t,e.color);l.push(n[0],n[1],n[2])}if(e.skeleton){var v;if(void 0!==e.weightTable[t])fe(v=e.weightTable[t]).call(v,(function(e){_.push(e.weight),g.push(e.id)}));if(_.length>4){s||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),s=!0);const e=[0,0,0,0],t=[0,0,0,0];fe(_).call(_,(function(n,r){let i=n,s=g[r];fe(t).call(t,(function(t,n,r){if(i>t){r[n]=i,i=t;const a=e[n];e[n]=s,s=a}}))})),g=e,_=t}for(;_.length<4;)_.push(0),g.push(0);for(let e=0;e<4;++e)u.push(_[e]),h.push(g[e])}if(e.normal){const n=eM(d,r,t,e.normal);o.push(n[0],n[1],n[2])}var y;(e.material&&"AllSame"!==e.material.mappingType&&(m=eM(d,r,t,e.material)[0],m<0&&(p.negativeMaterialIndices=!0,m=0)),e.uv)&&fe(y=e.uv).call(y,(function(e,n){const i=eM(d,r,t,e);void 0===c[n]&&(c[n]=[]),c[n].push(i[0]),c[n].push(i[1])}));i++,f&&(p.genFace(n,e,a,m,o,l,c,u,h,i),r++,i=0,a=[],o=[],l=[],c=[],u=[],h=[])})),n}genFace(e,t,n,r,i,s,a,o,l,c){for(let h=2;h<c;h++){var u;if(e.vertex.push(t.vertexPositions[n[0]]),e.vertex.push(t.vertexPositions[n[1]]),e.vertex.push(t.vertexPositions[n[2]]),e.vertex.push(t.vertexPositions[n[3*(h-1)]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+1]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+2]]),e.vertex.push(t.vertexPositions[n[3*h]]),e.vertex.push(t.vertexPositions[n[3*h+1]]),e.vertex.push(t.vertexPositions[n[3*h+2]]),t.skeleton&&(e.vertexWeights.push(o[0]),e.vertexWeights.push(o[1]),e.vertexWeights.push(o[2]),e.vertexWeights.push(o[3]),e.vertexWeights.push(o[4*(h-1)]),e.vertexWeights.push(o[4*(h-1)+1]),e.vertexWeights.push(o[4*(h-1)+2]),e.vertexWeights.push(o[4*(h-1)+3]),e.vertexWeights.push(o[4*h]),e.vertexWeights.push(o[4*h+1]),e.vertexWeights.push(o[4*h+2]),e.vertexWeights.push(o[4*h+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(h-1)]),e.weightsIndices.push(l[4*(h-1)+1]),e.weightsIndices.push(l[4*(h-1)+2]),e.weightsIndices.push(l[4*(h-1)+3]),e.weightsIndices.push(l[4*h]),e.weightsIndices.push(l[4*h+1]),e.weightsIndices.push(l[4*h+2]),e.weightsIndices.push(l[4*h+3])),t.color&&(e.colors.push(s[0]),e.colors.push(s[1]),e.colors.push(s[2]),e.colors.push(s[3*(h-1)]),e.colors.push(s[3*(h-1)+1]),e.colors.push(s[3*(h-1)+2]),e.colors.push(s[3*h]),e.colors.push(s[3*h+1]),e.colors.push(s[3*h+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(i[0]),e.normal.push(i[1]),e.normal.push(i[2]),e.normal.push(i[3*(h-1)]),e.normal.push(i[3*(h-1)+1]),e.normal.push(i[3*(h-1)+2]),e.normal.push(i[3*h]),e.normal.push(i[3*h+1]),e.normal.push(i[3*h+2])),t.uv)fe(u=t.uv).call(u,(function(t,n){void 0===e.uvs[n]&&(e.uvs[n]=[]),e.uvs[n].push(a[n][0]),e.uvs[n].push(a[n][1]),e.uvs[n].push(a[n][2*(h-1)]),e.uvs[n].push(a[n][2*(h-1)+1]),e.uvs[n].push(a[n][2*h]),e.uvs[n].push(a[n][2*h+1])}))}}addMorphTargets(e,t,n,r){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;fe(n).call(n,(function(n){var s;fe(s=n.rawTargets).call(s,(function(n){const s=jI.Objects.Geometry[n.geoID];void 0!==s&&i.genMorphGeometry(e,t,s,r,n.name)}))}))}genMorphGeometry(e,t,n,r,i){const s=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],a=void 0!==n.Vertices?n.Vertices.a:[],o=void 0!==n.Indexes?n.Indexes.a:[],l=3*e.attributes.position.count,c=new Float32Array(l);for(let e=0;e<o.length;e++){const t=3*o[e];c[t]=a[3*e],c[t+1]=a[3*e+1],c[t+2]=a[3*e+2]}const u={vertexIndices:s,vertexPositions:c},h=this.genBuffers(u),p=new zr(h.vertex,3);p.name=i||n.attrName,p.applyMatrix4(r),e.morphAttributes.position.push(p)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Normals.a;let i=[];return"IndexToDirect"===n&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:i,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.UV.a;let i=[];return"IndexToDirect"===n&&(i=e.UVIndex.a),{dataSize:2,buffer:r,indices:i,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Colors.a;let i=[];return"IndexToDirect"===n&&(i=e.ColorIndex.a),{dataSize:4,buffer:r,indices:i,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const r=e.Materials.a,i=[];for(let e=0;e<r.length;++e)i.push(e);return{dataSize:1,buffer:r,indices:i,mappingType:t,referenceType:n}}parseNurbsGeometry(e){if(void 0===BI)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new Kr;const t=N(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new Kr;const n=t-1,r=e.KnotVector.a,i=[],s=e.Points.a;for(let e=0,t=s.length;e<t;e+=4)i.push((new gn).fromArray(s,e));let a,o;if("Closed"===e.Form)i.push(i[0]);else if("Periodic"===e.Form){a=n,o=r.length-1-a;for(let e=0;e<n;++e)i.push(i[e])}const l=new BI(n,r,i,a,o).getPoints(12*i.length);return(new Kr).setFromPoints(l)}}class WI{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const n in t){const r=t[n],i=this.addClip(r);e.push(i)}return e}parseClips(){if(void 0===jI.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=jI.Objects.AnimationCurveNode,t=new ce;for(const n in e){const r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){const e={id:r.id,attr:r.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=jI.Objects.AnimationCurve;for(const r in t){var n;const i={id:t[r].id,times:K(n=t[r].KeyTime.a).call(n,JI),values:t[r].KeyValueFloat.a},s=GI.get(i.id);if(void 0!==s){const t=s.parents[0].ID,n=s.parents[0].relationship;n.match(/X/)?e.get(t).curves.x=i:n.match(/Y/)?e.get(t).curves.y=i:n.match(/Z/)?e.get(t).curves.z=i:n.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=i)}}}parseAnimationLayers(e){const t=jI.Objects.AnimationLayer,n=new ce;for(const r in t){const t=[],i=GI.get(N(r));if(void 0!==i){const s=i.children;fe(s).call(s,(function(n,r){if(e.has(n.ID)){const a=e.get(n.ID);if(void 0!==a.curves.x||void 0!==a.curves.y||void 0!==a.curves.z){if(void 0===t[r]){var i;const e=oe(i=GI.get(n.ID).parents).call(i,(function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const i=jI.Objects.Model[e.toString()];if(void 0===i)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const s={modelName:i.attrName?fu.sanitizeNodeName(i.attrName):"",ID:i.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};zI.traverse((function(e){e.ID===i.id&&(s.transform=e.matrix,e.userData.transformData&&(s.eulerOrder=e.userData.transformData.eulerOrder))})),s.transform||(s.transform=new Zn),"PreRotation"in i&&(s.preRotation=i.PreRotation.value),"PostRotation"in i&&(s.postRotation=i.PostRotation.value),t[r]=s}}t[r]&&(t[r][a.attr]=a)}else if(void 0!==a.curves.morph){if(void 0===t[r]){var s;const e=oe(s=GI.get(n.ID).parents).call(s,(function(e){return void 0!==e.relationship}))[0].ID,i=GI.get(e).parents[0].ID,a=GI.get(i).parents[0].ID,o=GI.get(a).parents[0].ID,l=jI.Objects.Model[o],c={modelName:l.attrName?fu.sanitizeNodeName(l.attrName):"",morphName:jI.Objects.Deformer[e].attrName};t[r]=c}t[r][a.attr]=a}}})),n.set(N(r),t)}}return n}parseAnimStacks(e){const t=jI.Objects.AnimationStack,n={};for(const r in t){const i=GI.get(N(r)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=e.get(i[0].ID);n[r]={name:t[r].attrName,layer:s}}return n}addClip(e){var t;let n=[];const r=this;return fe(t=e.layer).call(t,(function(e){n=ye(n).call(n,r.generateTracks(e))})),new Dc(e.name,-1,n)}generateTracks(e){const t=[];let n=new xn,r=new bn,i=new xn;if(e.transform&&e.transform.decompose(n,r,i),n=n.toArray(),r=(new or).setFromQuaternion(r,e.eulerOrder).toArray(),i=i.toArray(),void 0!==e.T&&J(e.T.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&J(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,r,e.preRotation,e.postRotation,e.eulerOrder);void 0!==n&&t.push(n)}if(void 0!==e.S&&J(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,i,"scale");void 0!==n&&t.push(n)}if(void 0!==e.DeformPercent){const n=this.generateMorphTrack(e);void 0!==n&&t.push(n)}return t}generateVectorTrack(e,t,n,r){const i=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(i,t,n);return new Rc(e+"."+r,i,s)}generateRotationTrack(e,t,n,r,i,s){var a,o,l;void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=K(a=de(t.x)).call(a,Yt.degToRad));void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=K(o=de(t.y)).call(o,Yt.degToRad));void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=K(l=de(t.z)).call(l,Yt.degToRad));const c=this.getTimesForAllAxes(t),u=this.getKeyframeTrackValues(c,t,n);void 0!==r&&((r=K(r).call(r,Yt.degToRad)).push(s),r=(new or).fromArray(r),r=(new bn).setFromEuler(r)),void 0!==i&&((i=K(i).call(i,Yt.degToRad)).push(s),i=(new or).fromArray(i),i=(new bn).setFromEuler(i).invert());const h=new bn,p=new or,d=[];for(let e=0;e<u.length;e+=3)p.set(u[e],u[e+1],u[e+2],s),h.setFromEuler(p),void 0!==r&&h.premultiply(r),void 0!==i&&h.multiply(i),h.toArray(d,e/3*4);return new Mc(e+".quaternion",c,d)}generateMorphTrack(e){var t;const n=e.DeformPercent.curves.morph,r=K(t=de(n)).call(t,(function(e){return e/100})),i=zI.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Sc(e.modelName+".morphTargetInfluences["+i+"]",n.times,r)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=ye(t).call(t,e.x.times)),void 0!==e.y&&(t=ye(t).call(t,e.y.times)),void 0!==e.z&&(t=ye(t).call(t,e.z.times)),t=ne(t).call(t,(function(e,t){return e-t})),t.length>1){let e=1,n=t[0];for(let r=1;r<t.length;r++){const i=t[r];i!==n&&(t[e]=i,n=i,e++)}t=I(t).call(t,0,e)}return t}getKeyframeTrackValues(e,t,n){const r=n,i=[];let s=-1,a=-1,o=-1;return fe(e).call(e,(function(e){var n,l,c;if(t.x&&(s=T(n=t.x.times).call(n,e)),t.y&&(a=T(l=t.y.times).call(l,e)),t.z&&(o=T(c=t.z.times).call(c,e)),-1!==s){const e=de(t.x)[s];i.push(e),r[0]=e}else i.push(r[0]);if(-1!==a){const e=de(t.y)[a];i.push(e),r[1]=e}else i.push(r[1]);if(-1!==o){const e=de(t.z)[o];i.push(e),r[2]=e}else i.push(r[2])})),i}interpolateRotations(e){for(let t=1;t<de(e).length;t++){const n=de(e)[t-1],r=de(e)[t]-n,i=Math.abs(r);if(i>=180){const s=i/180,a=r/s;let o=n+a;const l=e.times[t-1],c=(e.times[t]-l)/s;let u=l+c;const h=[],p=[];for(;u<e.times[t];)h.push(u),u+=c,p.push(o),o+=a;e.times=oM(e.times,t,h),e.values=oM(de(e),t,p)}}}}class YI{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new KI,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return fe(n).call(n,(function(e,r){const i=e.match(/^[\s\t]*;/),s=e.match(/^[\s\t]*$/);if(i||s)return;const a=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");a?t.parseNodeBegin(e,a):o?t.parseNodeProperty(e,o,n[++r]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){var n,r;const i=se(n=t[1]).call(n).replace(/^"/,"").replace(/"$/,""),s=K(r=t[2].split(",")).call(r,(function(e){return se(e).call(e).replace(/^"/,"").replace(/"$/,"")})),a={name:i},o=this.parseNodeAttr(s),l=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,a):i in l?("PoseNode"===i?l.PoseNode.push(a):void 0!==l[i].id&&(l[i]={},l[i][l[i].id]=l[i]),""!==o.id&&(l[i][o.id]=a)):"number"==typeof o.id?(l[i]={},l[i][o.id]=a):"Properties70"!==i&&(l[i]="PoseNode"===i?[a]:a),"number"==typeof o.id&&(a.id=o.id),""!==o.name&&(a.attrName=o.name),""!==o.type&&(a.attrType=o.type),this.pushStack(a)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=N(e[0]),isNaN(t)&&(t=e[0]));let n="",r="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}}parseNodeProperty(e,t,n){var r,i;let s=se(r=t[1].replace(/^"/,"").replace(/"$/,"")).call(r),a=se(i=t[2].replace(/^"/,"").replace(/"$/,"")).call(i);var o;"Content"===s&&","===a&&(a=se(o=n.replace(/"/g,"").replace(/,$/,"")).call(o));const l=this.getCurrentNode();if("Properties70"!==l.name){if("C"===s){var c,u;const e=I(c=a.split(",")).call(c,1),t=N(e[0]),n=N(e[1]);let r=I(u=a.split(",")).call(u,3);r=K(r).call(r,(function(e){return se(e).call(e).replace(/^"/,"")})),s="connections",a=[t,n],function(e,t){for(let n=0,r=e.length,i=t.length;n<i;n++,r++)e[r]=t[n]}(a,r),void 0===l[s]&&(l[s]=[])}"Node"===s&&(l.id=a),s in l&&b(l[s])?l[s].push(a):"a"!==s?l[s]=a:l.a=a,this.setCurrentProp(l,s),"a"===s&&","!==I(a).call(a,-1)&&(l.a=sM(a))}else this.parseNodeSpecialProperty(e,s,a)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==I(e).call(e,-1)&&(t.a=sM(t.a))}parseNodeSpecialProperty(e,t,n){var r;const i=K(r=n.split('",')).call(r,(function(e){return se(e).call(e).replace(/^\"/,"").replace(/\s/,"_")})),s=i[0],a=i[1],o=i[2],l=i[3];let c=i[4];switch(a){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=O(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=sM(c)}this.getPrevNode()[s]={type:a,type2:o,flag:l,value:c},this.setCurrentProp(this.getPrevNode(),s)}}class XI{parse(e){const t=new $I(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const r=new KI;for(;!this.endOfContent(t);){const e=this.parseNode(t,n);null!==e&&r.add(e.name,e)}return r}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},r=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const s=e.getUint8(),a=e.getString(s);if(0===r)return null;const o=[];for(let t=0;t<i;t++)o.push(this.parseProperty(e));const l=o.length>0?o[0]:"",c=o.length>1?o[1]:"",u=o.length>2?o[2]:"";for(n.singleProperty=1===i&&e.getOffset()===r;r>e.getOffset();){const r=this.parseNode(e,t);null!==r&&this.parseSubNode(a,n,r)}return n.propertyList=o,"number"==typeof l&&(n.id=l),""!==c&&(n.attrName=c),""!==u&&(n.attrType=u),""!==a&&(n.name=a),n}parseSubNode(e,t,n){if(!0===n.singleProperty){const e=n.propertyList[0];b(e)?(t[n.name]=n,n.a=e):t[n.name]=e}else if("Connections"===e&&"C"===n.name){var r;const e=[];fe(r=n.propertyList).call(r,(function(t,n){0!==n&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===n.name){const e=J(n);fe(e).call(e,(function(e){t[e]=n[e]}))}else if("Properties70"===e&&"P"===n.name){let e=n.propertyList[0],r=n.propertyList[1];const i=n.propertyList[2],s=n.propertyList[3];let a;0===T(e).call(e,"Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===T(r).call(r,"Lcl ")&&(r=r.replace("Lcl ","Lcl_")),a="Color"===r||"ColorRGB"===r||"Vector"===r||"Vector3D"===r||0===T(r).call(r,"Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[e]={type:r,type2:i,flag:s,value:a}}else void 0===t[n.name]?"number"==typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(b(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)}parseProperty(t){const n=t.getString(1);let r;switch(n){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return r=t.getUint32(),t.getArrayBuffer(r);case"S":return r=t.getUint32(),t.getString(r);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const i=t.getUint32(),s=t.getUint32(),a=t.getUint32();if(0===s)switch(n){case"b":case"c":return t.getBooleanArray(i);case"d":return t.getFloat64Array(i);case"f":return t.getFloat32Array(i);case"i":return t.getInt32Array(i);case"l":return t.getInt64Array(i)}void 0===e&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const o=tI(new Uint8Array(t.getArrayBuffer(a))),l=new $I(o.buffer);switch(n){case"b":case"c":return l.getBooleanArray(i);case"d":return l.getFloat64Array(i);case"f":return l.getFloat32Array(i);case"i":return l.getInt32Array(i);case"l":return l.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+n)}}}class $I{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){var t;const n=I(t=this.dv.buffer).call(t,this.offset,this.offset+e);return this.offset+=e,n}getString(e){let t=[];for(let n=0;n<e;n++)t[n]=this.getUint8();const n=T(t).call(t,0);return n>=0&&(t=I(t).call(t,0,n)),su.decodeText(new Uint8Array(t))}}class KI{add(e,t){this[e]=t}}function ZI(e){const t=e.match(/FBXVersion: (\d+)/);if(t){return N(t[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function JI(e){return e/46186158e3}const QI=[];function eM(e,t,n,r){let i;switch(r.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;case"ByVertice":i=n;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(i=r.indices[i]);const s=i*r.dataSize,a=s+r.dataSize;return function(e,t,n,r){for(let i=n,s=0;i<r;i++,s++)e[s]=t[i];return e}(QI,r.buffer,s,a)}const tM=new or,nM=new xn;function rM(e){const t=new Zn,n=new Zn,r=new Zn,i=new Zn,s=new Zn,a=new Zn,o=new Zn,l=new Zn,c=new Zn,u=new Zn,h=new Zn,p=new Zn,d=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(nM.fromArray(e.translation)),e.preRotation){var m;const t=K(m=e.preRotation).call(m,Yt.degToRad);t.push(e.eulerOrder||or.DefaultOrder),n.makeRotationFromEuler(tM.fromArray(t))}if(e.rotation){var f;const t=K(f=e.rotation).call(f,Yt.degToRad);t.push(e.eulerOrder||or.DefaultOrder),r.makeRotationFromEuler(tM.fromArray(t))}if(e.postRotation){var g;const t=K(g=e.postRotation).call(g,Yt.degToRad);t.push(e.eulerOrder||or.DefaultOrder),i.makeRotationFromEuler(tM.fromArray(t)),i.invert()}e.scale&&s.scale(nM.fromArray(e.scale)),e.scalingOffset&&o.setPosition(nM.fromArray(e.scalingOffset)),e.scalingPivot&&a.setPosition(nM.fromArray(e.scalingPivot)),e.rotationOffset&&l.setPosition(nM.fromArray(e.rotationOffset)),e.rotationPivot&&c.setPosition(nM.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(h.copy(e.parentMatrix),u.copy(e.parentMatrixWorld));const _=n.clone().multiply(r).multiply(i),v=new Zn;v.extractRotation(u);const y=new Zn;y.copyPosition(u);const b=y.clone().invert().multiply(u),x=v.clone().invert().multiply(b),T=s,w=new Zn;if(0===d)w.copy(v).multiply(_).multiply(x).multiply(T);else if(1===d)w.copy(v).multiply(x).multiply(_).multiply(T);else{const e=(new Zn).scale((new xn).setFromMatrixScale(h)).clone().invert(),t=x.clone().multiply(e);w.copy(v).multiply(_).multiply(t).multiply(T)}const E=c.clone().invert(),S=a.clone().invert();let I=t.clone().multiply(l).multiply(c).multiply(n).multiply(r).multiply(i).multiply(E).multiply(o).multiply(a).multiply(s).multiply(S);const M=(new Zn).copyPosition(I),A=u.clone().multiply(M);return p.copyPosition(A),I=p.clone().multiply(w),I.premultiply(u.invert()),I}function iM(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function sM(e){var t;return K(t=e.split(",")).call(t,(function(e){return O(e)}))}function aM(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),su.decodeText(new Uint8Array(e,t,n))}function oM(e,t,n){var r,i;return ye(r=ye(i=I(e).call(e,0,t)).call(i,n)).call(r,I(e).call(e,t))}class lM extends Lc{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new mM(e)})),this.register((function(e){return new xM(e)})),this.register((function(e){return new TM(e)})),this.register((function(e){return new gM(e)})),this.register((function(e){return new _M(e)})),this.register((function(e){return new vM(e)})),this.register((function(e){return new yM(e)})),this.register((function(e){return new dM(e)})),this.register((function(e){return new bM(e)})),this.register((function(e){return new fM(e)})),this.register((function(e){return new hM(e)})),this.register((function(e){return new wM(e)})),this.register((function(e){return new EM(e)}))}load(e,t,n,r){const i=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:su.extractUrlBase(e),this.manager.itemStart(e);const a=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},o=new Uc(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{i.parse(n,s,(function(n){t(n),i.manager.itemEnd(e)}),a)}catch(e){a(e)}}),n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){var t;return-1===T(t=this.pluginCallbacks).call(t,e)&&this.pluginCallbacks.push(e),this}unregister(e){var t,n,r;-1!==T(t=this.pluginCallbacks).call(t,e)&&E(n=this.pluginCallbacks).call(n,T(r=this.pluginCallbacks).call(r,e),1);return this}parse(e,t,n,r){let i;const s={},a={};if("string"==typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if(su.decodeText(new Uint8Array(e,0,4))===SM){try{s[uM.KHR_BINARY_GLTF]=new AM(e)}catch(e){return void(r&&r(e))}i=JSON.parse(s[uM.KHR_BINARY_GLTF].content)}else i=JSON.parse(su.decodeText(new Uint8Array(e)))}else i=e;if(void 0===i.asset||i.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const o=new eA(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});o.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](o);a[t.name]=t,s[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){const t=i.extensionsUsed[e],n=i.extensionsRequired||[];switch(t){case uM.KHR_MATERIALS_UNLIT:s[t]=new pM;break;case uM.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:s[t]=new OM;break;case uM.KHR_DRACO_MESH_COMPRESSION:s[t]=new RM(i,this.dracoLoader);break;case uM.KHR_TEXTURE_TRANSFORM:s[t]=new DM;break;case uM.KHR_MESH_QUANTIZATION:s[t]=new PM;break;default:T(n).call(n,t)>=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}o.setExtensions(s),o.setPlugins(a),o.parse(n,r)}parseAsync(e,t){const n=this;return new _((function(r,i){n.parse(e,t,r,i)}))}}function cM(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const uM={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class hM{constructor(e){this.parser=e,this.name=uM.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,s=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let a;const o=new cn(16777215);void 0!==s.color&&o.fromArray(s.color);const l=void 0!==s.range?s.range:0;switch(s.type){case"directional":a=new ru(o),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new tu(o),a.distance=l;break;case"spot":a=new Kc(o),a.distance=l,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,a.angle=s.spot.outerConeAngle,a.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return a.position.set(0,0,0),a.decay=2,void 0!==s.intensity&&(a.intensity=s.intensity),a.name=t.createUniqueName(s.name||"light_"+e),r=_.resolve(a),t.cache.add(n,r),r}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class pM{constructor(){this.name=uM.KHR_MATERIALS_UNLIT}getMaterialType(){return kr}extendParams(e,t,n){const r=[];e.color=new cn(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(b(i.baseColorFactor)){const t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,St))}return _.all(r)}}class dM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return _.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),_.resolve()}}class mM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return _.resolve();const i=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const e=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Xt(e,e)}return _.all(i)}}class fM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return _.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.iridescenceFactor&&(t.iridescence=s.iridescenceFactor),void 0!==s.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),void 0!==s.iridescenceIor&&(t.iridescenceIOR=s.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==s.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),void 0!==s.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),void 0!==s.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),_.all(i)}}class gM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return _.resolve();const i=[];t.sheenColor=new cn(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];return void 0!==s.sheenColorFactor&&t.sheenColor.fromArray(s.sheenColorFactor),void 0!==s.sheenRoughnessFactor&&(t.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,St)),void 0!==s.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),_.all(i)}}class _M{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return _.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),_.all(i)}}class vM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return _.resolve();const i=[],s=r.extensions[this.name];t.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const a=s.attenuationColor||[1,1,1];return t.attenuationColor=new cn(a[0],a[1],a[2]),_.all(i)}}class yM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return _.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,_.resolve()}}class bM{constructor(e){this.parser=e,this.name=uM.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return _.resolve();const i=[],s=r.extensions[this.name];t.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const a=s.specularColorFactor||[1,1,1];return t.specularColor=new cn(a[0],a[1],a[2]),void 0!==s.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,St)),_.all(i)}}class xM{constructor(e){this.parser=e,this.name=uM.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){var a;if(n.extensionsRequired&&T(a=n.extensionsRequired).call(a,this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class TM{constructor(e){this.parser=e,this.name=uM.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],a=r.images[s.source];let o=n.textureLoader;if(a.uri){const e=n.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){var a;if(i)return n.loadTextureImage(e,s.source,o);if(r.extensionsRequired&&T(a=r.extensionsRequired).call(a,t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new _((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class wM{constructor(e){this.name=uM.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],i=this.parser.getDependency("buffer",e.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){var r;if(t.extensionsRequired&&T(r=t.extensionsRequired).call(r,this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,n,r);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(i,a,o,e.mode,oe(e)).then((function(e){return e.buffer})):s.ready.then((function(){const t=new ArrayBuffer(i*a);return s.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,oe(e)),t}))}))}return null}}class EM{constructor(e){this.name=uM.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;const r=t.meshes[n.mesh];for(const e of r.primitives)if(e.mode!==FM.TRIANGLES&&e.mode!==FM.TRIANGLE_STRIP&&e.mode!==FM.TRIANGLE_FAN&&void 0!==e.mode)return null;const i=n.extensions[this.name].attributes,s=[],a={};for(const e in i)s.push(this.parser.getDependency("accessor",i[e]).then((t=>(a[e]=t,a[e]))));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),_.all(s).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(const e of n){const t=new Zn,n=new xn,s=new bn,o=new xn(1,1,1),l=new ko(e.geometry,e.material,r);for(let e=0;e<r;e++)a.TRANSLATION&&n.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&s.fromBufferAttribute(a.ROTATION,e),a.SCALE&&o.fromBufferAttribute(a.SCALE,e),l.setMatrixAt(e,t.compose(n,s,o));for(const t in a)"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);Tr.prototype.copy.call(l,e),l.frustumCulled=!1,this.parser.assignFinalMaterial(l),i.push(l)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]})))}}const SM="glTF",IM=1313821514,MM=5130562;class AM{constructor(e){this.name=uM.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:su.decodeText(new Uint8Array(I(e).call(e,0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==SM)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,n===IM){const n=new Uint8Array(e,12+i,t);this.content=su.decodeText(n)}else if(n===MM){const n=12+i;this.body=I(e).call(e,n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class RM{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=uM.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,a={},o={},l={};for(const e in s){const t=zM[e]||e.toLowerCase();a[t]=s[e]}for(const t in e.attributes){const r=zM[t]||t.toLowerCase();if(void 0!==s[t]){const i=n.accessors[e.attributes[t]],s=UM[i.componentType];l[r]=s.name,o[r]=!0===i.normalized}}return t.getDependency("bufferView",i).then((function(e){return new _((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=o[t];void 0!==r&&(n.normalized=r)}t(e)}),a,l)}))}))}}class DM{constructor(){this.name=uM.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&j(e).fromArray(t.scale),e.needsUpdate=!0),e}}class CM extends ac{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),i=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),a={specular:{value:(new cn).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(e){for(const t in a)e.uniforms[t]=a[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",i).replace("#include <lights_physical_fragment>",s)},X(this,{specular:{get:function(){return a.specular.value},set:function(e){a.specular.value=e}},specularMap:{get:function(){return a.specularMap.value},set:function(e){a.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(e){a.glossiness.value=e}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(e){a.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class OM{constructor(){this.name=uM.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return CM}extendParams(e,t,n){const r=t.extensions[this.name];e.color=new cn(1,1,1),e.opacity=1;const i=[];if(b(r.diffuseFactor)){const t=r.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture,St)),e.emissive=new cn(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new cn(1,1,1),b(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const t=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",t)),i.push(n.assignTexture(e,"specularMap",t,St))}return _.all(i)}createMaterial(e){const t=new CM(e);return t.fog=!0,t.color=e.color,t.map=void 0===K(e)?null:K(e),t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}}class PM{constructor(){this.name=uM.KHR_MESH_QUANTIZATION}}class NM extends vc{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=r-t,u=(n-t)/c,h=u*u,p=h*u,d=e*l,m=d-l,f=-2*p+3*h,g=p-h,_=1-f,v=g-h+u;for(let e=0;e!==a;e++){const t=s[m+e+a],n=s[m+e+o]*c,r=s[d+e+a],l=s[d+e]*c;i[e]=_*t+v*n+f*r+g*l}return i}}const LM=new bn;class kM extends NM{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return LM.fromArray(i).normalize().toArray(i),i}}const FM={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},UM={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},BM={9728:Qe,9729:nt,9984:et,9985:rt,9986:tt,9987:it},jM={33071:Ze,33648:Je,10497:Ke},GM={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zM={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},VM={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},HM={CUBICSPLINE:void 0,LINEAR:yt,STEP:vt},qM="OPAQUE",WM="MASK",YM="BLEND";function XM(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function $M(e,t){void 0!==t.extras&&("object"==typeof t.extras?H(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function KM(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&b(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function ZM(e){const t=e.extensions&&e.extensions[uM.KHR_DRACO_MESH_COMPRESSION];let n;return n=t?"draco:"+t.bufferView+":"+t.indices+":"+JM(t.attributes):e.indices+":"+JM(e.attributes)+":"+e.mode,n}function JM(e){var t;let n="";const r=ne(t=J(e)).call(t);for(let t=0,i=r.length;t<i;t++)n+=r[t]+":"+e[r[t]]+";";return n}function QM(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class eA{constructor(e={},t={}){var n;this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new cM,this.associations=new ce,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=T(n=navigator.userAgent).call(n,"Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||r||i&&s<98?this.textureLoader=new zc(this.options.manager):this.textureLoader=new au(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Uc(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),_.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return _.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const s={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};XM(i,s,r),$M(s,r),_.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){const r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(n[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,s]of c_(r=e.children).call(r)){var r;i(s,t.children[n])}};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=ep(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=ep(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=_.all(K(r).call(r,(function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return _.resolve(this.extensions[uM.KHR_BINARY_GLTF].body);const r=this.options;return new _((function(e,i){n.load(su.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return I(e).call(e,r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse)return _.resolve(null);const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",de(r.sparse).bufferView))),_.all(i).then((function(e){const i=e[0],s=GM[r.type],a=UM[r.componentType],o=a.BYTES_PER_ELEMENT,l=o*s,c=r.byteOffset||0,u=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,h=!0===r.normalized;let p,d;if(u&&u!==l){const e=Math.floor(c/u),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let l=t.cache.get(n);l||(p=new a(i,e*u,r.count*u/o),l=new fo(p,u/o),t.cache.add(n,l)),d=new _o(l,s,c%u/o,h)}else p=null===i?new a(r.count*s):new a(i,c,r.count*s),d=new Br(p,s,h);if(void 0!==r.sparse){const t=GM.SCALAR,n=UM[r.sparse.indices.componentType],o=r.sparse.indices.byteOffset||0,l=de(r.sparse).byteOffset||0,c=new n(e[1],o,r.sparse.count*t),u=new a(e[2],l,r.sparse.count*s);var m;if(null!==i)d=new Br(I(m=d.array).call(m),d.itemSize,d.normalized);for(let e=0,t=c.length;e<t;e++){const t=c[e];if(d.setX(t,u[e*s]),s>=2&&d.setY(t,u[e*s+1]),s>=3&&d.setZ(t,u[e*s+2]),s>=4&&d.setW(t,u[e*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return d}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let s=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,n){const r=this,i=this.json,s=i.textures[e],a=i.images[t],o=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[o])return this.textureCache[o];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=s.name||a.name||"";const n=(i.samplers||{})[s.sampler]||{};return t.magFilter=BM[n.magFilter]||nt,t.minFilter=BM[n.minFilter]||it,t.wrapS=jM[n.wrapS]||Ke,t.wrapT=jM[n.wrapT]||Ke,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[o]=l,l}loadImageSource(e,t){const n=this,r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=r.images[e],a=g_||self.webkitURL;let o=s.uri||"",l=!1;if(void 0!==s.bufferView)o=n.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return o=a.createObjectURL(t),o}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=_.resolve(o).then((function(e){return new _((function(n,r){let s=n;!0===t.isImageBitmapLoader&&(s=function(e){const t=new fn(e);t.needsUpdate=!0,n(t)}),t.load(su.resolveURL(e,i.path),s,void 0,r)}))})).then((function(e){var t;return!0===l&&a.revokeObjectURL(o),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(s){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[uM.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[uM.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[uM.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==r&&(s.encoding=r),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new Xo,Lr.prototype.copy.call(t,n),t.color.copy(n.color),t.map=K(n),t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new Fo,Lr.prototype.copy.call(t,n),t.color.copy(n.color),this.cache.add(e,t)),n=t}if(r||i||s){let e="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),s&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return ac}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let s;const a={},o=i.extensions||{},l=[];if(o[uM.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=r[uM.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];s=e.getMaterialType(),l.push(e.extendParams(a,i,t))}else if(o[uM.KHR_MATERIALS_UNLIT]){const e=r[uM.KHR_MATERIALS_UNLIT];s=e.getMaterialType(),l.push(e.extendParams(a,i,t))}else{const n=i.pbrMetallicRoughness||{};if(a.color=new cn(1,1,1),a.opacity=1,b(n.baseColorFactor)){const e=n.baseColorFactor;a.color.fromArray(e),a.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(a,"map",n.baseColorTexture,St)),a.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,a.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",n.metallicRoughnessTexture))),s=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(_.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===i.doubleSided&&(a.side=2);const c=i.alphaMode||qM;if(c===YM?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===WM&&(a.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&s!==kr&&(l.push(t.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new Xt(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;a.normalScale.set(e,e)}return void 0!==i.occlusionTexture&&s!==kr&&(l.push(t.assignTexture(a,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(a.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&s!==kr&&(a.emissive=(new cn).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&s!==kr&&l.push(t.assignTexture(a,"emissiveMap",i.emissiveTexture,St)),_.all(l).then((function(){let n;return n=s===CM?r[uM.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new s(a),i.name&&(n.name=i.name),$M(n,i),t.associations.set(n,{materials:e}),i.extensions&&XM(r,n,i),n}))}createUniqueName(e){const t=fu.sanitizeNodeName(e||"");let n=t;for(let e=1;this.nodeNamesUsed[n];++e)n=t+"_"+e;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[uM.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return nA(n,e,t)}))}const s=[];for(let n=0,a=e.length;n<a;n++){const a=e[n],o=ZM(a),l=r[o];if(l)s.push(l.promise);else{let e;e=a.extensions&&a.extensions[uM.KHR_DRACO_MESH_COMPRESSION]?i(a):nA(new Kr,a,t),r[o]={primitive:a,promise:e},s.push(e)}}return _.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],s=i.primitives,a=[];for(let e=0,t=s.length;e<t;e++){const t=void 0===s[e].material?(void 0===(o=this.cache).DefaultMaterial&&(o.DefaultMaterial=new ac({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),o.DefaultMaterial):this.getDependency("material",s[e].material);a.push(t)}var o;return a.push(t.loadGeometries(s)),_.all(a).then((function(n){const a=I(n).call(n,0,n.length-1),o=n[n.length-1],l=[];for(let n=0,c=o.length;n<c;n++){const c=o[n],u=s[n];let h;const p=a[n];if(u.mode===FM.TRIANGLES||u.mode===FM.TRIANGLE_STRIP||u.mode===FM.TRIANGLE_FAN||void 0===u.mode)h=!0===i.isSkinnedMesh?new Eo(c,p):new mi(c,p),!0!==h.isSkinnedMesh||h.geometry.attributes.skinWeight.normalized||h.normalizeSkinWeights(),u.mode===FM.TRIANGLE_STRIP?h.geometry=rA(h.geometry,1):u.mode===FM.TRIANGLE_FAN&&(h.geometry=rA(h.geometry,2));else if(u.mode===FM.LINES)h=new Wo(c,p);else if(u.mode===FM.LINE_STRIP)h=new Vo(c,p);else if(u.mode===FM.LINE_LOOP)h=new Yo(c,p);else{if(u.mode!==FM.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);h=new Qo(c,p)}J(h.geometry.morphAttributes).length>0&&KM(h,i),h.name=t.createUniqueName(i.name||"mesh_"+e),$M(h,i),u.extensions&&XM(r,h,u),t.assignFinalMaterial(h),l.push(h)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const c=new io;t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new Ti(Yt.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new Wi(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),$M(t,n),_.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?_.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))}loadAnimation(e){const t=this.json.animations[e],n=[],r=[],i=[],s=[],a=[];for(let e=0,o=t.channels.length;e<o;e++){const o=t.channels[e],l=t.samplers[o.sampler],c=o.target,u=c.node,h=void 0!==t.parameters?t.parameters[l.input]:l.input,p=void 0!==t.parameters?t.parameters[l.output]:l.output;n.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",h)),i.push(this.getDependency("accessor",p)),s.push(l),a.push(c)}return _.all([_.all(n),_.all(r),_.all(i),_.all(s),_.all(a)]).then((function(n){const r=n[0],i=n[1],s=n[2],a=n[3],o=n[4],l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=i[e],c=s[e],u=a[e],h=o[e];if(void 0===t)continue;let p;switch(t.updateMatrix(),VM[h.path]){case VM.weights:p=Sc;break;case VM.rotation:p=Mc;break;default:p=Rc}const d=t.name?t.name:t.uuid,m=void 0!==u.interpolation?HM[u.interpolation]:yt,f=[];VM[h.path]===VM.weights?t.traverse((function(e){e.morphTargetInfluences&&f.push(e.name?e.name:e.uuid)})):f.push(d);let g=c.array;if(c.normalized){const e=QM(g.constructor),t=new Float32Array(g.length);for(let n=0,r=g.length;n<r;n++)t[n]=g[n]*e;g=t}for(let e=0,t=f.length;e<t;e++){const t=new p(f[e]+"."+VM[h.path],n.array,g,m);"CUBICSPLINE"===u.interpolation&&(t.createInterpolant=function(e){return new(this instanceof Mc?kM:NM)(this.times,de(this),this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const c=t.name?t.name:"animation_"+e;return new Dc(c,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this.json,n=this.extensions,r=this,i=t.nodes[e],s=i.name?r.createUniqueName(i.name):"";return function(){var t;const n=[],s=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return s&&n.push(s),void 0!==i.camera&&n.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),fe(t=r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}))).call(t,(function(e){n.push(e)})),_.all(n)}().then((function(t){let a;if(a=!0===i.isBone?new So:t.length>1?new io:1===t.length?t[0]:new Tr,a!==t[0])for(let e=0,n=t.length;e<n;e++)a.add(t[e]);if(i.name&&(a.userData.name=i.name,a.name=s),$M(a,i),i.extensions&&XM(n,a,i),void 0!==i.matrix){const e=new Zn;e.fromArray(i.matrix),a.applyMatrix4(e)}else void 0!==i.translation&&a.position.fromArray(i.translation),void 0!==i.rotation&&a.quaternion.fromArray(i.rotation),void 0!==i.scale&&a.scale.fromArray(i.scale);return r.associations.has(a)||r.associations.set(a,{}),r.associations.get(a).nodes=e,a}))}loadScene(e){const t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,s=new io;r.name&&(s.name=i.createUniqueName(r.name)),$M(s,r),r.extensions&&XM(n,s,r);const a=r.nodes||[],o=[];for(let e=0,n=a.length;e<n;e++)o.push(tA(a[e],s,t,i));return _.all(o).then((function(){return i.associations=(e=>{const t=new ce;for(const[e,n]of i.associations)(e instanceof Lr||e instanceof fn)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(s),s}))}}function tA(e,t,n,r){const i=n.nodes[e];return r.getDependency("node",e).then((function(e){if(void 0===i.skin)return e;let t;return r.getDependency("skin",i.skin).then((function(e){t=e;const n=[];for(let e=0,i=t.joints.length;e<i;e++)n.push(r.getDependency("node",t.joints[e]));return _.all(n)})).then((function(n){return e.traverse((function(e){if(!e.isMesh)return;const r=[],i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e];if(s){r.push(s);const n=new Zn;void 0!==t.inverseBindMatrices&&n.fromArray(t.inverseBindMatrices.array,16*e),i.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}_e(e).call(e,new Ro(r,i),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const s=[];if(i.children){const t=i.children;for(let i=0,a=t.length;i<a;i++){const a=t[i];s.push(tA(a,e,n,r))}}return _.all(s)}))}function nA(e,t,n){const r=t.attributes,i=[];function s(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const t in r){const n=zM[t]||t.toLowerCase();n in e.attributes||i.push(s(r[t],n))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return $M(e,t),function(e,t,n){const r=t.attributes,i=new En;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,s=e.max;if(void 0===t||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new xn(t[0],t[1],t[2]),new xn(s[0],s[1],s[2])),e.normalized){const t=QM(UM[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const s=t.targets;if(void 0!==s){const e=new xn,t=new xn;for(let r=0,i=s.length;r<i;r++){const i=s[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],s=r.min,a=r.max;if(void 0!==s&&void 0!==a){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(a[2]))),r.normalized){const e=QM(UM[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const a=new zn;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=a}(e,t,n),_.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,s=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(void 0!==n.POSITION&&(r=!0),void 0!==n.NORMAL&&(i=!0),void 0!==n.COLOR_0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return _.resolve(e);const a=[],o=[],l=[];for(let c=0,u=t.length;c<u;c++){const u=t[c];if(r){const t=void 0!==u.POSITION?n.getDependency("accessor",u.POSITION):e.attributes.position;a.push(t)}if(i){const t=void 0!==u.NORMAL?n.getDependency("accessor",u.NORMAL):e.attributes.normal;o.push(t)}if(s){const t=void 0!==u.COLOR_0?n.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return _.all([_.all(a),_.all(o),_.all(l)]).then((function(t){const n=t[0],a=t[1],o=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=a),s&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function rA(e,t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(2===t)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=e.clone();return s.setIndex(i),s}var iA=n(92381),sA=n(8010),aA=U,oA=Xh,lA=Object.prototype.hasOwnProperty,cA=Object.prototype.propertyIsEnumerable,uA=(e,t,n)=>t in e?aA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hA=(e,t)=>{for(var n in t||(t={}))lA.call(t,n)&&uA(e,n,t[n]);if(oA)for(var n of oA(t))cA.call(t,n)&&uA(e,n,t[n]);return e},pA=e=>{if("undefined"!=typeof require)return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')},dA=(e,t)=>function(){return t||(0,e[J(e)[0]])((t={exports:{}}).exports,t),t.exports},mA=dA({"(disabled):crypto"(){}}),fA=dA({"dist/web-ifc.js"(e,t){var n,r=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(n=n||__filename),function(e){var t,r,i,s,a=void 0!==(e=e||{})?e:{};a.ready=new _((function(e,t){i=e,s=t}));var o,l={};for(o in a)a.hasOwnProperty(o)&&(l[o]=a[o]);var c=[],u="./this.program",h=function(e,t){throw t},p=!1,d=!1,m=!1,f=!1;p="object"==typeof window,d="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,f=!p&&!m&&!d;var g,v,y,b,x,w="";function S(e){return a.locateFile?a.locateFile(e,w):w+e}m?(w=d?pA("path").dirname(w)+"/":__dirname+"/",g=function(e,t){return y||(y=pA("fs")),b||(b=pA("path")),e=b.normalize(e),y.readFileSync(e,t?null:"utf8")},v=function(e){var t=g(e,!0);return t.buffer||(t=new Uint8Array(t)),k(t.buffer),t},process.argv.length>1&&(u=process.argv[1].replace(/\\/g,"/")),c=I(x=process.argv).call(x,2),process.on("uncaughtException",(function(e){if(!(e instanceof ii))throw e})),process.on("unhandledRejection",Fe),h=function(e){process.exit(e)},a.inspect=function(){return"[Emscripten Module object]"}):f?("undefined"!=typeof read&&(g=function(e){return read(e)}),v=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(k("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?c=scriptArgs:void 0!==arguments&&(c=arguments),"function"==typeof quit&&(h=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(p||d)&&(d?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==T(w).call(w,"blob:")?I(w).call(w,0,De(w).call(w,"/")+1):"",g=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(v=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var M=a.print||_e(t=console.log).call(t,console),A=a.printErr||_e(r=console.warn).call(r,console);for(o in l)l.hasOwnProperty(o)&&(a[o]=l[o]);l=null,a.arguments&&(c=a.arguments),a.thisProgram&&(u=a.thisProgram),a.quit&&(h=a.quit);var R=16;function D(e,t){return t||(t=R),Math.ceil(e/t)*t}var C,O,P,N=function(e){};a.wasmBinary&&(C=a.wasmBinary),a.noExitRuntime&&(O=a.noExitRuntime),"object"!=typeof WebAssembly&&Fe("no native wasm support detected");var L=!1;function k(e,t){e||Fe("Assertion failed: "+t)}var F="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function U(e,t,n){for(var r=(t>>>=0)+n,i=t;e[i>>>0]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&F)return F.decode(e.subarray(t>>>0,i>>>0));for(var s="";t<i;){var a=e[t++>>>0];if(128&a){var o=63&e[t++>>>0];if(192!=(224&a)){var l=63&e[t++>>>0];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++>>>0])<65536)s+=String.fromCharCode(a);else{var c=a-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}function B(e,t){return(e>>>=0)?U(q,e,t):""}function j(e,t,n,r){if(!(r>0))return 0;for(var i=n>>>=0,s=n+r-1,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),o<=127){if(n>=s)break;t[n++>>>0]=o}else if(o<=2047){if(n+1>=s)break;t[n++>>>0]=192|o>>6,t[n++>>>0]=128|63&o}else if(o<=65535){if(n+2>=s)break;t[n++>>>0]=224|o>>12,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}else{if(n+3>=s)break;t[n++>>>0]=240|o>>18,t[n++>>>0]=128|o>>12&63,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}}return t[n>>>0]=0,n-i}function G(e,t,n){return j(e,q,t,n)}function z(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}var V,H,q,W,Y,$,Z,Q,ee,te="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ne(e,t){for(var n=e,r=n>>1,i=r+t/2;!(r>=i)&&Y[r>>>0];)++r;if((n=r<<1)-e>32&&te)return te.decode(q.subarray(e>>>0,n>>>0));for(var s="",a=0;!(a>=t/2);++a){var o=W[e+2*a>>>1];if(0==o)break;s+=String.fromCharCode(o)}return s}function re(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,i=(n-=2)<2*e.length?n/2:e.length,s=0;s<i;++s){var a=e.charCodeAt(s);W[t>>>1]=a,t+=2}return W[t>>>1]=0,t-r}function ie(e){return 2*e.length}function se(e,t){for(var n=0,r="";!(n>=t/4);){var i=$[e+4*n>>>2];if(0==i)break;if(++n,i>=65536){var s=i-65536;r+=String.fromCharCode(55296|s>>10,56320|1023&s)}else r+=String.fromCharCode(i)}return r}function ae(e,t,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t>>>=0,i=r+n-4,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),$[t>>>2]=a,(t+=4)+4>i)break}return $[t>>>2]=0,t-r}function le(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t}function ce(e,t){H.set(e,t>>>0)}function ue(e,t,n){for(var r=0;r<e.length;++r)H[t++>>>0]=e.charCodeAt(r);n||(H[t>>>0]=0)}function he(e,t){return e%t>0&&(e+=t-e%t),e}function pe(e){V=e,a.HEAP8=H=new Int8Array(e),a.HEAP16=W=new Int16Array(e),a.HEAP32=$=new Int32Array(e),a.HEAPU8=q=new Uint8Array(e),a.HEAPU16=Y=new Uint16Array(e),a.HEAPU32=Z=new Uint32Array(e),a.HEAPF32=Q=new Float32Array(e),a.HEAPF64=ee=new Float64Array(e)}var de,me=a.INITIAL_MEMORY||16777216;(P=a.wasmMemory?a.wasmMemory:new WebAssembly.Memory({initial:me/65536,maximum:65536}))&&(V=P.buffer),me=V.byteLength,pe(V);var ge=[],ve=[],be=[],Te=[];function we(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Re(a.preRun.shift());$e(ge)}function Ee(){a.noFSInit||at.init.initialized||at.init(),rt.init(),$e(ve)}function Se(){at.ignorePermissions=!1,$e(be)}function Ie(){}function Me(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ce(a.postRun.shift());$e(Te)}function Re(e){ge.unshift(e)}function Ce(e){Te.unshift(e)}var Oe=0,Pe=null,Ne=null;function Le(e){Oe++,a.monitorRunDependencies&&a.monitorRunDependencies(Oe)}function ke(e){if(Oe--,a.monitorRunDependencies&&a.monitorRunDependencies(Oe),0==Oe&&(null!==Pe&&(clearInterval(Pe),Pe=null),Ne)){var t=Ne;Ne=null,t()}}function Fe(e){a.onAbort&&a.onAbort(e),A(e+=""),L=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw s(t),t}function Ue(e,t){return tx(String.prototype)?tx(e).call(e,t):0===T(e).call(e,t)}a.preloadedImages={},a.preloadedAudios={};var Be="data:application/octet-stream;base64,";function je(e){return Ue(e,Be)}var Ge="file://";function ze(e){return Ue(e,Ge)}var Ve,He,qe=CY+"web-ifc.wasm";function We(){try{if(C)return new Uint8Array(C);if(v)return v(qe);throw"both async and sync fetching of the wasm failed"}catch(e){Fe(e)}}function Ye(){return C||!p&&!d||"function"!=typeof fetch||ze(qe)?_.resolve().then(We):fetch(qe,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+qe+"'";return e.arrayBuffer()})).catch((function(){return We()}))}function Xe(){var e={a:Jr};function t(e,t){var n=e.exports;a.asm=n,de=a.asm.X,ke()}function n(e){t(e.instance)}function r(t){return Ye().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){A("failed to asynchronously prepare wasm: "+e),Fe(e)}))}if(Le(),a.instantiateWasm)try{return a.instantiateWasm(e,t)}catch(e){return A("Module.instantiateWasm callback failed with error: "+e),!1}return(C||"function"!=typeof WebAssembly.instantiateStreaming||je(qe)||ze(qe)||"function"!=typeof fetch?r(n):fetch(qe,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return A("wasm streaming compile failed: "+e),A("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(s),{}}function $e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?de.get(n)():de.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(a)}}function Ke(e,t,n){var r;return n&&n.length?a["dynCall_"+e].apply(null,ye(r=[t]).call(r,n)):a["dynCall_"+e].call(null,t)}function Ze(e,t,n){return-1!=T(e).call(e,"j")?Ke(e,t,n):de.get(t).apply(null,n)}function Je(e,t,n,r){Fe("Assertion failed: "+B(e)+", at: "+[t?B(t):"unknown filename",n,r?B(r):"unknown function"])}function Qe(e){return $[ni()>>>2]=e,e}je(qe)||(qe=S(qe));var et={splitPath:function(e){var t;return I(t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e)).call(t,1)},normalizeArray:function(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?E(e).call(e,r,1):".."===i?(E(e).call(e,r,1),n++):n&&(E(e).call(e,r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:function(e){var t,n="/"===e.charAt(0),r="/"===I(e).call(e,-1);return(e=et.normalizeArray(oe(t=e.split("/")).call(t,(function(e){return!!e})),!n).join("/"))||n||(e="."),e&&r&&(e+="/"),(n?"/":"")+e},dirname:function(e){var t=et.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=I(r).call(r,0,r.length-1)),n+r):"."},basename:function(e){if("/"===e)return"/";e=(e=et.normalize(e)).replace(/\/$/,"");var t=De(e).call(e,"/");return-1===t?e:I(e).call(e,t+1)},extname:function(e){return et.splitPath(e)[3]},join:function(){var e=I(Array.prototype).call(arguments,0);return et.normalize(e.join("/"))},join2:function(e,t){return et.normalize(e+"/"+t)}};function tt(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(m)try{var t=mA();return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){Fe("randomDevice")}}var nt={resolve:function(){for(var e,t="",n=!1,r=arguments.length-1;r>=-1&&!n;r--){var i=r>=0?arguments[r]:at.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";t=i+"/"+t,n="/"===i.charAt(0)}return(n?"/":"")+(t=et.normalizeArray(oe(e=t.split("/")).call(e,(function(e){return!!e})),!n).join("/"))||"."},relative:function(e,t){var n,r;function i(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:I(e).call(e,t,n-t+1)}e=I(n=nt.resolve(e)).call(n,1),t=I(r=nt.resolve(t)).call(r,1);for(var s=i(e.split("/")),a=i(t.split("/")),o=Math.min(s.length,a.length),l=o,c=0;c<o;c++)if(s[c]!==a[c]){l=c;break}var u=[];for(c=l;c<s.length;c++)u.push("..");return(u=ye(u).call(u,I(a).call(a,l))).join("/")}},rt={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){rt.ttys[e]={input:[],output:[],ops:t},at.registerDevice(e,rt.stream_ops)},stream_ops:{open:function(e){var t=rt.ttys[e.node.rdev];if(!t)throw new at.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,n,r,i){if(!e.tty||!e.tty.ops.get_char)throw new at.ErrnoError(60);for(var s=0,a=0;a<r;a++){var o;try{o=e.tty.ops.get_char(e.tty)}catch(e){throw new at.ErrnoError(29)}if(void 0===o&&0===s)throw new at.ErrnoError(6);if(null==o)break;s++,t[n+a]=o}return s&&(e.node.timestamp=Wh()),s},write:function(e,t,n,r,i){if(!e.tty||!e.tty.ops.put_char)throw new at.ErrnoError(60);try{for(var s=0;s<r;s++)e.tty.ops.put_char(e.tty,t[n+s])}catch(e){throw new at.ErrnoError(29)}return r&&(e.node.timestamp=Wh()),s}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(m){var n=Buffer.alloc?Buffer.alloc(256):new Buffer(256),r=0;try{r=y.readSync(process.stdin.fd,n,0,256,null)}catch(e){var i;if(-1==T(i=e.toString()).call(i,"EOF"))throw e;r=0}t=r>0?I(n).call(n,0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=Kr(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(M(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(M(U(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(A(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(A(U(e.output,0)),e.output=[])}}};function it(e){for(var t=D(e,16384),n=ei(t);e<t;)H[n+e++>>>0]=0;return n}var st={ops_table:null,mount:function(e){return st.createNode(null,"/",16895,0)},createNode:function(e,t,n,r){if(at.isBlkdev(n)||at.isFIFO(n))throw new at.ErrnoError(63);st.ops_table||(st.ops_table={dir:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr,lookup:st.node_ops.lookup,mknod:st.node_ops.mknod,rename:st.node_ops.rename,unlink:st.node_ops.unlink,rmdir:st.node_ops.rmdir,readdir:st.node_ops.readdir,symlink:st.node_ops.symlink},stream:{llseek:st.stream_ops.llseek}},file:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr},stream:{llseek:st.stream_ops.llseek,read:st.stream_ops.read,write:st.stream_ops.write,allocate:st.stream_ops.allocate,mmap:st.stream_ops.mmap,msync:st.stream_ops.msync}},link:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr,readlink:st.node_ops.readlink},stream:{}},chrdev:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr},stream:at.chrdev_stream_ops}});var i=at.createNode(e,t,n,r);return at.isDir(i.mode)?(i.node_ops=st.ops_table.dir.node,i.stream_ops=st.ops_table.dir.stream,i.contents={}):at.isFile(i.mode)?(i.node_ops=st.ops_table.file.node,i.stream_ops=st.ops_table.file.stream,i.usedBytes=0,i.contents=null):at.isLink(i.mode)?(i.node_ops=st.ops_table.link.node,i.stream_ops=st.ops_table.link.stream):at.isChrdev(i.mode)&&(i.node_ops=st.ops_table.chrdev.node,i.stream_ops=st.ops_table.chrdev.stream),i.timestamp=Wh(),e&&(e.contents[t]=i),i},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],n=0;n<e.usedBytes;++n)t.push(e.contents[n]);return t}return e.contents},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){t>>>=0;var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(t>>>=0,e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var n=e.contents;return e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length<t;)e.contents.push(0);e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=at.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,at.isDir(e.mode)?t.size=4096:at.isFile(e.mode)?t.size=e.usedBytes:at.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&st.resizeFileStorage(e,t.size)},lookup:function(e,t){throw at.genericErrors[44]},mknod:function(e,t,n,r){return st.createNode(e,t,n,r)},rename:function(e,t,n){if(at.isDir(e.mode)){var r;try{r=at.lookupNode(t,n)}catch(e){}if(r)for(var i in r.contents)throw new at.ErrnoError(55)}delete e.parent.contents[e.name],e.name=n,t.contents[n]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var n=at.lookupNode(e,t);for(var r in n.contents)throw new at.ErrnoError(55);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink:function(e,t,n){var r=st.createNode(e,t,41471,0);return r.link=n,r},readlink:function(e){if(!at.isLink(e.mode))throw new at.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,n,r,i){var s=e.node.contents;if(i>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-i,r);if(a>8&&s.subarray)t.set(s.subarray(i,i+a),n);else for(var o=0;o<a;o++)t[n+o]=s[i+o];return a},write:function(e,t,n,r,i,s){if(t.buffer===H.buffer&&(s=!1),!r)return 0;var a=e.node;if(a.timestamp=Wh(),t.subarray&&(!a.contents||a.contents.subarray)){if(s)return a.contents=t.subarray(n,n+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===i)return a.contents=I(t).call(t,n,n+r),a.usedBytes=r,r;if(i+r<=a.usedBytes)return a.contents.set(t.subarray(n,n+r),i),r}if(st.expandFileStorage(a,i+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)a.contents[i+o]=t[n+o];return a.usedBytes=Math.max(a.usedBytes,i+r),r},llseek:function(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&at.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new at.ErrnoError(28);return r},allocate:function(e,t,n){st.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap:function(e,t,n,r,i,s){if(k(0===t),!at.isFile(e.node.mode))throw new at.ErrnoError(43);var a,o,l=e.node.contents;if(2&s||l.buffer!==V){if((r>0||r+n<l.length)&&(l=l.subarray?l.subarray(r,r+n):I(Array.prototype).call(l,r,r+n)),o=!0,!(a=it(n)))throw new at.ErrnoError(48);a>>>=0,H.set(l,a>>>0)}else o=!1,a=l.byteOffset;return{ptr:a,allocated:o}},msync:function(e,t,n,r,i){if(!at.isFile(e.node.mode))throw new at.ErrnoError(43);return 2&i||st.stream_ops.write(e,t,0,r,n,!1),0}}},at={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){var n;if(t=t||{},!(e=nt.resolve(at.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var i in r)void 0===t[i]&&(t[i]=r[i]);if(t.recurse_count>8)throw new at.ErrnoError(32);for(var s=et.normalizeArray(oe(n=e.split("/")).call(n,(function(e){return!!e})),!1),a=at.root,o="/",l=0;l<s.length;l++){var c=l===s.length-1;if(c&&t.parent)break;if(a=at.lookupNode(a,s[l]),o=et.join2(o,s[l]),at.isMountpoint(a)&&(!c||c&&t.follow_mount)&&(a=a.mounted.root),!c||t.follow)for(var u=0;at.isLink(a.mode);){var h=at.readlink(o);if(o=nt.resolve(et.dirname(o),h),a=at.lookupPath(o,{recurse_count:t.recurse_count}).node,u++>40)throw new at.ErrnoError(32)}}return{path:o,node:a}},getPath:function(e){for(var t;;){if(at.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?n+"/"+t:n+t:n}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%at.nameTable.length},hashAddNode:function(e){var t=at.hashName(e.parent.id,e.name);e.name_next=at.nameTable[t],at.nameTable[t]=e},hashRemoveNode:function(e){var t=at.hashName(e.parent.id,e.name);if(at.nameTable[t]===e)at.nameTable[t]=e.name_next;else for(var n=at.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:function(e,t){var n=at.mayLookup(e);if(n)throw new at.ErrnoError(n,e);for(var r=at.hashName(e.id,t),i=at.nameTable[r];i;i=i.name_next){var s=i.name;if(i.parent.id===e.id&&s===t)return i}return at.lookup(e,t)},createNode:function(e,t,n,r){var i=new at.FSNode(e,t,n,r);return at.hashAddNode(i),i},destroyNode:function(e){at.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=at.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return at.ignorePermissions||(-1===T(t).call(t,"r")||292&e.mode)&&(-1===T(t).call(t,"w")||146&e.mode)&&(-1===T(t).call(t,"x")||73&e.mode)?0:2},mayLookup:function(e){var t=at.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return at.lookupNode(e,t),20}catch(e){}return at.nodePermissions(e,"wx")},mayDelete:function(e,t,n){var r;try{r=at.lookupNode(e,t)}catch(e){return e.errno}var i=at.nodePermissions(e,"wx");if(i)return i;if(n){if(!at.isDir(r.mode))return 54;if(at.isRoot(r)||at.getPath(r)===at.cwd())return 10}else if(at.isDir(r.mode))return 31;return 0},mayOpen:function(e,t){return e?at.isLink(e.mode)?32:at.isDir(e.mode)&&("r"!==at.flagsToPermissionString(t)||512&t)?31:at.nodePermissions(e,at.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||at.MAX_OPEN_FDS;for(var n=e;n<=t;n++)if(!at.streams[n])return n;throw new at.ErrnoError(33)},getStream:function(e){return at.streams[e]},createStream:function(e,t,n){at.FSStream||(at.FSStream=function(){},at.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&$b(this))}},isWrite:{get:function(){return 0!=(2097155&$b(this))}},isAppend:{get:function(){return 1024&$b(this)}}});var r=new at.FSStream;for(var i in e)r[i]=e[i];e=r;var s=at.nextfd(t,n);return e.fd=s,at.streams[s]=e,e},closeStream:function(e){at.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=at.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new at.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){at.devices[e]={stream_ops:t}},getDevice:function(e){return at.devices[e]},getMounts:function(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),at.syncFSRequests++,at.syncFSRequests>1&&A("warning: "+at.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=at.getMounts(at.root.mount),r=0;function i(e){return at.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,i(e));++r>=n.length&&i(null)}fe(n).call(n,(function(t){if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount:function(e,t,n){var r,i="/"===n,s=!n;if(i&&at.root)throw new at.ErrnoError(10);if(!i&&!s){var a=at.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,at.isMountpoint(r))throw new at.ErrnoError(10);if(!at.isDir(r.mode))throw new at.ErrnoError(54)}var o={type:e,opts:t,mountpoint:n,mounts:[]},l=e.mount(o);return l.mount=o,o.root=l,i?at.root=l:r&&(r.mounted=o,r.mount&&r.mount.mounts.push(o)),l},unmount:function(e){var t,n,r,i=at.lookupPath(e,{follow_mount:!1});if(!at.isMountpoint(i.node))throw new at.ErrnoError(28);var s=i.node,a=s.mounted,o=at.getMounts(a);fe(t=J(at.nameTable)).call(t,(function(e){for(var t=at.nameTable[e];t;){var n=t.name_next;-1!==T(o).call(o,t.mount)&&at.destroyNode(t),t=n}})),s.mounted=null;var l=T(n=s.mount.mounts).call(n,a);E(r=s.mount.mounts).call(r,l,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,n){var r=at.lookupPath(e,{parent:!0}).node,i=et.basename(e);if(!i||"."===i||".."===i)throw new at.ErrnoError(28);var s=at.mayCreate(r,i);if(s)throw new at.ErrnoError(s);if(!r.node_ops.mknod)throw new at.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,at.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,at.mknod(e,t,0)},mkdirTree:function(e,t){for(var n=e.split("/"),r="",i=0;i<n.length;++i)if(n[i]){r+="/"+n[i];try{at.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,n){return void 0===n&&(n=t,t=438),t|=8192,at.mknod(e,t,n)},symlink:function(e,t){if(!nt.resolve(e))throw new at.ErrnoError(44);var n=at.lookupPath(t,{parent:!0}).node;if(!n)throw new at.ErrnoError(44);var r=et.basename(t),i=at.mayCreate(n,r);if(i)throw new at.ErrnoError(i);if(!n.node_ops.symlink)throw new at.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename:function(e,t){var n,r,i=et.dirname(e),s=et.dirname(t),a=et.basename(e),o=et.basename(t);if(n=at.lookupPath(e,{parent:!0}).node,r=at.lookupPath(t,{parent:!0}).node,!n||!r)throw new at.ErrnoError(44);if(n.mount!==r.mount)throw new at.ErrnoError(75);var l,c=at.lookupNode(n,a),u=nt.relative(e,s);if("."!==u.charAt(0))throw new at.ErrnoError(28);if("."!==(u=nt.relative(t,i)).charAt(0))throw new at.ErrnoError(55);try{l=at.lookupNode(r,o)}catch(e){}if(c!==l){var h=at.isDir(c.mode),p=at.mayDelete(n,a,h);if(p)throw new at.ErrnoError(p);if(p=l?at.mayDelete(r,o,h):at.mayCreate(r,o))throw new at.ErrnoError(p);if(!n.node_ops.rename)throw new at.ErrnoError(63);if(at.isMountpoint(c)||l&&at.isMountpoint(l))throw new at.ErrnoError(10);if(r!==n&&(p=at.nodePermissions(n,"w")))throw new at.ErrnoError(p);try{at.trackingDelegate.willMovePath&&at.trackingDelegate.willMovePath(e,t)}catch(n){A("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+n.message)}at.hashRemoveNode(c);try{n.node_ops.rename(c,r,o)}catch(e){throw e}finally{at.hashAddNode(c)}try{at.trackingDelegate.onMovePath&&at.trackingDelegate.onMovePath(e,t)}catch(n){A("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+n.message)}}},rmdir:function(e){var t=at.lookupPath(e,{parent:!0}).node,n=et.basename(e),r=at.lookupNode(t,n),i=at.mayDelete(t,n,!0);if(i)throw new at.ErrnoError(i);if(!t.node_ops.rmdir)throw new at.ErrnoError(63);if(at.isMountpoint(r))throw new at.ErrnoError(10);try{at.trackingDelegate.willDeletePath&&at.trackingDelegate.willDeletePath(e)}catch(t){A("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,n),at.destroyNode(r);try{at.trackingDelegate.onDeletePath&&at.trackingDelegate.onDeletePath(e)}catch(t){A("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=at.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new at.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=at.lookupPath(e,{parent:!0}).node,n=et.basename(e),r=at.lookupNode(t,n),i=at.mayDelete(t,n,!1);if(i)throw new at.ErrnoError(i);if(!t.node_ops.unlink)throw new at.ErrnoError(63);if(at.isMountpoint(r))throw new at.ErrnoError(10);try{at.trackingDelegate.willDeletePath&&at.trackingDelegate.willDeletePath(e)}catch(t){A("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,n),at.destroyNode(r);try{at.trackingDelegate.onDeletePath&&at.trackingDelegate.onDeletePath(e)}catch(t){A("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=at.lookupPath(e).node;if(!t)throw new at.ErrnoError(44);if(!t.node_ops.readlink)throw new at.ErrnoError(28);return nt.resolve(at.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var n=at.lookupPath(e,{follow:!t}).node;if(!n)throw new at.ErrnoError(44);if(!n.node_ops.getattr)throw new at.ErrnoError(63);return n.node_ops.getattr(n)},lstat:function(e){return at.stat(e,!0)},chmod:function(e,t,n){var r;if(!(r="string"==typeof e?at.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new at.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Wh()})},lchmod:function(e,t){at.chmod(e,t,!0)},fchmod:function(e,t){var n=at.getStream(e);if(!n)throw new at.ErrnoError(8);at.chmod(n.node,t)},chown:function(e,t,n,r){var i;if(!(i="string"==typeof e?at.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new at.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Wh()})},lchown:function(e,t,n){at.chown(e,t,n,!0)},fchown:function(e,t,n){var r=at.getStream(e);if(!r)throw new at.ErrnoError(8);at.chown(r.node,t,n)},truncate:function(e,t){if(t<0)throw new at.ErrnoError(28);var n;if(!(n="string"==typeof e?at.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new at.ErrnoError(63);if(at.isDir(n.mode))throw new at.ErrnoError(31);if(!at.isFile(n.mode))throw new at.ErrnoError(28);var r=at.nodePermissions(n,"w");if(r)throw new at.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Wh()})},ftruncate:function(e,t){var n=at.getStream(e);if(!n)throw new at.ErrnoError(8);if(0==(2097155&$b(n)))throw new at.ErrnoError(28);at.truncate(n.node,t)},utime:function(e,t,n){var r=at.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open:function(e,t,n,r,i){if(""===e)throw new at.ErrnoError(44);var s;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?at.modeStringToFlags(t):t)?4095&n|32768:0,"object"==typeof e)s=e;else{e=et.normalize(e);try{s=at.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(s){if(128&t)throw new at.ErrnoError(20)}else s=at.mknod(e,n,0),o=!0;if(!s)throw new at.ErrnoError(44);if(at.isChrdev(s.mode)&&(t&=-513),65536&t&&!at.isDir(s.mode))throw new at.ErrnoError(54);if(!o){var l=at.mayOpen(s,t);if(l)throw new at.ErrnoError(l)}512&t&&at.truncate(s,0),t&=-131713;var c=at.createStream({node:s,path:at.getPath(s),flags:t,seekable:!0,position:0,stream_ops:s.stream_ops,ungotten:[],error:!1},r,i);c.stream_ops.open&&c.stream_ops.open(c),!a.logReadFiles||1&t||(at.readFiles||(at.readFiles={}),e in at.readFiles||(at.readFiles[e]=1,A("FS.trackingDelegate error on read file: "+e)));try{if(at.trackingDelegate.onOpenFile){var u=0;1!=(2097155&t)&&(u|=at.tracking.openFlags.READ),0!=(2097155&t)&&(u|=at.tracking.openFlags.WRITE),at.trackingDelegate.onOpenFile(e,u)}}catch(t){A("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return c},close:function(e){if(at.isClosed(e))throw new at.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{at.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,n){if(at.isClosed(e))throw new at.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new at.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new at.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read:function(e,t,n,r,i){if(n>>>=0,r<0||i<0)throw new at.ErrnoError(28);if(at.isClosed(e))throw new at.ErrnoError(8);if(1==(2097155&$b(e)))throw new at.ErrnoError(8);if(at.isDir(e.node.mode))throw new at.ErrnoError(31);if(!e.stream_ops.read)throw new at.ErrnoError(28);var s=void 0!==i;if(s){if(!e.seekable)throw new at.ErrnoError(70)}else i=e.position;var a=e.stream_ops.read(e,t,n,r,i);return s||(e.position+=a),a},write:function(e,t,n,r,i,s){if(n>>>=0,r<0||i<0)throw new at.ErrnoError(28);if(at.isClosed(e))throw new at.ErrnoError(8);if(0==(2097155&$b(e)))throw new at.ErrnoError(8);if(at.isDir(e.node.mode))throw new at.ErrnoError(31);if(!e.stream_ops.write)throw new at.ErrnoError(28);e.seekable&&1024&$b(e)&&at.llseek(e,0,2);var a=void 0!==i;if(a){if(!e.seekable)throw new at.ErrnoError(70)}else i=e.position;var o=e.stream_ops.write(e,t,n,r,i,s);a||(e.position+=o);try{e.path&&at.trackingDelegate.onWriteToFile&&at.trackingDelegate.onWriteToFile(e.path)}catch(t){A("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return o},allocate:function(e,t,n){if(at.isClosed(e))throw new at.ErrnoError(8);if(t<0||n<=0)throw new at.ErrnoError(28);if(0==(2097155&$b(e)))throw new at.ErrnoError(8);if(!at.isFile(e.node.mode)&&!at.isDir(e.node.mode))throw new at.ErrnoError(43);if(!e.stream_ops.allocate)throw new at.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap:function(e,t,n,r,i,s){if(t>>>=0,0!=(2&i)&&0==(2&s)&&2!=(2097155&$b(e)))throw new at.ErrnoError(2);if(1==(2097155&$b(e)))throw new at.ErrnoError(2);if(!e.stream_ops.mmap)throw new at.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,i,s)},msync:function(e,t,n,r,i){return n>>>=0,e&&e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,i):0},munmap:function(e){return 0},ioctl:function(e,t,n){if(!e.stream_ops.ioctl)throw new at.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile:function(e,t){if((t=t||{}).flags=$b(t)||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var n,r=at.open(e,$b(t)),i=at.stat(e).size,s=new Uint8Array(i);return at.read(r,s,0,i,0),"utf8"===t.encoding?n=U(s,0):"binary"===t.encoding&&(n=s),at.close(r),n},writeFile:function(e,t,n){(n=n||{}).flags=$b(n)||577;var r=at.open(e,$b(n),n.mode);if("string"==typeof t){var i=new Uint8Array(z(t)+1),s=j(t,i,0,i.length);at.write(r,i,0,s,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");at.write(r,t,0,t.byteLength,void 0,n.canOwn)}at.close(r)},cwd:function(){return at.currentPath},chdir:function(e){var t=at.lookupPath(e,{follow:!0});if(null===t.node)throw new at.ErrnoError(44);if(!at.isDir(t.node.mode))throw new at.ErrnoError(54);var n=at.nodePermissions(t.node,"x");if(n)throw new at.ErrnoError(n);at.currentPath=t.path},createDefaultDirectories:function(){at.mkdir("/tmp"),at.mkdir("/home"),at.mkdir("/home/web_user")},createDefaultDevices:function(){at.mkdir("/dev"),at.registerDevice(at.makedev(1,3),{read:function(){return 0},write:function(e,t,n,r,i){return r}}),at.mkdev("/dev/null",at.makedev(1,3)),rt.register(at.makedev(5,0),rt.default_tty_ops),rt.register(at.makedev(6,0),rt.default_tty1_ops),at.mkdev("/dev/tty",at.makedev(5,0)),at.mkdev("/dev/tty1",at.makedev(6,0));var e=tt();at.createDevice("/dev","random",e),at.createDevice("/dev","urandom",e),at.mkdir("/dev/shm"),at.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){at.mkdir("/proc"),at.mkdir("/proc/self"),at.mkdir("/proc/self/fd"),at.mount({mount:function(){var e=at.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(e,t){var n=+t,r=at.getStream(n);if(!r)throw new at.ErrnoError(8);var i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return r.path}}};return i.parent=i,i}},e}},{},"/proc/self/fd")},createStandardStreams:function(){a.stdin?at.createDevice("/dev","stdin",a.stdin):at.symlink("/dev/tty","/dev/stdin"),a.stdout?at.createDevice("/dev","stdout",null,a.stdout):at.symlink("/dev/tty","/dev/stdout"),a.stderr?at.createDevice("/dev","stderr",null,a.stderr):at.symlink("/dev/tty1","/dev/stderr"),at.open("/dev/stdin",0),at.open("/dev/stdout",1),at.open("/dev/stderr",1)},ensureErrnoError:function(){var e;at.ErrnoError||(at.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},at.ErrnoError.prototype=new Error,at.ErrnoError.prototype.constructor=at.ErrnoError,fe(e=[44]).call(e,(function(e){at.genericErrors[e]=new at.ErrnoError(e),at.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){at.ensureErrnoError(),at.nameTable=new Array(4096),at.mount(st,{},"/"),at.createDefaultDirectories(),at.createDefaultDevices(),at.createSpecialDirectories(),at.filesystems={MEMFS:st}},init:function(e,t,n){at.init.initialized=!0,at.ensureErrnoError(),a.stdin=e||a.stdin,a.stdout=t||a.stdout,a.stderr=n||a.stderr,at.createStandardStreams()},quit:function(){at.init.initialized=!1;var e=a._fflush;e&&e(0);for(var t=0;t<at.streams.length;t++){var n=at.streams[t];n&&at.close(n)}},getMode:function(e,t){var n=0;return e&&(n|=365),t&&(n|=146),n},findObject:function(e,t){var n=at.analyzePath(e,t);return n.exists?n.object:null},analyzePath:function(e,t){try{e=(r=at.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=at.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=et.basename(e),r=at.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(e){n.error=e.errno}return n},createPath:function(e,t,n,r){var i;e="string"==typeof e?e:at.getPath(e);for(var s=xe(i=t.split("/")).call(i);s.length;){var a=s.pop();if(a){var o=et.join2(e,a);try{at.mkdir(o)}catch(e){}e=o}}return o},createFile:function(e,t,n,r,i){var s=et.join2("string"==typeof e?e:at.getPath(e),t),a=at.getMode(r,i);return at.create(s,a)},createDataFile:function(e,t,n,r,i,s){var a=t?et.join2("string"==typeof e?e:at.getPath(e),t):e,o=at.getMode(r,i),l=at.create(a,o);if(n){if("string"==typeof n){for(var c=new Array(n.length),u=0,h=n.length;u<h;++u)c[u]=n.charCodeAt(u);n=c}at.chmod(l,146|o);var p=at.open(l,577);at.write(p,n,0,n.length,0,s),at.close(p),at.chmod(l,o)}return l},createDevice:function(e,t,n,r){var i=et.join2("string"==typeof e?e:at.getPath(e),t),s=at.getMode(!!n,!!r);at.createDevice.major||(at.createDevice.major=64);var a=at.makedev(at.createDevice.major++,0);return at.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,t,r,i,s){for(var a=0,o=0;o<i;o++){var l;try{l=n()}catch(e){throw new at.ErrnoError(29)}if(void 0===l&&0===a)throw new at.ErrnoError(6);if(null==l)break;a++,t[r+o]=l}return a&&(e.node.timestamp=Wh()),a},write:function(e,t,n,i,s){for(var a=0;a<i;a++)try{r(t[n+a])}catch(e){throw new at.ErrnoError(29)}return i&&(e.node.timestamp=Wh()),a}}),at.mkdev(i,s,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!g)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Kr(g(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new at.ErrnoError(29)}},createLazyFile:function(e,t,n,r,i){function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,s=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;i||(a=r);var o=this;o.setDataGetter((function(e){var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,r-1),void 0===o.chunks[e]&&(o.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",n,!1),r!==a&&i.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(i.responseType="arraybuffer"),i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+n+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):Kr(i.responseText||"",!0)}(t,i)),void 0===o.chunks[e])throw new Error("doXHR failed!");return o.chunks[e]})),!s&&r||(a=r=1,r=this.getter(0).length,a=r,M("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!d)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new s;X(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var o={isDevice:!1,contents:a}}else o={isDevice:!1,url:n};var l=at.createFile(e,t,o,r,i);o.contents?l.contents=o.contents:o.url&&(l.contents=null,l.url=o.url),X(l,{usedBytes:{get:function(){return this.contents.length}}});var c={},u=J(l.stream_ops);return fe(u).call(u,(function(e){var t=l.stream_ops[e];c[e]=function(){return at.forceLoadFile(l),t.apply(null,arguments)}})),c.read=function(e,t,n,r,i){at.forceLoadFile(l);var s=e.node.contents;if(i>=s.length)return 0;var a=Math.min(s.length-i,r);if(I(s))for(var o=0;o<a;o++)t[n+o]=s[i+o];else for(o=0;o<a;o++)t[n+o]=s.get(i+o);return a},l.stream_ops=c,l},createPreloadedFile:function(e,t,n,r,i,s,o,l,c,u){Browser.init();var h=t?nt.resolve(et.join2(e,t)):e;function p(n){var p;function d(n){u&&u(),l||at.createDataFile(e,t,n,r,i,c),s&&s(),ke()}var m=!1;fe(p=a.preloadPlugins).call(p,(function(e){m||e.canHandle(h)&&(e.handle(n,h,d,(function(){o&&o(),ke()})),m=!0)})),m||d(n)}Le(),"string"==typeof n?Browser.asyncLoad(n,(function(e){p(e)}),o):p(n)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,n){t=t||function(){},n=n||function(){};var r=at.indexedDB();try{var i=r.open(at.DB_NAME(),at.DB_VERSION)}catch(e){return n(e)}i.onupgradeneeded=function(){M("creating db"),i.result.createObjectStore(at.DB_STORE_NAME)},i.onsuccess=function(){var r=i.result.transaction([at.DB_STORE_NAME],"readwrite"),s=r.objectStore(at.DB_STORE_NAME),a=0,o=0,l=e.length;function c(){0==o?t():n()}fe(e).call(e,(function(e){var t=s.put(at.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+o==l&&c()},t.onerror=function(){o++,a+o==l&&c()}})),r.onerror=n},i.onerror=n},loadFilesFromDB:function(e,t,n){t=t||function(){},n=n||function(){};var r=at.indexedDB();try{var i=r.open(at.DB_NAME(),at.DB_VERSION)}catch(e){return n(e)}i.onupgradeneeded=n,i.onsuccess=function(){var r=i.result;try{var s=r.transaction([at.DB_STORE_NAME],"readonly")}catch(e){return void n(e)}var a=s.objectStore(at.DB_STORE_NAME),o=0,l=0,c=e.length;function u(){0==l?t():n()}fe(e).call(e,(function(e){var t=a.get(e);t.onsuccess=function(){at.analyzePath(e).exists&&at.unlink(e),at.createDataFile(et.dirname(e),et.basename(e),t.result,!0,!0,!0),++o+l==c&&u()},t.onerror=function(){l++,o+l==c&&u()}})),s.onerror=n},i.onerror=n}},ot={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,t){if("/"!==t[0]){var n;if(-100===e)n=at.cwd();else{var r=at.getStream(e);if(!r)throw new at.ErrnoError(8);n=r.path}t=et.join2(n,t)}return t},doStat:function(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&et.normalize(t)!==et.normalize(at.getPath(e.node)))return-54;throw e}return $[n>>>2]=r.dev,$[n+4>>>2]=0,$[n+8>>>2]=r.ino,$[n+12>>>2]=r.mode,$[n+16>>>2]=r.nlink,$[n+20>>>2]=r.uid,$[n+24>>>2]=r.gid,$[n+28>>>2]=r.rdev,$[n+32>>>2]=0,He=[r.size>>>0,(Ve=r.size,+Math.abs(Ve)>=1?Ve>0?(0|Math.min(+Math.floor(Ve/4294967296),4294967295))>>>0:~~+Math.ceil((Ve-+(~~Ve>>>0))/4294967296)>>>0:0)],$[n+40>>>2]=He[0],$[n+44>>>2]=He[1],$[n+48>>>2]=4096,$[n+52>>>2]=r.blocks,$[n+56>>>2]=r.atime.getTime()/1e3|0,$[n+60>>>2]=0,$[n+64>>>2]=r.mtime.getTime()/1e3|0,$[n+68>>>2]=0,$[n+72>>>2]=r.ctime.getTime()/1e3|0,$[n+76>>>2]=0,He=[r.ino>>>0,(Ve=r.ino,+Math.abs(Ve)>=1?Ve>0?(0|Math.min(+Math.floor(Ve/4294967296),4294967295))>>>0:~~+Math.ceil((Ve-+(~~Ve>>>0))/4294967296)>>>0:0)],$[n+80>>>2]=He[0],$[n+84>>>2]=He[1],0},doMsync:function(e,t,n,r,i){var s=I(q).call(q,e,e+n);at.msync(t,s,i,n,r)},doMkdir:function(e,t){return"/"===(e=et.normalize(e))[e.length-1]&&(e=I(e).call(e,0,e.length-1)),at.mkdir(e,t,0),0},doMknod:function(e,t,n){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return at.mknod(e,t,n),0},doReadlink:function(e,t,n){if(n<=0)return-28;var r=at.readlink(e),i=Math.min(n,z(r)),s=H[t+i>>>0];return G(r,t,n+1),H[t+i>>>0]=s,i},doAccess:function(e,t){if(-8&t)return-28;var n;if(!(n=at.lookupPath(e,{follow:!0}).node))return-44;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&at.nodePermissions(n,r)?-2:0},doDup:function(e,t,n){var r=at.getStream(n);return r&&at.close(r),at.open(e,t,0,n,n).fd},doReadv:function(e,t,n,r){for(var i=0,s=0;s<n;s++){var a=$[t+8*s>>>2],o=$[t+(8*s+4)>>>2],l=at.read(e,H,a,o,r);if(l<0)return-1;if(i+=l,l<o)break}return i},doWritev:function(e,t,n,r){for(var i=0,s=0;s<n;s++){var a=$[t+8*s>>>2],o=$[t+(8*s+4)>>>2],l=at.write(e,H,a,o,r);if(l<0)return-1;i+=l}return i},varargs:void 0,get:function(){return ot.varargs+=4,$[ot.varargs-4>>>2]},getStr:function(e){return B(e)},getStreamFromFD:function(e){var t=at.getStream(e);if(!t)throw new at.ErrnoError(8);return t},get64:function(e,t){return e}};function lt(e,t,n){ot.varargs=n;try{var r=ot.getStreamFromFD(e);switch(t){case 0:return(i=ot.get())<0?-28:at.open(r.path,$b(r),0,i).fd;case 1:case 2:case 13:case 14:return 0;case 3:return $b(r);case 4:var i=ot.get();return r.flags|=i,0;case 12:return i=ot.get(),W[i+0>>>1]=2,0;case 16:case 8:default:return-28;case 9:return Qe(28),-1}}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),-e.errno}}function ct(e,t,n){ot.varargs=n;try{var r=ot.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return r.tty?0:-59;case 21519:if(!r.tty)return-59;var i=ot.get();return $[i>>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:return i=ot.get(),at.ioctl(r,t,i);default:Fe("bad ioctl syscall "+t)}}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),-e.errno}}function ut(e,t,n){ot.varargs=n;try{var r=ot.getStr(e),i=ot.get();return at.open(r,t,i).fd}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),-e.errno}}var ht={};function pt(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function dt(e){return this.fromWireType(Z[e>>>2])}var mt={},ft={},gt={},_t=48,vt=57;function yt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=_t&&t<=vt?"_"+e:e}function bt(e,t){return e=yt(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function xt(e,t){var n=bt(t,(function(e){this.name=t,this.message=e;var n=new Error(e).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Cp(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Tt=void 0;function wt(e){throw new Tt(e)}function Et(e,t,n){function r(t){var r=n(t);r.length!==e.length&&wt("Mismatched type converter count");for(var i=0;i<e.length;++i)Nt(e[i],r[i])}fe(e).call(e,(function(e){gt[e]=t}));var i=new Array(t.length),s=[],a=0;fe(t).call(t,(function(e,t){ft.hasOwnProperty(e)?i[t]=ft[e]:(s.push(e),mt.hasOwnProperty(e)||(mt[e]=[]),mt[e].push((function(){i[t]=ft[e],++a===s.length&&r(i)})))})),0===s.length&&r(i)}function St(e){var t,n=ht[e];delete ht[e];var r=n.elements,i=r.length,s=ye(t=K(r).call(r,(function(e){return e.getterReturnType}))).call(t,K(r).call(r,(function(e){return e.setterArgumentType}))),a=n.rawConstructor,o=n.rawDestructor;Et([e],s,(function(e){return fe(r).call(r,(function(t,n){var r=e[n],s=t.getter,a=t.getterContext,o=e[n+i],l=t.setter,c=t.setterContext;t.read=function(e){return r.fromWireType(s(a,e))},t.write=function(e,t){var n=[];l(c,e,o.toWireType(n,t)),pt(n)}})),[{name:n.name,fromWireType:function(e){for(var t=new Array(i),n=0;n<i;++n)t[n]=r[n].read(e);return o(e),t},toWireType:function(e,t){if(i!==t.length)throw new TypeError("Incorrect number of tuple elements for "+n.name+": expected="+i+", actual="+t.length);for(var s=a(),l=0;l<i;++l)r[l].write(s,t[l]);return null!==e&&e.push(o,s),s},argPackAdvance:8,readValueFromPointer:dt,destructorFunction:o}]}))}var It={};function Mt(e){var t,n=It[e];delete It[e];var r=n.rawConstructor,i=n.rawDestructor,s=n.fields;Et([e],ye(t=K(s).call(s,(function(e){return e.getterReturnType}))).call(t,K(s).call(s,(function(e){return e.setterArgumentType}))),(function(e){var t={};return fe(s).call(s,(function(n,r){var i=n.fieldName,a=e[r],o=n.getter,l=n.getterContext,c=e[r+s.length],u=n.setter,h=n.setterContext;t[i]={read:function(e){return a.fromWireType(o(l,e))},write:function(e,t){var n=[];u(h,e,c.toWireType(n,t)),pt(n)}}})),[{name:n.name,fromWireType:function(e){var n={};for(var r in t)n[r]=t[r].read(e);return i(e),n},toWireType:function(e,n){for(var s in t)if(!(s in n))throw new TypeError('Missing field: "'+s+'"');var a=r();for(s in t)t[s].write(a,n[s]);return null!==e&&e.push(i,a),a},argPackAdvance:8,readValueFromPointer:dt,destructorFunction:i}]}))}function At(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function Rt(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Dt=e}var Dt=void 0;function Ct(e){for(var t="",n=e;q[n>>>0];)t+=Dt[q[n++>>>0]];return t}var Ot=void 0;function Pt(e){throw new Ot(e)}function Nt(e,t,n){if(n=n||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(e||Pt('type "'+r+'" must have a positive integer typeid pointer'),ft.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Pt("Cannot register type '"+r+"' twice")}if(ft[e]=t,delete gt[e],mt.hasOwnProperty(e)){var i=mt[e];delete mt[e],fe(i).call(i,(function(e){e()}))}}function Lt(e,t,n,r,i){var s=At(n);Nt(e,{name:t=Ct(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:i},argPackAdvance:8,readValueFromPointer:function(e){var r;if(1===n)r=H;else if(2===n)r=W;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+t);r=$}return this.fromWireType(r[e>>>s])},destructorFunction:null})}function kt(e){if(!(this instanceof Jt))return!1;if(!(e instanceof Jt))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return t===r&&n===i}function Ft(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function Ut(e){Pt(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Bt=!1;function jt(e){}function Gt(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function zt(e){e.count.value-=1,0===e.count.value&&Gt(e)}function Vt(e){return"undefined"==typeof FinalizationGroup?(Vt=function(e){return e},e):(Bt=new FinalizationGroup((function(e){for(var t=e.next();!t.done;t=e.next()){var n=t.value;n.ptr?zt(n):console.warn("object already deleted: "+n.ptr)}})),jt=function(e){Bt.unregister(e.$$)},(Vt=function(e){return Bt.register(e,e.$$,e.$$),e})(e))}function Ht(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Vt(Cp(Tp(this),{$$:{value:Ft(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function qt(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pt("Object already scheduled for deletion"),jt(this),zt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Wt(){return!this.$$.ptr}var Yt=void 0,Xt=[];function $t(){for(;Xt.length;){var e=Xt.pop();e.$$.deleteScheduled=!1,e.delete()}}function Kt(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pt("Object already scheduled for deletion"),Xt.push(this),1===Xt.length&&Yt&&Yt($t),this.$$.deleteScheduled=!0,this}function Zt(){Jt.prototype.isAliasOf=kt,Jt.prototype.clone=Ht,Jt.prototype.delete=qt,Jt.prototype.isDeleted=Wt,Jt.prototype.deleteLater=Kt}function Jt(){}var Qt={};function en(e,t,n){if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Pt("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}}function tn(e,t,n){a.hasOwnProperty(e)?((void 0===n||void 0!==a[e].overloadTable&&void 0!==a[e].overloadTable[n])&&Pt("Cannot register public name '"+e+"' twice"),en(a,e,e),a.hasOwnProperty(n)&&Pt("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),a[e].overloadTable[n]=t):(a[e]=t,void 0!==n&&(a[e].numArguments=n))}function nn(e,t,n,r,i,s,a,o){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=s,this.upcast=a,this.downcast=o,this.pureVirtualFunctions=[]}function rn(e,t,n){for(;t!==n;)t.upcast||Pt("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function sn(e,t){if(null===t)return this.isReference&&Pt("null is not a valid "+this.name),0;t.$$||Pt('Cannot pass "'+Vn(t)+'" as a '+this.name),t.$$.ptr||Pt("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass;return rn(t.$$.ptr,n,this.registeredClass)}function an(e,t){var n;if(null===t)return this.isReference&&Pt("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||Pt('Cannot pass "'+Vn(t)+'" as a '+this.name),t.$$.ptr||Pt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Pt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;if(n=rn(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Pt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Pt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var i=t.clone();n=this.rawShare(n,Gn((function(){i.delete()}))),null!==e&&e.push(this.rawDestructor,n)}break;default:Pt("Unsupporting sharing policy")}return n}function on(e,t){if(null===t)return this.isReference&&Pt("null is not a valid "+this.name),0;t.$$||Pt('Cannot pass "'+Vn(t)+'" as a '+this.name),t.$$.ptr||Pt("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Pt("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;return rn(t.$$.ptr,n,this.registeredClass)}function ln(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function cn(e){this.rawDestructor&&this.rawDestructor(e)}function un(e){null!==e&&e.delete()}function hn(e,t,n){if(t===n)return e;if(void 0===n.baseClass)return null;var r=hn(e,t,n.baseClass);return null===r?null:n.downcast(r)}function pn(){return J(gn).length}function dn(){var e=[];for(var t in gn)gn.hasOwnProperty(t)&&e.push(gn[t]);return e}function mn(e){Yt=e,Xt.length&&Yt&&Yt($t)}function fn(){a.getInheritedInstanceCount=pn,a.getLiveInheritedInstances=dn,a.flushPendingDeletes=$t,a.setDelayFunction=mn}var gn={};function _n(e,t){for(void 0===t&&Pt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function vn(e,t){return t=_n(e,t),gn[t]}function yn(e,t){return t.ptrType&&t.ptr||wt("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&wt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Vt(Cp(e,{$$:{value:t}}))}function bn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=vn(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function i(){return this.isSmartPointer?yn(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):yn(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,a=this.registeredClass.getActualType(t),o=Qt[a];if(!o)return i.call(this);s=this.isConst?o.constPointerType:o.pointerType;var l=hn(t,this.registeredClass,s.registeredClass);return null===l?i.call(this):this.isSmartPointer?yn(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):yn(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function xn(){Tn.prototype.getPointee=ln,Tn.prototype.destructor=cn,Tn.prototype.argPackAdvance=8,Tn.prototype.readValueFromPointer=dt,Tn.prototype.deleteObject=un,Tn.prototype.fromWireType=bn}function Tn(e,t,n,r,i,s,a,o,l,c,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=s,this.sharingPolicy=a,this.rawGetPointee=o,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,i||void 0!==t.baseClass?this.toWireType=an:r?(this.toWireType=sn,this.destructorFunction=null):(this.toWireType=on,this.destructorFunction=null)}function wn(e,t,n){a.hasOwnProperty(e)||wt("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==n?a[e].overloadTable[n]=t:(a[e]=t,a[e].argCount=n)}function En(e,t){k(T(e).call(e,"j")>=0,"getDynCaller should only be called with i64 sigs");var n=[];return function(){n.length=arguments.length;for(var r=0;r<arguments.length;r++)n[r]=arguments[r];return Ze(e,t,n)}}function Sn(e,t){e=Ct(e);var n=-1!=T(e).call(e,"j")?En(e,t):de.get(t);return"function"!=typeof n&&Pt("unknown function pointer with signature "+e+": "+t),n}var In=void 0;function Mn(e){var t=ti(e),n=Ct(t);return ri(t),n}function An(e,t){var n=[],r={};throw fe(t).call(t,(function e(t){var i;r[t]||ft[t]||(gt[t]?fe(i=gt[t]).call(i,e):(n.push(t),r[t]=!0))})),new In(e+": "+K(n).call(n,Mn).join([", "]))}function Rn(e,t,n,r,i,s,a,o,l,c,u,h,p){u=Ct(u),s=Sn(i,s),o&&(o=Sn(a,o)),c&&(c=Sn(l,c)),p=Sn(h,p);var d=yt(u);tn(d,(function(){An("Cannot construct "+u+" due to unbound types",[r])})),Et([e,t,n],r?[r]:[],(function(t){var n,i;t=t[0],i=r?(n=t.registeredClass).instancePrototype:Jt.prototype;var a=bt(d,(function(){if(Tp(this)!==l)throw new Ot("Use 'new' to construct "+u);if(void 0===h.constructor_body)throw new Ot(u+" has no accessible constructor");var e=h.constructor_body[arguments.length];if(void 0===e)throw new Ot("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+J(h.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),l=Cp(i,{constructor:{value:a}});a.prototype=l;var h=new nn(u,a,l,p,n,s,o,c),m=new Tn(u,h,!0,!1,!1),f=new Tn(u+"*",h,!1,!1,!1),g=new Tn(u+" const*",h,!1,!0,!1);return Qt[e]={pointerType:f,constPointerType:g},wn(d,a),[m,f,g]}))}function Dn(e,t){for(var n=[],r=0;r<e;r++)n.push($[(t>>2)+r>>>0]);return n}function Cn(e,t,n,r,i,s){k(t>0);var a=Dn(t,n);i=Sn(r,i);var o=[s],l=[];Et([],[e],(function(e){var n="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Ot("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=function(){An("Cannot construct "+e.name+" due to unbound types",a)},Et([],a,(function(r){return e.registeredClass.constructor_body[t-1]=function(){arguments.length!==t-1&&Pt(n+" called with "+arguments.length+" arguments, expected "+(t-1)),l.length=0,o.length=t;for(var e=1;e<t;++e)o[e]=r[e].toWireType(l,arguments[e-1]);var s=i.apply(null,o);return pt(l),r[0].fromWireType(s)},[]})),[]}))}function On(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=bt(e.name||"unknownFunctionName",(function(){}));n.prototype=e.prototype;var r=new n,i=e.apply(r,t);return i instanceof Object?i:r}function Pn(e,t,n,r,i){var s=t.length;s<2&&Pt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==n,o=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){o=!0;break}var c="void"!==t[0].name,u="",h="";for(l=0;l<s-2;++l)u+=(0!==l?", ":"")+"arg"+l,h+=(0!==l?", ":"")+"arg"+l+"Wired";var p="return function "+yt(e)+"("+u+") {\nif (arguments.length !== "+(s-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(s-2)+" args!');\n}\n";o&&(p+="var destructors = [];\n");var d=o?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],f=[Pt,r,i,pt,t[0],t[1]];for(a&&(p+="var thisWired = classParam.toWireType("+d+", this);\n"),l=0;l<s-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+d+", arg"+l+"); // "+t[l+2].name+"\n",m.push("argType"+l),f.push(t[l+2]);if(a&&(h="thisWired"+(h.length>0?", ":"")+h),p+=(c?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",o)p+="runDestructors(destructors);\n";else for(l=a?1:2;l<t.length;++l){var g=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(p+=g+"_dtor("+g+"); // "+t[l].name+"\n",m.push(g+"_dtor"),f.push(t[l].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),On(Function,m).apply(null,f)}function Nn(e,t,n,r,i,s,a,o){var l=Dn(n,r);t=Ct(t),s=Sn(i,s),Et([],[e],(function(e){var r=(e=e[0]).name+"."+t;function i(){An("Cannot call "+r+" due to unbound types",l)}o&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,u=c[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===n-2?(i.argCount=n-2,i.className=e.name,c[t]=i):(en(c,t,r),c[t].overloadTable[n-2]=i),Et([],l,(function(i){var o=Pn(r,i,e,s,a);return void 0===c[t].overloadTable?(o.argCount=n-2,c[t]=o):c[t].overloadTable[n-2]=o,[]})),[]}))}var Ln=[],kn=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Fn(e){e>4&&0==--kn[e].refcount&&(kn[e]=void 0,Ln.push(e))}function Un(){for(var e=0,t=5;t<kn.length;++t)void 0!==kn[t]&&++e;return e}function Bn(){for(var e=5;e<kn.length;++e)if(void 0!==kn[e])return kn[e];return null}function jn(){a.count_emval_handles=Un,a.get_first_emval=Bn}function Gn(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Ln.length?Ln.pop():kn.length;return kn[t]={refcount:1,value:e},t}}function zn(e,t){Nt(e,{name:t=Ct(t),fromWireType:function(e){var t=kn[e].value;return Fn(e),t},toWireType:function(e,t){return Gn(t)},argPackAdvance:8,readValueFromPointer:dt,destructorFunction:null})}function Vn(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Hn(e,t){switch(t){case 2:return function(e){return this.fromWireType(Q[e>>>2])};case 3:return function(e){return this.fromWireType(ee[e>>>3])};default:throw new TypeError("Unknown float type: "+e)}}function qn(e,t,n){var r=At(n);Nt(e,{name:t=Ct(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Vn(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:Hn(t,r),destructorFunction:null})}function Wn(e,t,n,r,i,s){var a=Dn(t,n);e=Ct(e),i=Sn(r,i),tn(e,(function(){An("Cannot call "+e+" due to unbound types",a)}),t-1),Et([],a,(function(n){var r,a=ye(r=[n[0],null]).call(r,I(n).call(n,1));return wn(e,Pn(e,a,null,i,s),t-1),[]}))}function Yn(e,t,n){switch(t){case 0:return n?function(e){return H[e>>>0]}:function(e){return q[e>>>0]};case 1:return n?function(e){return W[e>>>1]}:function(e){return Y[e>>>1]};case 2:return n?function(e){return $[e>>>2]}:function(e){return Z[e>>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function Xn(e,t,n,r,i){t=Ct(t),-1===i&&(i=4294967295);var s=At(n),a=function(e){return e};if(0===r){var o=32-8*n;a=function(e){return e<<o>>>o}}var l=-1!=T(t).call(t,"unsigned");Nt(e,{name:t,fromWireType:a,toWireType:function(e,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+Vn(n)+'" to '+this.name);if(n<r||n>i)throw new TypeError('Passing a number "'+Vn(n)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+i+"]!");return l?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:Yn(t,s,0!==r),destructorFunction:null})}function $n(e,t,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=Z,n=t[(e>>=2)>>>0],i=t[e+1>>>0];return new r(V,i,n)}Nt(e,{name:n=Ct(n),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})}function Kn(e,t){var n="std::string"===(t=Ct(t));Nt(e,{name:t,fromWireType:function(e){var t,r=Z[e>>>2];if(n)for(var i=e+4,s=0;s<=r;++s){var a=e+4+s;if(s==r||0==q[a>>>0]){var o=B(i,a-i);void 0===t?t=o:(t+=String.fromCharCode(0),t+=o),i=a+1}}else{var l=new Array(r);for(s=0;s<r;++s)l[s]=String.fromCharCode(q[e+4+s>>>0]);t=l.join("")}return ri(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Pt("Cannot pass non-string to std::string");var i=(n&&r?function(){return z(t)}:function(){return t.length})(),s=ei(4+i+1);if(Z[(s>>>=0)>>>2]=i,n&&r)G(t,s+4,i+1);else if(r)for(var a=0;a<i;++a){var o=t.charCodeAt(a);o>255&&(ri(s),Pt("String has UTF-16 code units that do not fit in 8 bits")),q[s+4+a>>>0]=o}else for(a=0;a<i;++a)q[s+4+a>>>0]=t[a];return null!==e&&e.push(ri,s),s},argPackAdvance:8,readValueFromPointer:dt,destructorFunction:function(e){ri(e)}})}function Zn(e,t,n){var r,i,s,a,o;n=Ct(n),2===t?(r=ne,i=re,a=ie,s=function(){return Y},o=1):4===t&&(r=se,i=ae,a=le,s=function(){return Z},o=2),Nt(e,{name:n,fromWireType:function(e){for(var n,i=Z[e>>>2],a=s(),l=e+4,c=0;c<=i;++c){var u=e+4+c*t;if(c==i||0==a[u>>>o]){var h=r(l,u-l);void 0===n?n=h:(n+=String.fromCharCode(0),n+=h),l=u+t}}return ri(e),n},toWireType:function(e,r){"string"!=typeof r&&Pt("Cannot pass non-string to C++ string type "+n);var s=a(r),l=ei(4+s+t);return Z[(l>>>=0)>>>2]=s>>o,i(r,l+4,s+t),null!==e&&e.push(ri,l),l},argPackAdvance:8,readValueFromPointer:dt,destructorFunction:function(e){ri(e)}})}function Jn(e,t,n,r,i,s){ht[e]={name:Ct(t),rawConstructor:Sn(n,r),rawDestructor:Sn(i,s),elements:[]}}function Qn(e,t,n,r,i,s,a,o,l){ht[e].elements.push({getterReturnType:t,getter:Sn(n,r),getterContext:i,setterArgumentType:s,setter:Sn(a,o),setterContext:l})}function er(e,t,n,r,i,s){It[e]={name:Ct(t),rawConstructor:Sn(n,r),rawDestructor:Sn(i,s),fields:[]}}function tr(e,t,n,r,i,s,a,o,l,c){It[e].fields.push({fieldName:Ct(t),getterReturnType:n,getter:Sn(r,i),getterContext:s,setterArgumentType:a,setter:Sn(o,l),setterContext:c})}function nr(e,t){Nt(e,{isVoid:!0,name:t=Ct(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function rr(e){return e||Pt("Cannot use deleted val. handle = "+e),kn[e].value}function ir(e,t){var n=ft[e];return void 0===n&&Pt(t+" has unknown type "+Mn(e)),n}function sr(e,t,n){e=rr(e),t=ir(t,"emval::as");var r=[],i=Gn(r);return $[n>>>2]=i,t.toWireType(r,e)}function ar(e,t){for(var n=new Array(e),r=0;r<e;++r)n[r]=ir($[(t>>2)+r>>>0],"parameter "+r);return n}function or(e,t,n,r){e=rr(e);for(var i=ar(t,n),s=new Array(t),a=0;a<t;++a){var o=i[a];s[a]=o.readValueFromPointer(r),r+=o.argPackAdvance}return Gn(e.apply(void 0,s))}var lr,cr={};function ur(e){var t=cr[e];return void 0===t?Ct(e):t}function hr(){return"object"==typeof iA?iA:Function("return this")()}function pr(e){return 0===e?Gn(hr()):(e=ur(e),Gn(hr()[e]))}function dr(e,t){return Gn((e=rr(e))[t=rr(t)])}function mr(e){e>4&&(kn[e].refcount+=1)}function fr(e,t){return(e=rr(e))instanceof(t=rr(t))}function gr(e){return"number"==typeof(e=rr(e))}function _r(){return Gn([])}function vr(e){return Gn(ur(e))}function yr(){return Gn({})}function br(e){pt(kn[e].value),Fn(e)}function xr(e,t,n){e=rr(e),t=rr(t),n=rr(n),e[t]=n}function Tr(e,t){return Gn((e=ir(e,"_emval_take_value")).readValueFromPointer(t))}function wr(){Fe()}lr=m?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var Er=!0;function Sr(e,t){var n;if(0===e)n=Wh();else{if(1!==e&&4!==e||!Er)return Qe(28),-1;n=lr()}return $[t>>>2]=n/1e3|0,$[t+4>>>2]=n%1e3*1e3*1e3|0,0}function Ir(e,t,n){sA(q).call(q,e>>>0,t>>>0,t+n>>>0)}function Mr(){return q.length}function Ar(e){try{return P.grow(e-V.byteLength+65535>>>16),pe(P.buffer),1}catch(e){}}function Rr(e){e>>>=0;var t=Mr(),n=4294967296;if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),Ar(Math.min(n,he(Math.max(16777216,e,i),65536))))return!0}return!1}var Dr={};function Cr(){return u||"./this.program"}function Or(){if(!Or.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Cr()};for(var t in Dr)e[t]=Dr[t];var n=[];for(var t in e)n.push(t+"="+e[t]);Or.strings=n}return Or.strings}function Pr(e,t){try{var n,r=0;return fe(n=Or()).call(n,(function(n,i){var s=t+r;$[e+4*i>>>2]=s,ue(n,s),r+=n.length+1})),0}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),e.errno}}function Nr(e,t){try{var n=Or();$[e>>>2]=n.length;var r=0;return fe(n).call(n,(function(e){r+=e.length+1})),$[t>>>2]=r,0}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),e.errno}}function Lr(e){try{var t=ot.getStreamFromFD(e);return at.close(t),0}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),e.errno}}function kr(e,t,n,r){try{var i=ot.getStreamFromFD(e),s=ot.doReadv(i,t,n);return $[r>>>2]=s,0}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),e.errno}}function Fr(e,t,n,r,i){try{var s=ot.getStreamFromFD(e),a=4294967296*n+(t>>>0),o=9007199254740992;return a<=-o||a>=o?-61:(at.llseek(s,a,r),He=[s.position>>>0,(Ve=s.position,+Math.abs(Ve)>=1?Ve>0?(0|Math.min(+Math.floor(Ve/4294967296),4294967295))>>>0:~~+Math.ceil((Ve-+(~~Ve>>>0))/4294967296)>>>0:0)],$[i>>>2]=He[0],$[i+4>>>2]=He[1],s.getdents&&0===a&&0===r&&(s.getdents=null),0)}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),e.errno}}function Ur(e,t,n,r){try{var i=ot.getStreamFromFD(e),s=ot.doWritev(i,t,n);return $[r>>>2]=s,0}catch(e){return void 0!==at&&e instanceof at.ErrnoError||Fe(e),e.errno}}function Br(e){N(0|e)}function jr(e){return e%4==0&&(e%100!=0||e%400==0)}function Gr(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var zr=[31,29,31,30,31,30,31,31,30,31,30,31],Vr=[31,28,31,30,31,30,31,31,30,31,30,31];function Hr(e,t){for(var n=new Date(e.getTime());t>0;){var r=jr(n.getFullYear()),i=n.getMonth(),s=(r?zr:Vr)[i];if(!(t>s-n.getDate()))return n.setDate(n.getDate()+t),n;t-=s-n.getDate()+1,n.setDate(1),i<11?n.setMonth(i+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function qr(e,t,n,r){var i=$[r+40>>>2],s={tm_sec:$[r>>>2],tm_min:$[r+4>>>2],tm_hour:$[r+8>>>2],tm_mday:$[r+12>>>2],tm_mon:$[r+16>>>2],tm_year:$[r+20>>>2],tm_wday:$[r+24>>>2],tm_yday:$[r+28>>>2],tm_isdst:$[r+32>>>2],tm_gmtoff:$[r+36>>>2],tm_zone:i?B(i):""},a=B(n),o={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in o)a=a.replace(new RegExp(l,"g"),o[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=n[0]+r;return r}function p(e,t){return h(e,t,"0")}function d(e,t){function n(e){return e<0?-1:e>0?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function m(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function f(e){var t=Hr(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),i=m(n),s=m(r);return d(i,t)<=0?d(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return p((e.tm_year+1900)/100|0,2)},"%d":function(e){return p(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return f(e).toString().substring(2)},"%G":function(e){return f(e)},"%H":function(e){return p(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":function(e){return p(e.tm_mday+Gr(jr(e.tm_year+1900)?zr:Vr,e.tm_mon-1),3)},"%m":function(e){return p(e.tm_mon+1,2)},"%M":function(e){return p(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return p(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),n=0===t.getDay()?t:Hr(t,7-t.getDay()),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(n,r)<0){var i=Gr(jr(r.getFullYear())?zr:Vr,r.getMonth()-1)-31,s=31-n.getDate()+i+r.getDate();return p(Math.ceil(s/7),2)}return 0===d(n,t)?"01":"00"},"%V":function(e){var t,n=new Date(e.tm_year+1900,0,4),r=new Date(e.tm_year+1901,0,4),i=m(n),s=m(r),a=Hr(new Date(e.tm_year+1900,0,1),e.tm_yday);return d(a,i)<0?"53":d(s,a)<=0?"01":(t=i.getFullYear()<e.tm_year+1900?e.tm_yday+32-i.getDate():e.tm_yday+1-i.getDate(),p(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),n=1===t.getDay()?t:Hr(t,0===t.getDay()?1:7-t.getDay()+1),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(n,r)<0){var i=Gr(jr(r.getFullYear())?zr:Vr,r.getMonth()-1)-31,s=31-n.getDate()+i+r.getDate();return p(Math.ceil(s/7),2)}return 0===d(n,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t,n=e.tm_gmtoff,r=n>=0;return n=(n=Math.abs(n)/60)/60*100+n%60,(r?"+":"-")+I(t=String("0000"+n)).call(t,-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in g)T(a).call(a,l)>=0&&(a=a.replace(new RegExp(l,"g"),g[l](s)));var _=Kr(a,!1);return _.length>t?0:(ce(_,e),_.length-1)}function Wr(e,t,n,r){return qr(e,t,n,r)}var Yr=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=at.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r},Xr=365,$r=146;function Kr(e,t,n){var r=n>0?n:z(e)+1,i=new Array(r),s=j(e,i,0,i.length);return t&&(i.length=s),i}X(Yr.prototype,{read:{get:function(){return(this.mode&Xr)===Xr},set:function(e){e?this.mode|=Xr:this.mode&=~Xr}},write:{get:function(){return(this.mode&$r)===$r},set:function(e){e?this.mode|=$r:this.mode&=~$r}},isFolder:{get:function(){return at.isDir(this.mode)}},isDevice:{get:function(){return at.isChrdev(this.mode)}}}),at.FSNode=Yr,at.staticInit(),a.FS_createPath=at.createPath,a.FS_createDataFile=at.createDataFile,a.FS_createPreloadedFile=at.createPreloadedFile,a.FS_createLazyFile=at.createLazyFile,a.FS_createDevice=at.createDevice,a.FS_unlink=at.unlink,Tt=a.InternalError=xt(Error,"InternalError"),Rt(),Ot=a.BindingError=xt(Error,"BindingError"),Zt(),xn(),fn(),In=a.UnboundTypeError=xt(Error,"UnboundTypeError"),jn(),ve.push({func:function(){Qr()}});var Zr,Jr={x:Je,A:lt,P:ct,Q:ut,U:St,s:Mt,S:Lt,v:Rn,u:Cn,d:Nn,R:zn,C:qn,h:Wn,m:Xn,k:$n,D:Kn,w:Zn,V:Jn,g:Qn,t:er,j:tr,T:nr,q:sr,W:or,b:Fn,F:pr,n:dr,l:mr,N:fr,E:gr,y:_r,f:vr,r:yr,p:br,i:xr,e:Tr,c:wr,M:Sr,I:Ir,o:Rr,K:Pr,L:Nr,B:Lr,O:kr,G:Fr,z:Ur,a:P,H:Br,J:Wr},Qr=(Xe(),a.___wasm_call_ctors=function(){return(Qr=a.___wasm_call_ctors=a.asm.Y).apply(null,arguments)}),ei=(a._main=function(){return(a._main=a.asm.Z).apply(null,arguments)},a._malloc=function(){return(ei=a._malloc=a.asm._).apply(null,arguments)}),ti=a.___getTypeName=function(){return(ti=a.___getTypeName=a.asm.$).apply(null,arguments)},ni=(a.___embind_register_native_and_builtin_types=function(){return(a.___embind_register_native_and_builtin_types=a.asm.aa).apply(null,arguments)},a.___errno_location=function(){return(ni=a.___errno_location=a.asm.ba).apply(null,arguments)}),ri=a._free=function(){return(ri=a._free=a.asm.ca).apply(null,arguments)};function ii(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function si(e){var t=a._main;try{oi(t(0,0),!0)}catch(e){if(e instanceof ii)return;if("unwind"==e)return void(O=!0);var n=e;e&&"object"==typeof e&&e.stack&&(n=[e,e.stack]),A("exception thrown: "+n),h(1,e)}}function ai(e){function t(){Zr||(Zr=!0,a.calledRun=!0,L||(Ee(),Se(),i(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),li&&si(),Me()))}e=e||c,Oe>0||(we(),Oe>0||(a.setStatus?(a.setStatus("Running..."),Ae((function(){Ae((function(){a.setStatus("")}),1),t()}),1)):t()))}function oi(e,t){t&&O&&0===e||(O||(Ie(),a.onExit&&a.onExit(e),L=!0),h(e,new ii(e)))}if(a.dynCall_jiji=function(){return(a.dynCall_jiji=a.asm.da).apply(null,arguments)},a.dynCall_viijii=function(){return(a.dynCall_viijii=a.asm.ea).apply(null,arguments)},a.dynCall_iiiiiijj=function(){return(a.dynCall_iiiiiijj=a.asm.fa).apply(null,arguments)},a.dynCall_iiiiij=function(){return(a.dynCall_iiiiij=a.asm.ga).apply(null,arguments)},a.dynCall_iiiiijj=function(){return(a.dynCall_iiiiijj=a.asm.ha).apply(null,arguments)},a.addRunDependency=Le,a.removeRunDependency=ke,a.FS_createPath=at.createPath,a.FS_createDataFile=at.createDataFile,a.FS_createPreloadedFile=at.createPreloadedFile,a.FS_createLazyFile=at.createLazyFile,a.FS_createDevice=at.createDevice,a.FS_unlink=at.unlink,a.FS=at,Ne=function e(){Zr||ai(),Zr||(Ne=e)},a.run=ai,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();var li=!0;return a.noInitialRun&&(li=!1),O=!0,ai(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=r:"function"==typeof define&&define.amd?define([],(function(){return r})):"object"==typeof e&&(e.WebIFCWasm=r)}}),gA=103090709,_A=160246688,vA=2655215786,yA=3242617779,bA=4186316022,xA=781010003,TA={3821786052:e=>wO.FromTape(e.ID,e.type,e.arguments),2296667514:e=>EO.FromTape(e.ID,e.type,e.arguments),3630933823:e=>SO.FromTape(e.ID,e.type,e.arguments),4288193352:e=>IO.FromTape(e.ID,e.type,e.arguments),2874132201:e=>MO.FromTape(e.ID,e.type,e.arguments),618182010:e=>AO.FromTape(e.ID,e.type,e.arguments),1635779807:e=>RO.FromTape(e.ID,e.type,e.arguments),2603310189:e=>DO.FromTape(e.ID,e.type,e.arguments),3406155212:e=>CO.FromTape(e.ID,e.type,e.arguments),1634111441:e=>OO.FromTape(e.ID,e.type,e.arguments),177149247:e=>PO.FromTape(e.ID,e.type,e.arguments),1411407467:e=>NO.FromTape(e.ID,e.type,e.arguments),3352864051:e=>LO.FromTape(e.ID,e.type,e.arguments),2056796094:e=>kO.FromTape(e.ID,e.type,e.arguments),1871374353:e=>FO.FromTape(e.ID,e.type,e.arguments),3087945054:e=>UO.FromTape(e.ID,e.type,e.arguments),3001207471:e=>BO.FromTape(e.ID,e.type,e.arguments),325726236:e=>jO.FromTape(e.ID,e.type,e.arguments),749761778:e=>GO.FromTape(e.ID,e.type,e.arguments),3199563722:e=>zO.FromTape(e.ID,e.type,e.arguments),2483840362:e=>VO.FromTape(e.ID,e.type,e.arguments),3379348081:e=>HO.FromTape(e.ID,e.type,e.arguments),3239324667:e=>qO.FromTape(e.ID,e.type,e.arguments),4263986512:e=>WO.FromTape(e.ID,e.type,e.arguments),53199957:e=>YO.FromTape(e.ID,e.type,e.arguments),2029264950:e=>XO.FromTape(e.ID,e.type,e.arguments),3512275521:e=>$O.FromTape(e.ID,e.type,e.arguments),1674181508:e=>KO.FromTape(e.ID,e.type,e.arguments),669184980:e=>ZO.FromTape(e.ID,e.type,e.arguments),639542469:e=>JO.FromTape(e.ID,e.type,e.arguments),411424972:e=>QO.FromTape(e.ID,e.type,e.arguments),130549933:e=>eP.FromTape(e.ID,e.type,e.arguments),3869604511:e=>tP.FromTape(e.ID,e.type,e.arguments),3798115385:e=>nP.FromTape(e.ID,e.type,e.arguments),1310608509:e=>rP.FromTape(e.ID,e.type,e.arguments),2705031697:e=>iP.FromTape(e.ID,e.type,e.arguments),3460190687:e=>sP.FromTape(e.ID,e.type,e.arguments),3207858831:e=>aP.FromTape(e.ID,e.type,e.arguments),277319702:e=>oP.FromTape(e.ID,e.type,e.arguments),1532957894:e=>lP.FromTape(e.ID,e.type,e.arguments),4261334040:e=>cP.FromTape(e.ID,e.type,e.arguments),3125803723:e=>uP.FromTape(e.ID,e.type,e.arguments),2740243338:e=>hP.FromTape(e.ID,e.type,e.arguments),1967976161:e=>pP.FromTape(e.ID,e.type,e.arguments),2461110595:e=>dP.FromTape(e.ID,e.type,e.arguments),2887950389:e=>mP.FromTape(e.ID,e.type,e.arguments),167062518:e=>fP.FromTape(e.ID,e.type,e.arguments),753842376:e=>gP.FromTape(e.ID,e.type,e.arguments),2906023776:e=>_P.FromTape(e.ID,e.type,e.arguments),819618141:e=>vP.FromTape(e.ID,e.type,e.arguments),4196446775:e=>yP.FromTape(e.ID,e.type,e.arguments),3649138523:e=>bP.FromTape(e.ID,e.type,e.arguments),616511568:e=>xP.FromTape(e.ID,e.type,e.arguments),1334484129:e=>TP.FromTape(e.ID,e.type,e.arguments),32344328:e=>wP.FromTape(e.ID,e.type,e.arguments),231477066:e=>EP.FromTape(e.ID,e.type,e.arguments),3649129432:e=>SP.FromTape(e.ID,e.type,e.arguments),2736907675:e=>IP.FromTape(e.ID,e.type,e.arguments),4037036970:e=>MP.FromTape(e.ID,e.type,e.arguments),1136057603:e=>AP.FromTape(e.ID,e.type,e.arguments),1560379544:e=>RP.FromTape(e.ID,e.type,e.arguments),3367102660:e=>DP.FromTape(e.ID,e.type,e.arguments),1387855156:e=>CP.FromTape(e.ID,e.type,e.arguments),2069777674:e=>OP.FromTape(e.ID,e.type,e.arguments),1260505505:e=>PP.FromTape(e.ID,e.type,e.arguments),4182860854:e=>NP.FromTape(e.ID,e.type,e.arguments),2581212453:e=>LP.FromTape(e.ID,e.type,e.arguments),2713105998:e=>kP.FromTape(e.ID,e.type,e.arguments),644574406:e=>FP.FromTape(e.ID,e.type,e.arguments),963979645:e=>UP.FromTape(e.ID,e.type,e.arguments),4031249490:e=>BP.FromTape(e.ID,e.type,e.arguments),3299480353:e=>jP.FromTape(e.ID,e.type,e.arguments),2979338954:e=>GP.FromTape(e.ID,e.type,e.arguments),39481116:e=>zP.FromTape(e.ID,e.type,e.arguments),1095909175:e=>VP.FromTape(e.ID,e.type,e.arguments),1909888760:e=>HP.FromTape(e.ID,e.type,e.arguments),1950629157:e=>qP.FromTape(e.ID,e.type,e.arguments),3124254112:e=>WP.FromTape(e.ID,e.type,e.arguments),1177604601:e=>YP.FromTape(e.ID,e.type,e.arguments),2938176219:e=>XP.FromTape(e.ID,e.type,e.arguments),2188180465:e=>$P.FromTape(e.ID,e.type,e.arguments),2898889636:e=>KP.FromTape(e.ID,e.type,e.arguments),635142910:e=>ZP.FromTape(e.ID,e.type,e.arguments),395041908:e=>JP.FromTape(e.ID,e.type,e.arguments),3758799889:e=>QP.FromTape(e.ID,e.type,e.arguments),3293546465:e=>eN.FromTape(e.ID,e.type,e.arguments),1051757585:e=>tN.FromTape(e.ID,e.type,e.arguments),2674252688:e=>nN.FromTape(e.ID,e.type,e.arguments),4217484030:e=>rN.FromTape(e.ID,e.type,e.arguments),1285652485:e=>iN.FromTape(e.ID,e.type,e.arguments),3999819293:e=>sN.FromTape(e.ID,e.type,e.arguments),3203706013:e=>aN.FromTape(e.ID,e.type,e.arguments),1123145078:e=>oN.FromTape(e.ID,e.type,e.arguments),574549367:e=>lN.FromTape(e.ID,e.type,e.arguments),1675464909:e=>cN.FromTape(e.ID,e.type,e.arguments),2059837836:e=>uN.FromTape(e.ID,e.type,e.arguments),59481748:e=>hN.FromTape(e.ID,e.type,e.arguments),3749851601:e=>pN.FromTape(e.ID,e.type,e.arguments),3486308946:e=>dN.FromTape(e.ID,e.type,e.arguments),3331915920:e=>mN.FromTape(e.ID,e.type,e.arguments),1416205885:e=>fN.FromTape(e.ID,e.type,e.arguments),3150382593:e=>gN.FromTape(e.ID,e.type,e.arguments),3902619387:e=>_N.FromTape(e.ID,e.type,e.arguments),2951183804:e=>vN.FromTape(e.ID,e.type,e.arguments),3296154744:e=>yN.FromTape(e.ID,e.type,e.arguments),2197970202:e=>bN.FromTape(e.ID,e.type,e.arguments),2611217952:e=>xN.FromTape(e.ID,e.type,e.arguments),2937912522:e=>TN.FromTape(e.ID,e.type,e.arguments),1383045692:e=>wN.FromTape(e.ID,e.type,e.arguments),1062206242:e=>EN.FromTape(e.ID,e.type,e.arguments),1677625105:e=>SN.FromTape(e.ID,e.type,e.arguments),3893394355:e=>IN.FromTape(e.ID,e.type,e.arguments),747523909:e=>MN.FromTape(e.ID,e.type,e.arguments),647927063:e=>AN.FromTape(e.ID,e.type,e.arguments),2205249479:e=>RN.FromTape(e.ID,e.type,e.arguments),639361253:e=>DN.FromTape(e.ID,e.type,e.arguments),2301859152:e=>CN.FromTape(e.ID,e.type,e.arguments),776857604:e=>ON.FromTape(e.ID,e.type,e.arguments),3285139300:e=>PN.FromTape(e.ID,e.type,e.arguments),3264961684:e=>NN.FromTape(e.ID,e.type,e.arguments),843113511:e=>LN.FromTape(e.ID,e.type,e.arguments),905975707:e=>kN.FromTape(e.ID,e.type,e.arguments),300633059:e=>FN.FromTape(e.ID,e.type,e.arguments),3221913625:e=>UN.FromTape(e.ID,e.type,e.arguments),400855858:e=>BN.FromTape(e.ID,e.type,e.arguments),2542286263:e=>jN.FromTape(e.ID,e.type,e.arguments),3875453745:e=>GN.FromTape(e.ID,e.type,e.arguments),3732776249:e=>zN.FromTape(e.ID,e.type,e.arguments),15328376:e=>VN.FromTape(e.ID,e.type,e.arguments),2485617015:e=>HN.FromTape(e.ID,e.type,e.arguments),1485152156:e=>qN.FromTape(e.ID,e.type,e.arguments),3571504051:e=>WN.FromTape(e.ID,e.type,e.arguments),3850581409:e=>YN.FromTape(e.ID,e.type,e.arguments),2272882330:e=>XN.FromTape(e.ID,e.type,e.arguments),2816379211:e=>$N.FromTape(e.ID,e.type,e.arguments),2510884976:e=>KN.FromTape(e.ID,e.type,e.arguments),370225590:e=>ZN.FromTape(e.ID,e.type,e.arguments),1981873012:e=>JN.FromTape(e.ID,e.type,e.arguments),2859738748:e=>QN.FromTape(e.ID,e.type,e.arguments),45288368:e=>eL.FromTape(e.ID,e.type,e.arguments),2614616156:e=>tL.FromTape(e.ID,e.type,e.arguments),2732653382:e=>nL.FromTape(e.ID,e.type,e.arguments),775493141:e=>rL.FromTape(e.ID,e.type,e.arguments),1959218052:e=>iL.FromTape(e.ID,e.type,e.arguments),3898045240:e=>sL.FromTape(e.ID,e.type,e.arguments),2185764099:e=>aL.FromTape(e.ID,e.type,e.arguments),1060000209:e=>oL.FromTape(e.ID,e.type,e.arguments),4105962743:e=>lL.FromTape(e.ID,e.type,e.arguments),488727124:e=>cL.FromTape(e.ID,e.type,e.arguments),1525564444:e=>uL.FromTape(e.ID,e.type,e.arguments),2559216714:e=>hL.FromTape(e.ID,e.type,e.arguments),2574617495:e=>pL.FromTape(e.ID,e.type,e.arguments),3419103109:e=>dL.FromTape(e.ID,e.type,e.arguments),3050246964:e=>mL.FromTape(e.ID,e.type,e.arguments),3293443760:e=>fL.FromTape(e.ID,e.type,e.arguments),25142252:e=>gL.FromTape(e.ID,e.type,e.arguments),578613899:e=>_L.FromTape(e.ID,e.type,e.arguments),2889183280:e=>vL.FromTape(e.ID,e.type,e.arguments),2713554722:e=>yL.FromTape(e.ID,e.type,e.arguments),4136498852:e=>bL.FromTape(e.ID,e.type,e.arguments),335055490:e=>xL.FromTape(e.ID,e.type,e.arguments),3640358203:e=>TL.FromTape(e.ID,e.type,e.arguments),2954562838:e=>wL.FromTape(e.ID,e.type,e.arguments),1785450214:e=>EL.FromTape(e.ID,e.type,e.arguments),1466758467:e=>SL.FromTape(e.ID,e.type,e.arguments),3895139033:e=>IL.FromTape(e.ID,e.type,e.arguments),1419761937:e=>ML.FromTape(e.ID,e.type,e.arguments),602808272:e=>AL.FromTape(e.ID,e.type,e.arguments),1973544240:e=>RL.FromTape(e.ID,e.type,e.arguments),1916426348:e=>DL.FromTape(e.ID,e.type,e.arguments),3295246426:e=>CL.FromTape(e.ID,e.type,e.arguments),1815067380:e=>OL.FromTape(e.ID,e.type,e.arguments),2506170314:e=>PL.FromTape(e.ID,e.type,e.arguments),2147822146:e=>NL.FromTape(e.ID,e.type,e.arguments),539742890:e=>LL.FromTape(e.ID,e.type,e.arguments),3495092785:e=>kL.FromTape(e.ID,e.type,e.arguments),1457835157:e=>FL.FromTape(e.ID,e.type,e.arguments),2601014836:e=>UL.FromTape(e.ID,e.type,e.arguments),2827736869:e=>BL.FromTape(e.ID,e.type,e.arguments),2629017746:e=>jL.FromTape(e.ID,e.type,e.arguments),1186437898:e=>GL.FromTape(e.ID,e.type,e.arguments),3800577675:e=>zL.FromTape(e.ID,e.type,e.arguments),1105321065:e=>VL.FromTape(e.ID,e.type,e.arguments),2367409068:e=>HL.FromTape(e.ID,e.type,e.arguments),3510044353:e=>qL.FromTape(e.ID,e.type,e.arguments),1213902940:e=>WL.FromTape(e.ID,e.type,e.arguments),4074379575:e=>YL.FromTape(e.ID,e.type,e.arguments),3961806047:e=>XL.FromTape(e.ID,e.type,e.arguments),3426335179:e=>$L.FromTape(e.ID,e.type,e.arguments),1306400036:e=>KL.FromTape(e.ID,e.type,e.arguments),3632507154:e=>ZL.FromTape(e.ID,e.type,e.arguments),1765591967:e=>JL.FromTape(e.ID,e.type,e.arguments),1045800335:e=>QL.FromTape(e.ID,e.type,e.arguments),2949456006:e=>ek.FromTape(e.ID,e.type,e.arguments),32440307:e=>tk.FromTape(e.ID,e.type,e.arguments),1335981549:e=>nk.FromTape(e.ID,e.type,e.arguments),2635815018:e=>rk.FromTape(e.ID,e.type,e.arguments),1945343521:e=>ik.FromTape(e.ID,e.type,e.arguments),1052013943:e=>sk.FromTape(e.ID,e.type,e.arguments),1599208980:e=>ak.FromTape(e.ID,e.type,e.arguments),562808652:e=>ok.FromTape(e.ID,e.type,e.arguments),1062813311:e=>lk.FromTape(e.ID,e.type,e.arguments),2063403501:e=>ck.FromTape(e.ID,e.type,e.arguments),1945004755:e=>uk.FromTape(e.ID,e.type,e.arguments),3256556792:e=>hk.FromTape(e.ID,e.type,e.arguments),3040386961:e=>pk.FromTape(e.ID,e.type,e.arguments),3849074793:e=>dk.FromTape(e.ID,e.type,e.arguments),3041715199:e=>mk.FromTape(e.ID,e.type,e.arguments),3205830791:e=>fk.FromTape(e.ID,e.type,e.arguments),1154170062:e=>gk.FromTape(e.ID,e.type,e.arguments),770865208:e=>_k.FromTape(e.ID,e.type,e.arguments),3732053477:e=>vk.FromTape(e.ID,e.type,e.arguments),395920057:e=>yk.FromTape(e.ID,e.type,e.arguments),2963535650:e=>bk.FromTape(e.ID,e.type,e.arguments),1714330368:e=>xk.FromTape(e.ID,e.type,e.arguments),3242481149:e=>Tk.FromTape(e.ID,e.type,e.arguments),526551008:e=>wk.FromTape(e.ID,e.type,e.arguments),2323601079:e=>Ek.FromTape(e.ID,e.type,e.arguments),445594917:e=>Sk.FromTape(e.ID,e.type,e.arguments),4006246654:e=>Ik.FromTape(e.ID,e.type,e.arguments),342316401:e=>Mk.FromTape(e.ID,e.type,e.arguments),869906466:e=>Ak.FromTape(e.ID,e.type,e.arguments),3518393246:e=>Rk.FromTape(e.ID,e.type,e.arguments),3760055223:e=>Dk.FromTape(e.ID,e.type,e.arguments),1360408905:e=>Ck.FromTape(e.ID,e.type,e.arguments),2030761528:e=>Ok.FromTape(e.ID,e.type,e.arguments),3900360178:e=>Pk.FromTape(e.ID,e.type,e.arguments),476780140:e=>Nk.FromTape(e.ID,e.type,e.arguments),1472233963:e=>Lk.FromTape(e.ID,e.type,e.arguments),1904799276:e=>kk.FromTape(e.ID,e.type,e.arguments),663422040:e=>Fk.FromTape(e.ID,e.type,e.arguments),862014818:e=>Uk.FromTape(e.ID,e.type,e.arguments),2417008758:e=>Bk.FromTape(e.ID,e.type,e.arguments),3310460725:e=>jk.FromTape(e.ID,e.type,e.arguments),3277789161:e=>Gk.FromTape(e.ID,e.type,e.arguments),264262732:e=>zk.FromTape(e.ID,e.type,e.arguments),1534661035:e=>Vk.FromTape(e.ID,e.type,e.arguments),402227799:e=>Hk.FromTape(e.ID,e.type,e.arguments),1217240411:e=>qk.FromTape(e.ID,e.type,e.arguments),1003880860:e=>Wk.FromTape(e.ID,e.type,e.arguments),712377611:e=>Yk.FromTape(e.ID,e.type,e.arguments),1758889154:e=>Xk.FromTape(e.ID,e.type,e.arguments),4123344466:e=>$k.FromTape(e.ID,e.type,e.arguments),2397081782:e=>Kk.FromTape(e.ID,e.type,e.arguments),1623761950:e=>Zk.FromTape(e.ID,e.type,e.arguments),2590856083:e=>Jk.FromTape(e.ID,e.type,e.arguments),1883228015:e=>Qk.FromTape(e.ID,e.type,e.arguments),339256511:e=>eF.FromTape(e.ID,e.type,e.arguments),2777663545:e=>tF.FromTape(e.ID,e.type,e.arguments),1704287377:e=>nF.FromTape(e.ID,e.type,e.arguments),2835456948:e=>rF.FromTape(e.ID,e.type,e.arguments),1658829314:e=>iF.FromTape(e.ID,e.type,e.arguments),2107101300:e=>sF.FromTape(e.ID,e.type,e.arguments),2814081492:e=>aF.FromTape(e.ID,e.type,e.arguments),132023988:e=>oF.FromTape(e.ID,e.type,e.arguments),3747195512:e=>lF.FromTape(e.ID,e.type,e.arguments),3174744832:e=>cF.FromTape(e.ID,e.type,e.arguments),484807127:e=>uF.FromTape(e.ID,e.type,e.arguments),3390157468:e=>hF.FromTape(e.ID,e.type,e.arguments),4148101412:e=>pF.FromTape(e.ID,e.type,e.arguments),211053100:e=>dF.FromTape(e.ID,e.type,e.arguments),4024345920:e=>mF.FromTape(e.ID,e.type,e.arguments),297599258:e=>fF.FromTape(e.ID,e.type,e.arguments),4294318154:e=>gF.FromTape(e.ID,e.type,e.arguments),3200245327:e=>_F.FromTape(e.ID,e.type,e.arguments),1437805879:e=>vF.FromTape(e.ID,e.type,e.arguments),1209101575:e=>yF.FromTape(e.ID,e.type,e.arguments),2853485674:e=>bF.FromTape(e.ID,e.type,e.arguments),2242383968:e=>xF.FromTape(e.ID,e.type,e.arguments),1040185647:e=>TF.FromTape(e.ID,e.type,e.arguments),3548104201:e=>wF.FromTape(e.ID,e.type,e.arguments),477187591:e=>EF.FromTape(e.ID,e.type,e.arguments),2804161546:e=>SF.FromTape(e.ID,e.type,e.arguments),2556980723:e=>IF.FromTape(e.ID,e.type,e.arguments),2047409740:e=>MF.FromTape(e.ID,e.type,e.arguments),1809719519:e=>AF.FromTape(e.ID,e.type,e.arguments),803316827:e=>RF.FromTape(e.ID,e.type,e.arguments),3008276851:e=>DF.FromTape(e.ID,e.type,e.arguments),807026263:e=>CF.FromTape(e.ID,e.type,e.arguments),3737207727:e=>OF.FromTape(e.ID,e.type,e.arguments),24185140:e=>PF.FromTape(e.ID,e.type,e.arguments),1310830890:e=>NF.FromTape(e.ID,e.type,e.arguments),4219587988:e=>LF.FromTape(e.ID,e.type,e.arguments),3415622556:e=>kF.FromTape(e.ID,e.type,e.arguments),346874300:e=>FF.FromTape(e.ID,e.type,e.arguments),647756555:e=>UF.FromTape(e.ID,e.type,e.arguments),2489546625:e=>BF.FromTape(e.ID,e.type,e.arguments),2827207264:e=>jF.FromTape(e.ID,e.type,e.arguments),2143335405:e=>GF.FromTape(e.ID,e.type,e.arguments),1287392070:e=>zF.FromTape(e.ID,e.type,e.arguments),738692330:e=>VF.FromTape(e.ID,e.type,e.arguments),374418227:e=>HF.FromTape(e.ID,e.type,e.arguments),315944413:e=>qF.FromTape(e.ID,e.type,e.arguments),819412036:e=>WF.FromTape(e.ID,e.type,e.arguments),1810631287:e=>YF.FromTape(e.ID,e.type,e.arguments),1426591983:e=>XF.FromTape(e.ID,e.type,e.arguments),4222183408:e=>$F.FromTape(e.ID,e.type,e.arguments),2652556860:e=>KF.FromTape(e.ID,e.type,e.arguments),2058353004:e=>ZF.FromTape(e.ID,e.type,e.arguments),3907093117:e=>JF.FromTape(e.ID,e.type,e.arguments),4278956645:e=>QF.FromTape(e.ID,e.type,e.arguments),3198132628:e=>eU.FromTape(e.ID,e.type,e.arguments),182646315:e=>tU.FromTape(e.ID,e.type,e.arguments),4037862832:e=>nU.FromTape(e.ID,e.type,e.arguments),2188021234:e=>rU.FromTape(e.ID,e.type,e.arguments),3815607619:e=>iU.FromTape(e.ID,e.type,e.arguments),3132237377:e=>sU.FromTape(e.ID,e.type,e.arguments),1482959167:e=>aU.FromTape(e.ID,e.type,e.arguments),987401354:e=>oU.FromTape(e.ID,e.type,e.arguments),1834744321:e=>lU.FromTape(e.ID,e.type,e.arguments),707683696:e=>cU.FromTape(e.ID,e.type,e.arguments),1339347760:e=>uU.FromTape(e.ID,e.type,e.arguments),2223149337:e=>hU.FromTape(e.ID,e.type,e.arguments),2297155007:e=>pU.FromTape(e.ID,e.type,e.arguments),3508470533:e=>dU.FromTape(e.ID,e.type,e.arguments),3009222698:e=>mU.FromTape(e.ID,e.type,e.arguments),900683007:e=>fU.FromTape(e.ID,e.type,e.arguments),1893162501:e=>gU.FromTape(e.ID,e.type,e.arguments),263784265:e=>_U.FromTape(e.ID,e.type,e.arguments),4238390223:e=>vU.FromTape(e.ID,e.type,e.arguments),1509553395:e=>yU.FromTape(e.ID,e.type,e.arguments),1268542332:e=>bU.FromTape(e.ID,e.type,e.arguments),3493046030:e=>xU.FromTape(e.ID,e.type,e.arguments),4095422895:e=>TU.FromTape(e.ID,e.type,e.arguments),987898635:e=>wU.FromTape(e.ID,e.type,e.arguments),3448662350:e=>EU.FromTape(e.ID,e.type,e.arguments),2453401579:e=>SU.FromTape(e.ID,e.type,e.arguments),4142052618:e=>IU.FromTape(e.ID,e.type,e.arguments),3590301190:e=>MU.FromTape(e.ID,e.type,e.arguments),3009204131:e=>AU.FromTape(e.ID,e.type,e.arguments),852622518:e=>RU.FromTape(e.ID,e.type,e.arguments),178086475:e=>DU.FromTape(e.ID,e.type,e.arguments),2706460486:e=>CU.FromTape(e.ID,e.type,e.arguments),812098782:e=>OU.FromTape(e.ID,e.type,e.arguments),3319311131:e=>PU.FromTape(e.ID,e.type,e.arguments),1251058090:e=>NU.FromTape(e.ID,e.type,e.arguments),2068733104:e=>LU.FromTape(e.ID,e.type,e.arguments),1806887404:e=>kU.FromTape(e.ID,e.type,e.arguments),1484403080:e=>FU.FromTape(e.ID,e.type,e.arguments),3905492369:e=>UU.FromTape(e.ID,e.type,e.arguments),3570813810:e=>BU.FromTape(e.ID,e.type,e.arguments),2571569899:e=>jU.FromTape(e.ID,e.type,e.arguments),178912537:e=>GU.FromTape(e.ID,e.type,e.arguments),2294589976:e=>zU.FromTape(e.ID,e.type,e.arguments),1437953363:e=>VU.FromTape(e.ID,e.type,e.arguments),2133299955:e=>HU.FromTape(e.ID,e.type,e.arguments),4175244083:e=>qU.FromTape(e.ID,e.type,e.arguments),3946677679:e=>WU.FromTape(e.ID,e.type,e.arguments),3113134337:e=>YU.FromTape(e.ID,e.type,e.arguments),2391368822:e=>XU.FromTape(e.ID,e.type,e.arguments),3741457305:e=>$U.FromTape(e.ID,e.type,e.arguments),3020489413:e=>KU.FromTape(e.ID,e.type,e.arguments),2176052936:e=>ZU.FromTape(e.ID,e.type,e.arguments),4288270099:e=>JU.FromTape(e.ID,e.type,e.arguments),572779678:e=>QU.FromTape(e.ID,e.type,e.arguments),3827777499:e=>eB.FromTape(e.ID,e.type,e.arguments),428585644:e=>tB.FromTape(e.ID,e.type,e.arguments),1585845231:e=>nB.FromTape(e.ID,e.type,e.arguments),76236018:e=>rB.FromTape(e.ID,e.type,e.arguments),1051575348:e=>iB.FromTape(e.ID,e.type,e.arguments),2655187982:e=>sB.FromTape(e.ID,e.type,e.arguments),3452421091:e=>aB.FromTape(e.ID,e.type,e.arguments),4162380809:e=>oB.FromTape(e.ID,e.type,e.arguments),629592764:e=>lB.FromTape(e.ID,e.type,e.arguments),1161773419:e=>cB.FromTape(e.ID,e.type,e.arguments),1566485204:e=>uB.FromTape(e.ID,e.type,e.arguments),1402838566:e=>hB.FromTape(e.ID,e.type,e.arguments),125510826:e=>pB.FromTape(e.ID,e.type,e.arguments),2604431987:e=>dB.FromTape(e.ID,e.type,e.arguments),4266656042:e=>mB.FromTape(e.ID,e.type,e.arguments),1520743889:e=>fB.FromTape(e.ID,e.type,e.arguments),3422422726:e=>gB.FromTape(e.ID,e.type,e.arguments),1281925730:e=>_B.FromTape(e.ID,e.type,e.arguments),3092502836:e=>vB.FromTape(e.ID,e.type,e.arguments),388784114:e=>yB.FromTape(e.ID,e.type,e.arguments),1154579445:e=>bB.FromTape(e.ID,e.type,e.arguments),2624227202:e=>xB.FromTape(e.ID,e.type,e.arguments),1008929658:e=>TB.FromTape(e.ID,e.type,e.arguments),1425443689:e=>wB.FromTape(e.ID,e.type,e.arguments),3057273783:e=>EB.FromTape(e.ID,e.type,e.arguments),2347385850:e=>SB.FromTape(e.ID,e.type,e.arguments),1838606355:e=>IB.FromTape(e.ID,e.type,e.arguments),1847130766:e=>MB.FromTape(e.ID,e.type,e.arguments),3708119e3:e=>AB.FromTape(e.ID,e.type,e.arguments),2852063980:e=>RB.FromTape(e.ID,e.type,e.arguments),760658860:e=>DB.FromTape(e.ID,e.type,e.arguments),2022407955:e=>CB.FromTape(e.ID,e.type,e.arguments),248100487:e=>OB.FromTape(e.ID,e.type,e.arguments),3303938423:e=>PB.FromTape(e.ID,e.type,e.arguments),1303795690:e=>NB.FromTape(e.ID,e.type,e.arguments),1847252529:e=>LB.FromTape(e.ID,e.type,e.arguments),2199411900:e=>kB.FromTape(e.ID,e.type,e.arguments),2235152071:e=>FB.FromTape(e.ID,e.type,e.arguments),164193824:e=>UB.FromTape(e.ID,e.type,e.arguments),3079605661:e=>BB.FromTape(e.ID,e.type,e.arguments),3404854881:e=>jB.FromTape(e.ID,e.type,e.arguments),552965576:e=>GB.FromTape(e.ID,e.type,e.arguments),3265635763:e=>zB.FromTape(e.ID,e.type,e.arguments),853536259:e=>VB.FromTape(e.ID,e.type,e.arguments),1507914824:e=>HB.FromTape(e.ID,e.type,e.arguments),2597039031:e=>qB.FromTape(e.ID,e.type,e.arguments),377706215:e=>WB.FromTape(e.ID,e.type,e.arguments),2108223431:e=>YB.FromTape(e.ID,e.type,e.arguments),1437502449:e=>XB.FromTape(e.ID,e.type,e.arguments),1114901282:e=>$B.FromTape(e.ID,e.type,e.arguments),1073191201:e=>KB.FromTape(e.ID,e.type,e.arguments),1911478936:e=>ZB.FromTape(e.ID,e.type,e.arguments),3181161470:e=>JB.FromTape(e.ID,e.type,e.arguments),3368373690:e=>QB.FromTape(e.ID,e.type,e.arguments),2998442950:e=>ej.FromTape(e.ID,e.type,e.arguments),2706619895:e=>tj.FromTape(e.ID,e.type,e.arguments),2474470126:e=>nj.FromTape(e.ID,e.type,e.arguments),977012517:e=>rj.FromTape(e.ID,e.type,e.arguments),1918398963:e=>ij.FromTape(e.ID,e.type,e.arguments),3888040117:e=>sj.FromTape(e.ID,e.type,e.arguments),219451334:e=>aj.FromTape(e.ID,e.type,e.arguments),3701648758:e=>oj.FromTape(e.ID,e.type,e.arguments),2251480897:e=>lj.FromTape(e.ID,e.type,e.arguments),4143007308:e=>cj.FromTape(e.ID,e.type,e.arguments),590820931:e=>uj.FromTape(e.ID,e.type,e.arguments),3388369263:e=>hj.FromTape(e.ID,e.type,e.arguments),3505215534:e=>pj.FromTape(e.ID,e.type,e.arguments),2485787929:e=>dj.FromTape(e.ID,e.type,e.arguments),2665983363:e=>mj.FromTape(e.ID,e.type,e.arguments),3588315303:e=>fj.FromTape(e.ID,e.type,e.arguments),3079942009:e=>gj.FromTape(e.ID,e.type,e.arguments),4251960020:e=>_j.FromTape(e.ID,e.type,e.arguments),1411181986:e=>vj.FromTape(e.ID,e.type,e.arguments),643959842:e=>yj.FromTape(e.ID,e.type,e.arguments),1029017970:e=>bj.FromTape(e.ID,e.type,e.arguments),144952367:e=>xj.FromTape(e.ID,e.type,e.arguments),3694346114:e=>Tj.FromTape(e.ID,e.type,e.arguments),2837617999:e=>wj.FromTape(e.ID,e.type,e.arguments),1207048766:e=>Ej.FromTape(e.ID,e.type,e.arguments),2529465313:e=>Sj.FromTape(e.ID,e.type,e.arguments),2519244187:e=>Ij.FromTape(e.ID,e.type,e.arguments),1682466193:e=>Mj.FromTape(e.ID,e.type,e.arguments),2382730787:e=>Aj.FromTape(e.ID,e.type,e.arguments),3566463478:e=>Rj.FromTape(e.ID,e.type,e.arguments),3327091369:e=>Dj.FromTape(e.ID,e.type,e.arguments),2077209135:e=>Cj.FromTape(e.ID,e.type,e.arguments),101040310:e=>Oj.FromTape(e.ID,e.type,e.arguments),3021840470:e=>Pj.FromTape(e.ID,e.type,e.arguments),2483315170:e=>Nj.FromTape(e.ID,e.type,e.arguments),2226359599:e=>Lj.FromTape(e.ID,e.type,e.arguments),1687234759:e=>kj.FromTape(e.ID,e.type,e.arguments),1158309216:e=>Fj.FromTape(e.ID,e.type,e.arguments),310824031:e=>Uj.FromTape(e.ID,e.type,e.arguments),804291784:e=>Bj.FromTape(e.ID,e.type,e.arguments),3612865200:e=>jj.FromTape(e.ID,e.type,e.arguments),4231323485:e=>Gj.FromTape(e.ID,e.type,e.arguments),597895409:e=>zj.FromTape(e.ID,e.type,e.arguments),2004835150:e=>Vj.FromTape(e.ID,e.type,e.arguments),603570806:e=>Hj.FromTape(e.ID,e.type,e.arguments),1663979128:e=>qj.FromTape(e.ID,e.type,e.arguments),220341763:e=>Wj.FromTape(e.ID,e.type,e.arguments),3171933400:e=>Yj.FromTape(e.ID,e.type,e.arguments),1156407060:e=>Xj.FromTape(e.ID,e.type,e.arguments),4017108033:e=>$j.FromTape(e.ID,e.type,e.arguments),2067069095:e=>Kj.FromTape(e.ID,e.type,e.arguments),4022376103:e=>Zj.FromTape(e.ID,e.type,e.arguments),1423911732:e=>Jj.FromTape(e.ID,e.type,e.arguments),2924175390:e=>Qj.FromTape(e.ID,e.type,e.arguments),2775532180:e=>eG.FromTape(e.ID,e.type,e.arguments),2839578677:e=>tG.FromTape(e.ID,e.type,e.arguments),3724593414:e=>nG.FromTape(e.ID,e.type,e.arguments),3740093272:e=>rG.FromTape(e.ID,e.type,e.arguments),1946335990:e=>iG.FromTape(e.ID,e.type,e.arguments),3355820592:e=>sG.FromTape(e.ID,e.type,e.arguments),759155922:e=>aG.FromTape(e.ID,e.type,e.arguments),2559016684:e=>oG.FromTape(e.ID,e.type,e.arguments),3727388367:e=>lG.FromTape(e.ID,e.type,e.arguments),3778827333:e=>cG.FromTape(e.ID,e.type,e.arguments),3967405729:e=>uG.FromTape(e.ID,e.type,e.arguments),1775413392:e=>hG.FromTape(e.ID,e.type,e.arguments),677532197:e=>pG.FromTape(e.ID,e.type,e.arguments),2022622350:e=>dG.FromTape(e.ID,e.type,e.arguments),1304840413:e=>mG.FromTape(e.ID,e.type,e.arguments),3119450353:e=>fG.FromTape(e.ID,e.type,e.arguments),2417041796:e=>gG.FromTape(e.ID,e.type,e.arguments),2744685151:e=>_G.FromTape(e.ID,e.type,e.arguments),569719735:e=>vG.FromTape(e.ID,e.type,e.arguments),2945172077:e=>yG.FromTape(e.ID,e.type,e.arguments),4208778838:e=>bG.FromTape(e.ID,e.type,e.arguments),673634403:e=>xG.FromTape(e.ID,e.type,e.arguments),2095639259:e=>TG.FromTape(e.ID,e.type,e.arguments),3958567839:e=>wG.FromTape(e.ID,e.type,e.arguments),2802850158:e=>EG.FromTape(e.ID,e.type,e.arguments),103090709:e=>SG.FromTape(e.ID,e.type,e.arguments),653396225:e=>IG.FromTape(e.ID,e.type,e.arguments),2904328755:e=>MG.FromTape(e.ID,e.type,e.arguments),3843373140:e=>AG.FromTape(e.ID,e.type,e.arguments),3651124850:e=>RG.FromTape(e.ID,e.type,e.arguments),2598011224:e=>DG.FromTape(e.ID,e.type,e.arguments),986844984:e=>CG.FromTape(e.ID,e.type,e.arguments),871118103:e=>OG.FromTape(e.ID,e.type,e.arguments),1680319473:e=>PG.FromTape(e.ID,e.type,e.arguments),148025276:e=>NG.FromTape(e.ID,e.type,e.arguments),4166981789:e=>LG.FromTape(e.ID,e.type,e.arguments),3710013099:e=>kG.FromTape(e.ID,e.type,e.arguments),2752243245:e=>FG.FromTape(e.ID,e.type,e.arguments),941946838:e=>UG.FromTape(e.ID,e.type,e.arguments),1451395588:e=>BG.FromTape(e.ID,e.type,e.arguments),3357820518:e=>jG.FromTape(e.ID,e.type,e.arguments),492091185:e=>GG.FromTape(e.ID,e.type,e.arguments),3650150729:e=>zG.FromTape(e.ID,e.type,e.arguments),110355661:e=>VG.FromTape(e.ID,e.type,e.arguments),3521284610:e=>HG.FromTape(e.ID,e.type,e.arguments),1482703590:e=>qG.FromTape(e.ID,e.type,e.arguments),738039164:e=>WG.FromTape(e.ID,e.type,e.arguments),2295281155:e=>YG.FromTape(e.ID,e.type,e.arguments),655969474:e=>XG.FromTape(e.ID,e.type,e.arguments),1842657554:e=>$G.FromTape(e.ID,e.type,e.arguments),3219374653:e=>KG.FromTape(e.ID,e.type,e.arguments),90941305:e=>ZG.FromTape(e.ID,e.type,e.arguments),2250791053:e=>JG.FromTape(e.ID,e.type,e.arguments),2044713172:e=>QG.FromTape(e.ID,e.type,e.arguments),2093928680:e=>ez.FromTape(e.ID,e.type,e.arguments),931644368:e=>tz.FromTape(e.ID,e.type,e.arguments),2090586900:e=>nz.FromTape(e.ID,e.type,e.arguments),3252649465:e=>rz.FromTape(e.ID,e.type,e.arguments),2405470396:e=>iz.FromTape(e.ID,e.type,e.arguments),825690147:e=>sz.FromTape(e.ID,e.type,e.arguments),2262370178:e=>az.FromTape(e.ID,e.type,e.arguments),2893384427:e=>oz.FromTape(e.ID,e.type,e.arguments),3024970846:e=>lz.FromTape(e.ID,e.type,e.arguments),3283111854:e=>cz.FromTape(e.ID,e.type,e.arguments),2324767716:e=>uz.FromTape(e.ID,e.type,e.arguments),1469900589:e=>hz.FromTape(e.ID,e.type,e.arguments),1232101972:e=>pz.FromTape(e.ID,e.type,e.arguments),683857671:e=>dz.FromTape(e.ID,e.type,e.arguments),2770003689:e=>mz.FromTape(e.ID,e.type,e.arguments),3615266464:e=>fz.FromTape(e.ID,e.type,e.arguments),2798486643:e=>gz.FromTape(e.ID,e.type,e.arguments),3454111270:e=>_z.FromTape(e.ID,e.type,e.arguments),3915482550:e=>vz.FromTape(e.ID,e.type,e.arguments),2433181523:e=>yz.FromTape(e.ID,e.type,e.arguments),4021432810:e=>bz.FromTape(e.ID,e.type,e.arguments),3413951693:e=>xz.FromTape(e.ID,e.type,e.arguments),1580146022:e=>Tz.FromTape(e.ID,e.type,e.arguments),3765753017:e=>wz.FromTape(e.ID,e.type,e.arguments),979691226:e=>Ez.FromTape(e.ID,e.type,e.arguments),2572171363:e=>Sz.FromTape(e.ID,e.type,e.arguments),3027567501:e=>Iz.FromTape(e.ID,e.type,e.arguments),964333572:e=>Mz.FromTape(e.ID,e.type,e.arguments),2320036040:e=>Az.FromTape(e.ID,e.type,e.arguments),2310774935:e=>Rz.FromTape(e.ID,e.type,e.arguments),160246688:e=>Dz.FromTape(e.ID,e.type,e.arguments),3939117080:e=>Cz.FromTape(e.ID,e.type,e.arguments),1683148259:e=>Oz.FromTape(e.ID,e.type,e.arguments),2495723537:e=>Pz.FromTape(e.ID,e.type,e.arguments),1307041759:e=>Nz.FromTape(e.ID,e.type,e.arguments),1027710054:e=>Lz.FromTape(e.ID,e.type,e.arguments),4278684876:e=>kz.FromTape(e.ID,e.type,e.arguments),2857406711:e=>Fz.FromTape(e.ID,e.type,e.arguments),205026976:e=>Uz.FromTape(e.ID,e.type,e.arguments),1865459582:e=>Bz.FromTape(e.ID,e.type,e.arguments),4095574036:e=>jz.FromTape(e.ID,e.type,e.arguments),919958153:e=>Gz.FromTape(e.ID,e.type,e.arguments),2728634034:e=>zz.FromTape(e.ID,e.type,e.arguments),982818633:e=>Vz.FromTape(e.ID,e.type,e.arguments),3840914261:e=>Hz.FromTape(e.ID,e.type,e.arguments),2655215786:e=>qz.FromTape(e.ID,e.type,e.arguments),826625072:e=>Wz.FromTape(e.ID,e.type,e.arguments),1204542856:e=>Yz.FromTape(e.ID,e.type,e.arguments),3945020480:e=>Xz.FromTape(e.ID,e.type,e.arguments),4201705270:e=>$z.FromTape(e.ID,e.type,e.arguments),3190031847:e=>Kz.FromTape(e.ID,e.type,e.arguments),2127690289:e=>Zz.FromTape(e.ID,e.type,e.arguments),1638771189:e=>Jz.FromTape(e.ID,e.type,e.arguments),504942748:e=>Qz.FromTape(e.ID,e.type,e.arguments),3678494232:e=>eV.FromTape(e.ID,e.type,e.arguments),3242617779:e=>tV.FromTape(e.ID,e.type,e.arguments),886880790:e=>nV.FromTape(e.ID,e.type,e.arguments),2802773753:e=>rV.FromTape(e.ID,e.type,e.arguments),2565941209:e=>iV.FromTape(e.ID,e.type,e.arguments),2551354335:e=>sV.FromTape(e.ID,e.type,e.arguments),693640335:e=>aV.FromTape(e.ID,e.type,e.arguments),1462361463:e=>oV.FromTape(e.ID,e.type,e.arguments),4186316022:e=>lV.FromTape(e.ID,e.type,e.arguments),307848117:e=>cV.FromTape(e.ID,e.type,e.arguments),781010003:e=>uV.FromTape(e.ID,e.type,e.arguments),3940055652:e=>hV.FromTape(e.ID,e.type,e.arguments),279856033:e=>pV.FromTape(e.ID,e.type,e.arguments),427948657:e=>dV.FromTape(e.ID,e.type,e.arguments),3268803585:e=>mV.FromTape(e.ID,e.type,e.arguments),1441486842:e=>fV.FromTape(e.ID,e.type,e.arguments),750771296:e=>gV.FromTape(e.ID,e.type,e.arguments),1245217292:e=>_V.FromTape(e.ID,e.type,e.arguments),4122056220:e=>vV.FromTape(e.ID,e.type,e.arguments),366585022:e=>yV.FromTape(e.ID,e.type,e.arguments),3451746338:e=>bV.FromTape(e.ID,e.type,e.arguments),3523091289:e=>xV.FromTape(e.ID,e.type,e.arguments),1521410863:e=>TV.FromTape(e.ID,e.type,e.arguments),1401173127:e=>wV.FromTape(e.ID,e.type,e.arguments),478536968:e=>EV.FromTape(e.ID,e.type,e.arguments),816062949:e=>SV.FromTape(e.ID,e.type,e.arguments),1076942058:e=>IV.FromTape(e.ID,e.type,e.arguments),3377609919:e=>MV.FromTape(e.ID,e.type,e.arguments),3008791417:e=>AV.FromTape(e.ID,e.type,e.arguments),1660063152:e=>RV.FromTape(e.ID,e.type,e.arguments),2914609552:e=>DV.FromTape(e.ID,e.type,e.arguments),2943643501:e=>CV.FromTape(e.ID,e.type,e.arguments),1608871552:e=>OV.FromTape(e.ID,e.type,e.arguments),2439245199:e=>PV.FromTape(e.ID,e.type,e.arguments),1042787934:e=>NV.FromTape(e.ID,e.type,e.arguments),1856042241:e=>LV.FromTape(e.ID,e.type,e.arguments),3243963512:e=>kV.FromTape(e.ID,e.type,e.arguments),4158566097:e=>FV.FromTape(e.ID,e.type,e.arguments),3626867408:e=>UV.FromTape(e.ID,e.type,e.arguments),2016517767:e=>BV.FromTape(e.ID,e.type,e.arguments),2781568857:e=>jV.FromTape(e.ID,e.type,e.arguments),2341007311:e=>GV.FromTape(e.ID,e.type,e.arguments),2778083089:e=>zV.FromTape(e.ID,e.type,e.arguments),448429030:e=>VV.FromTape(e.ID,e.type,e.arguments),3053780830:e=>HV.FromTape(e.ID,e.type,e.arguments),1768891740:e=>qV.FromTape(e.ID,e.type,e.arguments),1054537805:e=>WV.FromTape(e.ID,e.type,e.arguments),2157484638:e=>YV.FromTape(e.ID,e.type,e.arguments),2042790032:e=>XV.FromTape(e.ID,e.type,e.arguments),4165799628:e=>$V.FromTape(e.ID,e.type,e.arguments),1862484736:e=>KV.FromTape(e.ID,e.type,e.arguments),1290935644:e=>ZV.FromTape(e.ID,e.type,e.arguments),1509187699:e=>JV.FromTape(e.ID,e.type,e.arguments),4086658281:e=>QV.FromTape(e.ID,e.type,e.arguments),1783015770:e=>eH.FromTape(e.ID,e.type,e.arguments),1329646415:e=>tH.FromTape(e.ID,e.type,e.arguments),4074543187:e=>nH.FromTape(e.ID,e.type,e.arguments),867548509:e=>rH.FromTape(e.ID,e.type,e.arguments),3982875396:e=>iH.FromTape(e.ID,e.type,e.arguments),4240577450:e=>sH.FromTape(e.ID,e.type,e.arguments),4124623270:e=>aH.FromTape(e.ID,e.type,e.arguments),3692461612:e=>oH.FromTape(e.ID,e.type,e.arguments),3663146110:e=>lH.FromTape(e.ID,e.type,e.arguments),4097777520:e=>cH.FromTape(e.ID,e.type,e.arguments),1529196076:e=>uH.FromTape(e.ID,e.type,e.arguments),3127900445:e=>hH.FromTape(e.ID,e.type,e.arguments),3027962421:e=>pH.FromTape(e.ID,e.type,e.arguments),2533589738:e=>dH.FromTape(e.ID,e.type,e.arguments),2609359061:e=>mH.FromTape(e.ID,e.type,e.arguments),3420628829:e=>fH.FromTape(e.ID,e.type,e.arguments),1072016465:e=>gH.FromTape(e.ID,e.type,e.arguments),723233188:e=>_H.FromTape(e.ID,e.type,e.arguments),3856911033:e=>vH.FromTape(e.ID,e.type,e.arguments),1999602285:e=>yH.FromTape(e.ID,e.type,e.arguments),1305183839:e=>bH.FromTape(e.ID,e.type,e.arguments),3812236995:e=>xH.FromTape(e.ID,e.type,e.arguments),1412071761:e=>TH.FromTape(e.ID,e.type,e.arguments),710998568:e=>wH.FromTape(e.ID,e.type,e.arguments),2706606064:e=>EH.FromTape(e.ID,e.type,e.arguments),3893378262:e=>SH.FromTape(e.ID,e.type,e.arguments),463610769:e=>IH.FromTape(e.ID,e.type,e.arguments),2481509218:e=>MH.FromTape(e.ID,e.type,e.arguments),451544542:e=>AH.FromTape(e.ID,e.type,e.arguments),4015995234:e=>RH.FromTape(e.ID,e.type,e.arguments),1404847402:e=>DH.FromTape(e.ID,e.type,e.arguments),3112655638:e=>CH.FromTape(e.ID,e.type,e.arguments),331165859:e=>OH.FromTape(e.ID,e.type,e.arguments),4252922144:e=>PH.FromTape(e.ID,e.type,e.arguments),1039846685:e=>NH.FromTape(e.ID,e.type,e.arguments),338393293:e=>LH.FromTape(e.ID,e.type,e.arguments),682877961:e=>kH.FromTape(e.ID,e.type,e.arguments),3544373492:e=>FH.FromTape(e.ID,e.type,e.arguments),2515109513:e=>UH.FromTape(e.ID,e.type,e.arguments),1179482911:e=>BH.FromTape(e.ID,e.type,e.arguments),2273995522:e=>jH.FromTape(e.ID,e.type,e.arguments),1004757350:e=>GH.FromTape(e.ID,e.type,e.arguments),4243806635:e=>zH.FromTape(e.ID,e.type,e.arguments),214636428:e=>VH.FromTape(e.ID,e.type,e.arguments),2445595289:e=>HH.FromTape(e.ID,e.type,e.arguments),2757150158:e=>qH.FromTape(e.ID,e.type,e.arguments),3136571912:e=>WH.FromTape(e.ID,e.type,e.arguments),1807405624:e=>YH.FromTape(e.ID,e.type,e.arguments),2162789131:e=>XH.FromTape(e.ID,e.type,e.arguments),385403989:e=>$H.FromTape(e.ID,e.type,e.arguments),3478079324:e=>KH.FromTape(e.ID,e.type,e.arguments),1252848954:e=>ZH.FromTape(e.ID,e.type,e.arguments),1595516126:e=>JH.FromTape(e.ID,e.type,e.arguments),609421318:e=>QH.FromTape(e.ID,e.type,e.arguments),2668620305:e=>eq.FromTape(e.ID,e.type,e.arguments),2473145415:e=>tq.FromTape(e.ID,e.type,e.arguments),1973038258:e=>nq.FromTape(e.ID,e.type,e.arguments),1597423693:e=>rq.FromTape(e.ID,e.type,e.arguments),1190533807:e=>iq.FromTape(e.ID,e.type,e.arguments),2525727697:e=>sq.FromTape(e.ID,e.type,e.arguments),3408363356:e=>aq.FromTape(e.ID,e.type,e.arguments),530289379:e=>oq.FromTape(e.ID,e.type,e.arguments),1621171031:e=>lq.FromTape(e.ID,e.type,e.arguments),2082059205:e=>cq.FromTape(e.ID,e.type,e.arguments),734778138:e=>uq.FromTape(e.ID,e.type,e.arguments),1235345126:e=>hq.FromTape(e.ID,e.type,e.arguments),3689010777:e=>pq.FromTape(e.ID,e.type,e.arguments),2986769608:e=>dq.FromTape(e.ID,e.type,e.arguments),3657597509:e=>mq.FromTape(e.ID,e.type,e.arguments),1975003073:e=>fq.FromTape(e.ID,e.type,e.arguments),3979015343:e=>gq.FromTape(e.ID,e.type,e.arguments),2218152070:e=>_q.FromTape(e.ID,e.type,e.arguments),603775116:e=>vq.FromTape(e.ID,e.type,e.arguments),2830218821:e=>yq.FromTape(e.ID,e.type,e.arguments),3958052878:e=>bq.FromTape(e.ID,e.type,e.arguments),3049322572:e=>xq.FromTape(e.ID,e.type,e.arguments),148013059:e=>Tq.FromTape(e.ID,e.type,e.arguments),4095615324:e=>wq.FromTape(e.ID,e.type,e.arguments),2233826070:e=>Eq.FromTape(e.ID,e.type,e.arguments),2513912981:e=>Sq.FromTape(e.ID,e.type,e.arguments),699246055:e=>Iq.FromTape(e.ID,e.type,e.arguments),2028607225:e=>Mq.FromTape(e.ID,e.type,e.arguments),3101698114:e=>Aq.FromTape(e.ID,e.type,e.arguments),2809605785:e=>Rq.FromTape(e.ID,e.type,e.arguments),4124788165:e=>Dq.FromTape(e.ID,e.type,e.arguments),2934153892:e=>Cq.FromTape(e.ID,e.type,e.arguments),1300840506:e=>Oq.FromTape(e.ID,e.type,e.arguments),3303107099:e=>Pq.FromTape(e.ID,e.type,e.arguments),1607154358:e=>Nq.FromTape(e.ID,e.type,e.arguments),1878645084:e=>Lq.FromTape(e.ID,e.type,e.arguments),846575682:e=>kq.FromTape(e.ID,e.type,e.arguments),1351298697:e=>Fq.FromTape(e.ID,e.type,e.arguments),626085974:e=>Uq.FromTape(e.ID,e.type,e.arguments),2247615214:e=>Bq.FromTape(e.ID,e.type,e.arguments),1260650574:e=>jq.FromTape(e.ID,e.type,e.arguments),1096409881:e=>Gq.FromTape(e.ID,e.type,e.arguments),230924584:e=>zq.FromTape(e.ID,e.type,e.arguments),1162798199:e=>Vq.FromTape(e.ID,e.type,e.arguments),2315554128:e=>Hq.FromTape(e.ID,e.type,e.arguments),2254336722:e=>qq.FromTape(e.ID,e.type,e.arguments),413509423:e=>Wq.FromTape(e.ID,e.type,e.arguments),1580310250:e=>Yq.FromTape(e.ID,e.type,e.arguments),3071757647:e=>Xq.FromTape(e.ID,e.type,e.arguments),985171141:e=>$q.FromTape(e.ID,e.type,e.arguments),2043862942:e=>Kq.FromTape(e.ID,e.type,e.arguments),531007025:e=>Zq.FromTape(e.ID,e.type,e.arguments),812556717:e=>Jq.FromTape(e.ID,e.type,e.arguments),5716631:e=>Qq.FromTape(e.ID,e.type,e.arguments),3473067441:e=>eW.FromTape(e.ID,e.type,e.arguments),1549132990:e=>tW.FromTape(e.ID,e.type,e.arguments),2771591690:e=>nW.FromTape(e.ID,e.type,e.arguments),3206491090:e=>rW.FromTape(e.ID,e.type,e.arguments),912023232:e=>iW.FromTape(e.ID,e.type,e.arguments),3824725483:e=>sW.FromTape(e.ID,e.type,e.arguments),2347447852:e=>aW.FromTape(e.ID,e.type,e.arguments),3081323446:e=>oW.FromTape(e.ID,e.type,e.arguments),3663046924:e=>lW.FromTape(e.ID,e.type,e.arguments),2281632017:e=>cW.FromTape(e.ID,e.type,e.arguments),2415094496:e=>uW.FromTape(e.ID,e.type,e.arguments),2387106220:e=>hW.FromTape(e.ID,e.type,e.arguments),901063453:e=>pW.FromTape(e.ID,e.type,e.arguments),4282788508:e=>dW.FromTape(e.ID,e.type,e.arguments),3124975700:e=>mW.FromTape(e.ID,e.type,e.arguments),1447204868:e=>fW.FromTape(e.ID,e.type,e.arguments),1983826977:e=>gW.FromTape(e.ID,e.type,e.arguments),2636378356:e=>_W.FromTape(e.ID,e.type,e.arguments),1640371178:e=>vW.FromTape(e.ID,e.type,e.arguments),280115917:e=>yW.FromTape(e.ID,e.type,e.arguments),1742049831:e=>bW.FromTape(e.ID,e.type,e.arguments),2552916305:e=>xW.FromTape(e.ID,e.type,e.arguments),1210645708:e=>TW.FromTape(e.ID,e.type,e.arguments),3611470254:e=>wW.FromTape(e.ID,e.type,e.arguments),1199560280:e=>EW.FromTape(e.ID,e.type,e.arguments),3101149627:e=>SW.FromTape(e.ID,e.type,e.arguments),581633288:e=>IW.FromTape(e.ID,e.type,e.arguments),1377556343:e=>MW.FromTape(e.ID,e.type,e.arguments),1735638870:e=>AW.FromTape(e.ID,e.type,e.arguments),1935646853:e=>RW.FromTape(e.ID,e.type,e.arguments),3825984169:e=>DW.FromTape(e.ID,e.type,e.arguments),1692211062:e=>CW.FromTape(e.ID,e.type,e.arguments),2595432518:e=>OW.FromTape(e.ID,e.type,e.arguments),1620046519:e=>PW.FromTape(e.ID,e.type,e.arguments),2097647324:e=>NW.FromTape(e.ID,e.type,e.arguments),2715220739:e=>LW.FromTape(e.ID,e.type,e.arguments),2916149573:e=>kW.FromTape(e.ID,e.type,e.arguments),1229763772:e=>FW.FromTape(e.ID,e.type,e.arguments),3593883385:e=>UW.FromTape(e.ID,e.type,e.arguments),3026737570:e=>BW.FromTape(e.ID,e.type,e.arguments),1600972822:e=>jW.FromTape(e.ID,e.type,e.arguments),1628702193:e=>GW.FromTape(e.ID,e.type,e.arguments),3736923433:e=>zW.FromTape(e.ID,e.type,e.arguments),2347495698:e=>VW.FromTape(e.ID,e.type,e.arguments),3698973494:e=>HW.FromTape(e.ID,e.type,e.arguments),427810014:e=>qW.FromTape(e.ID,e.type,e.arguments),180925521:e=>WW.FromTape(e.ID,e.type,e.arguments),630975310:e=>YW.FromTape(e.ID,e.type,e.arguments),3179687236:e=>XW.FromTape(e.ID,e.type,e.arguments),4292641817:e=>$W.FromTape(e.ID,e.type,e.arguments),1911125066:e=>KW.FromTape(e.ID,e.type,e.arguments),4207607924:e=>ZW.FromTape(e.ID,e.type,e.arguments),728799441:e=>JW.FromTape(e.ID,e.type,e.arguments),1417489154:e=>QW.FromTape(e.ID,e.type,e.arguments),2799835756:e=>eY.FromTape(e.ID,e.type,e.arguments),2759199220:e=>tY.FromTape(e.ID,e.type,e.arguments),1907098498:e=>nY.FromTape(e.ID,e.type,e.arguments),1530820697:e=>rY.FromTape(e.ID,e.type,e.arguments),3956297820:e=>iY.FromTape(e.ID,e.type,e.arguments),2391383451:e=>sY.FromTape(e.ID,e.type,e.arguments),3313531582:e=>aY.FromTape(e.ID,e.type,e.arguments),2769231204:e=>oY.FromTape(e.ID,e.type,e.arguments),891718957:e=>lY.FromTape(e.ID,e.type,e.arguments),926996030:e=>cY.FromTape(e.ID,e.type,e.arguments),2391406946:e=>uY.FromTape(e.ID,e.type,e.arguments),4156078855:e=>hY.FromTape(e.ID,e.type,e.arguments),3512223829:e=>pY.FromTape(e.ID,e.type,e.arguments),1898987631:e=>dY.FromTape(e.ID,e.type,e.arguments),4237592921:e=>mY.FromTape(e.ID,e.type,e.arguments),1133259667:e=>fY.FromTape(e.ID,e.type,e.arguments),3304561284:e=>gY.FromTape(e.ID,e.type,e.arguments),336235671:e=>_Y.FromTape(e.ID,e.type,e.arguments),512836454:e=>vY.FromTape(e.ID,e.type,e.arguments),486154966:e=>yY.FromTape(e.ID,e.type,e.arguments),1299126871:e=>bY.FromTape(e.ID,e.type,e.arguments),4009809668:e=>xY.FromTape(e.ID,e.type,e.arguments),4088093105:e=>TY.FromTape(e.ID,e.type,e.arguments),1028945134:e=>wY.FromTape(e.ID,e.type,e.arguments),4218914973:e=>EY.FromTape(e.ID,e.type,e.arguments),3342526732:e=>SY.FromTape(e.ID,e.type,e.arguments),1236880293:e=>IY.FromTape(e.ID,e.type,e.arguments),2543172580:e=>MY.FromTape(e.ID,e.type,e.arguments),1033361043:e=>AY.FromTape(e.ID,e.type,e.arguments)};var wA=class{constructor(e){this.value=e}};wA.EMAIL="EMAIL",wA.FAX="FAX",wA.PHONE="PHONE",wA.POST="POST",wA.VERBAL="VERBAL",wA.USERDEFINED="USERDEFINED",wA.NOTDEFINED="NOTDEFINED";var EA=class{constructor(e){this.value=e}};EA.DEAD_LOAD_G="DEAD_LOAD_G",EA.COMPLETION_G1="COMPLETION_G1",EA.LIVE_LOAD_Q="LIVE_LOAD_Q",EA.SNOW_S="SNOW_S",EA.WIND_W="WIND_W",EA.PRESTRESSING_P="PRESTRESSING_P",EA.SETTLEMENT_U="SETTLEMENT_U",EA.TEMPERATURE_T="TEMPERATURE_T",EA.EARTHQUAKE_E="EARTHQUAKE_E",EA.FIRE="FIRE",EA.IMPULSE="IMPULSE",EA.IMPACT="IMPACT",EA.TRANSPORT="TRANSPORT",EA.ERECTION="ERECTION",EA.PROPPING="PROPPING",EA.SYSTEM_IMPERFECTION="SYSTEM_IMPERFECTION",EA.SHRINKAGE="SHRINKAGE",EA.CREEP="CREEP",EA.LACK_OF_FIT="LACK_OF_FIT",EA.BUOYANCY="BUOYANCY",EA.ICE="ICE",EA.CURRENT="CURRENT",EA.WAVE="WAVE",EA.RAIN="RAIN",EA.BRAKES="BRAKES",EA.USERDEFINED="USERDEFINED",EA.NOTDEFINED="NOTDEFINED";var SA=class{constructor(e){this.value=e}};SA.PERMANENT_G="PERMANENT_G",SA.VARIABLE_Q="VARIABLE_Q",SA.EXTRAORDINARY_A="EXTRAORDINARY_A",SA.USERDEFINED="USERDEFINED",SA.NOTDEFINED="NOTDEFINED";var IA=class{constructor(e){this.value=e}};IA.ELECTRICACTUATOR="ELECTRICACTUATOR",IA.HANDOPERATEDACTUATOR="HANDOPERATEDACTUATOR",IA.HYDRAULICACTUATOR="HYDRAULICACTUATOR",IA.PNEUMATICACTUATOR="PNEUMATICACTUATOR",IA.THERMOSTATICACTUATOR="THERMOSTATICACTUATOR",IA.USERDEFINED="USERDEFINED",IA.NOTDEFINED="NOTDEFINED";var MA=class{constructor(e){this.value=e}};MA.OFFICE="OFFICE",MA.SITE="SITE",MA.HOME="HOME",MA.DISTRIBUTIONPOINT="DISTRIBUTIONPOINT",MA.USERDEFINED="USERDEFINED";var AA=class{constructor(e){this.value=e}};AA.CONSTANTFLOW="CONSTANTFLOW",AA.VARIABLEFLOWPRESSUREDEPENDANT="VARIABLEFLOWPRESSUREDEPENDANT",AA.VARIABLEFLOWPRESSUREINDEPENDANT="VARIABLEFLOWPRESSUREINDEPENDANT",AA.USERDEFINED="USERDEFINED",AA.NOTDEFINED="NOTDEFINED";var RA=class{constructor(e){this.value=e}};RA.DIFFUSER="DIFFUSER",RA.GRILLE="GRILLE",RA.LOUVRE="LOUVRE",RA.REGISTER="REGISTER",RA.USERDEFINED="USERDEFINED",RA.NOTDEFINED="NOTDEFINED";var DA=class{constructor(e){this.value=e}};DA.FIXEDPLATECOUNTERFLOWEXCHANGER="FIXEDPLATECOUNTERFLOWEXCHANGER",DA.FIXEDPLATECROSSFLOWEXCHANGER="FIXEDPLATECROSSFLOWEXCHANGER",DA.FIXEDPLATEPARALLELFLOWEXCHANGER="FIXEDPLATEPARALLELFLOWEXCHANGER",DA.ROTARYWHEEL="ROTARYWHEEL",DA.RUNAROUNDCOILLOOP="RUNAROUNDCOILLOOP",DA.HEATPIPE="HEATPIPE",DA.TWINTOWERENTHALPYRECOVERYLOOPS="TWINTOWERENTHALPYRECOVERYLOOPS",DA.THERMOSIPHONSEALEDTUBEHEATEXCHANGERS="THERMOSIPHONSEALEDTUBEHEATEXCHANGERS",DA.THERMOSIPHONCOILTYPEHEATEXCHANGERS="THERMOSIPHONCOILTYPEHEATEXCHANGERS",DA.USERDEFINED="USERDEFINED",DA.NOTDEFINED="NOTDEFINED";var CA=class{constructor(e){this.value=e}};CA.BELL="BELL",CA.BREAKGLASSBUTTON="BREAKGLASSBUTTON",CA.LIGHT="LIGHT",CA.MANUALPULLBOX="MANUALPULLBOX",CA.SIREN="SIREN",CA.WHISTLE="WHISTLE",CA.USERDEFINED="USERDEFINED",CA.NOTDEFINED="NOTDEFINED";var OA=class{constructor(e){this.value=e}};OA.USERDEFINED="USERDEFINED",OA.NOTDEFINED="NOTDEFINED";var PA=class{constructor(e){this.value=e}};PA.IN_PLANE_LOADING_2D="IN_PLANE_LOADING_2D",PA.OUT_PLANE_LOADING_2D="OUT_PLANE_LOADING_2D",PA.LOADING_3D="LOADING_3D",PA.USERDEFINED="USERDEFINED",PA.NOTDEFINED="NOTDEFINED";var NA=class{constructor(e){this.value=e}};NA.FIRST_ORDER_THEORY="FIRST_ORDER_THEORY",NA.SECOND_ORDER_THEORY="SECOND_ORDER_THEORY",NA.THIRD_ORDER_THEORY="THIRD_ORDER_THEORY",NA.FULL_NONLINEAR_THEORY="FULL_NONLINEAR_THEORY",NA.USERDEFINED="USERDEFINED",NA.NOTDEFINED="NOTDEFINED";var LA=class{constructor(e){this.value=e}};LA.ADD="ADD",LA.DIVIDE="DIVIDE",LA.MULTIPLY="MULTIPLY",LA.SUBTRACT="SUBTRACT";var kA=class{constructor(e){this.value=e}};kA.SITE="SITE",kA.FACTORY="FACTORY",kA.NOTDEFINED="NOTDEFINED";var FA=class{constructor(e){this.value=e}};FA.AMPLIFIER="AMPLIFIER",FA.CAMERA="CAMERA",FA.DISPLAY="DISPLAY",FA.MICROPHONE="MICROPHONE",FA.PLAYER="PLAYER",FA.PROJECTOR="PROJECTOR",FA.RECEIVER="RECEIVER",FA.SPEAKER="SPEAKER",FA.SWITCHER="SWITCHER",FA.TELEPHONE="TELEPHONE",FA.TUNER="TUNER",FA.USERDEFINED="USERDEFINED",FA.NOTDEFINED="NOTDEFINED";var UA=class{constructor(e){this.value=e}};UA.POLYLINE_FORM="POLYLINE_FORM",UA.CIRCULAR_ARC="CIRCULAR_ARC",UA.ELLIPTIC_ARC="ELLIPTIC_ARC",UA.PARABOLIC_ARC="PARABOLIC_ARC",UA.HYPERBOLIC_ARC="HYPERBOLIC_ARC",UA.UNSPECIFIED="UNSPECIFIED";var BA=class{constructor(e){this.value=e}};BA.PLANE_SURF="PLANE_SURF",BA.CYLINDRICAL_SURF="CYLINDRICAL_SURF",BA.CONICAL_SURF="CONICAL_SURF",BA.SPHERICAL_SURF="SPHERICAL_SURF",BA.TOROIDAL_SURF="TOROIDAL_SURF",BA.SURF_OF_REVOLUTION="SURF_OF_REVOLUTION",BA.RULED_SURF="RULED_SURF",BA.GENERALISED_CONE="GENERALISED_CONE",BA.QUADRIC_SURF="QUADRIC_SURF",BA.SURF_OF_LINEAR_EXTRUSION="SURF_OF_LINEAR_EXTRUSION",BA.UNSPECIFIED="UNSPECIFIED";var jA=class{constructor(e){this.value=e}};jA.BEAM="BEAM",jA.JOIST="JOIST",jA.HOLLOWCORE="HOLLOWCORE",jA.LINTEL="LINTEL",jA.SPANDREL="SPANDREL",jA.T_BEAM="T_BEAM",jA.GIRDER_SEGMENT="GIRDER_SEGMENT",jA.DIAPHRAGM="DIAPHRAGM",jA.PIERCAP="PIERCAP",jA.HATSTONE="HATSTONE",jA.CORNICE="CORNICE",jA.EDGEBEAM="EDGEBEAM",jA.USERDEFINED="USERDEFINED",jA.NOTDEFINED="NOTDEFINED";var GA=class{constructor(e){this.value=e}};GA.FIXED_MOVEMENT="FIXED_MOVEMENT",GA.GUIDED_LONGITUDINAL="GUIDED_LONGITUDINAL",GA.GUIDED_TRANSVERSAL="GUIDED_TRANSVERSAL",GA.FREE_MOVEMENT="FREE_MOVEMENT",GA.NOTDEFINED="NOTDEFINED";var zA=class{constructor(e){this.value=e}};zA.CYLINDRICAL="CYLINDRICAL",zA.SPHERICAL="SPHERICAL",zA.ELASTOMERIC="ELASTOMERIC",zA.POT="POT",zA.GUIDE="GUIDE",zA.ROCKER="ROCKER",zA.ROLLER="ROLLER",zA.DISK="DISK",zA.USERDEFINED="USERDEFINED",zA.NOTDEFINED="NOTDEFINED";var VA=class{constructor(e){this.value=e}};VA.GREATERTHAN="GREATERTHAN",VA.GREATERTHANOREQUALTO="GREATERTHANOREQUALTO",VA.LESSTHAN="LESSTHAN",VA.LESSTHANOREQUALTO="LESSTHANOREQUALTO",VA.EQUALTO="EQUALTO",VA.NOTEQUALTO="NOTEQUALTO",VA.INCLUDES="INCLUDES",VA.NOTINCLUDES="NOTINCLUDES",VA.INCLUDEDIN="INCLUDEDIN",VA.NOTINCLUDEDIN="NOTINCLUDEDIN";var HA=class{constructor(e){this.value=e}};HA.WATER="WATER",HA.STEAM="STEAM",HA.USERDEFINED="USERDEFINED",HA.NOTDEFINED="NOTDEFINED";var qA=class{constructor(e){this.value=e}};qA.UNION="UNION",qA.INTERSECTION="INTERSECTION",qA.DIFFERENCE="DIFFERENCE";var WA=class{constructor(e){this.value=e}};WA.ABUTMENT="ABUTMENT",WA.DECK="DECK",WA.DECK_SEGMENT="DECK_SEGMENT",WA.FOUNDATION="FOUNDATION",WA.PIER="PIER",WA.PIER_SEGMENT="PIER_SEGMENT",WA.PYLON="PYLON",WA.SUBSTRUCTURE="SUBSTRUCTURE",WA.SUPERSTRUCTURE="SUPERSTRUCTURE",WA.SURFACESTRUCTURE="SURFACESTRUCTURE",WA.USERDEFINED="USERDEFINED",WA.NOTDEFINED="NOTDEFINED";var YA=class{constructor(e){this.value=e}};YA.ARCHED="ARCHED",YA.CABLE_STAYED="CABLE_STAYED",YA.CANTILEVER="CANTILEVER",YA.CULVERT="CULVERT",YA.FRAMEWORK="FRAMEWORK",YA.GIRDER="GIRDER",YA.SUSPENSION="SUSPENSION",YA.TRUSS="TRUSS",YA.USERDEFINED="USERDEFINED",YA.NOTDEFINED="NOTDEFINED";var XA=class{constructor(e){this.value=e}};XA.INSULATION="INSULATION",XA.PRECASTPANEL="PRECASTPANEL",XA.APRON="APRON",XA.USERDEFINED="USERDEFINED",XA.NOTDEFINED="NOTDEFINED";var $A=class{constructor(e){this.value=e}};$A.COMPLEX="COMPLEX",$A.ELEMENT="ELEMENT",$A.PARTIAL="PARTIAL",$A.PROVISIONFORVOID="PROVISIONFORVOID",$A.PROVISIONFORSPACE="PROVISIONFORSPACE",$A.USERDEFINED="USERDEFINED",$A.NOTDEFINED="NOTDEFINED";var KA=class{constructor(e){this.value=e}};KA.FENESTRATION="FENESTRATION",KA.FOUNDATION="FOUNDATION",KA.LOADBEARING="LOADBEARING",KA.OUTERSHELL="OUTERSHELL",KA.SHADING="SHADING",KA.TRANSPORT="TRANSPORT",KA.REINFORCING="REINFORCING",KA.PRESTRESSING="PRESTRESSING",KA.USERDEFINED="USERDEFINED",KA.NOTDEFINED="NOTDEFINED";var ZA=class{constructor(e){this.value=e}};ZA.USERDEFINED="USERDEFINED",ZA.NOTDEFINED="NOTDEFINED";var JA=class{constructor(e){this.value=e}};JA.BEND="BEND",JA.CROSS="CROSS",JA.REDUCER="REDUCER",JA.TEE="TEE",JA.USERDEFINED="USERDEFINED",JA.NOTDEFINED="NOTDEFINED";var QA=class{constructor(e){this.value=e}};QA.CABLELADDERSEGMENT="CABLELADDERSEGMENT",QA.CABLETRAYSEGMENT="CABLETRAYSEGMENT",QA.CABLETRUNKINGSEGMENT="CABLETRUNKINGSEGMENT",QA.CONDUITSEGMENT="CONDUITSEGMENT",QA.USERDEFINED="USERDEFINED",QA.NOTDEFINED="NOTDEFINED";var eR=class{constructor(e){this.value=e}};eR.CONNECTOR="CONNECTOR",eR.ENTRY="ENTRY",eR.EXIT="EXIT",eR.JUNCTION="JUNCTION",eR.TRANSITION="TRANSITION",eR.USERDEFINED="USERDEFINED",eR.NOTDEFINED="NOTDEFINED";var tR=class{constructor(e){this.value=e}};tR.BUSBARSEGMENT="BUSBARSEGMENT",tR.CABLESEGMENT="CABLESEGMENT",tR.CONDUCTORSEGMENT="CONDUCTORSEGMENT",tR.CORESEGMENT="CORESEGMENT",tR.USERDEFINED="USERDEFINED",tR.NOTDEFINED="NOTDEFINED";var nR=class{constructor(e){this.value=e}};nR.WELL="WELL",nR.CAISSON="CAISSON",nR.USERDEFINED="USERDEFINED",nR.NOTDEFINED="NOTDEFINED";var rR=class{constructor(e){this.value=e}};rR.NOCHANGE="NOCHANGE",rR.MODIFIED="MODIFIED",rR.ADDED="ADDED",rR.DELETED="DELETED",rR.NOTDEFINED="NOTDEFINED";var iR=class{constructor(e){this.value=e}};iR.AIRCOOLED="AIRCOOLED",iR.WATERCOOLED="WATERCOOLED",iR.HEATRECOVERY="HEATRECOVERY",iR.USERDEFINED="USERDEFINED",iR.NOTDEFINED="NOTDEFINED";var sR=class{constructor(e){this.value=e}};sR.USERDEFINED="USERDEFINED",sR.NOTDEFINED="NOTDEFINED";var aR=class{constructor(e){this.value=e}};aR.DXCOOLINGCOIL="DXCOOLINGCOIL",aR.ELECTRICHEATINGCOIL="ELECTRICHEATINGCOIL",aR.GASHEATINGCOIL="GASHEATINGCOIL",aR.HYDRONICCOIL="HYDRONICCOIL",aR.STEAMHEATINGCOIL="STEAMHEATINGCOIL",aR.WATERCOOLINGCOIL="WATERCOOLINGCOIL",aR.WATERHEATINGCOIL="WATERHEATINGCOIL",aR.USERDEFINED="USERDEFINED",aR.NOTDEFINED="NOTDEFINED";var oR=class{constructor(e){this.value=e}};oR.COLUMN="COLUMN",oR.PILASTER="PILASTER",oR.PIERSTEM="PIERSTEM",oR.PIERSTEM_SEGMENT="PIERSTEM_SEGMENT",oR.STANDCOLUMN="STANDCOLUMN",oR.USERDEFINED="USERDEFINED",oR.NOTDEFINED="NOTDEFINED";var lR=class{constructor(e){this.value=e}};lR.ANTENNA="ANTENNA",lR.COMPUTER="COMPUTER",lR.FAX="FAX",lR.GATEWAY="GATEWAY",lR.MODEM="MODEM",lR.NETWORKAPPLIANCE="NETWORKAPPLIANCE",lR.NETWORKBRIDGE="NETWORKBRIDGE",lR.NETWORKHUB="NETWORKHUB",lR.PRINTER="PRINTER",lR.REPEATER="REPEATER",lR.ROUTER="ROUTER",lR.SCANNER="SCANNER",lR.USERDEFINED="USERDEFINED",lR.NOTDEFINED="NOTDEFINED";var cR=class{constructor(e){this.value=e}};cR.P_COMPLEX="P_COMPLEX",cR.Q_COMPLEX="Q_COMPLEX";var uR=class{constructor(e){this.value=e}};uR.DYNAMIC="DYNAMIC",uR.RECIPROCATING="RECIPROCATING",uR.ROTARY="ROTARY",uR.SCROLL="SCROLL",uR.TROCHOIDAL="TROCHOIDAL",uR.SINGLESTAGE="SINGLESTAGE",uR.BOOSTER="BOOSTER",uR.OPENTYPE="OPENTYPE",uR.HERMETIC="HERMETIC",uR.SEMIHERMETIC="SEMIHERMETIC",uR.WELDEDSHELLHERMETIC="WELDEDSHELLHERMETIC",uR.ROLLINGPISTON="ROLLINGPISTON",uR.ROTARYVANE="ROTARYVANE",uR.SINGLESCREW="SINGLESCREW",uR.TWINSCREW="TWINSCREW",uR.USERDEFINED="USERDEFINED",uR.NOTDEFINED="NOTDEFINED";var hR=class{constructor(e){this.value=e}};hR.AIRCOOLED="AIRCOOLED",hR.EVAPORATIVECOOLED="EVAPORATIVECOOLED",hR.WATERCOOLED="WATERCOOLED",hR.WATERCOOLEDBRAZEDPLATE="WATERCOOLEDBRAZEDPLATE",hR.WATERCOOLEDSHELLCOIL="WATERCOOLEDSHELLCOIL",hR.WATERCOOLEDSHELLTUBE="WATERCOOLEDSHELLTUBE",hR.WATERCOOLEDTUBEINTUBE="WATERCOOLEDTUBEINTUBE",hR.USERDEFINED="USERDEFINED",hR.NOTDEFINED="NOTDEFINED";var pR=class{constructor(e){this.value=e}};pR.ATPATH="ATPATH",pR.ATSTART="ATSTART",pR.ATEND="ATEND",pR.NOTDEFINED="NOTDEFINED";var dR=class{constructor(e){this.value=e}};dR.HARD="HARD",dR.SOFT="SOFT",dR.ADVISORY="ADVISORY",dR.USERDEFINED="USERDEFINED",dR.NOTDEFINED="NOTDEFINED";var mR=class{constructor(e){this.value=e}};mR.DEMOLISHING="DEMOLISHING",mR.EARTHMOVING="EARTHMOVING",mR.ERECTING="ERECTING",mR.HEATING="HEATING",mR.LIGHTING="LIGHTING",mR.PAVING="PAVING",mR.PUMPING="PUMPING",mR.TRANSPORTING="TRANSPORTING",mR.USERDEFINED="USERDEFINED",mR.NOTDEFINED="NOTDEFINED";var fR=class{constructor(e){this.value=e}};fR.AGGREGATES="AGGREGATES",fR.CONCRETE="CONCRETE",fR.DRYWALL="DRYWALL",fR.FUEL="FUEL",fR.GYPSUM="GYPSUM",fR.MASONRY="MASONRY",fR.METAL="METAL",fR.PLASTIC="PLASTIC",fR.WOOD="WOOD",fR.NOTDEFINED="NOTDEFINED",fR.USERDEFINED="USERDEFINED";var gR=class{constructor(e){this.value=e}};gR.ASSEMBLY="ASSEMBLY",gR.FORMWORK="FORMWORK",gR.USERDEFINED="USERDEFINED",gR.NOTDEFINED="NOTDEFINED";var _R=class{constructor(e){this.value=e}};_R.FLOATING="FLOATING",_R.PROGRAMMABLE="PROGRAMMABLE",_R.PROPORTIONAL="PROPORTIONAL",_R.MULTIPOSITION="MULTIPOSITION",_R.TWOPOSITION="TWOPOSITION",_R.USERDEFINED="USERDEFINED",_R.NOTDEFINED="NOTDEFINED";var vR=class{constructor(e){this.value=e}};vR.ACTIVE="ACTIVE",vR.PASSIVE="PASSIVE",vR.USERDEFINED="USERDEFINED",vR.NOTDEFINED="NOTDEFINED";var yR=class{constructor(e){this.value=e}};yR.NATURALDRAFT="NATURALDRAFT",yR.MECHANICALINDUCEDDRAFT="MECHANICALINDUCEDDRAFT",yR.MECHANICALFORCEDDRAFT="MECHANICALFORCEDDRAFT",yR.USERDEFINED="USERDEFINED",yR.NOTDEFINED="NOTDEFINED";var bR=class{constructor(e){this.value=e}};bR.USERDEFINED="USERDEFINED",bR.NOTDEFINED="NOTDEFINED";var xR=class{constructor(e){this.value=e}};xR.BUDGET="BUDGET",xR.COSTPLAN="COSTPLAN",xR.ESTIMATE="ESTIMATE",xR.TENDER="TENDER",xR.PRICEDBILLOFQUANTITIES="PRICEDBILLOFQUANTITIES",xR.UNPRICEDBILLOFQUANTITIES="UNPRICEDBILLOFQUANTITIES",xR.SCHEDULEOFRATES="SCHEDULEOFRATES",xR.USERDEFINED="USERDEFINED",xR.NOTDEFINED="NOTDEFINED";var TR=class{constructor(e){this.value=e}};TR.CEILING="CEILING",TR.FLOORING="FLOORING",TR.CLADDING="CLADDING",TR.ROOFING="ROOFING",TR.MOLDING="MOLDING",TR.SKIRTINGBOARD="SKIRTINGBOARD",TR.INSULATION="INSULATION",TR.MEMBRANE="MEMBRANE",TR.SLEEVING="SLEEVING",TR.WRAPPING="WRAPPING",TR.COPING="COPING",TR.USERDEFINED="USERDEFINED",TR.NOTDEFINED="NOTDEFINED";var wR=class{constructor(e){this.value=e}};wR.OFFICE="OFFICE",wR.SITE="SITE",wR.USERDEFINED="USERDEFINED",wR.NOTDEFINED="NOTDEFINED";var ER=class{constructor(e){this.value=e}};ER.USERDEFINED="USERDEFINED",ER.NOTDEFINED="NOTDEFINED";var SR=class{constructor(e){this.value=e}};SR.LINEAR="LINEAR",SR.LOG_LINEAR="LOG_LINEAR",SR.LOG_LOG="LOG_LOG",SR.NOTDEFINED="NOTDEFINED";var IR=class{constructor(e){this.value=e}};IR.BACKDRAFTDAMPER="BACKDRAFTDAMPER",IR.BALANCINGDAMPER="BALANCINGDAMPER",IR.BLASTDAMPER="BLASTDAMPER",IR.CONTROLDAMPER="CONTROLDAMPER",IR.FIREDAMPER="FIREDAMPER",IR.FIRESMOKEDAMPER="FIRESMOKEDAMPER",IR.FUMEHOODEXHAUST="FUMEHOODEXHAUST",IR.GRAVITYDAMPER="GRAVITYDAMPER",IR.GRAVITYRELIEFDAMPER="GRAVITYRELIEFDAMPER",IR.RELIEFDAMPER="RELIEFDAMPER",IR.SMOKEDAMPER="SMOKEDAMPER",IR.USERDEFINED="USERDEFINED",IR.NOTDEFINED="NOTDEFINED";var MR=class{constructor(e){this.value=e}};MR.MEASURED="MEASURED",MR.PREDICTED="PREDICTED",MR.SIMULATED="SIMULATED",MR.USERDEFINED="USERDEFINED",MR.NOTDEFINED="NOTDEFINED";var AR=class{constructor(e){this.value=e}};AR.ANGULARVELOCITYUNIT="ANGULARVELOCITYUNIT",AR.AREADENSITYUNIT="AREADENSITYUNIT",AR.COMPOUNDPLANEANGLEUNIT="COMPOUNDPLANEANGLEUNIT",AR.DYNAMICVISCOSITYUNIT="DYNAMICVISCOSITYUNIT",AR.HEATFLUXDENSITYUNIT="HEATFLUXDENSITYUNIT",AR.INTEGERCOUNTRATEUNIT="INTEGERCOUNTRATEUNIT",AR.ISOTHERMALMOISTURECAPACITYUNIT="ISOTHERMALMOISTURECAPACITYUNIT",AR.KINEMATICVISCOSITYUNIT="KINEMATICVISCOSITYUNIT",AR.LINEARVELOCITYUNIT="LINEARVELOCITYUNIT",AR.MASSDENSITYUNIT="MASSDENSITYUNIT",AR.MASSFLOWRATEUNIT="MASSFLOWRATEUNIT",AR.MOISTUREDIFFUSIVITYUNIT="MOISTUREDIFFUSIVITYUNIT",AR.MOLECULARWEIGHTUNIT="MOLECULARWEIGHTUNIT",AR.SPECIFICHEATCAPACITYUNIT="SPECIFICHEATCAPACITYUNIT",AR.THERMALADMITTANCEUNIT="THERMALADMITTANCEUNIT",AR.THERMALCONDUCTANCEUNIT="THERMALCONDUCTANCEUNIT",AR.THERMALRESISTANCEUNIT="THERMALRESISTANCEUNIT",AR.THERMALTRANSMITTANCEUNIT="THERMALTRANSMITTANCEUNIT",AR.VAPORPERMEABILITYUNIT="VAPORPERMEABILITYUNIT",AR.VOLUMETRICFLOWRATEUNIT="VOLUMETRICFLOWRATEUNIT",AR.ROTATIONALFREQUENCYUNIT="ROTATIONALFREQUENCYUNIT",AR.TORQUEUNIT="TORQUEUNIT",AR.MOMENTOFINERTIAUNIT="MOMENTOFINERTIAUNIT",AR.LINEARMOMENTUNIT="LINEARMOMENTUNIT",AR.LINEARFORCEUNIT="LINEARFORCEUNIT",AR.PLANARFORCEUNIT="PLANARFORCEUNIT",AR.MODULUSOFELASTICITYUNIT="MODULUSOFELASTICITYUNIT",AR.SHEARMODULUSUNIT="SHEARMODULUSUNIT",AR.LINEARSTIFFNESSUNIT="LINEARSTIFFNESSUNIT",AR.ROTATIONALSTIFFNESSUNIT="ROTATIONALSTIFFNESSUNIT",AR.MODULUSOFSUBGRADEREACTIONUNIT="MODULUSOFSUBGRADEREACTIONUNIT",AR.ACCELERATIONUNIT="ACCELERATIONUNIT",AR.CURVATUREUNIT="CURVATUREUNIT",AR.HEATINGVALUEUNIT="HEATINGVALUEUNIT",AR.IONCONCENTRATIONUNIT="IONCONCENTRATIONUNIT",AR.LUMINOUSINTENSITYDISTRIBUTIONUNIT="LUMINOUSINTENSITYDISTRIBUTIONUNIT",AR.MASSPERLENGTHUNIT="MASSPERLENGTHUNIT",AR.MODULUSOFLINEARSUBGRADEREACTIONUNIT="MODULUSOFLINEARSUBGRADEREACTIONUNIT",AR.MODULUSOFROTATIONALSUBGRADEREACTIONUNIT="MODULUSOFROTATIONALSUBGRADEREACTIONUNIT",AR.PHUNIT="PHUNIT",AR.ROTATIONALMASSUNIT="ROTATIONALMASSUNIT",AR.SECTIONAREAINTEGRALUNIT="SECTIONAREAINTEGRALUNIT",AR.SECTIONMODULUSUNIT="SECTIONMODULUSUNIT",AR.SOUNDPOWERLEVELUNIT="SOUNDPOWERLEVELUNIT",AR.SOUNDPOWERUNIT="SOUNDPOWERUNIT",AR.SOUNDPRESSURELEVELUNIT="SOUNDPRESSURELEVELUNIT",AR.SOUNDPRESSUREUNIT="SOUNDPRESSUREUNIT",AR.TEMPERATUREGRADIENTUNIT="TEMPERATUREGRADIENTUNIT",AR.TEMPERATURERATEOFCHANGEUNIT="TEMPERATURERATEOFCHANGEUNIT",AR.THERMALEXPANSIONCOEFFICIENTUNIT="THERMALEXPANSIONCOEFFICIENTUNIT",AR.WARPINGCONSTANTUNIT="WARPINGCONSTANTUNIT",AR.WARPINGMOMENTUNIT="WARPINGMOMENTUNIT",AR.USERDEFINED="USERDEFINED";var RR=class{constructor(e){this.value=e}};RR.POSITIVE="POSITIVE",RR.NEGATIVE="NEGATIVE";var DR=class{constructor(e){this.value=e}};DR.ANCHORPLATE="ANCHORPLATE",DR.BRACKET="BRACKET",DR.SHOE="SHOE",DR.EXPANSION_JOINT_DEVICE="EXPANSION_JOINT_DEVICE",DR.USERDEFINED="USERDEFINED",DR.NOTDEFINED="NOTDEFINED";var CR=class{constructor(e){this.value=e}};CR.FORMEDDUCT="FORMEDDUCT",CR.INSPECTIONCHAMBER="INSPECTIONCHAMBER",CR.INSPECTIONPIT="INSPECTIONPIT",CR.MANHOLE="MANHOLE",CR.METERCHAMBER="METERCHAMBER",CR.SUMP="SUMP",CR.TRENCH="TRENCH",CR.VALVECHAMBER="VALVECHAMBER",CR.USERDEFINED="USERDEFINED",CR.NOTDEFINED="NOTDEFINED";var OR=class{constructor(e){this.value=e}};OR.CABLE="CABLE",OR.CABLECARRIER="CABLECARRIER",OR.DUCT="DUCT",OR.PIPE="PIPE",OR.USERDEFINED="USERDEFINED",OR.NOTDEFINED="NOTDEFINED";var PR=class{constructor(e){this.value=e}};PR.AIRCONDITIONING="AIRCONDITIONING",PR.AUDIOVISUAL="AUDIOVISUAL",PR.CHEMICAL="CHEMICAL",PR.CHILLEDWATER="CHILLEDWATER",PR.COMMUNICATION="COMMUNICATION",PR.COMPRESSEDAIR="COMPRESSEDAIR",PR.CONDENSERWATER="CONDENSERWATER",PR.CONTROL="CONTROL",PR.CONVEYING="CONVEYING",PR.DATA="DATA",PR.DISPOSAL="DISPOSAL",PR.DOMESTICCOLDWATER="DOMESTICCOLDWATER",PR.DOMESTICHOTWATER="DOMESTICHOTWATER",PR.DRAINAGE="DRAINAGE",PR.EARTHING="EARTHING",PR.ELECTRICAL="ELECTRICAL",PR.ELECTROACOUSTIC="ELECTROACOUSTIC",PR.EXHAUST="EXHAUST",PR.FIREPROTECTION="FIREPROTECTION",PR.FUEL="FUEL",PR.GAS="GAS",PR.HAZARDOUS="HAZARDOUS",PR.HEATING="HEATING",PR.LIGHTING="LIGHTING",PR.LIGHTNINGPROTECTION="LIGHTNINGPROTECTION",PR.MUNICIPALSOLIDWASTE="MUNICIPALSOLIDWASTE",PR.OIL="OIL",PR.OPERATIONAL="OPERATIONAL",PR.POWERGENERATION="POWERGENERATION",PR.RAINWATER="RAINWATER",PR.REFRIGERATION="REFRIGERATION",PR.SECURITY="SECURITY",PR.SEWAGE="SEWAGE",PR.SIGNAL="SIGNAL",PR.STORMWATER="STORMWATER",PR.TELEPHONE="TELEPHONE",PR.TV="TV",PR.VACUUM="VACUUM",PR.VENT="VENT",PR.VENTILATION="VENTILATION",PR.WASTEWATER="WASTEWATER",PR.WATERSUPPLY="WATERSUPPLY",PR.USERDEFINED="USERDEFINED",PR.NOTDEFINED="NOTDEFINED";var NR=class{constructor(e){this.value=e}};NR.PUBLIC="PUBLIC",NR.RESTRICTED="RESTRICTED",NR.CONFIDENTIAL="CONFIDENTIAL",NR.PERSONAL="PERSONAL",NR.USERDEFINED="USERDEFINED",NR.NOTDEFINED="NOTDEFINED";var LR=class{constructor(e){this.value=e}};LR.DRAFT="DRAFT",LR.FINALDRAFT="FINALDRAFT",LR.FINAL="FINAL",LR.REVISION="REVISION",LR.NOTDEFINED="NOTDEFINED";var kR=class{constructor(e){this.value=e}};kR.SWINGING="SWINGING",kR.DOUBLE_ACTING="DOUBLE_ACTING",kR.SLIDING="SLIDING",kR.FOLDING="FOLDING",kR.REVOLVING="REVOLVING",kR.ROLLINGUP="ROLLINGUP",kR.FIXEDPANEL="FIXEDPANEL",kR.USERDEFINED="USERDEFINED",kR.NOTDEFINED="NOTDEFINED";var FR=class{constructor(e){this.value=e}};FR.LEFT="LEFT",FR.MIDDLE="MIDDLE",FR.RIGHT="RIGHT",FR.NOTDEFINED="NOTDEFINED";var UR=class{constructor(e){this.value=e}};UR.ALUMINIUM="ALUMINIUM",UR.HIGH_GRADE_STEEL="HIGH_GRADE_STEEL",UR.STEEL="STEEL",UR.WOOD="WOOD",UR.ALUMINIUM_WOOD="ALUMINIUM_WOOD",UR.ALUMINIUM_PLASTIC="ALUMINIUM_PLASTIC",UR.PLASTIC="PLASTIC",UR.USERDEFINED="USERDEFINED",UR.NOTDEFINED="NOTDEFINED";var BR=class{constructor(e){this.value=e}};BR.SINGLE_SWING_LEFT="SINGLE_SWING_LEFT",BR.SINGLE_SWING_RIGHT="SINGLE_SWING_RIGHT",BR.DOUBLE_DOOR_SINGLE_SWING="DOUBLE_DOOR_SINGLE_SWING",BR.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT",BR.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT",BR.DOUBLE_SWING_LEFT="DOUBLE_SWING_LEFT",BR.DOUBLE_SWING_RIGHT="DOUBLE_SWING_RIGHT",BR.DOUBLE_DOOR_DOUBLE_SWING="DOUBLE_DOOR_DOUBLE_SWING",BR.SLIDING_TO_LEFT="SLIDING_TO_LEFT",BR.SLIDING_TO_RIGHT="SLIDING_TO_RIGHT",BR.DOUBLE_DOOR_SLIDING="DOUBLE_DOOR_SLIDING",BR.FOLDING_TO_LEFT="FOLDING_TO_LEFT",BR.FOLDING_TO_RIGHT="FOLDING_TO_RIGHT",BR.DOUBLE_DOOR_FOLDING="DOUBLE_DOOR_FOLDING",BR.REVOLVING="REVOLVING",BR.ROLLINGUP="ROLLINGUP",BR.USERDEFINED="USERDEFINED",BR.NOTDEFINED="NOTDEFINED";var jR=class{constructor(e){this.value=e}};jR.DOOR="DOOR",jR.GATE="GATE",jR.TRAPDOOR="TRAPDOOR",jR.USERDEFINED="USERDEFINED",jR.NOTDEFINED="NOTDEFINED";var GR=class{constructor(e){this.value=e}};GR.SINGLE_SWING_LEFT="SINGLE_SWING_LEFT",GR.SINGLE_SWING_RIGHT="SINGLE_SWING_RIGHT",GR.DOUBLE_DOOR_SINGLE_SWING="DOUBLE_DOOR_SINGLE_SWING",GR.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT",GR.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT",GR.DOUBLE_SWING_LEFT="DOUBLE_SWING_LEFT",GR.DOUBLE_SWING_RIGHT="DOUBLE_SWING_RIGHT",GR.DOUBLE_DOOR_DOUBLE_SWING="DOUBLE_DOOR_DOUBLE_SWING",GR.SLIDING_TO_LEFT="SLIDING_TO_LEFT",GR.SLIDING_TO_RIGHT="SLIDING_TO_RIGHT",GR.DOUBLE_DOOR_SLIDING="DOUBLE_DOOR_SLIDING",GR.FOLDING_TO_LEFT="FOLDING_TO_LEFT",GR.FOLDING_TO_RIGHT="FOLDING_TO_RIGHT",GR.DOUBLE_DOOR_FOLDING="DOUBLE_DOOR_FOLDING",GR.REVOLVING="REVOLVING",GR.ROLLINGUP="ROLLINGUP",GR.SWING_FIXED_LEFT="SWING_FIXED_LEFT",GR.SWING_FIXED_RIGHT="SWING_FIXED_RIGHT",GR.USERDEFINED="USERDEFINED",GR.NOTDEFINED="NOTDEFINED";var zR=class{constructor(e){this.value=e}};zR.BEND="BEND",zR.CONNECTOR="CONNECTOR",zR.ENTRY="ENTRY",zR.EXIT="EXIT",zR.JUNCTION="JUNCTION",zR.OBSTRUCTION="OBSTRUCTION",zR.TRANSITION="TRANSITION",zR.USERDEFINED="USERDEFINED",zR.NOTDEFINED="NOTDEFINED";var VR=class{constructor(e){this.value=e}};VR.RIGIDSEGMENT="RIGIDSEGMENT",VR.FLEXIBLESEGMENT="FLEXIBLESEGMENT",VR.USERDEFINED="USERDEFINED",VR.NOTDEFINED="NOTDEFINED";var HR=class{constructor(e){this.value=e}};HR.FLATOVAL="FLATOVAL",HR.RECTANGULAR="RECTANGULAR",HR.ROUND="ROUND",HR.USERDEFINED="USERDEFINED",HR.NOTDEFINED="NOTDEFINED";var qR=class{constructor(e){this.value=e}};qR.DISHWASHER="DISHWASHER",qR.ELECTRICCOOKER="ELECTRICCOOKER",qR.FREESTANDINGELECTRICHEATER="FREESTANDINGELECTRICHEATER",qR.FREESTANDINGFAN="FREESTANDINGFAN",qR.FREESTANDINGWATERHEATER="FREESTANDINGWATERHEATER",qR.FREESTANDINGWATERCOOLER="FREESTANDINGWATERCOOLER",qR.FREEZER="FREEZER",qR.FRIDGE_FREEZER="FRIDGE_FREEZER",qR.HANDDRYER="HANDDRYER",qR.KITCHENMACHINE="KITCHENMACHINE",qR.MICROWAVE="MICROWAVE",qR.PHOTOCOPIER="PHOTOCOPIER",qR.REFRIGERATOR="REFRIGERATOR",qR.TUMBLEDRYER="TUMBLEDRYER",qR.VENDINGMACHINE="VENDINGMACHINE",qR.WASHINGMACHINE="WASHINGMACHINE",qR.USERDEFINED="USERDEFINED",qR.NOTDEFINED="NOTDEFINED";var WR=class{constructor(e){this.value=e}};WR.CONSUMERUNIT="CONSUMERUNIT",WR.DISTRIBUTIONBOARD="DISTRIBUTIONBOARD",WR.MOTORCONTROLCENTRE="MOTORCONTROLCENTRE",WR.SWITCHBOARD="SWITCHBOARD",WR.USERDEFINED="USERDEFINED",WR.NOTDEFINED="NOTDEFINED";var YR=class{constructor(e){this.value=e}};YR.BATTERY="BATTERY",YR.CAPACITORBANK="CAPACITORBANK",YR.HARMONICFILTER="HARMONICFILTER",YR.INDUCTORBANK="INDUCTORBANK",YR.UPS="UPS",YR.USERDEFINED="USERDEFINED",YR.NOTDEFINED="NOTDEFINED";var XR=class{constructor(e){this.value=e}};XR.CHP="CHP",XR.ENGINEGENERATOR="ENGINEGENERATOR",XR.STANDALONE="STANDALONE",XR.USERDEFINED="USERDEFINED",XR.NOTDEFINED="NOTDEFINED";var $R=class{constructor(e){this.value=e}};$R.DC="DC",$R.INDUCTION="INDUCTION",$R.POLYPHASE="POLYPHASE",$R.RELUCTANCESYNCHRONOUS="RELUCTANCESYNCHRONOUS",$R.SYNCHRONOUS="SYNCHRONOUS",$R.USERDEFINED="USERDEFINED",$R.NOTDEFINED="NOTDEFINED";var KR=class{constructor(e){this.value=e}};KR.TIMECLOCK="TIMECLOCK",KR.TIMEDELAY="TIMEDELAY",KR.RELAY="RELAY",KR.USERDEFINED="USERDEFINED",KR.NOTDEFINED="NOTDEFINED";var ZR=class{constructor(e){this.value=e}};ZR.ACCESSORY_ASSEMBLY="ACCESSORY_ASSEMBLY",ZR.ARCH="ARCH",ZR.BEAM_GRID="BEAM_GRID",ZR.BRACED_FRAME="BRACED_FRAME",ZR.GIRDER="GIRDER",ZR.REINFORCEMENT_UNIT="REINFORCEMENT_UNIT",ZR.RIGID_FRAME="RIGID_FRAME",ZR.SLAB_FIELD="SLAB_FIELD",ZR.TRUSS="TRUSS",ZR.ABUTMENT="ABUTMENT",ZR.PIER="PIER",ZR.PYLON="PYLON",ZR.CROSS_BRACING="CROSS_BRACING",ZR.DECK="DECK",ZR.USERDEFINED="USERDEFINED",ZR.NOTDEFINED="NOTDEFINED";var JR=class{constructor(e){this.value=e}};JR.COMPLEX="COMPLEX",JR.ELEMENT="ELEMENT",JR.PARTIAL="PARTIAL";var QR=class{constructor(e){this.value=e}};QR.EXTERNALCOMBUSTION="EXTERNALCOMBUSTION",QR.INTERNALCOMBUSTION="INTERNALCOMBUSTION",QR.USERDEFINED="USERDEFINED",QR.NOTDEFINED="NOTDEFINED";var eD=class{constructor(e){this.value=e}};eD.DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER="DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER",eD.DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER="DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER",eD.DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER="DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER",eD.DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER="DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER",eD.DIRECTEVAPORATIVEAIRWASHER="DIRECTEVAPORATIVEAIRWASHER",eD.INDIRECTEVAPORATIVEPACKAGEAIRCOOLER="INDIRECTEVAPORATIVEPACKAGEAIRCOOLER",eD.INDIRECTEVAPORATIVEWETCOIL="INDIRECTEVAPORATIVEWETCOIL",eD.INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER="INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER",eD.INDIRECTDIRECTCOMBINATION="INDIRECTDIRECTCOMBINATION",eD.USERDEFINED="USERDEFINED",eD.NOTDEFINED="NOTDEFINED";var tD=class{constructor(e){this.value=e}};tD.DIRECTEXPANSION="DIRECTEXPANSION",tD.DIRECTEXPANSIONSHELLANDTUBE="DIRECTEXPANSIONSHELLANDTUBE",tD.DIRECTEXPANSIONTUBEINTUBE="DIRECTEXPANSIONTUBEINTUBE",tD.DIRECTEXPANSIONBRAZEDPLATE="DIRECTEXPANSIONBRAZEDPLATE",tD.FLOODEDSHELLANDTUBE="FLOODEDSHELLANDTUBE",tD.SHELLANDCOIL="SHELLANDCOIL",tD.USERDEFINED="USERDEFINED",tD.NOTDEFINED="NOTDEFINED";var nD=class{constructor(e){this.value=e}};nD.EVENTRULE="EVENTRULE",nD.EVENTMESSAGE="EVENTMESSAGE",nD.EVENTTIME="EVENTTIME",nD.EVENTCOMPLEX="EVENTCOMPLEX",nD.USERDEFINED="USERDEFINED",nD.NOTDEFINED="NOTDEFINED";var rD=class{constructor(e){this.value=e}};rD.STARTEVENT="STARTEVENT",rD.ENDEVENT="ENDEVENT",rD.INTERMEDIATEEVENT="INTERMEDIATEEVENT",rD.USERDEFINED="USERDEFINED",rD.NOTDEFINED="NOTDEFINED";var iD=class{constructor(e){this.value=e}};iD.EXTERNAL="EXTERNAL",iD.EXTERNAL_EARTH="EXTERNAL_EARTH",iD.EXTERNAL_WATER="EXTERNAL_WATER",iD.EXTERNAL_FIRE="EXTERNAL_FIRE",iD.USERDEFINED="USERDEFINED",iD.NOTDEFINED="NOTDEFINED";var sD=class{constructor(e){this.value=e}};sD.CENTRIFUGALFORWARDCURVED="CENTRIFUGALFORWARDCURVED",sD.CENTRIFUGALRADIAL="CENTRIFUGALRADIAL",sD.CENTRIFUGALBACKWARDINCLINEDCURVED="CENTRIFUGALBACKWARDINCLINEDCURVED",sD.CENTRIFUGALAIRFOIL="CENTRIFUGALAIRFOIL",sD.TUBEAXIAL="TUBEAXIAL",sD.VANEAXIAL="VANEAXIAL",sD.PROPELLORAXIAL="PROPELLORAXIAL",sD.USERDEFINED="USERDEFINED",sD.NOTDEFINED="NOTDEFINED";var aD=class{constructor(e){this.value=e}};aD.GLUE="GLUE",aD.MORTAR="MORTAR",aD.WELD="WELD",aD.USERDEFINED="USERDEFINED",aD.NOTDEFINED="NOTDEFINED";var oD=class{constructor(e){this.value=e}};oD.AIRPARTICLEFILTER="AIRPARTICLEFILTER",oD.COMPRESSEDAIRFILTER="COMPRESSEDAIRFILTER",oD.ODORFILTER="ODORFILTER",oD.OILFILTER="OILFILTER",oD.STRAINER="STRAINER",oD.WATERFILTER="WATERFILTER",oD.USERDEFINED="USERDEFINED",oD.NOTDEFINED="NOTDEFINED";var lD=class{constructor(e){this.value=e}};lD.BREECHINGINLET="BREECHINGINLET",lD.FIREHYDRANT="FIREHYDRANT",lD.HOSEREEL="HOSEREEL",lD.SPRINKLER="SPRINKLER",lD.SPRINKLERDEFLECTOR="SPRINKLERDEFLECTOR",lD.USERDEFINED="USERDEFINED",lD.NOTDEFINED="NOTDEFINED";var cD=class{constructor(e){this.value=e}};cD.SOURCE="SOURCE",cD.SINK="SINK",cD.SOURCEANDSINK="SOURCEANDSINK",cD.NOTDEFINED="NOTDEFINED";var uD=class{constructor(e){this.value=e}};uD.PRESSUREGAUGE="PRESSUREGAUGE",uD.THERMOMETER="THERMOMETER",uD.AMMETER="AMMETER",uD.FREQUENCYMETER="FREQUENCYMETER",uD.POWERFACTORMETER="POWERFACTORMETER",uD.PHASEANGLEMETER="PHASEANGLEMETER",uD.VOLTMETER_PEAK="VOLTMETER_PEAK",uD.VOLTMETER_RMS="VOLTMETER_RMS",uD.USERDEFINED="USERDEFINED",uD.NOTDEFINED="NOTDEFINED";var hD=class{constructor(e){this.value=e}};hD.ENERGYMETER="ENERGYMETER",hD.GASMETER="GASMETER",hD.OILMETER="OILMETER",hD.WATERMETER="WATERMETER",hD.USERDEFINED="USERDEFINED",hD.NOTDEFINED="NOTDEFINED";var pD=class{constructor(e){this.value=e}};pD.CAISSON_FOUNDATION="CAISSON_FOUNDATION",pD.FOOTING_BEAM="FOOTING_BEAM",pD.PAD_FOOTING="PAD_FOOTING",pD.PILE_CAP="PILE_CAP",pD.STRIP_FOOTING="STRIP_FOOTING",pD.USERDEFINED="USERDEFINED",pD.NOTDEFINED="NOTDEFINED";var dD=class{constructor(e){this.value=e}};dD.CHAIR="CHAIR",dD.TABLE="TABLE",dD.DESK="DESK",dD.BED="BED",dD.FILECABINET="FILECABINET",dD.SHELF="SHELF",dD.SOFA="SOFA",dD.USERDEFINED="USERDEFINED",dD.NOTDEFINED="NOTDEFINED";var mD=class{constructor(e){this.value=e}};mD.TERRAIN="TERRAIN",mD.SOIL_BORING_POINT="SOIL_BORING_POINT",mD.USERDEFINED="USERDEFINED",mD.NOTDEFINED="NOTDEFINED";var fD=class{constructor(e){this.value=e}};fD.GRAPH_VIEW="GRAPH_VIEW",fD.SKETCH_VIEW="SKETCH_VIEW",fD.MODEL_VIEW="MODEL_VIEW",fD.PLAN_VIEW="PLAN_VIEW",fD.REFLECTED_PLAN_VIEW="REFLECTED_PLAN_VIEW",fD.SECTION_VIEW="SECTION_VIEW",fD.ELEVATION_VIEW="ELEVATION_VIEW",fD.USERDEFINED="USERDEFINED",fD.NOTDEFINED="NOTDEFINED";var gD=class{constructor(e){this.value=e}};gD.GLOBAL_COORDS="GLOBAL_COORDS",gD.LOCAL_COORDS="LOCAL_COORDS";var _D=class{constructor(e){this.value=e}};_D.RECTANGULAR="RECTANGULAR",_D.RADIAL="RADIAL",_D.TRIANGULAR="TRIANGULAR",_D.IRREGULAR="IRREGULAR",_D.USERDEFINED="USERDEFINED",_D.NOTDEFINED="NOTDEFINED";var vD=class{constructor(e){this.value=e}};vD.PLATE="PLATE",vD.SHELLANDTUBE="SHELLANDTUBE",vD.USERDEFINED="USERDEFINED",vD.NOTDEFINED="NOTDEFINED";var yD=class{constructor(e){this.value=e}};yD.STEAMINJECTION="STEAMINJECTION",yD.ADIABATICAIRWASHER="ADIABATICAIRWASHER",yD.ADIABATICPAN="ADIABATICPAN",yD.ADIABATICWETTEDELEMENT="ADIABATICWETTEDELEMENT",yD.ADIABATICATOMIZING="ADIABATICATOMIZING",yD.ADIABATICULTRASONIC="ADIABATICULTRASONIC",yD.ADIABATICRIGIDMEDIA="ADIABATICRIGIDMEDIA",yD.ADIABATICCOMPRESSEDAIRNOZZLE="ADIABATICCOMPRESSEDAIRNOZZLE",yD.ASSISTEDELECTRIC="ASSISTEDELECTRIC",yD.ASSISTEDNATURALGAS="ASSISTEDNATURALGAS",yD.ASSISTEDPROPANE="ASSISTEDPROPANE",yD.ASSISTEDBUTANE="ASSISTEDBUTANE",yD.ASSISTEDSTEAM="ASSISTEDSTEAM",yD.USERDEFINED="USERDEFINED",yD.NOTDEFINED="NOTDEFINED";var bD=class{constructor(e){this.value=e}};bD.CYCLONIC="CYCLONIC",bD.GREASE="GREASE",bD.OIL="OIL",bD.PETROL="PETROL",bD.USERDEFINED="USERDEFINED",bD.NOTDEFINED="NOTDEFINED";var xD=class{constructor(e){this.value=e}};xD.INTERNAL="INTERNAL",xD.EXTERNAL="EXTERNAL",xD.EXTERNAL_EARTH="EXTERNAL_EARTH",xD.EXTERNAL_WATER="EXTERNAL_WATER",xD.EXTERNAL_FIRE="EXTERNAL_FIRE",xD.NOTDEFINED="NOTDEFINED";var TD=class{constructor(e){this.value=e}};TD.ASSETINVENTORY="ASSETINVENTORY",TD.SPACEINVENTORY="SPACEINVENTORY",TD.FURNITUREINVENTORY="FURNITUREINVENTORY",TD.USERDEFINED="USERDEFINED",TD.NOTDEFINED="NOTDEFINED";var wD=class{constructor(e){this.value=e}};wD.DATA="DATA",wD.POWER="POWER",wD.USERDEFINED="USERDEFINED",wD.NOTDEFINED="NOTDEFINED";var ED=class{constructor(e){this.value=e}};ED.UNIFORM_KNOTS="UNIFORM_KNOTS",ED.QUASI_UNIFORM_KNOTS="QUASI_UNIFORM_KNOTS",ED.PIECEWISE_BEZIER_KNOTS="PIECEWISE_BEZIER_KNOTS",ED.UNSPECIFIED="UNSPECIFIED";var SD=class{constructor(e){this.value=e}};SD.ADMINISTRATION="ADMINISTRATION",SD.CARPENTRY="CARPENTRY",SD.CLEANING="CLEANING",SD.CONCRETE="CONCRETE",SD.DRYWALL="DRYWALL",SD.ELECTRIC="ELECTRIC",SD.FINISHING="FINISHING",SD.FLOORING="FLOORING",SD.GENERAL="GENERAL",SD.HVAC="HVAC",SD.LANDSCAPING="LANDSCAPING",SD.MASONRY="MASONRY",SD.PAINTING="PAINTING",SD.PAVING="PAVING",SD.PLUMBING="PLUMBING",SD.ROOFING="ROOFING",SD.SITEGRADING="SITEGRADING",SD.STEELWORK="STEELWORK",SD.SURVEYING="SURVEYING",SD.USERDEFINED="USERDEFINED",SD.NOTDEFINED="NOTDEFINED";var ID=class{constructor(e){this.value=e}};ID.COMPACTFLUORESCENT="COMPACTFLUORESCENT",ID.FLUORESCENT="FLUORESCENT",ID.HALOGEN="HALOGEN",ID.HIGHPRESSUREMERCURY="HIGHPRESSUREMERCURY",ID.HIGHPRESSURESODIUM="HIGHPRESSURESODIUM",ID.LED="LED",ID.METALHALIDE="METALHALIDE",ID.OLED="OLED",ID.TUNGSTENFILAMENT="TUNGSTENFILAMENT",ID.USERDEFINED="USERDEFINED",ID.NOTDEFINED="NOTDEFINED";var MD=class{constructor(e){this.value=e}};MD.AXIS1="AXIS1",MD.AXIS2="AXIS2",MD.AXIS3="AXIS3";var AD=class{constructor(e){this.value=e}};AD.TYPE_A="TYPE_A",AD.TYPE_B="TYPE_B",AD.TYPE_C="TYPE_C",AD.NOTDEFINED="NOTDEFINED";var RD=class{constructor(e){this.value=e}};RD.COMPACTFLUORESCENT="COMPACTFLUORESCENT",RD.FLUORESCENT="FLUORESCENT",RD.HIGHPRESSUREMERCURY="HIGHPRESSUREMERCURY",RD.HIGHPRESSURESODIUM="HIGHPRESSURESODIUM",RD.LIGHTEMITTINGDIODE="LIGHTEMITTINGDIODE",RD.LOWPRESSURESODIUM="LOWPRESSURESODIUM",RD.LOWVOLTAGEHALOGEN="LOWVOLTAGEHALOGEN",RD.MAINVOLTAGEHALOGEN="MAINVOLTAGEHALOGEN",RD.METALHALIDE="METALHALIDE",RD.TUNGSTENFILAMENT="TUNGSTENFILAMENT",RD.NOTDEFINED="NOTDEFINED";var DD=class{constructor(e){this.value=e}};DD.POINTSOURCE="POINTSOURCE",DD.DIRECTIONSOURCE="DIRECTIONSOURCE",DD.SECURITYLIGHTING="SECURITYLIGHTING",DD.USERDEFINED="USERDEFINED",DD.NOTDEFINED="NOTDEFINED";var CD=class{constructor(e){this.value=e}};CD.LOAD_GROUP="LOAD_GROUP",CD.LOAD_CASE="LOAD_CASE",CD.LOAD_COMBINATION="LOAD_COMBINATION",CD.USERDEFINED="USERDEFINED",CD.NOTDEFINED="NOTDEFINED";var OD=class{constructor(e){this.value=e}};OD.LOGICALAND="LOGICALAND",OD.LOGICALOR="LOGICALOR",OD.LOGICALXOR="LOGICALXOR",OD.LOGICALNOTAND="LOGICALNOTAND",OD.LOGICALNOTOR="LOGICALNOTOR";var PD=class{constructor(e){this.value=e}};PD.ANCHORBOLT="ANCHORBOLT",PD.BOLT="BOLT",PD.DOWEL="DOWEL",PD.NAIL="NAIL",PD.NAILPLATE="NAILPLATE",PD.RIVET="RIVET",PD.SCREW="SCREW",PD.SHEARCONNECTOR="SHEARCONNECTOR",PD.STAPLE="STAPLE",PD.STUDSHEARCONNECTOR="STUDSHEARCONNECTOR",PD.COUPLER="COUPLER",PD.USERDEFINED="USERDEFINED",PD.NOTDEFINED="NOTDEFINED";var ND=class{constructor(e){this.value=e}};ND.AIRSTATION="AIRSTATION",ND.FEEDAIRUNIT="FEEDAIRUNIT",ND.OXYGENGENERATOR="OXYGENGENERATOR",ND.OXYGENPLANT="OXYGENPLANT",ND.VACUUMSTATION="VACUUMSTATION",ND.USERDEFINED="USERDEFINED",ND.NOTDEFINED="NOTDEFINED";var LD=class{constructor(e){this.value=e}};LD.BRACE="BRACE",LD.CHORD="CHORD",LD.COLLAR="COLLAR",LD.MEMBER="MEMBER",LD.MULLION="MULLION",LD.PLATE="PLATE",LD.POST="POST",LD.PURLIN="PURLIN",LD.RAFTER="RAFTER",LD.STRINGER="STRINGER",LD.STRUT="STRUT",LD.STUD="STUD",LD.STIFFENING_RIB="STIFFENING_RIB",LD.ARCH_SEGMENT="ARCH_SEGMENT",LD.SUSPENSION_CABLE="SUSPENSION_CABLE",LD.SUSPENDER="SUSPENDER",LD.STAY_CABLE="STAY_CABLE",LD.USERDEFINED="USERDEFINED",LD.NOTDEFINED="NOTDEFINED";var kD=class{constructor(e){this.value=e}};kD.BELTDRIVE="BELTDRIVE",kD.COUPLING="COUPLING",kD.DIRECTDRIVE="DIRECTDRIVE",kD.USERDEFINED="USERDEFINED",kD.NOTDEFINED="NOTDEFINED";var FD=class{constructor(e){this.value=e}};FD.PRODUCT="PRODUCT",FD.PROCESS="PROCESS",FD.CONTROL="CONTROL",FD.RESOURCE="RESOURCE",FD.ACTOR="ACTOR",FD.GROUP="GROUP",FD.PROJECT="PROJECT",FD.NOTDEFINED="NOTDEFINED";var UD=class{constructor(e){this.value=e}};UD.CODECOMPLIANCE="CODECOMPLIANCE",UD.CODEWAIVER="CODEWAIVER",UD.DESIGNINTENT="DESIGNINTENT",UD.EXTERNAL="EXTERNAL",UD.HEALTHANDSAFETY="HEALTHANDSAFETY",UD.MERGECONFLICT="MERGECONFLICT",UD.MODELVIEW="MODELVIEW",UD.PARAMETER="PARAMETER",UD.REQUIREMENT="REQUIREMENT",UD.SPECIFICATION="SPECIFICATION",UD.TRIGGERCONDITION="TRIGGERCONDITION",UD.USERDEFINED="USERDEFINED",UD.NOTDEFINED="NOTDEFINED";var BD=class{constructor(e){this.value=e}};BD.ASSIGNEE="ASSIGNEE",BD.ASSIGNOR="ASSIGNOR",BD.LESSEE="LESSEE",BD.LESSOR="LESSOR",BD.LETTINGAGENT="LETTINGAGENT",BD.OWNER="OWNER",BD.TENANT="TENANT",BD.USERDEFINED="USERDEFINED",BD.NOTDEFINED="NOTDEFINED";var jD=class{constructor(e){this.value=e}};jD.OPENING="OPENING",jD.RECESS="RECESS",jD.USERDEFINED="USERDEFINED",jD.NOTDEFINED="NOTDEFINED";var GD=class{constructor(e){this.value=e}};GD.AUDIOVISUALOUTLET="AUDIOVISUALOUTLET",GD.COMMUNICATIONSOUTLET="COMMUNICATIONSOUTLET",GD.POWEROUTLET="POWEROUTLET",GD.DATAOUTLET="DATAOUTLET",GD.TELEPHONEOUTLET="TELEPHONEOUTLET",GD.USERDEFINED="USERDEFINED",GD.NOTDEFINED="NOTDEFINED";var zD=class{constructor(e){this.value=e}};zD.USERDEFINED="USERDEFINED",zD.NOTDEFINED="NOTDEFINED";var VD=class{constructor(e){this.value=e}};VD.GRILL="GRILL",VD.LOUVER="LOUVER",VD.SCREEN="SCREEN",VD.USERDEFINED="USERDEFINED",VD.NOTDEFINED="NOTDEFINED";var HD=class{constructor(e){this.value=e}};HD.ACCESS="ACCESS",HD.BUILDING="BUILDING",HD.WORK="WORK",HD.USERDEFINED="USERDEFINED",HD.NOTDEFINED="NOTDEFINED";var qD=class{constructor(e){this.value=e}};qD.PHYSICAL="PHYSICAL",qD.VIRTUAL="VIRTUAL",qD.NOTDEFINED="NOTDEFINED";var WD=class{constructor(e){this.value=e}};WD.CAST_IN_PLACE="CAST_IN_PLACE",WD.COMPOSITE="COMPOSITE",WD.PRECAST_CONCRETE="PRECAST_CONCRETE",WD.PREFAB_STEEL="PREFAB_STEEL",WD.USERDEFINED="USERDEFINED",WD.NOTDEFINED="NOTDEFINED";var YD=class{constructor(e){this.value=e}};YD.BORED="BORED",YD.DRIVEN="DRIVEN",YD.JETGROUTING="JETGROUTING",YD.COHESION="COHESION",YD.FRICTION="FRICTION",YD.SUPPORT="SUPPORT",YD.USERDEFINED="USERDEFINED",YD.NOTDEFINED="NOTDEFINED";var XD=class{constructor(e){this.value=e}};XD.BEND="BEND",XD.CONNECTOR="CONNECTOR",XD.ENTRY="ENTRY",XD.EXIT="EXIT",XD.JUNCTION="JUNCTION",XD.OBSTRUCTION="OBSTRUCTION",XD.TRANSITION="TRANSITION",XD.USERDEFINED="USERDEFINED",XD.NOTDEFINED="NOTDEFINED";var $D=class{constructor(e){this.value=e}};$D.CULVERT="CULVERT",$D.FLEXIBLESEGMENT="FLEXIBLESEGMENT",$D.RIGIDSEGMENT="RIGIDSEGMENT",$D.GUTTER="GUTTER",$D.SPOOL="SPOOL",$D.USERDEFINED="USERDEFINED",$D.NOTDEFINED="NOTDEFINED";var KD=class{constructor(e){this.value=e}};KD.CURTAIN_PANEL="CURTAIN_PANEL",KD.SHEET="SHEET",KD.FLANGE_PLATE="FLANGE_PLATE",KD.WEB_PLATE="WEB_PLATE",KD.STIFFENER_PLATE="STIFFENER_PLATE",KD.GUSSET_PLATE="GUSSET_PLATE",KD.COVER_PLATE="COVER_PLATE",KD.SPLICE_PLATE="SPLICE_PLATE",KD.BASE_PLATE="BASE_PLATE",KD.USERDEFINED="USERDEFINED",KD.NOTDEFINED="NOTDEFINED";var ZD=class{constructor(e){this.value=e}};ZD.CURVE3D="CURVE3D",ZD.PCURVE_S1="PCURVE_S1",ZD.PCURVE_S2="PCURVE_S2";var JD=class{constructor(e){this.value=e}};JD.ADVICE_CAUTION="ADVICE_CAUTION",JD.ADVICE_NOTE="ADVICE_NOTE",JD.ADVICE_WARNING="ADVICE_WARNING",JD.CALIBRATION="CALIBRATION",JD.DIAGNOSTIC="DIAGNOSTIC",JD.SHUTDOWN="SHUTDOWN",JD.STARTUP="STARTUP",JD.USERDEFINED="USERDEFINED",JD.NOTDEFINED="NOTDEFINED";var QD=class{constructor(e){this.value=e}};QD.CURVE="CURVE",QD.AREA="AREA";var eC=class{constructor(e){this.value=e}};eC.CHANGEORDER="CHANGEORDER",eC.MAINTENANCEWORKORDER="MAINTENANCEWORKORDER",eC.MOVEORDER="MOVEORDER",eC.PURCHASEORDER="PURCHASEORDER",eC.WORKORDER="WORKORDER",eC.USERDEFINED="USERDEFINED",eC.NOTDEFINED="NOTDEFINED";var tC=class{constructor(e){this.value=e}};tC.PROJECTED_LENGTH="PROJECTED_LENGTH",tC.TRUE_LENGTH="TRUE_LENGTH";var nC=class{constructor(e){this.value=e}};nC.BLISTER="BLISTER",nC.DEVIATOR="DEVIATOR",nC.USERDEFINED="USERDEFINED",nC.NOTDEFINED="NOTDEFINED";var rC=class{constructor(e){this.value=e}};rC.PSET_TYPEDRIVENONLY="PSET_TYPEDRIVENONLY",rC.PSET_TYPEDRIVENOVERRIDE="PSET_TYPEDRIVENOVERRIDE",rC.PSET_OCCURRENCEDRIVEN="PSET_OCCURRENCEDRIVEN",rC.PSET_PERFORMANCEDRIVEN="PSET_PERFORMANCEDRIVEN",rC.QTO_TYPEDRIVENONLY="QTO_TYPEDRIVENONLY",rC.QTO_TYPEDRIVENOVERRIDE="QTO_TYPEDRIVENOVERRIDE",rC.QTO_OCCURRENCEDRIVEN="QTO_OCCURRENCEDRIVEN",rC.NOTDEFINED="NOTDEFINED";var iC=class{constructor(e){this.value=e}};iC.ELECTRONIC="ELECTRONIC",iC.ELECTROMAGNETIC="ELECTROMAGNETIC",iC.RESIDUALCURRENT="RESIDUALCURRENT",iC.THERMAL="THERMAL",iC.USERDEFINED="USERDEFINED",iC.NOTDEFINED="NOTDEFINED";var sC=class{constructor(e){this.value=e}};sC.CIRCUITBREAKER="CIRCUITBREAKER",sC.EARTHLEAKAGECIRCUITBREAKER="EARTHLEAKAGECIRCUITBREAKER",sC.EARTHINGSWITCH="EARTHINGSWITCH",sC.FUSEDISCONNECTOR="FUSEDISCONNECTOR",sC.RESIDUALCURRENTCIRCUITBREAKER="RESIDUALCURRENTCIRCUITBREAKER",sC.RESIDUALCURRENTSWITCH="RESIDUALCURRENTSWITCH",sC.VARISTOR="VARISTOR",sC.USERDEFINED="USERDEFINED",sC.NOTDEFINED="NOTDEFINED";var aC=class{constructor(e){this.value=e}};aC.CIRCULATOR="CIRCULATOR",aC.ENDSUCTION="ENDSUCTION",aC.SPLITCASE="SPLITCASE",aC.SUBMERSIBLEPUMP="SUBMERSIBLEPUMP",aC.SUMPPUMP="SUMPPUMP",aC.VERTICALINLINE="VERTICALINLINE",aC.VERTICALTURBINE="VERTICALTURBINE",aC.USERDEFINED="USERDEFINED",aC.NOTDEFINED="NOTDEFINED";var oC=class{constructor(e){this.value=e}};oC.HANDRAIL="HANDRAIL",oC.GUARDRAIL="GUARDRAIL",oC.BALUSTRADE="BALUSTRADE",oC.USERDEFINED="USERDEFINED",oC.NOTDEFINED="NOTDEFINED";var lC=class{constructor(e){this.value=e}};lC.STRAIGHT="STRAIGHT",lC.SPIRAL="SPIRAL",lC.USERDEFINED="USERDEFINED",lC.NOTDEFINED="NOTDEFINED";var cC=class{constructor(e){this.value=e}};cC.STRAIGHT_RUN_RAMP="STRAIGHT_RUN_RAMP",cC.TWO_STRAIGHT_RUN_RAMP="TWO_STRAIGHT_RUN_RAMP",cC.QUARTER_TURN_RAMP="QUARTER_TURN_RAMP",cC.TWO_QUARTER_TURN_RAMP="TWO_QUARTER_TURN_RAMP",cC.HALF_TURN_RAMP="HALF_TURN_RAMP",cC.SPIRAL_RAMP="SPIRAL_RAMP",cC.USERDEFINED="USERDEFINED",cC.NOTDEFINED="NOTDEFINED";var uC=class{constructor(e){this.value=e}};uC.DAILY="DAILY",uC.WEEKLY="WEEKLY",uC.MONTHLY_BY_DAY_OF_MONTH="MONTHLY_BY_DAY_OF_MONTH",uC.MONTHLY_BY_POSITION="MONTHLY_BY_POSITION",uC.BY_DAY_COUNT="BY_DAY_COUNT",uC.BY_WEEKDAY_COUNT="BY_WEEKDAY_COUNT",uC.YEARLY_BY_DAY_OF_MONTH="YEARLY_BY_DAY_OF_MONTH",uC.YEARLY_BY_POSITION="YEARLY_BY_POSITION";var hC=class{constructor(e){this.value=e}};hC.KILOPOINT="KILOPOINT",hC.MILEPOINT="MILEPOINT",hC.STATION="STATION",hC.USERDEFINED="USERDEFINED",hC.NOTDEFINED="NOTDEFINED";var pC=class{constructor(e){this.value=e}};pC.BLINN="BLINN",pC.FLAT="FLAT",pC.GLASS="GLASS",pC.MATT="MATT",pC.METAL="METAL",pC.MIRROR="MIRROR",pC.PHONG="PHONG",pC.PLASTIC="PLASTIC",pC.STRAUSS="STRAUSS",pC.NOTDEFINED="NOTDEFINED";var dC=class{constructor(e){this.value=e}};dC.MAIN="MAIN",dC.SHEAR="SHEAR",dC.LIGATURE="LIGATURE",dC.STUD="STUD",dC.PUNCHING="PUNCHING",dC.EDGE="EDGE",dC.RING="RING",dC.ANCHORING="ANCHORING",dC.USERDEFINED="USERDEFINED",dC.NOTDEFINED="NOTDEFINED";var mC=class{constructor(e){this.value=e}};mC.PLAIN="PLAIN",mC.TEXTURED="TEXTURED";var fC=class{constructor(e){this.value=e}};fC.ANCHORING="ANCHORING",fC.EDGE="EDGE",fC.LIGATURE="LIGATURE",fC.MAIN="MAIN",fC.PUNCHING="PUNCHING",fC.RING="RING",fC.SHEAR="SHEAR",fC.STUD="STUD",fC.SPACEBAR="SPACEBAR",fC.USERDEFINED="USERDEFINED",fC.NOTDEFINED="NOTDEFINED";var gC=class{constructor(e){this.value=e}};gC.USERDEFINED="USERDEFINED",gC.NOTDEFINED="NOTDEFINED";var _C=class{constructor(e){this.value=e}};_C.SUPPLIER="SUPPLIER",_C.MANUFACTURER="MANUFACTURER",_C.CONTRACTOR="CONTRACTOR",_C.SUBCONTRACTOR="SUBCONTRACTOR",_C.ARCHITECT="ARCHITECT",_C.STRUCTURALENGINEER="STRUCTURALENGINEER",_C.COSTENGINEER="COSTENGINEER",_C.CLIENT="CLIENT",_C.BUILDINGOWNER="BUILDINGOWNER",_C.BUILDINGOPERATOR="BUILDINGOPERATOR",_C.MECHANICALENGINEER="MECHANICALENGINEER",_C.ELECTRICALENGINEER="ELECTRICALENGINEER",_C.PROJECTMANAGER="PROJECTMANAGER",_C.FACILITIESMANAGER="FACILITIESMANAGER",_C.CIVILENGINEER="CIVILENGINEER",_C.COMMISSIONINGENGINEER="COMMISSIONINGENGINEER",_C.ENGINEER="ENGINEER",_C.OWNER="OWNER",_C.CONSULTANT="CONSULTANT",_C.CONSTRUCTIONMANAGER="CONSTRUCTIONMANAGER",_C.FIELDCONSTRUCTIONMANAGER="FIELDCONSTRUCTIONMANAGER",_C.RESELLER="RESELLER",_C.USERDEFINED="USERDEFINED";var vC=class{constructor(e){this.value=e}};vC.FLAT_ROOF="FLAT_ROOF",vC.SHED_ROOF="SHED_ROOF",vC.GABLE_ROOF="GABLE_ROOF",vC.HIP_ROOF="HIP_ROOF",vC.HIPPED_GABLE_ROOF="HIPPED_GABLE_ROOF",vC.GAMBREL_ROOF="GAMBREL_ROOF",vC.MANSARD_ROOF="MANSARD_ROOF",vC.BARREL_ROOF="BARREL_ROOF",vC.RAINBOW_ROOF="RAINBOW_ROOF",vC.BUTTERFLY_ROOF="BUTTERFLY_ROOF",vC.PAVILION_ROOF="PAVILION_ROOF",vC.DOME_ROOF="DOME_ROOF",vC.FREEFORM="FREEFORM",vC.USERDEFINED="USERDEFINED",vC.NOTDEFINED="NOTDEFINED";var yC=class{constructor(e){this.value=e}};yC.EXA="EXA",yC.PETA="PETA",yC.TERA="TERA",yC.GIGA="GIGA",yC.MEGA="MEGA",yC.KILO="KILO",yC.HECTO="HECTO",yC.DECA="DECA",yC.DECI="DECI",yC.CENTI="CENTI",yC.MILLI="MILLI",yC.MICRO="MICRO",yC.NANO="NANO",yC.PICO="PICO",yC.FEMTO="FEMTO",yC.ATTO="ATTO";var bC=class{constructor(e){this.value=e}};bC.AMPERE="AMPERE",bC.BECQUEREL="BECQUEREL",bC.CANDELA="CANDELA",bC.COULOMB="COULOMB",bC.CUBIC_METRE="CUBIC_METRE",bC.DEGREE_CELSIUS="DEGREE_CELSIUS",bC.FARAD="FARAD",bC.GRAM="GRAM",bC.GRAY="GRAY",bC.HENRY="HENRY",bC.HERTZ="HERTZ",bC.JOULE="JOULE",bC.KELVIN="KELVIN",bC.LUMEN="LUMEN",bC.LUX="LUX",bC.METRE="METRE",bC.MOLE="MOLE",bC.NEWTON="NEWTON",bC.OHM="OHM",bC.PASCAL="PASCAL",bC.RADIAN="RADIAN",bC.SECOND="SECOND",bC.SIEMENS="SIEMENS",bC.SIEVERT="SIEVERT",bC.SQUARE_METRE="SQUARE_METRE",bC.STERADIAN="STERADIAN",bC.TESLA="TESLA",bC.VOLT="VOLT",bC.WATT="WATT",bC.WEBER="WEBER";var xC=class{constructor(e){this.value=e}};xC.BATH="BATH",xC.BIDET="BIDET",xC.CISTERN="CISTERN",xC.SHOWER="SHOWER",xC.SINK="SINK",xC.SANITARYFOUNTAIN="SANITARYFOUNTAIN",xC.TOILETPAN="TOILETPAN",xC.URINAL="URINAL",xC.WASHHANDBASIN="WASHHANDBASIN",xC.WCSEAT="WCSEAT",xC.USERDEFINED="USERDEFINED",xC.NOTDEFINED="NOTDEFINED";var TC=class{constructor(e){this.value=e}};TC.UNIFORM="UNIFORM",TC.TAPERED="TAPERED";var wC=class{constructor(e){this.value=e}};wC.COSENSOR="COSENSOR",wC.CO2SENSOR="CO2SENSOR",wC.CONDUCTANCESENSOR="CONDUCTANCESENSOR",wC.CONTACTSENSOR="CONTACTSENSOR",wC.FIRESENSOR="FIRESENSOR",wC.FLOWSENSOR="FLOWSENSOR",wC.FROSTSENSOR="FROSTSENSOR",wC.GASSENSOR="GASSENSOR",wC.HEATSENSOR="HEATSENSOR",wC.HUMIDITYSENSOR="HUMIDITYSENSOR",wC.IDENTIFIERSENSOR="IDENTIFIERSENSOR",wC.IONCONCENTRATIONSENSOR="IONCONCENTRATIONSENSOR",wC.LEVELSENSOR="LEVELSENSOR",wC.LIGHTSENSOR="LIGHTSENSOR",wC.MOISTURESENSOR="MOISTURESENSOR",wC.MOVEMENTSENSOR="MOVEMENTSENSOR",wC.PHSENSOR="PHSENSOR",wC.PRESSURESENSOR="PRESSURESENSOR",wC.RADIATIONSENSOR="RADIATIONSENSOR",wC.RADIOACTIVITYSENSOR="RADIOACTIVITYSENSOR",wC.SMOKESENSOR="SMOKESENSOR",wC.SOUNDSENSOR="SOUNDSENSOR",wC.TEMPERATURESENSOR="TEMPERATURESENSOR",wC.WINDSENSOR="WINDSENSOR",wC.USERDEFINED="USERDEFINED",wC.NOTDEFINED="NOTDEFINED";var EC=class{constructor(e){this.value=e}};EC.START_START="START_START",EC.START_FINISH="START_FINISH",EC.FINISH_START="FINISH_START",EC.FINISH_FINISH="FINISH_FINISH",EC.USERDEFINED="USERDEFINED",EC.NOTDEFINED="NOTDEFINED";var SC=class{constructor(e){this.value=e}};SC.JALOUSIE="JALOUSIE",SC.SHUTTER="SHUTTER",SC.AWNING="AWNING",SC.USERDEFINED="USERDEFINED",SC.NOTDEFINED="NOTDEFINED";var IC=class{constructor(e){this.value=e}};IC.P_SINGLEVALUE="P_SINGLEVALUE",IC.P_ENUMERATEDVALUE="P_ENUMERATEDVALUE",IC.P_BOUNDEDVALUE="P_BOUNDEDVALUE",IC.P_LISTVALUE="P_LISTVALUE",IC.P_TABLEVALUE="P_TABLEVALUE",IC.P_REFERENCEVALUE="P_REFERENCEVALUE",IC.Q_LENGTH="Q_LENGTH",IC.Q_AREA="Q_AREA",IC.Q_VOLUME="Q_VOLUME",IC.Q_COUNT="Q_COUNT",IC.Q_WEIGHT="Q_WEIGHT",IC.Q_TIME="Q_TIME";var MC=class{constructor(e){this.value=e}};MC.FLOOR="FLOOR",MC.ROOF="ROOF",MC.LANDING="LANDING",MC.BASESLAB="BASESLAB",MC.APPROACH_SLAB="APPROACH_SLAB",MC.PAVING="PAVING",MC.WEARING="WEARING",MC.SIDEWALK="SIDEWALK",MC.USERDEFINED="USERDEFINED",MC.NOTDEFINED="NOTDEFINED";var AC=class{constructor(e){this.value=e}};AC.SOLARCOLLECTOR="SOLARCOLLECTOR",AC.SOLARPANEL="SOLARPANEL",AC.USERDEFINED="USERDEFINED",AC.NOTDEFINED="NOTDEFINED";var RC=class{constructor(e){this.value=e}};RC.CONVECTOR="CONVECTOR",RC.RADIATOR="RADIATOR",RC.USERDEFINED="USERDEFINED",RC.NOTDEFINED="NOTDEFINED";var DC=class{constructor(e){this.value=e}};DC.SPACE="SPACE",DC.PARKING="PARKING",DC.GFA="GFA",DC.INTERNAL="INTERNAL",DC.EXTERNAL="EXTERNAL",DC.USERDEFINED="USERDEFINED",DC.NOTDEFINED="NOTDEFINED";var CC=class{constructor(e){this.value=e}};CC.CONSTRUCTION="CONSTRUCTION",CC.FIRESAFETY="FIRESAFETY",CC.LIGHTING="LIGHTING",CC.OCCUPANCY="OCCUPANCY",CC.SECURITY="SECURITY",CC.THERMAL="THERMAL",CC.TRANSPORT="TRANSPORT",CC.VENTILATION="VENTILATION",CC.USERDEFINED="USERDEFINED",CC.NOTDEFINED="NOTDEFINED";var OC=class{constructor(e){this.value=e}};OC.BIRDCAGE="BIRDCAGE",OC.COWL="COWL",OC.RAINWATERHOPPER="RAINWATERHOPPER",OC.USERDEFINED="USERDEFINED",OC.NOTDEFINED="NOTDEFINED";var PC=class{constructor(e){this.value=e}};PC.STRAIGHT="STRAIGHT",PC.WINDER="WINDER",PC.SPIRAL="SPIRAL",PC.CURVED="CURVED",PC.FREEFORM="FREEFORM",PC.USERDEFINED="USERDEFINED",PC.NOTDEFINED="NOTDEFINED";var NC=class{constructor(e){this.value=e}};NC.STRAIGHT_RUN_STAIR="STRAIGHT_RUN_STAIR",NC.TWO_STRAIGHT_RUN_STAIR="TWO_STRAIGHT_RUN_STAIR",NC.QUARTER_WINDING_STAIR="QUARTER_WINDING_STAIR",NC.QUARTER_TURN_STAIR="QUARTER_TURN_STAIR",NC.HALF_WINDING_STAIR="HALF_WINDING_STAIR",NC.HALF_TURN_STAIR="HALF_TURN_STAIR",NC.TWO_QUARTER_WINDING_STAIR="TWO_QUARTER_WINDING_STAIR",NC.TWO_QUARTER_TURN_STAIR="TWO_QUARTER_TURN_STAIR",NC.THREE_QUARTER_WINDING_STAIR="THREE_QUARTER_WINDING_STAIR",NC.THREE_QUARTER_TURN_STAIR="THREE_QUARTER_TURN_STAIR",NC.SPIRAL_STAIR="SPIRAL_STAIR",NC.DOUBLE_RETURN_STAIR="DOUBLE_RETURN_STAIR",NC.CURVED_RUN_STAIR="CURVED_RUN_STAIR",NC.TWO_CURVED_RUN_STAIR="TWO_CURVED_RUN_STAIR",NC.USERDEFINED="USERDEFINED",NC.NOTDEFINED="NOTDEFINED";var LC=class{constructor(e){this.value=e}};LC.READWRITE="READWRITE",LC.READONLY="READONLY",LC.LOCKED="LOCKED",LC.READWRITELOCKED="READWRITELOCKED",LC.READONLYLOCKED="READONLYLOCKED";var kC=class{constructor(e){this.value=e}};kC.CONST="CONST",kC.LINEAR="LINEAR",kC.POLYGONAL="POLYGONAL",kC.EQUIDISTANT="EQUIDISTANT",kC.SINUS="SINUS",kC.PARABOLA="PARABOLA",kC.DISCRETE="DISCRETE",kC.USERDEFINED="USERDEFINED",kC.NOTDEFINED="NOTDEFINED";var FC=class{constructor(e){this.value=e}};FC.RIGID_JOINED_MEMBER="RIGID_JOINED_MEMBER",FC.PIN_JOINED_MEMBER="PIN_JOINED_MEMBER",FC.CABLE="CABLE",FC.TENSION_MEMBER="TENSION_MEMBER",FC.COMPRESSION_MEMBER="COMPRESSION_MEMBER",FC.USERDEFINED="USERDEFINED",FC.NOTDEFINED="NOTDEFINED";var UC=class{constructor(e){this.value=e}};UC.CONST="CONST",UC.BILINEAR="BILINEAR",UC.DISCRETE="DISCRETE",UC.ISOCONTOUR="ISOCONTOUR",UC.USERDEFINED="USERDEFINED",UC.NOTDEFINED="NOTDEFINED";var BC=class{constructor(e){this.value=e}};BC.BENDING_ELEMENT="BENDING_ELEMENT",BC.MEMBRANE_ELEMENT="MEMBRANE_ELEMENT",BC.SHELL="SHELL",BC.USERDEFINED="USERDEFINED",BC.NOTDEFINED="NOTDEFINED";var jC=class{constructor(e){this.value=e}};jC.PURCHASE="PURCHASE",jC.WORK="WORK",jC.USERDEFINED="USERDEFINED",jC.NOTDEFINED="NOTDEFINED";var GC=class{constructor(e){this.value=e}};GC.MARK="MARK",GC.TAG="TAG",GC.TREATMENT="TREATMENT",GC.DEFECT="DEFECT",GC.USERDEFINED="USERDEFINED",GC.NOTDEFINED="NOTDEFINED";var zC=class{constructor(e){this.value=e}};zC.POSITIVE="POSITIVE",zC.NEGATIVE="NEGATIVE",zC.BOTH="BOTH";var VC=class{constructor(e){this.value=e}};VC.CONTACTOR="CONTACTOR",VC.DIMMERSWITCH="DIMMERSWITCH",VC.EMERGENCYSTOP="EMERGENCYSTOP",VC.KEYPAD="KEYPAD",VC.MOMENTARYSWITCH="MOMENTARYSWITCH",VC.SELECTORSWITCH="SELECTORSWITCH",VC.STARTER="STARTER",VC.SWITCHDISCONNECTOR="SWITCHDISCONNECTOR",VC.TOGGLESWITCH="TOGGLESWITCH",VC.USERDEFINED="USERDEFINED",VC.NOTDEFINED="NOTDEFINED";var HC=class{constructor(e){this.value=e}};HC.PANEL="PANEL",HC.WORKSURFACE="WORKSURFACE",HC.USERDEFINED="USERDEFINED",HC.NOTDEFINED="NOTDEFINED";var qC=class{constructor(e){this.value=e}};qC.BASIN="BASIN",qC.BREAKPRESSURE="BREAKPRESSURE",qC.EXPANSION="EXPANSION",qC.FEEDANDEXPANSION="FEEDANDEXPANSION",qC.PRESSUREVESSEL="PRESSUREVESSEL",qC.STORAGE="STORAGE",qC.VESSEL="VESSEL",qC.USERDEFINED="USERDEFINED",qC.NOTDEFINED="NOTDEFINED";var WC=class{constructor(e){this.value=e}};WC.ELAPSEDTIME="ELAPSEDTIME",WC.WORKTIME="WORKTIME",WC.NOTDEFINED="NOTDEFINED";var YC=class{constructor(e){this.value=e}};YC.ATTENDANCE="ATTENDANCE",YC.CONSTRUCTION="CONSTRUCTION",YC.DEMOLITION="DEMOLITION",YC.DISMANTLE="DISMANTLE",YC.DISPOSAL="DISPOSAL",YC.INSTALLATION="INSTALLATION",YC.LOGISTIC="LOGISTIC",YC.MAINTENANCE="MAINTENANCE",YC.MOVE="MOVE",YC.OPERATION="OPERATION",YC.REMOVAL="REMOVAL",YC.RENOVATION="RENOVATION",YC.USERDEFINED="USERDEFINED",YC.NOTDEFINED="NOTDEFINED";var XC=class{constructor(e){this.value=e}};XC.COUPLER="COUPLER",XC.FIXED_END="FIXED_END",XC.TENSIONING_END="TENSIONING_END",XC.USERDEFINED="USERDEFINED",XC.NOTDEFINED="NOTDEFINED";var $C=class{constructor(e){this.value=e}};$C.DUCT="DUCT",$C.COUPLER="COUPLER",$C.GROUTING_DUCT="GROUTING_DUCT",$C.TRUMPET="TRUMPET",$C.DIABOLO="DIABOLO",$C.USERDEFINED="USERDEFINED",$C.NOTDEFINED="NOTDEFINED";var KC=class{constructor(e){this.value=e}};KC.BAR="BAR",KC.COATED="COATED",KC.STRAND="STRAND",KC.WIRE="WIRE",KC.USERDEFINED="USERDEFINED",KC.NOTDEFINED="NOTDEFINED";var ZC=class{constructor(e){this.value=e}};ZC.LEFT="LEFT",ZC.RIGHT="RIGHT",ZC.UP="UP",ZC.DOWN="DOWN";var JC=class{constructor(e){this.value=e}};JC.CONTINUOUS="CONTINUOUS",JC.DISCRETE="DISCRETE",JC.DISCRETEBINARY="DISCRETEBINARY",JC.PIECEWISEBINARY="PIECEWISEBINARY",JC.PIECEWISECONSTANT="PIECEWISECONSTANT",JC.PIECEWISECONTINUOUS="PIECEWISECONTINUOUS",JC.NOTDEFINED="NOTDEFINED";var QC=class{constructor(e){this.value=e}};QC.CURRENT="CURRENT",QC.FREQUENCY="FREQUENCY",QC.INVERTER="INVERTER",QC.RECTIFIER="RECTIFIER",QC.VOLTAGE="VOLTAGE",QC.USERDEFINED="USERDEFINED",QC.NOTDEFINED="NOTDEFINED";var eO=class{constructor(e){this.value=e}};eO.DISCONTINUOUS="DISCONTINUOUS",eO.CONTINUOUS="CONTINUOUS",eO.CONTSAMEGRADIENT="CONTSAMEGRADIENT",eO.CONTSAMEGRADIENTSAMECURVATURE="CONTSAMEGRADIENTSAMECURVATURE";var tO=class{constructor(e){this.value=e}};tO.BIQUADRATICPARABOLA="BIQUADRATICPARABOLA",tO.BLOSSCURVE="BLOSSCURVE",tO.CLOTHOIDCURVE="CLOTHOIDCURVE",tO.COSINECURVE="COSINECURVE",tO.CUBICPARABOLA="CUBICPARABOLA",tO.SINECURVE="SINECURVE";var nO=class{constructor(e){this.value=e}};nO.ELEVATOR="ELEVATOR",nO.ESCALATOR="ESCALATOR",nO.MOVINGWALKWAY="MOVINGWALKWAY",nO.CRANEWAY="CRANEWAY",nO.LIFTINGGEAR="LIFTINGGEAR",nO.USERDEFINED="USERDEFINED",nO.NOTDEFINED="NOTDEFINED";var rO=class{constructor(e){this.value=e}};rO.CARTESIAN="CARTESIAN",rO.PARAMETER="PARAMETER",rO.UNSPECIFIED="UNSPECIFIED";var iO=class{constructor(e){this.value=e}};iO.FINNED="FINNED",iO.USERDEFINED="USERDEFINED",iO.NOTDEFINED="NOTDEFINED";var sO=class{constructor(e){this.value=e}};sO.ABSORBEDDOSEUNIT="ABSORBEDDOSEUNIT",sO.AMOUNTOFSUBSTANCEUNIT="AMOUNTOFSUBSTANCEUNIT",sO.AREAUNIT="AREAUNIT",sO.DOSEEQUIVALENTUNIT="DOSEEQUIVALENTUNIT",sO.ELECTRICCAPACITANCEUNIT="ELECTRICCAPACITANCEUNIT",sO.ELECTRICCHARGEUNIT="ELECTRICCHARGEUNIT",sO.ELECTRICCONDUCTANCEUNIT="ELECTRICCONDUCTANCEUNIT",sO.ELECTRICCURRENTUNIT="ELECTRICCURRENTUNIT",sO.ELECTRICRESISTANCEUNIT="ELECTRICRESISTANCEUNIT",sO.ELECTRICVOLTAGEUNIT="ELECTRICVOLTAGEUNIT",sO.ENERGYUNIT="ENERGYUNIT",sO.FORCEUNIT="FORCEUNIT",sO.FREQUENCYUNIT="FREQUENCYUNIT",sO.ILLUMINANCEUNIT="ILLUMINANCEUNIT",sO.INDUCTANCEUNIT="INDUCTANCEUNIT",sO.LENGTHUNIT="LENGTHUNIT",sO.LUMINOUSFLUXUNIT="LUMINOUSFLUXUNIT",sO.LUMINOUSINTENSITYUNIT="LUMINOUSINTENSITYUNIT",sO.MAGNETICFLUXDENSITYUNIT="MAGNETICFLUXDENSITYUNIT",sO.MAGNETICFLUXUNIT="MAGNETICFLUXUNIT",sO.MASSUNIT="MASSUNIT",sO.PLANEANGLEUNIT="PLANEANGLEUNIT",sO.POWERUNIT="POWERUNIT",sO.PRESSUREUNIT="PRESSUREUNIT",sO.RADIOACTIVITYUNIT="RADIOACTIVITYUNIT",sO.SOLIDANGLEUNIT="SOLIDANGLEUNIT",sO.THERMODYNAMICTEMPERATUREUNIT="THERMODYNAMICTEMPERATUREUNIT",sO.TIMEUNIT="TIMEUNIT",sO.VOLUMEUNIT="VOLUMEUNIT",sO.USERDEFINED="USERDEFINED";var aO=class{constructor(e){this.value=e}};aO.ALARMPANEL="ALARMPANEL",aO.CONTROLPANEL="CONTROLPANEL",aO.GASDETECTIONPANEL="GASDETECTIONPANEL",aO.INDICATORPANEL="INDICATORPANEL",aO.MIMICPANEL="MIMICPANEL",aO.HUMIDISTAT="HUMIDISTAT",aO.THERMOSTAT="THERMOSTAT",aO.WEATHERSTATION="WEATHERSTATION",aO.USERDEFINED="USERDEFINED",aO.NOTDEFINED="NOTDEFINED";var oO=class{constructor(e){this.value=e}};oO.AIRHANDLER="AIRHANDLER",oO.AIRCONDITIONINGUNIT="AIRCONDITIONINGUNIT",oO.DEHUMIDIFIER="DEHUMIDIFIER",oO.SPLITSYSTEM="SPLITSYSTEM",oO.ROOFTOPUNIT="ROOFTOPUNIT",oO.USERDEFINED="USERDEFINED",oO.NOTDEFINED="NOTDEFINED";var lO=class{constructor(e){this.value=e}};lO.AIRRELEASE="AIRRELEASE",lO.ANTIVACUUM="ANTIVACUUM",lO.CHANGEOVER="CHANGEOVER",lO.CHECK="CHECK",lO.COMMISSIONING="COMMISSIONING",lO.DIVERTING="DIVERTING",lO.DRAWOFFCOCK="DRAWOFFCOCK",lO.DOUBLECHECK="DOUBLECHECK",lO.DOUBLEREGULATING="DOUBLEREGULATING",lO.FAUCET="FAUCET",lO.FLUSHING="FLUSHING",lO.GASCOCK="GASCOCK",lO.GASTAP="GASTAP",lO.ISOLATING="ISOLATING",lO.MIXING="MIXING",lO.PRESSUREREDUCING="PRESSUREREDUCING",lO.PRESSURERELIEF="PRESSURERELIEF",lO.REGULATING="REGULATING",lO.SAFETYCUTOFF="SAFETYCUTOFF",lO.STEAMTRAP="STEAMTRAP",lO.STOPCOCK="STOPCOCK",lO.USERDEFINED="USERDEFINED",lO.NOTDEFINED="NOTDEFINED";var cO=class{constructor(e){this.value=e}};cO.BENDING_YIELD="BENDING_YIELD",cO.SHEAR_YIELD="SHEAR_YIELD",cO.AXIAL_YIELD="AXIAL_YIELD",cO.FRICTION="FRICTION",cO.VISCOUS="VISCOUS",cO.RUBBER="RUBBER",cO.USERDEFINED="USERDEFINED",cO.NOTDEFINED="NOTDEFINED";var uO=class{constructor(e){this.value=e}};uO.COMPRESSION="COMPRESSION",uO.SPRING="SPRING",uO.BASE="BASE",uO.USERDEFINED="USERDEFINED",uO.NOTDEFINED="NOTDEFINED";var hO=class{constructor(e){this.value=e}};hO.CUTOUT="CUTOUT",hO.NOTCH="NOTCH",hO.HOLE="HOLE",hO.MITER="MITER",hO.CHAMFER="CHAMFER",hO.EDGE="EDGE",hO.USERDEFINED="USERDEFINED",hO.NOTDEFINED="NOTDEFINED";var pO=class{constructor(e){this.value=e}};pO.MOVABLE="MOVABLE",pO.PARAPET="PARAPET",pO.PARTITIONING="PARTITIONING",pO.PLUMBINGWALL="PLUMBINGWALL",pO.SHEAR="SHEAR",pO.SOLIDWALL="SOLIDWALL",pO.STANDARD="STANDARD",pO.POLYGONAL="POLYGONAL",pO.ELEMENTEDWALL="ELEMENTEDWALL",pO.RETAININGWALL="RETAININGWALL",pO.USERDEFINED="USERDEFINED",pO.NOTDEFINED="NOTDEFINED";var dO=class{constructor(e){this.value=e}};dO.FLOORTRAP="FLOORTRAP",dO.FLOORWASTE="FLOORWASTE",dO.GULLYSUMP="GULLYSUMP",dO.GULLYTRAP="GULLYTRAP",dO.ROOFDRAIN="ROOFDRAIN",dO.WASTEDISPOSALUNIT="WASTEDISPOSALUNIT",dO.WASTETRAP="WASTETRAP",dO.USERDEFINED="USERDEFINED",dO.NOTDEFINED="NOTDEFINED";var mO=class{constructor(e){this.value=e}};mO.SIDEHUNGRIGHTHAND="SIDEHUNGRIGHTHAND",mO.SIDEHUNGLEFTHAND="SIDEHUNGLEFTHAND",mO.TILTANDTURNRIGHTHAND="TILTANDTURNRIGHTHAND",mO.TILTANDTURNLEFTHAND="TILTANDTURNLEFTHAND",mO.TOPHUNG="TOPHUNG",mO.BOTTOMHUNG="BOTTOMHUNG",mO.PIVOTHORIZONTAL="PIVOTHORIZONTAL",mO.PIVOTVERTICAL="PIVOTVERTICAL",mO.SLIDINGHORIZONTAL="SLIDINGHORIZONTAL",mO.SLIDINGVERTICAL="SLIDINGVERTICAL",mO.REMOVABLECASEMENT="REMOVABLECASEMENT",mO.FIXEDCASEMENT="FIXEDCASEMENT",mO.OTHEROPERATION="OTHEROPERATION",mO.NOTDEFINED="NOTDEFINED";var fO=class{constructor(e){this.value=e}};fO.LEFT="LEFT",fO.MIDDLE="MIDDLE",fO.RIGHT="RIGHT",fO.BOTTOM="BOTTOM",fO.TOP="TOP",fO.NOTDEFINED="NOTDEFINED";var gO=class{constructor(e){this.value=e}};gO.ALUMINIUM="ALUMINIUM",gO.HIGH_GRADE_STEEL="HIGH_GRADE_STEEL",gO.STEEL="STEEL",gO.WOOD="WOOD",gO.ALUMINIUM_WOOD="ALUMINIUM_WOOD",gO.PLASTIC="PLASTIC",gO.OTHER_CONSTRUCTION="OTHER_CONSTRUCTION",gO.NOTDEFINED="NOTDEFINED";var _O=class{constructor(e){this.value=e}};_O.SINGLE_PANEL="SINGLE_PANEL",_O.DOUBLE_PANEL_VERTICAL="DOUBLE_PANEL_VERTICAL",_O.DOUBLE_PANEL_HORIZONTAL="DOUBLE_PANEL_HORIZONTAL",_O.TRIPLE_PANEL_VERTICAL="TRIPLE_PANEL_VERTICAL",_O.TRIPLE_PANEL_BOTTOM="TRIPLE_PANEL_BOTTOM",_O.TRIPLE_PANEL_TOP="TRIPLE_PANEL_TOP",_O.TRIPLE_PANEL_LEFT="TRIPLE_PANEL_LEFT",_O.TRIPLE_PANEL_RIGHT="TRIPLE_PANEL_RIGHT",_O.TRIPLE_PANEL_HORIZONTAL="TRIPLE_PANEL_HORIZONTAL",_O.USERDEFINED="USERDEFINED",_O.NOTDEFINED="NOTDEFINED";var vO=class{constructor(e){this.value=e}};vO.WINDOW="WINDOW",vO.SKYLIGHT="SKYLIGHT",vO.LIGHTDOME="LIGHTDOME",vO.USERDEFINED="USERDEFINED",vO.NOTDEFINED="NOTDEFINED";var yO=class{constructor(e){this.value=e}};yO.SINGLE_PANEL="SINGLE_PANEL",yO.DOUBLE_PANEL_VERTICAL="DOUBLE_PANEL_VERTICAL",yO.DOUBLE_PANEL_HORIZONTAL="DOUBLE_PANEL_HORIZONTAL",yO.TRIPLE_PANEL_VERTICAL="TRIPLE_PANEL_VERTICAL",yO.TRIPLE_PANEL_BOTTOM="TRIPLE_PANEL_BOTTOM",yO.TRIPLE_PANEL_TOP="TRIPLE_PANEL_TOP",yO.TRIPLE_PANEL_LEFT="TRIPLE_PANEL_LEFT",yO.TRIPLE_PANEL_RIGHT="TRIPLE_PANEL_RIGHT",yO.TRIPLE_PANEL_HORIZONTAL="TRIPLE_PANEL_HORIZONTAL",yO.USERDEFINED="USERDEFINED",yO.NOTDEFINED="NOTDEFINED";var bO=class{constructor(e){this.value=e}};bO.FIRSTSHIFT="FIRSTSHIFT",bO.SECONDSHIFT="SECONDSHIFT",bO.THIRDSHIFT="THIRDSHIFT",bO.USERDEFINED="USERDEFINED",bO.NOTDEFINED="NOTDEFINED";var xO=class{constructor(e){this.value=e}};xO.ACTUAL="ACTUAL",xO.BASELINE="BASELINE",xO.PLANNED="PLANNED",xO.USERDEFINED="USERDEFINED",xO.NOTDEFINED="NOTDEFINED";var TO=class{constructor(e){this.value=e}};TO.ACTUAL="ACTUAL",TO.BASELINE="BASELINE",TO.PLANNED="PLANNED",TO.USERDEFINED="USERDEFINED",TO.NOTDEFINED="NOTDEFINED";var wO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.LongDescription=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new wO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},EO=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.TheActor=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new EO(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheActor),e}},SO=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Role=n,this.UserDefinedRole=r,this.Description=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new SO(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Role),e.push(this.UserDefinedRole),e.push(this.Description),e}},IO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new IO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},MO=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new MO(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},AO=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Purpose=n,this.Description=r,this.UserDefinedPurpose=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new AO(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e}},RO=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Outer=n}static FromTape(e,t,n){let r=0,i=n[r++];return new RO(e,t,i)}ToTape(){let e=[];return e.push(this.Outer),e}},DO=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Outer=n,this.Voids=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new DO(e,t,i,s)}ToTape(){let e=[];return e.push(this.Outer),e.push(this.Voids),e}},CO=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Bounds=n,this.FaceSurface=r,this.SameSense=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new CO(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Bounds),e.push(this.FaceSurface),e.push(this.SameSense),e}},OO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new OO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},PO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new PO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},NO=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new NO(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},LO=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new LO(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},kO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new kO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},FO=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new FO(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},UO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new UO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},BO=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new BO(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Axis=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new jO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Axis),e.push(this.PredefinedType),e}},GO=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.StartDistAlong=n,this.Segments=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new GO(e,t,i,s)}ToTape(){let e=[];return e.push(this.StartDistAlong),e.push(this.Segments),e}},zO=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.TangentialContinuity=n,this.StartTag=r,this.EndTag=i,this.CurveGeometry=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new zO(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.CurveGeometry),e}},VO=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.TangentialContinuity=n,this.StartTag=r,this.EndTag=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new VO(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e}},HO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.TangentialContinuity=n,this.StartTag=r,this.EndTag=i,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l,this.Radius=c,this.IsConvex=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new HO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e.push(this.Radius),e.push(this.IsConvex),e}},qO=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.TangentialContinuity=n,this.StartTag=r,this.EndTag=i,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new qO(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e}},WO=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.TangentialContinuity=n,this.StartTag=r,this.EndTag=i,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l,this.ParabolaConstant=c,this.IsConvex=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new WO(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e.push(this.ParabolaConstant),e.push(this.IsConvex),e}},YO=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Segments=n}static FromTape(e,t,n){let r=0,i=n[r++];return new YO(e,t,i)}ToTape(){let e=[];return e.push(this.Segments),e}},XO=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.TangentialContinuity=n,this.StartTag=r,this.EndTag=i,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new XO(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e}},$O=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Horizontal=n,this.Vertical=r,this.Tag=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new $O(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Horizontal),e.push(this.Vertical),e.push(this.Tag),e}},KO=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new KO(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},ZO=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.OuterBoundary=n,this.InnerBoundaries=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new ZO(e,t,i,s)}ToTape(){let e=[];return e.push(this.OuterBoundary),e.push(this.InnerBoundaries),e}},JO=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ApplicationDeveloper=n,this.Version=r,this.ApplicationFullName=i,this.ApplicationIdentifier=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new JO(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ApplicationDeveloper),e.push(this.Version),e.push(this.ApplicationFullName),e.push(this.ApplicationIdentifier),e}},QO=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.AppliedValue=i,this.UnitBasis=s,this.ApplicableDate=a,this.FixedUntilDate=o,this.Category=l,this.Condition=c,this.ArithmeticOperator=u,this.Components=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new QO(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AppliedValue),e.push(this.UnitBasis),e.push(this.ApplicableDate),e.push(this.FixedUntilDate),e.push(this.Category),e.push(this.Condition),e.push(this.ArithmeticOperator),e.push(this.Components),e}},eP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Identifier=n,this.Name=r,this.Description=i,this.TimeOfApproval=s,this.Status=a,this.Level=o,this.Qualifier=l,this.RequestingApproval=c,this.GivingApproval=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new eP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Identifier),e.push(this.Name),e.push(this.Description),e.push(this.TimeOfApproval),e.push(this.Status),e.push(this.Level),e.push(this.Qualifier),e.push(this.RequestingApproval),e.push(this.GivingApproval),e}},tP=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingApproval=i,this.RelatedApprovals=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new tP(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingApproval),e.push(this.RelatedApprovals),e}},nP=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.OuterCurve=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new nP(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.OuterCurve),e}},rP=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Curve=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new rP(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Curve),e}},iP=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.OuterCurve=i,this.InnerCurves=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new iP(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.OuterCurve),e.push(this.InnerCurves),e}},sP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.OriginalValue=l,this.CurrentValue=c,this.TotalReplacementCost=u,this.Owner=h,this.User=p,this.ResponsiblePerson=d,this.IncorporationDate=m,this.DepreciatedValue=f}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++];return new sP(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.OriginalValue),e.push(this.CurrentValue),e.push(this.TotalReplacementCost),e.push(this.Owner),e.push(this.User),e.push(this.ResponsiblePerson),e.push(this.IncorporationDate),e.push(this.DepreciatedValue),e}},aP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.BottomFlangeWidth=s,this.OverallDepth=a,this.WebThickness=o,this.BottomFlangeThickness=l,this.BottomFlangeFilletRadius=c,this.TopFlangeWidth=u,this.TopFlangeThickness=h,this.TopFlangeFilletRadius=p,this.BottomFlangeEdgeRadius=d,this.BottomFlangeSlope=m,this.TopFlangeEdgeRadius=f,this.TopFlangeSlope=g}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++];return new aP(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.BottomFlangeWidth),e.push(this.OverallDepth),e.push(this.WebThickness),e.push(this.BottomFlangeThickness),e.push(this.BottomFlangeFilletRadius),e.push(this.TopFlangeWidth),e.push(this.TopFlangeThickness),e.push(this.TopFlangeFilletRadius),e.push(this.BottomFlangeEdgeRadius),e.push(this.BottomFlangeSlope),e.push(this.TopFlangeEdgeRadius),e.push(this.TopFlangeSlope),e}},oP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new oP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},lP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new lP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},cP=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Location=n,this.Axis=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new cP(e,t,i,s)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Axis),e}},uP=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Location=n,this.RefDirection=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new uP(e,t,i,s)}ToTape(){let e=[];return e.push(this.Location),e.push(this.RefDirection),e}},hP=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Location=n,this.Axis=r,this.RefDirection=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new hP(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Axis),e.push(this.RefDirection),e}},pP=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Degree=n,this.ControlPointsList=r,this.CurveForm=i,this.ClosedCurve=s,this.SelfIntersect=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new pP(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e}},dP=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Degree=n,this.ControlPointsList=r,this.CurveForm=i,this.ClosedCurve=s,this.SelfIntersect=a,this.KnotMultiplicities=o,this.Knots=l,this.KnotSpec=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new dP(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e.push(this.KnotMultiplicities),e.push(this.Knots),e.push(this.KnotSpec),e}},mP=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.UDegree=n,this.VDegree=r,this.ControlPointsList=i,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new mP(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e}},fP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.UDegree=n,this.VDegree=r,this.ControlPointsList=i,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l,this.UMultiplicities=c,this.VMultiplicities=u,this.UKnots=h,this.VKnots=p,this.KnotSpec=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new fP(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e.push(this.UMultiplicities),e.push(this.VMultiplicities),e.push(this.UKnots),e.push(this.VKnots),e.push(this.KnotSpec),e}},gP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new gP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},_P=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new _P(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},vP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new vP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},yP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new yP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new bP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},xP=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.RepeatS=n,this.RepeatT=r,this.Mode=i,this.TextureTransform=s,this.Parameter=a,this.RasterFormat=o,this.RasterCode=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new xP(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.RasterFormat),e.push(this.RasterCode),e}},TP=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Position=n,this.XLength=r,this.YLength=i,this.ZLength=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new TP(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Position),e.push(this.XLength),e.push(this.YLength),e.push(this.ZLength),e}},wP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new wP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},EP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new EP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},SP=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Operator=n,this.FirstOperand=r,this.SecondOperand=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new SP(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Operator),e.push(this.FirstOperand),e.push(this.SecondOperand),e}},IP=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Operator=n,this.FirstOperand=r,this.SecondOperand=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new IP(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Operator),e.push(this.FirstOperand),e.push(this.SecondOperand),e}},MP=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new MP(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},AP=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Segments=n,this.SelfIntersect=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new AP(e,t,i,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},RP=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.TranslationalStiffnessByLengthX=r,this.TranslationalStiffnessByLengthY=i,this.TranslationalStiffnessByLengthZ=s,this.RotationalStiffnessByLengthX=a,this.RotationalStiffnessByLengthY=o,this.RotationalStiffnessByLengthZ=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new RP(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessByLengthX),e.push(this.TranslationalStiffnessByLengthY),e.push(this.TranslationalStiffnessByLengthZ),e.push(this.RotationalStiffnessByLengthX),e.push(this.RotationalStiffnessByLengthY),e.push(this.RotationalStiffnessByLengthZ),e}},DP=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.TranslationalStiffnessByAreaX=r,this.TranslationalStiffnessByAreaY=i,this.TranslationalStiffnessByAreaZ=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new DP(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessByAreaX),e.push(this.TranslationalStiffnessByAreaY),e.push(this.TranslationalStiffnessByAreaZ),e}},CP=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.TranslationalStiffnessX=r,this.TranslationalStiffnessY=i,this.TranslationalStiffnessZ=s,this.RotationalStiffnessX=a,this.RotationalStiffnessY=o,this.RotationalStiffnessZ=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new CP(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessX),e.push(this.TranslationalStiffnessY),e.push(this.TranslationalStiffnessZ),e.push(this.RotationalStiffnessX),e.push(this.RotationalStiffnessY),e.push(this.RotationalStiffnessZ),e}},OP=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=n,this.TranslationalStiffnessX=r,this.TranslationalStiffnessY=i,this.TranslationalStiffnessZ=s,this.RotationalStiffnessX=a,this.RotationalStiffnessY=o,this.RotationalStiffnessZ=l,this.WarpingStiffness=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new OP(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessX),e.push(this.TranslationalStiffnessY),e.push(this.TranslationalStiffnessZ),e.push(this.RotationalStiffnessX),e.push(this.RotationalStiffnessY),e.push(this.RotationalStiffnessZ),e.push(this.WarpingStiffness),e}},PP=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new PP(e,t)}ToTape(){return[]}},NP=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new NP(e,t)}ToTape(){return[]}},LP=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Corner=n,this.XDim=r,this.YDim=i,this.ZDim=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new LP(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Corner),e.push(this.XDim),e.push(this.YDim),e.push(this.ZDim),e}},kP=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.BaseSurface=n,this.AgreementFlag=r,this.Enclosure=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new kP(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e.push(this.Enclosure),e}},FP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new FP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e}},UP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new UP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e}},BP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.ElevationOfRefHeight=h,this.ElevationOfTerrain=p,this.BuildingAddress=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new BP(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.ElevationOfRefHeight),e.push(this.ElevationOfTerrain),e.push(this.BuildingAddress),e}},jP=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new jP(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},GP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new GP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},zP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new zP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},VP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new VP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},HP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new HP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},qP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new qP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},WP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.Elevation=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new WP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.Elevation),e}},YP=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.LongName=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new YP(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.LongName),e}},XP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new XP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$P=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $P(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},KP=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Depth=s,this.Width=a,this.WallThickness=o,this.Girth=l,this.InternalFilletRadius=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new KP(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.Width),e.push(this.WallThickness),e.push(this.Girth),e.push(this.InternalFilletRadius),e}},ZP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new ZP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},JP=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new JP(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},QP=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new QP(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},eN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new eN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},tN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new tN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},nN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new nN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},rN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new rN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},iN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new iN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},sN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new sN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},aN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new aN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},oN=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Coordinates=n}static FromTape(e,t,n){let r=0,i=n[r++];return new oN(e,t,i)}ToTape(){let e=[];return e.push(this.Coordinates),e}},lN=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new lN(e,t)}ToTape(){return[]}},cN=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.CoordList=n,this.TagList=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new cN(e,t,i,s)}ToTape(){let e=[];return e.push(this.CoordList),e.push(this.TagList),e}},uN=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.CoordList=n,this.TagList=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new uN(e,t,i,s)}ToTape(){let e=[];return e.push(this.CoordList),e.push(this.TagList),e}},hN=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Axis1=n,this.Axis2=r,this.LocalOrigin=i,this.Scale=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new hN(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e}},pN=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Axis1=n,this.Axis2=r,this.LocalOrigin=i,this.Scale=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new pN(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e}},dN=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Axis1=n,this.Axis2=r,this.LocalOrigin=i,this.Scale=s,this.Scale2=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new dN(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Scale2),e}},mN=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Axis1=n,this.Axis2=r,this.LocalOrigin=i,this.Scale=s,this.Axis3=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new mN(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Axis3),e}},fN=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Axis1=n,this.Axis2=r,this.LocalOrigin=i,this.Scale=s,this.Axis3=a,this.Scale2=o,this.Scale3=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new fN(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Axis3),e.push(this.Scale2),e.push(this.Scale3),e}},gN=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Curve=i,this.Thickness=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new gN(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Curve),e.push(this.Thickness),e}},_N=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new _N(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},vN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new vN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},yN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new yN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new bN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},xN=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Position=n,this.Radius=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new xN(e,t,i,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},TN=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Radius=s,this.WallThickness=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new TN(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Radius),e.push(this.WallThickness),e}},wN=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Radius=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new wN(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Radius),e}},EN=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.StartPoint=n,this.StartDirection=r,this.SegmentLength=i,this.Radius=s,this.IsCCW=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new EN(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e.push(this.Radius),e.push(this.IsCCW),e}},SN=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new SN(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new IN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},MN=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Source=n,this.Edition=r,this.EditionDate=i,this.Name=s,this.Description=a,this.Location=o,this.ReferenceTokens=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new MN(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Source),e.push(this.Edition),e.push(this.EditionDate),e.push(this.Name),e.push(this.Description),e.push(this.Location),e.push(this.ReferenceTokens),e}},AN=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i,this.ReferencedSource=s,this.Description=a,this.Sort=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new AN(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.ReferencedSource),e.push(this.Description),e.push(this.Sort),e}},RN=class{constructor(e,t,n){this.expressID=e,this.type=t,this.CfsFaces=n}static FromTape(e,t,n){let r=0,i=n[r++];return new RN(e,t,i)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},DN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new DN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},CN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new CN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ON=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Red=r,this.Green=i,this.Blue=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new ON(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Red),e.push(this.Green),e.push(this.Blue),e}},PN=class{constructor(e,t,n){this.expressID=e,this.type=t,this.ColourList=n}static FromTape(e,t,n){let r=0,i=n[r++];return new PN(e,t,i)}ToTape(){let e=[];return e.push(this.ColourList),e}},NN=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new NN(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},LN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new LN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},kN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new kN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},FN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new FN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},UN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new UN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},BN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new BN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jN=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.UsageName=i,this.HasProperties=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new jN(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.HasProperties),e}},GN=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.UsageName=a,this.TemplateType=o,this.HasPropertyTemplates=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new GN(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.TemplateType),e.push(this.HasPropertyTemplates),e}},zN=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Segments=n,this.SelfIntersect=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new zN(e,t,i,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},VN=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Segments=n,this.SelfIntersect=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new VN(e,t,i,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},HN=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Transition=n,this.SameSense=r,this.ParentCurve=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new HN(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Transition),e.push(this.SameSense),e.push(this.ParentCurve),e}},qN=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Profiles=i,this.Label=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new qN(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Profiles),e.push(this.Label),e}},WN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new WN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},YN=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new YN(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},XN=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new XN(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$N=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $N(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},KN=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Position=n}static FromTape(e,t,n){let r=0,i=n[r++];return new KN(e,t,i)}ToTape(){let e=[];return e.push(this.Position),e}},ZN=class{constructor(e,t,n){this.expressID=e,this.type=t,this.CfsFaces=n}static FromTape(e,t,n){let r=0,i=n[r++];return new ZN(e,t,i)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},JN=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.CurveOnRelatingElement=n,this.CurveOnRelatedElement=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new JN(e,t,i,s)}ToTape(){let e=[];return e.push(this.CurveOnRelatingElement),e.push(this.CurveOnRelatedElement),e}},QN=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new QN(e,t)}ToTape(){return[]}},eL=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.PointOnRelatingElement=n,this.PointOnRelatedElement=r,this.EccentricityInX=i,this.EccentricityInY=s,this.EccentricityInZ=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new eL(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.PointOnRelatingElement),e.push(this.PointOnRelatedElement),e.push(this.EccentricityInX),e.push(this.EccentricityInY),e.push(this.EccentricityInZ),e}},tL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.PointOnRelatingElement=n,this.PointOnRelatedElement=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new tL(e,t,i,s)}ToTape(){let e=[];return e.push(this.PointOnRelatingElement),e.push(this.PointOnRelatedElement),e}},nL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.SurfaceOnRelatingElement=n,this.SurfaceOnRelatedElement=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new nL(e,t,i,s)}ToTape(){let e=[];return e.push(this.SurfaceOnRelatingElement),e.push(this.SurfaceOnRelatedElement),e}},rL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.VolumeOnRelatingElement=n,this.VolumeOnRelatedElement=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new rL(e,t,i,s)}ToTape(){let e=[];return e.push(this.VolumeOnRelatingElement),e.push(this.VolumeOnRelatedElement),e}},iL=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.ConstraintGrade=i,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new iL(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e}},sL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new sL(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},aL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new aL(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},oL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new oL(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},lL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new lL(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},cL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new cL(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},uL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new uL(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},hL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new hL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e}},pL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new pL(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e}},dL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=c,this.UnitsInContext=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new dL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},mL=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Dimensions=n,this.UnitType=r,this.Name=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new mL(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e}},fL=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new fL(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e}},gL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new gL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},_L=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new _L(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},vL=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Dimensions=n,this.UnitType=r,this.Name=i,this.ConversionFactor=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new vL(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e.push(this.ConversionFactor),e}},yL=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Dimensions=n,this.UnitType=r,this.Name=i,this.ConversionFactor=s,this.ConversionOffset=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new yL(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e.push(this.ConversionFactor),e.push(this.ConversionOffset),e}},bL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new bL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},xL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new xL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},TL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new TL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},wL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new wL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},EL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.SourceCRS=n,this.TargetCRS=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new EL(e,t,i,s)}ToTape(){let e=[];return e.push(this.SourceCRS),e.push(this.TargetCRS),e}},SL=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.GeodeticDatum=i,this.VerticalDatum=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new SL(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.GeodeticDatum),e.push(this.VerticalDatum),e}},IL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.CostValues=c,this.CostQuantities=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new IL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.CostValues),e.push(this.CostQuantities),e}},ML=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.SubmittedOn=u,this.UpdateDate=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new ML(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.SubmittedOn),e.push(this.UpdateDate),e}},AL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.AppliedValue=i,this.UnitBasis=s,this.ApplicableDate=a,this.FixedUntilDate=o,this.Category=l,this.Condition=c,this.ArithmeticOperator=u,this.Components=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new AL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AppliedValue),e.push(this.UnitBasis),e.push(this.ApplicableDate),e.push(this.FixedUntilDate),e.push(this.Category),e.push(this.Condition),e.push(this.ArithmeticOperator),e.push(this.Components),e}},RL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new RL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},DL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new DL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},CL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new CL(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},OL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new OL(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},PL=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Position=n}static FromTape(e,t,n){let r=0,i=n[r++];return new PL(e,t,i)}ToTape(){let e=[];return e.push(this.Position),e}},NL=class{constructor(e,t,n){this.expressID=e,this.type=t,this.TreeRootExpression=n}static FromTape(e,t,n){let r=0,i=n[r++];return new NL(e,t,i)}ToTape(){let e=[];return e.push(this.TreeRootExpression),e}},LL=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingMonetaryUnit=i,this.RelatedMonetaryUnit=s,this.ExchangeRate=a,this.RateDateTime=o,this.RateSource=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new LL(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingMonetaryUnit),e.push(this.RelatedMonetaryUnit),e.push(this.ExchangeRate),e.push(this.RateDateTime),e.push(this.RateSource),e}},kL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new kL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},FL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new FL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},UL=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new UL(e,t)}ToTape(){return[]}},BL=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.BasisSurface=n,this.OuterBoundary=r,this.InnerBoundaries=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new BL(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.OuterBoundary),e.push(this.InnerBoundaries),e}},jL=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.BasisSurface=n,this.Boundaries=r,this.ImplicitOuter=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new jL(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.Boundaries),e.push(this.ImplicitOuter),e}},GL=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.StartPoint=n,this.StartDirection=r,this.SegmentLength=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new GL(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e}},zL=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.CurveFont=r,this.CurveWidth=i,this.CurveColour=s,this.ModelOrDraughting=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new zL(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.CurveFont),e.push(this.CurveWidth),e.push(this.CurveColour),e.push(this.ModelOrDraughting),e}},VL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Name=n,this.PatternList=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new VL(e,t,i,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.PatternList),e}},HL=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.CurveFont=r,this.CurveFontScaling=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new HL(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.CurveFont),e.push(this.CurveFontScaling),e}},qL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.VisibleSegmentLength=n,this.InvisibleSegmentLength=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new qL(e,t,i,s)}ToTape(){let e=[];return e.push(this.VisibleSegmentLength),e.push(this.InvisibleSegmentLength),e}},WL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Position=n,this.Radius=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new WL(e,t,i,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},YL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new YL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},XL=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new XL(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},$L=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new $L(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},KL=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new KL(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},ZL=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.ParentProfile=i,this.Operator=s,this.Label=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new ZL(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.ParentProfile),e.push(this.Operator),e.push(this.Label),e}},JL=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Elements=n,this.UnitType=r,this.UserDefinedType=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new JL(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Elements),e.push(this.UnitType),e.push(this.UserDefinedType),e}},QL=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Unit=n,this.Exponent=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new QL(e,t,i,s)}ToTape(){let e=[];return e.push(this.Unit),e.push(this.Exponent),e}},ek=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.LengthExponent=n,this.MassExponent=r,this.TimeExponent=i,this.ElectricCurrentExponent=s,this.ThermodynamicTemperatureExponent=a,this.AmountOfSubstanceExponent=o,this.LuminousIntensityExponent=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new ek(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.LengthExponent),e.push(this.MassExponent),e.push(this.TimeExponent),e.push(this.ElectricCurrentExponent),e.push(this.ThermodynamicTemperatureExponent),e.push(this.AmountOfSubstanceExponent),e.push(this.LuminousIntensityExponent),e}},tk=class{constructor(e,t,n){this.expressID=e,this.type=t,this.DirectionRatios=n}static FromTape(e,t,n){let r=0,i=n[r++];return new tk(e,t,i)}ToTape(){let e=[];return e.push(this.DirectionRatios),e}},nk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new nk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},rk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new rk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ik=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.DistanceAlong=n,this.OffsetLateral=r,this.OffsetVertical=i,this.OffsetLongitudinal=s,this.AlongHorizontal=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new ik(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.DistanceAlong),e.push(this.OffsetLateral),e.push(this.OffsetVertical),e.push(this.OffsetLongitudinal),e.push(this.AlongHorizontal),e}},sk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new sk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ak=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new ak(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ok=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.LongName=o,this.PredefinedType=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new ok(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.PredefinedType),e}},lk=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new lk(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},ck=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new ck(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},uk=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new uk(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},hk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new hk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},pk=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new pk(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},dk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new dk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},mk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.FlowDirection=c,this.PredefinedType=u,this.SystemType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new mk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.FlowDirection),e.push(this.PredefinedType),e.push(this.SystemType),e}},fk=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.LongName=o,this.PredefinedType=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new fk(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.PredefinedType),e}},gk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v){this.expressID=e,this.type=t,this.Identification=n,this.Name=r,this.Description=i,this.Location=s,this.Purpose=a,this.IntendedUse=o,this.Scope=l,this.Revision=c,this.DocumentOwner=u,this.Editors=h,this.CreationTime=p,this.LastRevisionTime=d,this.ElectronicFormat=m,this.ValidFrom=f,this.ValidUntil=g,this.Confidentiality=_,this.Status=v}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++];return new gk(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Location),e.push(this.Purpose),e.push(this.IntendedUse),e.push(this.Scope),e.push(this.Revision),e.push(this.DocumentOwner),e.push(this.Editors),e.push(this.CreationTime),e.push(this.LastRevisionTime),e.push(this.ElectronicFormat),e.push(this.ValidFrom),e.push(this.ValidUntil),e.push(this.Confidentiality),e.push(this.Status),e}},_k=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingDocument=i,this.RelatedDocuments=s,this.RelationshipType=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new _k(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingDocument),e.push(this.RelatedDocuments),e.push(this.RelationshipType),e}},vk=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i,this.Description=s,this.ReferencedDocument=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new vk(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.ReferencedDocument),e}},yk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.OperationType=d,this.UserDefinedOperationType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new yk(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.UserDefinedOperationType),e}},bk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.LiningDepth=a,this.LiningThickness=o,this.ThresholdDepth=l,this.ThresholdThickness=c,this.TransomThickness=u,this.TransomOffset=h,this.LiningOffset=p,this.ThresholdOffset=d,this.CasingThickness=m,this.CasingDepth=f,this.ShapeAspectStyle=g,this.LiningToPanelOffsetX=_,this.LiningToPanelOffsetY=v}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++];return new bk(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.LiningDepth),e.push(this.LiningThickness),e.push(this.ThresholdDepth),e.push(this.ThresholdThickness),e.push(this.TransomThickness),e.push(this.TransomOffset),e.push(this.LiningOffset),e.push(this.ThresholdOffset),e.push(this.CasingThickness),e.push(this.CasingDepth),e.push(this.ShapeAspectStyle),e.push(this.LiningToPanelOffsetX),e.push(this.LiningToPanelOffsetY),e}},xk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.PanelDepth=a,this.PanelOperation=o,this.PanelWidth=l,this.PanelPosition=c,this.ShapeAspectStyle=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new xk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.PanelDepth),e.push(this.PanelOperation),e.push(this.PanelWidth),e.push(this.PanelPosition),e.push(this.ShapeAspectStyle),e}},Tk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.OperationType=d,this.UserDefinedOperationType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new Tk(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.UserDefinedOperationType),e}},wk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.OperationType=u,this.ConstructionType=h,this.ParameterTakesPrecedence=p,this.Sizeable=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new wk(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.OperationType),e.push(this.ConstructionType),e.push(this.ParameterTakesPrecedence),e.push(this.Sizeable),e}},Ek=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.OperationType=p,this.ParameterTakesPrecedence=d,this.UserDefinedOperationType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new Ek(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.ParameterTakesPrecedence),e.push(this.UserDefinedOperationType),e}},Sk=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Sk(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},Ik=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Ik(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},Mk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Mk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Ak=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Ak(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Rk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Rk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Dk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Dk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Ck=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Ck(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Ok=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Ok(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Pk=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.EdgeStart=n,this.EdgeEnd=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Pk(e,t,i,s)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e}},Nk=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.EdgeStart=n,this.EdgeEnd=r,this.EdgeGeometry=i,this.SameSense=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new Nk(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.EdgeGeometry),e.push(this.SameSense),e}},Lk=class{constructor(e,t,n){this.expressID=e,this.type=t,this.EdgeList=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Lk(e,t,i)}ToTape(){let e=[];return e.push(this.EdgeList),e}},kk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new kk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Fk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Fk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Uk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Uk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Bk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Bk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new jk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Gk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Gk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},zk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new zk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Vk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Vk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Hk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Hk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},qk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new qk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Wk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Wk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Yk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Yk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Xk=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Xk(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},$k=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.AssemblyPlace=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $k(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.AssemblyPlace),e.push(this.PredefinedType),e}},Kk=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Kk(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Zk=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Zk(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},Jk=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Jk(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},Qk=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.MethodOfMeasurement=a,this.Quantities=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Qk(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.MethodOfMeasurement),e.push(this.Quantities),e}},eF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new eF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},tF=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Position=n}static FromTape(e,t,n){let r=0,i=n[r++];return new tF(e,t,i)}ToTape(){let e=[];return e.push(this.Position),e}},nF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Position=n,this.SemiAxis1=r,this.SemiAxis2=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new nF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.SemiAxis1),e.push(this.SemiAxis2),e}},rF=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.SemiAxis1=s,this.SemiAxis2=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new rF(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.SemiAxis1),e.push(this.SemiAxis2),e}},iF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new iF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},sF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new sF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},aF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new aF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},oF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new oF(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},lF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new lF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},cF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new cF(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},uF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new uF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},hF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new hF(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},pF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.PredefinedType=c,this.EventTriggerType=u,this.UserDefinedEventTriggerType=h,this.EventOccurenceTime=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new pF(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.PredefinedType),e.push(this.EventTriggerType),e.push(this.UserDefinedEventTriggerType),e.push(this.EventOccurenceTime),e}},dF=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i,this.ActualDate=s,this.EarlyDate=a,this.LateDate=o,this.ScheduleDate=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new dF(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.ActualDate),e.push(this.EarlyDate),e.push(this.LateDate),e.push(this.ScheduleDate),e}},mF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u,this.PredefinedType=h,this.EventTriggerType=p,this.UserDefinedEventTriggerType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new mF(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e.push(this.EventTriggerType),e.push(this.UserDefinedEventTriggerType),e}},fF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Properties=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new fF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e}},gF=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new gF(e,t)}ToTape(){return[]}},_F=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new _F(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},vF=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingReference=i,this.RelatedResourceObjects=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new vF(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingReference),e.push(this.RelatedResourceObjects),e}},yF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new yF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.PredefinedType),e}},bF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new bF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e}},xF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new xF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},TF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new TF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},wF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new wF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},EF=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r,this.ExtrudedDirection=i,this.Depth=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new EF(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.ExtrudedDirection),e.push(this.Depth),e}},SF=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r,this.ExtrudedDirection=i,this.Depth=s,this.EndSweptArea=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new SF(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.ExtrudedDirection),e.push(this.Depth),e.push(this.EndSweptArea),e}},IF=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Bounds=n}static FromTape(e,t,n){let r=0,i=n[r++];return new IF(e,t,i)}ToTape(){let e=[];return e.push(this.Bounds),e}},MF=class{constructor(e,t,n){this.expressID=e,this.type=t,this.FbsmFaces=n}static FromTape(e,t,n){let r=0,i=n[r++];return new MF(e,t,i)}ToTape(){let e=[];return e.push(this.FbsmFaces),e}},AF=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Bound=n,this.Orientation=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new AF(e,t,i,s)}ToTape(){let e=[];return e.push(this.Bound),e.push(this.Orientation),e}},RF=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Bound=n,this.Orientation=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new RF(e,t,i,s)}ToTape(){let e=[];return e.push(this.Bound),e.push(this.Orientation),e}},DF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Bounds=n,this.FaceSurface=r,this.SameSense=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new DF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Bounds),e.push(this.FaceSurface),e.push(this.SameSense),e}},CF=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Outer=n}static FromTape(e,t,n){let r=0,i=n[r++];return new CF(e,t,i)}ToTape(){let e=[];return e.push(this.Outer),e}},OF=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Outer=n,this.Voids=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new OF(e,t,i,s)}ToTape(){let e=[];return e.push(this.Outer),e.push(this.Voids),e}},PF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new PF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},NF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new NF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},LF=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.TensionFailureX=r,this.TensionFailureY=i,this.TensionFailureZ=s,this.CompressionFailureX=a,this.CompressionFailureY=o,this.CompressionFailureZ=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new LF(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TensionFailureX),e.push(this.TensionFailureY),e.push(this.TensionFailureZ),e.push(this.CompressionFailureX),e.push(this.CompressionFailureY),e.push(this.CompressionFailureZ),e}},kF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new kF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},FF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new FF(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},UF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new UF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},BF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new BF(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new jF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},GF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new GF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},zF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new zF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},VF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.FillStyles=r,this.ModelorDraughting=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new VF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.FillStyles),e.push(this.ModelorDraughting),e}},HF=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.HatchLineAppearance=n,this.StartOfNextHatchLine=r,this.PointOfReferenceHatchLine=i,this.PatternStart=s,this.HatchLineAngle=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new HF(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.HatchLineAppearance),e.push(this.StartOfNextHatchLine),e.push(this.PointOfReferenceHatchLine),e.push(this.PatternStart),e.push(this.HatchLineAngle),e}},qF=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.TilingPattern=n,this.Tiles=r,this.TilingScale=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new qF(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.TilingPattern),e.push(this.Tiles),e.push(this.TilingScale),e}},WF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new WF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},YF=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new YF(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},XF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new XF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$F=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $F(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},KF=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r,this.Directrix=i,this.StartParam=s,this.EndParam=a,this.FixedReference=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new KF(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Directrix),e.push(this.StartParam),e.push(this.EndParam),e.push(this.FixedReference),e}},ZF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new ZF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},JF=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new JF(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},QF=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new QF(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},eU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new eU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},tU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new tU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},nU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new nU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},rU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new rU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},iU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new iU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},sU=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new sU(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},aU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new aU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},oU=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new oU(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},lU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new lU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},cU=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new cU(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},uU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new uU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},hU=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new hU(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},pU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new pU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},dU=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new dU(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},mU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new mU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},fU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new fU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},gU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new gU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},_U=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new _U(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},vU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new vU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},yU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new yU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.AssemblyPlace=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new bU(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.AssemblyPlace),e.push(this.PredefinedType),e}},xU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new xU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},TU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new TU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},wU=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Elements=n}static FromTape(e,t,n){let r=0,i=n[r++];return new wU(e,t,i)}ToTape(){let e=[];return e.push(this.Elements),e}},EU=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.ContextIdentifier=n,this.ContextType=r,this.CoordinateSpaceDimension=i,this.Precision=s,this.WorldCoordinateSystem=a,this.TrueNorth=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new EU(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e.push(this.CoordinateSpaceDimension),e.push(this.Precision),e.push(this.WorldCoordinateSystem),e.push(this.TrueNorth),e}},SU=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new SU(e,t)}ToTape(){return[]}},IU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.ContextIdentifier=n,this.ContextType=r,this.CoordinateSpaceDimension=i,this.Precision=s,this.WorldCoordinateSystem=a,this.TrueNorth=o,this.ParentContext=l,this.TargetScale=c,this.TargetView=u,this.UserDefinedTargetView=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new IU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e.push(this.CoordinateSpaceDimension),e.push(this.Precision),e.push(this.WorldCoordinateSystem),e.push(this.TrueNorth),e.push(this.ParentContext),e.push(this.TargetScale),e.push(this.TargetView),e.push(this.UserDefinedTargetView),e}},MU=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Elements=n}static FromTape(e,t,n){let r=0,i=n[r++];return new MU(e,t,i)}ToTape(){let e=[];return e.push(this.Elements),e}},AU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.UAxes=c,this.VAxes=u,this.WAxes=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new AU(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.UAxes),e.push(this.VAxes),e.push(this.WAxes),e.push(this.PredefinedType),e}},RU=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.AxisTag=n,this.AxisCurve=r,this.SameSense=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new RU(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.AxisTag),e.push(this.AxisCurve),e.push(this.SameSense),e}},DU=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.PlacementRelTo=n,this.PlacementLocation=r,this.PlacementRefDirection=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new DU(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.PlacementLocation),e.push(this.PlacementRefDirection),e}},CU=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new CU(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e}},OU=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.BaseSurface=n,this.AgreementFlag=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new OU(e,t,i,s)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e}},PU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new PU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},NU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new NU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},LU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new LU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},kU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new kU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},FU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.OverallWidth=s,this.OverallDepth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.FlangeEdgeRadius=u,this.FlangeSlope=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new FU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.OverallWidth),e.push(this.OverallDepth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.FlangeEdgeRadius),e.push(this.FlangeSlope),e}},UU=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.RepeatS=n,this.RepeatT=r,this.Mode=i,this.TextureTransform=s,this.Parameter=a,this.URLReference=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new UU(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.URLReference),e}},BU=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.MappedTo=n,this.Opacity=r,this.Colours=i,this.ColourIndex=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new BU(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.MappedTo),e.push(this.Opacity),e.push(this.Colours),e.push(this.ColourIndex),e}},jU=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Points=n,this.Segments=r,this.SelfIntersect=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new jU(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Points),e.push(this.Segments),e.push(this.SelfIntersect),e}},GU=class{constructor(e,t,n){this.expressID=e,this.type=t,this.CoordIndex=n}static FromTape(e,t,n){let r=0,i=n[r++];return new GU(e,t,i)}ToTape(){let e=[];return e.push(this.CoordIndex),e}},zU=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.CoordIndex=n,this.InnerCoordIndices=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new zU(e,t,i,s)}ToTape(){let e=[];return e.push(this.CoordIndex),e.push(this.InnerCoordIndices),e}},VU=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Maps=n,this.MappedTo=r,this.TexCoords=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new VU(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.MappedTo),e.push(this.TexCoords),e}},HU=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Maps=n,this.MappedTo=r,this.TexCoords=i,this.TexCoordIndex=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new HU(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.MappedTo),e.push(this.TexCoords),e.push(this.TexCoordIndex),e}},qU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new qU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},WU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new WU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},YU=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Curve3D=n,this.AssociatedGeometry=r,this.MasterRepresentation=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new YU(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},XU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.Jurisdiction=l,this.ResponsiblePersons=c,this.LastUpdateDate=u,this.CurrentValue=h,this.OriginalValue=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new XU(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.Jurisdiction),e.push(this.ResponsiblePersons),e.push(this.LastUpdateDate),e.push(this.CurrentValue),e.push(this.OriginalValue),e}},$U=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.StartTime=i,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=c,this.Values=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new $U(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e.push(this.Values),e}},KU=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.TimeStamp=n,this.ListValues=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new KU(e,t,i,s)}ToTape(){let e=[];return e.push(this.TimeStamp),e.push(this.ListValues),e}},ZU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new ZU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},JU=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new JU(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},QU=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Depth=s,this.Width=a,this.Thickness=o,this.FilletRadius=l,this.EdgeRadius=c,this.LegSlope=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new QU(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.Width),e.push(this.Thickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e.push(this.LegSlope),e}},eB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new eB(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},tB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new tB(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},nB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i,this.LagValue=s,this.DurationType=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new nB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.LagValue),e.push(this.DurationType),e}},rB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new rB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},iB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new iB(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},sB=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Name=n,this.Version=r,this.Publisher=i,this.VersionDate=s,this.Location=a,this.Description=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new sB(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Version),e.push(this.Publisher),e.push(this.VersionDate),e.push(this.Location),e.push(this.Description),e}},aB=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Location=n,this.Identification=r,this.Name=i,this.Description=s,this.Language=a,this.ReferencedLibrary=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new aB(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Language),e.push(this.ReferencedLibrary),e}},oB=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.MainPlaneAngle=n,this.SecondaryPlaneAngle=r,this.LuminousIntensity=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new oB(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.MainPlaneAngle),e.push(this.SecondaryPlaneAngle),e.push(this.LuminousIntensity),e}},lB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new lB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},cB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new cB(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},uB=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.LightDistributionCurve=n,this.DistributionData=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new uB(e,t,i,s)}ToTape(){let e=[];return e.push(this.LightDistributionCurve),e.push(this.DistributionData),e}},hB=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.LightColour=r,this.AmbientIntensity=i,this.Intensity=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new hB(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e}},pB=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.LightColour=r,this.AmbientIntensity=i,this.Intensity=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new pB(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e}},dB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.LightColour=r,this.AmbientIntensity=i,this.Intensity=s,this.Orientation=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new dB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Orientation),e}},mB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=n,this.LightColour=r,this.AmbientIntensity=i,this.Intensity=s,this.Position=a,this.ColourAppearance=o,this.ColourTemperature=l,this.LuminousFlux=c,this.LightEmissionSource=u,this.LightDistributionDataSource=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new mB(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.ColourAppearance),e.push(this.ColourTemperature),e.push(this.LuminousFlux),e.push(this.LightEmissionSource),e.push(this.LightDistributionDataSource),e}},fB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Name=n,this.LightColour=r,this.AmbientIntensity=i,this.Intensity=s,this.Position=a,this.Radius=o,this.ConstantAttenuation=l,this.DistanceAttenuation=c,this.QuadricAttenuation=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new fB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.Radius),e.push(this.ConstantAttenuation),e.push(this.DistanceAttenuation),e.push(this.QuadricAttenuation),e}},gB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.Name=n,this.LightColour=r,this.AmbientIntensity=i,this.Intensity=s,this.Position=a,this.Radius=o,this.ConstantAttenuation=l,this.DistanceAttenuation=c,this.QuadricAttenuation=u,this.Orientation=h,this.ConcentrationExponent=p,this.SpreadAngle=d,this.BeamWidthAngle=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new gB(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.Radius),e.push(this.ConstantAttenuation),e.push(this.DistanceAttenuation),e.push(this.QuadricAttenuation),e.push(this.Orientation),e.push(this.ConcentrationExponent),e.push(this.SpreadAngle),e.push(this.BeamWidthAngle),e}},_B=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Pnt=n,this.Dir=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new _B(e,t,i,s)}ToTape(){let e=[];return e.push(this.Pnt),e.push(this.Dir),e}},vB=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.StartPoint=n,this.StartDirection=r,this.SegmentLength=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new vB(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e}},yB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.PlacementRelTo=n,this.PlacementMeasuredAlong=r,this.Distance=i,this.Orientation=s,this.CartesianPosition=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new yB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.PlacementMeasuredAlong),e.push(this.Distance),e.push(this.Orientation),e.push(this.CartesianPosition),e}},bB=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Axis=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new bB(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Axis),e}},xB=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.PlacementRelTo=n,this.RelativePlacement=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new xB(e,t,i,s)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.RelativePlacement),e}},TB=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new TB(e,t)}ToTape(){return[]}},wB=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Outer=n}static FromTape(e,t,n){let r=0,i=n[r++];return new wB(e,t,i)}ToTape(){let e=[];return e.push(this.Outer),e}},EB=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.SourceCRS=n,this.TargetCRS=r,this.Eastings=i,this.Northings=s,this.OrthogonalHeight=a,this.XAxisAbscissa=o,this.XAxisOrdinate=l,this.Scale=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new EB(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.SourceCRS),e.push(this.TargetCRS),e.push(this.Eastings),e.push(this.Northings),e.push(this.OrthogonalHeight),e.push(this.XAxisAbscissa),e.push(this.XAxisOrdinate),e.push(this.Scale),e}},SB=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.MappingSource=n,this.MappingTarget=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new SB(e,t,i,s)}ToTape(){let e=[];return e.push(this.MappingSource),e.push(this.MappingTarget),e}},IB=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Category=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new IB(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Category),e}},MB=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.MaterialClassifications=n,this.ClassifiedMaterial=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new MB(e,t,i,s)}ToTape(){let e=[];return e.push(this.MaterialClassifications),e.push(this.ClassifiedMaterial),e}},AB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Material=i,this.Fraction=s,this.Category=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new AB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Fraction),e.push(this.Category),e}},RB=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.MaterialConstituents=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new RB(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.MaterialConstituents),e}},DB=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new DB(e,t)}ToTape(){return[]}},CB=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Representations=i,this.RepresentedMaterial=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new CB(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e.push(this.RepresentedMaterial),e}},OB=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Material=n,this.LayerThickness=r,this.IsVentilated=i,this.Name=s,this.Description=a,this.Category=o,this.Priority=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new OB(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Material),e.push(this.LayerThickness),e.push(this.IsVentilated),e.push(this.Name),e.push(this.Description),e.push(this.Category),e.push(this.Priority),e}},PB=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.MaterialLayers=n,this.LayerSetName=r,this.Description=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new PB(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.MaterialLayers),e.push(this.LayerSetName),e.push(this.Description),e}},NB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ForLayerSet=n,this.LayerSetDirection=r,this.DirectionSense=i,this.OffsetFromReferenceLine=s,this.ReferenceExtent=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new NB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ForLayerSet),e.push(this.LayerSetDirection),e.push(this.DirectionSense),e.push(this.OffsetFromReferenceLine),e.push(this.ReferenceExtent),e}},LB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Material=n,this.LayerThickness=r,this.IsVentilated=i,this.Name=s,this.Description=a,this.Category=o,this.Priority=l,this.OffsetDirection=c,this.OffsetValues=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new LB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Material),e.push(this.LayerThickness),e.push(this.IsVentilated),e.push(this.Name),e.push(this.Description),e.push(this.Category),e.push(this.Priority),e.push(this.OffsetDirection),e.push(this.OffsetValues),e}},kB=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Materials=n}static FromTape(e,t,n){let r=0,i=n[r++];return new kB(e,t,i)}ToTape(){let e=[];return e.push(this.Materials),e}},FB=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Material=i,this.Profile=s,this.Priority=a,this.Category=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new FB(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Profile),e.push(this.Priority),e.push(this.Category),e}},UB=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.MaterialProfiles=i,this.CompositeProfile=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new UB(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.MaterialProfiles),e.push(this.CompositeProfile),e}},BB=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.ForProfileSet=n,this.CardinalPoint=r,this.ReferenceExtent=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new BB(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.ForProfileSet),e.push(this.CardinalPoint),e.push(this.ReferenceExtent),e}},jB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ForProfileSet=n,this.CardinalPoint=r,this.ReferenceExtent=i,this.ForProfileEndSet=s,this.CardinalEndPoint=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new jB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ForProfileSet),e.push(this.CardinalPoint),e.push(this.ReferenceExtent),e.push(this.ForProfileEndSet),e.push(this.CardinalEndPoint),e}},GB=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Material=i,this.Profile=s,this.Priority=a,this.Category=o,this.OffsetValues=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new GB(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Profile),e.push(this.Priority),e.push(this.Category),e.push(this.OffsetValues),e}},zB=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Properties=i,this.Material=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new zB(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e.push(this.Material),e}},VB=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingMaterial=i,this.RelatedMaterials=s,this.Expression=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new VB(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingMaterial),e.push(this.RelatedMaterials),e.push(this.Expression),e}},HB=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new HB(e,t)}ToTape(){return[]}},qB=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.ValueComponent=n,this.UnitComponent=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new qB(e,t,i,s)}ToTape(){let e=[];return e.push(this.ValueComponent),e.push(this.UnitComponent),e}},WB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.NominalDiameter=u,this.NominalLength=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new WB(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.NominalDiameter),e.push(this.NominalLength),e.push(this.PredefinedType),e}},YB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.NominalDiameter=p,this.NominalLength=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new YB(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.NominalLength),e}},XB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new XB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$B=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $B(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},KB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new KB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},ZB=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new ZB(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},JB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new JB(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},QB=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.ConstraintGrade=i,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l,this.Benchmark=c,this.ValueSource=u,this.DataValue=h,this.ReferencePath=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new QB(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e.push(this.Benchmark),e.push(this.ValueSource),e.push(this.DataValue),e.push(this.ReferencePath),e}},ej=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.ParentProfile=i,this.Operator=s,this.Label=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new ej(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.ParentProfile),e.push(this.Operator),e.push(this.Label),e}},tj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Currency=n}static FromTape(e,t,n){let r=0,i=n[r++];return new tj(e,t,i)}ToTape(){let e=[];return e.push(this.Currency),e}},nj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new nj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},rj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new rj(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ij=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Dimensions=n,this.UnitType=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new ij(e,t,i,s)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e}},sj=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new sj(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e}},aj=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new aj(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},oj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.PlacementRelTo=n}static FromTape(e,t,n){let r=0,i=n[r++];return new oj(e,t,i)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e}},lj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.ConstraintGrade=i,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l,this.BenchmarkValues=c,this.LogicalAggregator=u,this.ObjectiveQualifier=h,this.UserDefinedQualifier=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new lj(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e.push(this.BenchmarkValues),e.push(this.LogicalAggregator),e.push(this.ObjectiveQualifier),e.push(this.UserDefinedQualifier),e}},cj=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.TheActor=o,this.PredefinedType=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new cj(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheActor),e.push(this.PredefinedType),e}},uj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.BasisCurve=n}static FromTape(e,t,n){let r=0,i=n[r++];return new uj(e,t,i)}ToTape(){let e=[];return e.push(this.BasisCurve),e}},hj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.BasisCurve=n,this.Distance=r,this.SelfIntersect=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new hj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Distance),e.push(this.SelfIntersect),e}},pj=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.BasisCurve=n,this.Distance=r,this.SelfIntersect=i,this.RefDirection=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new pj(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Distance),e.push(this.SelfIntersect),e.push(this.RefDirection),e}},dj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.BasisCurve=n,this.OffsetValues=r,this.Tag=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new dj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.OffsetValues),e.push(this.Tag),e}},mj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.CfsFaces=n}static FromTape(e,t,n){let r=0,i=n[r++];return new mj(e,t,i)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},fj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new fj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},gj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new gj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},_j=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Identification=n,this.Name=r,this.Description=i,this.Roles=s,this.Addresses=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new _j(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Roles),e.push(this.Addresses),e}},vj=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingOrganization=i,this.RelatedOrganizations=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new vj(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingOrganization),e.push(this.RelatedOrganizations),e}},yj=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.LateralAxisDirection=n,this.VerticalAxisDirection=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new yj(e,t,i,s)}ToTape(){let e=[];return e.push(this.LateralAxisDirection),e.push(this.VerticalAxisDirection),e}},bj=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.EdgeStart=n,this.EdgeEnd=r,this.EdgeElement=i,this.Orientation=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new bj(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.EdgeElement),e.push(this.Orientation),e}},xj=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Segments=n,this.SelfIntersect=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new xj(e,t,i,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},Tj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Tj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},wj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new wj(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Ej=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.OwningUser=n,this.OwningApplication=r,this.State=i,this.ChangeAction=s,this.LastModifiedDate=a,this.LastModifyingUser=o,this.LastModifyingApplication=l,this.CreationDate=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Ej(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.OwningUser),e.push(this.OwningApplication),e.push(this.State),e.push(this.ChangeAction),e.push(this.LastModifiedDate),e.push(this.LastModifyingUser),e.push(this.LastModifyingApplication),e.push(this.CreationDate),e}},Sj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Sj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e}},Ij=class{constructor(e,t,n){this.expressID=e,this.type=t,this.EdgeList=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Ij(e,t,i)}ToTape(){let e=[];return e.push(this.EdgeList),e}},Mj=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.BasisSurface=n,this.ReferenceCurve=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Mj(e,t,i,s)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.ReferenceCurve),e}},Aj=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LifeCyclePhase=l,this.PredefinedType=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Aj(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LifeCyclePhase),e.push(this.PredefinedType),e}},Rj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.OperationType=a,this.PanelPosition=o,this.FrameDepth=l,this.FrameThickness=c,this.ShapeAspectStyle=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Rj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.OperationType),e.push(this.PanelPosition),e.push(this.FrameDepth),e.push(this.FrameThickness),e.push(this.ShapeAspectStyle),e}},Dj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.LongDescription=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Dj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},Cj=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Identification=n,this.FamilyName=r,this.GivenName=i,this.MiddleNames=s,this.PrefixTitles=a,this.SuffixTitles=o,this.Roles=l,this.Addresses=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Cj(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.FamilyName),e.push(this.GivenName),e.push(this.MiddleNames),e.push(this.PrefixTitles),e.push(this.SuffixTitles),e.push(this.Roles),e.push(this.Addresses),e}},Oj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.ThePerson=n,this.TheOrganization=r,this.Roles=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Oj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.ThePerson),e.push(this.TheOrganization),e.push(this.Roles),e}},Pj=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.HasQuantities=i,this.Discrimination=s,this.Quality=a,this.Usage=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Pj(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.HasQuantities),e.push(this.Discrimination),e.push(this.Quality),e.push(this.Usage),e}},Nj=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Name=n,this.Description=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Nj(e,t,i,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},Lj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Lj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e}},kj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u,this.ConstructionType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new kj(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e.push(this.ConstructionType),e}},Fj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Fj(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Uj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Uj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Bj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Bj(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},jj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new jj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Gj=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Gj(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},zj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.RepeatS=n,this.RepeatT=r,this.Mode=i,this.TextureTransform=s,this.Parameter=a,this.Width=o,this.Height=l,this.ColourComponents=c,this.Pixel=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new zj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.Width),e.push(this.Height),e.push(this.ColourComponents),e.push(this.Pixel),e}},Vj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Location=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Vj(e,t,i)}ToTape(){let e=[];return e.push(this.Location),e}},Hj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.SizeInX=n,this.SizeInY=r,this.Placement=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Hj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.SizeInX),e.push(this.SizeInY),e.push(this.Placement),e}},qj=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.SizeInX=n,this.SizeInY=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new qj(e,t,i,s)}ToTape(){let e=[];return e.push(this.SizeInX),e.push(this.SizeInY),e}},Wj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Position=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Wj(e,t,i)}ToTape(){let e=[];return e.push(this.Position),e}},Yj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Yj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Xj=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Xj(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},$j=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $j(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Kj=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new Kj(e,t)}ToTape(){return[]}},Zj=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.BasisCurve=n,this.PointParameter=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Zj(e,t,i,s)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.PointParameter),e}},Jj=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.BasisSurface=n,this.PointParameterU=r,this.PointParameterV=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Jj(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.PointParameterU),e.push(this.PointParameterV),e}},Qj=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Polygon=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Qj(e,t,i)}ToTape(){let e=[];return e.push(this.Polygon),e}},eG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.BaseSurface=n,this.AgreementFlag=r,this.Position=i,this.PolygonalBoundary=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new eG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e.push(this.Position),e.push(this.PolygonalBoundary),e}},tG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Coordinates=n,this.Closed=r,this.Faces=i,this.PnIndex=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new tG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Closed),e.push(this.Faces),e.push(this.PnIndex),e}},nG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Points=n}static FromTape(e,t,n){let r=0,i=n[r++];return new nG(e,t,i)}ToTape(){let e=[];return e.push(this.Points),e}},rG=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new rG(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},iG=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new iG(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},sG=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Purpose=n,this.Description=r,this.UserDefinedPurpose=i,this.InternalLocation=s,this.AddressLines=a,this.PostalBox=o,this.Town=l,this.Region=c,this.PostalCode=u,this.Country=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new sG(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e.push(this.InternalLocation),e.push(this.AddressLines),e.push(this.PostalBox),e.push(this.Town),e.push(this.Region),e.push(this.PostalCode),e.push(this.Country),e}},aG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new aG(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},oG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new oG(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},lG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new lG(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},cG=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new cG(e,t)}ToTape(){return[]}},uG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new uG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},hG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new hG(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},pG=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new pG(e,t)}ToTape(){return[]}},dG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.AssignedItems=i,this.Identifier=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new dG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AssignedItems),e.push(this.Identifier),e}},mG=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.AssignedItems=i,this.Identifier=s,this.LayerOn=a,this.LayerFrozen=o,this.LayerBlocked=l,this.LayerStyles=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new mG(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AssignedItems),e.push(this.Identifier),e.push(this.LayerOn),e.push(this.LayerFrozen),e.push(this.LayerBlocked),e.push(this.LayerStyles),e}},fG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new fG(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},gG=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Styles=n}static FromTape(e,t,n){let r=0,i=n[r++];return new gG(e,t,i)}ToTape(){let e=[];return e.push(this.Styles),e}},_G=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.PredefinedType=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new _G(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.PredefinedType),e}},vG=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new vG(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e}},yG=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new yG(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e}},bG=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new bG(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},xG=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Representations=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new xG(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e}},TG=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Representations=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new TG(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e}},wG=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new wG(e,t,i,s)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e}},EG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Properties=i,this.ProfileDefinition=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new EG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e.push(this.ProfileDefinition),e}},SG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=c,this.UnitsInContext=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new SG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},IG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=c,this.UnitsInContext=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new IG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},MG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.LongDescription=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new MG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},AG=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.GeodeticDatum=i,this.VerticalDatum=s,this.MapProjection=a,this.MapZone=o,this.MapUnit=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new AG(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.GeodeticDatum),e.push(this.VerticalDatum),e.push(this.MapProjection),e.push(this.MapZone),e.push(this.MapUnit),e}},RG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new RG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},DG=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Name=n,this.Description=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new DG(e,t,i,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},CG=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new CG(e,t)}ToTape(){return[]}},OG=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.UpperBoundValue=i,this.LowerBoundValue=s,this.Unit=a,this.SetPointValue=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new OG(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UpperBoundValue),e.push(this.LowerBoundValue),e.push(this.Unit),e.push(this.SetPointValue),e}},PG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new PG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},NG=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.DependingProperty=i,this.DependantProperty=s,this.Expression=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new NG(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.DependingProperty),e.push(this.DependantProperty),e.push(this.Expression),e}},LG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.EnumerationValues=i,this.EnumerationReference=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new LG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.EnumerationValues),e.push(this.EnumerationReference),e}},kG=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.EnumerationValues=r,this.Unit=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new kG(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.EnumerationValues),e.push(this.Unit),e}},FG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.ListValues=i,this.Unit=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new FG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ListValues),e.push(this.Unit),e}},UG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.UsageName=i,this.PropertyReference=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new UG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.PropertyReference),e}},BG=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.HasProperties=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new BG(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.HasProperties),e}},jG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new jG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},GG=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.TemplateType=a,this.ApplicableEntity=o,this.HasPropertyTemplates=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new GG(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.TemplateType),e.push(this.ApplicableEntity),e.push(this.HasPropertyTemplates),e}},zG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.NominalValue=i,this.Unit=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new zG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.NominalValue),e.push(this.Unit),e}},VG=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.DefiningValues=i,this.DefinedValues=s,this.Expression=a,this.DefiningUnit=o,this.DefinedUnit=l,this.CurveInterpolation=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new VG(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.DefiningValues),e.push(this.DefinedValues),e.push(this.Expression),e.push(this.DefiningUnit),e.push(this.DefinedUnit),e.push(this.CurveInterpolation),e}},HG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new HG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},qG=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new qG(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},WG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new WG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},YG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new YG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},XG=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new XG(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},$G=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new $G(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},KG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.ProxyType=c,this.Tag=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new KG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.ProxyType),e.push(this.Tag),e}},ZG=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new ZG(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},JG=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new JG(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},QG=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i,this.AreaValue=s,this.Formula=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new QG(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.AreaValue),e.push(this.Formula),e}},ez=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i,this.CountValue=s,this.Formula=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new ez(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.CountValue),e.push(this.Formula),e}},tz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i,this.LengthValue=s,this.Formula=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new tz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.LengthValue),e.push(this.Formula),e}},nz=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new nz(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},rz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i,this.TimeValue=s,this.Formula=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new rz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.TimeValue),e.push(this.Formula),e}},iz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i,this.VolumeValue=s,this.Formula=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new iz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.VolumeValue),e.push(this.Formula),e}},sz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.Unit=i,this.WeightValue=s,this.Formula=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new sz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.WeightValue),e.push(this.Formula),e}},az=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new az(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},oz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new oz(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},lz=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new lz(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},cz=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new cz(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},uz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new uz(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},hz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new hz(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},pz=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Degree=n,this.ControlPointsList=r,this.CurveForm=i,this.ClosedCurve=s,this.SelfIntersect=a,this.KnotMultiplicities=o,this.Knots=l,this.KnotSpec=c,this.WeightsData=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new pz(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e.push(this.KnotMultiplicities),e.push(this.Knots),e.push(this.KnotSpec),e.push(this.WeightsData),e}},dz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.UDegree=n,this.VDegree=r,this.ControlPointsList=i,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l,this.UMultiplicities=c,this.VMultiplicities=u,this.UKnots=h,this.VKnots=p,this.KnotSpec=d,this.WeightsData=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new dz(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e.push(this.UMultiplicities),e.push(this.VMultiplicities),e.push(this.UKnots),e.push(this.VKnots),e.push(this.KnotSpec),e.push(this.WeightsData),e}},mz=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.XDim=s,this.YDim=a,this.WallThickness=o,this.InnerFilletRadius=l,this.OuterFilletRadius=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new mz(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e.push(this.WallThickness),e.push(this.InnerFilletRadius),e.push(this.OuterFilletRadius),e}},fz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.XDim=s,this.YDim=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new fz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e}},gz=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Position=n,this.XLength=r,this.YLength=i,this.Height=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new gz(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Position),e.push(this.XLength),e.push(this.YLength),e.push(this.Height),e}},_z=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.BasisSurface=n,this.U1=r,this.V1=i,this.U2=s,this.V2=a,this.Usense=o,this.Vsense=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new _z(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.U1),e.push(this.V1),e.push(this.U2),e.push(this.V2),e.push(this.Usense),e.push(this.Vsense),e}},vz=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.RecurrenceType=n,this.DayComponent=r,this.WeekdayComponent=i,this.MonthComponent=s,this.Position=a,this.Interval=o,this.Occurrences=l,this.TimePeriods=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new vz(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.RecurrenceType),e.push(this.DayComponent),e.push(this.WeekdayComponent),e.push(this.MonthComponent),e.push(this.Position),e.push(this.Interval),e.push(this.Occurrences),e.push(this.TimePeriods),e}},yz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.TypeIdentifier=n,this.AttributeIdentifier=r,this.InstanceName=i,this.ListPositions=s,this.InnerReference=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new yz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.TypeIdentifier),e.push(this.AttributeIdentifier),e.push(this.InstanceName),e.push(this.ListPositions),e.push(this.InnerReference),e}},bz=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.RestartDistance=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new bz(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.RestartDistance),e}},xz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.StartTime=i,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=c,this.TimeStep=u,this.Values=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new xz(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e.push(this.TimeStep),e.push(this.Values),e}},Tz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.TotalCrossSectionArea=n,this.SteelGrade=r,this.BarSurface=i,this.EffectiveDepth=s,this.NominalBarDiameter=a,this.BarCount=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Tz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.TotalCrossSectionArea),e.push(this.SteelGrade),e.push(this.BarSurface),e.push(this.EffectiveDepth),e.push(this.NominalBarDiameter),e.push(this.BarCount),e}},wz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.DefinitionType=a,this.ReinforcementSectionDefinitions=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new wz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.DefinitionType),e.push(this.ReinforcementSectionDefinitions),e}},Ez=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.NominalDiameter=h,this.CrossSectionArea=p,this.BarLength=d,this.PredefinedType=m,this.BarSurface=f}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++];return new Ez(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.BarLength),e.push(this.PredefinedType),e.push(this.BarSurface),e}},Sz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.NominalDiameter=p,this.CrossSectionArea=d,this.BarLength=m,this.BarSurface=f,this.BendingShapeCode=g,this.BendingParameters=_}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++];return new Sz(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.BarLength),e.push(this.BarSurface),e.push(this.BendingShapeCode),e.push(this.BendingParameters),e}},Iz=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Iz(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e}},Mz=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Mz(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},Az=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.MeshLength=h,this.MeshWidth=p,this.LongitudinalBarNominalDiameter=d,this.TransverseBarNominalDiameter=m,this.LongitudinalBarCrossSectionArea=f,this.TransverseBarCrossSectionArea=g,this.LongitudinalBarSpacing=_,this.TransverseBarSpacing=v,this.PredefinedType=y}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++],x=n[r++];return new Az(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.MeshLength),e.push(this.MeshWidth),e.push(this.LongitudinalBarNominalDiameter),e.push(this.TransverseBarNominalDiameter),e.push(this.LongitudinalBarCrossSectionArea),e.push(this.TransverseBarCrossSectionArea),e.push(this.LongitudinalBarSpacing),e.push(this.TransverseBarSpacing),e.push(this.PredefinedType),e}},Rz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.MeshLength=p,this.MeshWidth=d,this.LongitudinalBarNominalDiameter=m,this.TransverseBarNominalDiameter=f,this.LongitudinalBarCrossSectionArea=g,this.TransverseBarCrossSectionArea=_,this.LongitudinalBarSpacing=v,this.TransverseBarSpacing=y,this.BendingShapeCode=b,this.BendingParameters=x}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++],x=n[r++],T=n[r++],w=n[r++];return new Rz(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x,T,w)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.MeshLength),e.push(this.MeshWidth),e.push(this.LongitudinalBarNominalDiameter),e.push(this.TransverseBarNominalDiameter),e.push(this.LongitudinalBarCrossSectionArea),e.push(this.TransverseBarCrossSectionArea),e.push(this.LongitudinalBarSpacing),e.push(this.TransverseBarSpacing),e.push(this.BendingShapeCode),e.push(this.BendingParameters),e}},Dz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingObject=a,this.RelatedObjects=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Dz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingObject),e.push(this.RelatedObjects),e}},Cz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Cz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e}},Oz=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingActor=l,this.ActingRole=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Oz(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingActor),e.push(this.ActingRole),e}},Pz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingControl=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new Pz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingControl),e}},Nz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingGroup=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new Nz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingGroup),e}},Lz=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingGroup=l,this.Factor=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new Lz(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingGroup),e.push(this.Factor),e}},kz=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingProcess=l,this.QuantityInProcess=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new kz(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingProcess),e.push(this.QuantityInProcess),e}},Fz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingProduct=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new Fz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingProduct),e}},Uz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingResource=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new Uz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingResource),e}},Bz=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new Bz(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e}},jz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingApproval=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new jz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingApproval),e}},Gz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingClassification=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Gz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingClassification),e}},zz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.Intent=o,this.RelatingConstraint=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new zz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.Intent),e.push(this.RelatingConstraint),e}},Vz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingDocument=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Vz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingDocument),e}},Hz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingLibrary=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Hz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingLibrary),e}},qz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingMaterial=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new qz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingMaterial),e}},Wz=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new Wz(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},Yz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new Yz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e}},Xz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l,this.RelatingPriorities=c,this.RelatedPriorities=u,this.RelatedConnectionType=h,this.RelatingConnectionType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new Xz(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.RelatingPriorities),e.push(this.RelatedPriorities),e.push(this.RelatedConnectionType),e.push(this.RelatingConnectionType),e}},$z=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingPort=a,this.RelatedElement=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new $z(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPort),e.push(this.RelatedElement),e}},Kz=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingPort=a,this.RelatedPort=o,this.RealizingElement=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new Kz(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPort),e.push(this.RelatedPort),e.push(this.RealizingElement),e}},Zz=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingElement=a,this.RelatedStructuralActivity=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Zz(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedStructuralActivity),e}},Jz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingStructuralMember=a,this.RelatedStructuralConnection=o,this.AppliedCondition=l,this.AdditionalConditions=c,this.SupportedLength=u,this.ConditionCoordinateSystem=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Jz(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingStructuralMember),e.push(this.RelatedStructuralConnection),e.push(this.AppliedCondition),e.push(this.AdditionalConditions),e.push(this.SupportedLength),e.push(this.ConditionCoordinateSystem),e}},Qz=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingStructuralMember=a,this.RelatedStructuralConnection=o,this.AppliedCondition=l,this.AdditionalConditions=c,this.SupportedLength=u,this.ConditionCoordinateSystem=h,this.ConnectionConstraint=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new Qz(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingStructuralMember),e.push(this.RelatedStructuralConnection),e.push(this.AppliedCondition),e.push(this.AdditionalConditions),e.push(this.SupportedLength),e.push(this.ConditionCoordinateSystem),e.push(this.ConnectionConstraint),e}},eV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l,this.RealizingElements=c,this.ConnectionType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new eV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.RealizingElements),e.push(this.ConnectionType),e}},tV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedElements=a,this.RelatingStructure=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new tV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedElements),e.push(this.RelatingStructure),e}},nV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingBuildingElement=a,this.RelatedCoverings=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new nV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingBuildingElement),e.push(this.RelatedCoverings),e}},rV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingSpace=a,this.RelatedCoverings=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new rV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedCoverings),e}},iV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingContext=a,this.RelatedDefinitions=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new iV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingContext),e.push(this.RelatedDefinitions),e}},sV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new sV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},aV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new aV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},oV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingObject=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new oV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingObject),e}},lV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingPropertyDefinition=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new lV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingPropertyDefinition),e}},cV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedPropertySets=a,this.RelatingTemplate=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new cV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedPropertySets),e.push(this.RelatingTemplate),e}},uV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedObjects=a,this.RelatingType=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new uV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingType),e}},hV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingOpeningElement=a,this.RelatedBuildingElement=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new hV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingOpeningElement),e.push(this.RelatedBuildingElement),e}},pV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedControlElements=a,this.RelatingFlowElement=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new pV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedControlElements),e.push(this.RelatingFlowElement),e}},dV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingElement=a,this.RelatedElement=o,this.InterferenceGeometry=l,this.InterferenceType=c,this.ImpliedOrder=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new dV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.InterferenceGeometry),e.push(this.InterferenceType),e.push(this.ImpliedOrder),e}},mV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingObject=a,this.RelatedObjects=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new mV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingObject),e.push(this.RelatedObjects),e}},fV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingPositioningElement=a,this.RelatedProducts=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new fV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPositioningElement),e.push(this.RelatedProducts),e}},gV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingElement=a,this.RelatedFeatureElement=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new gV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedFeatureElement),e}},_V=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatedElements=a,this.RelatingStructure=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new _V(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedElements),e.push(this.RelatingStructure),e}},vV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingProcess=a,this.RelatedProcess=o,this.TimeLag=l,this.SequenceType=c,this.UserDefinedSequenceType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new vV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingProcess),e.push(this.RelatedProcess),e.push(this.TimeLag),e.push(this.SequenceType),e.push(this.UserDefinedSequenceType),e}},yV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingSystem=a,this.RelatedBuildings=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new yV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSystem),e.push(this.RelatedBuildings),e}},bV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=c,this.InternalOrExternalBoundary=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new bV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e}},xV=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=c,this.InternalOrExternalBoundary=u,this.ParentBoundary=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new xV(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e.push(this.ParentBoundary),e}},TV=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=c,this.InternalOrExternalBoundary=u,this.ParentBoundary=h,this.CorrespondingBoundary=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new TV(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e.push(this.ParentBoundary),e.push(this.CorrespondingBoundary),e}},wV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.RelatingBuildingElement=a,this.RelatedOpeningElement=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new wV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingBuildingElement),e.push(this.RelatedOpeningElement),e}},EV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new EV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},SV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Transition=n,this.SameSense=r,this.ParentCurve=i,this.ParamLength=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new SV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Transition),e.push(this.SameSense),e.push(this.ParentCurve),e.push(this.ParamLength),e}},IV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ContextOfItems=n,this.RepresentationIdentifier=r,this.RepresentationType=i,this.Items=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new IV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},MV=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.ContextIdentifier=n,this.ContextType=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new MV(e,t,i,s)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e}},AV=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new AV(e,t)}ToTape(){return[]}},RV=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.MappingOrigin=n,this.MappedRepresentation=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new RV(e,t,i,s)}ToTape(){let e=[];return e.push(this.MappingOrigin),e.push(this.MappedRepresentation),e}},DV=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new DV(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e}},CV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatedResourceObjects=i,this.RelatingApproval=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new CV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatedResourceObjects),e.push(this.RelatingApproval),e}},OV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.RelatingConstraint=i,this.RelatedResourceObjects=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new OV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingConstraint),e.push(this.RelatedResourceObjects),e}},PV=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Name=n,this.Description=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new PV(e,t,i,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},NV=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i,this.ScheduleWork=s,this.ScheduleUsage=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.ScheduleContour=c,this.LevelingDelay=u,this.IsOverAllocated=h,this.StatusTime=p,this.ActualWork=d,this.ActualUsage=m,this.ActualStart=f,this.ActualFinish=g,this.RemainingWork=_,this.RemainingUsage=v,this.Completion=y}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++],x=n[r++];return new NV(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.ScheduleWork),e.push(this.ScheduleUsage),e.push(this.ScheduleStart),e.push(this.ScheduleFinish),e.push(this.ScheduleContour),e.push(this.LevelingDelay),e.push(this.IsOverAllocated),e.push(this.StatusTime),e.push(this.ActualWork),e.push(this.ActualUsage),e.push(this.ActualStart),e.push(this.ActualFinish),e.push(this.RemainingWork),e.push(this.RemainingUsage),e.push(this.Completion),e}},LV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r,this.Axis=i,this.Angle=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new LV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Axis),e.push(this.Angle),e}},kV=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r,this.Axis=i,this.Angle=s,this.EndSweptArea=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new kV(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Axis),e.push(this.Angle),e.push(this.EndSweptArea),e}},FV=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Position=n,this.Height=r,this.BottomRadius=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new FV(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Height),e.push(this.BottomRadius),e}},UV=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Position=n,this.Height=r,this.Radius=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new UV(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Height),e.push(this.Radius),e}},BV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new BV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},jV=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new jV(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},GV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new GV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e}},zV=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.XDim=s,this.YDim=a,this.RoundingRadius=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new zV(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e.push(this.RoundingRadius),e}},VV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Dimensions=n,this.UnitType=r,this.Prefix=i,this.Name=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new VV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Prefix),e.push(this.Name),e}},HV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new HV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},qV=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new qV(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},WV=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new WV(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e}},YV=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Curve3D=n,this.AssociatedGeometry=r,this.MasterRepresentation=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new YV(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},XV=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.SectionType=n,this.StartProfile=r,this.EndProfile=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new XV(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.SectionType),e.push(this.StartProfile),e.push(this.EndProfile),e}},$V=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.LongitudinalStartPosition=n,this.LongitudinalEndPosition=r,this.TransversePosition=i,this.ReinforcementRole=s,this.SectionDefinition=a,this.CrossSectionReinforcementDefinitions=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new $V(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.LongitudinalStartPosition),e.push(this.LongitudinalEndPosition),e.push(this.TransversePosition),e.push(this.ReinforcementRole),e.push(this.SectionDefinition),e.push(this.CrossSectionReinforcementDefinitions),e}},KV=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Directrix=n,this.CrossSections=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new KV(e,t,i,s)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.CrossSections),e}},ZV=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Directrix=n,this.CrossSections=r,this.CrossSectionPositions=i,this.FixedAxisVertical=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new ZV(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.CrossSections),e.push(this.CrossSectionPositions),e.push(this.FixedAxisVertical),e}},JV=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.SpineCurve=n,this.CrossSections=r,this.CrossSectionPositions=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new JV(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.SpineCurve),e.push(this.CrossSections),e.push(this.CrossSectionPositions),e}},QV=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new QV(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},eH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new eH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},tH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new tH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},nH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new nH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},rH=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.ShapeRepresentations=n,this.Name=r,this.Description=i,this.ProductDefinitional=s,this.PartOfProductDefinitionShape=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new rH(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.ShapeRepresentations),e.push(this.Name),e.push(this.Description),e.push(this.ProductDefinitional),e.push(this.PartOfProductDefinitionShape),e}},iH=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ContextOfItems=n,this.RepresentationIdentifier=r,this.RepresentationType=i,this.Items=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new iH(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},sH=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ContextOfItems=n,this.RepresentationIdentifier=r,this.RepresentationType=i,this.Items=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new sH(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},aH=class{constructor(e,t,n){this.expressID=e,this.type=t,this.SbsmBoundary=n}static FromTape(e,t,n){let r=0,i=n[r++];return new aH(e,t,i)}ToTape(){let e=[];return e.push(this.SbsmBoundary),e}},oH=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Name=n,this.Description=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new oH(e,t,i,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},lH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.TemplateType=a,this.PrimaryMeasureType=o,this.SecondaryMeasureType=l,this.Enumerators=c,this.PrimaryUnit=u,this.SecondaryUnit=h,this.Expression=p,this.AccessState=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new lH(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.TemplateType),e.push(this.PrimaryMeasureType),e.push(this.SecondaryMeasureType),e.push(this.Enumerators),e.push(this.PrimaryUnit),e.push(this.SecondaryUnit),e.push(this.Expression),e.push(this.AccessState),e}},cH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.RefLatitude=h,this.RefLongitude=p,this.RefElevation=d,this.LandTitleNumber=m,this.SiteAddress=f}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++];return new cH(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.RefLatitude),e.push(this.RefLongitude),e.push(this.RefElevation),e.push(this.LandTitleNumber),e.push(this.SiteAddress),e}},uH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new uH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},hH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new hH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},pH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new pH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},dH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new dH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},mH=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.SlippageX=r,this.SlippageY=i,this.SlippageZ=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new mH(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.SlippageX),e.push(this.SlippageY),e.push(this.SlippageZ),e}},fH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new fH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},gH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new gH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},_H=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new _H(e,t)}ToTape(){return[]}},vH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.PredefinedType=h,this.ElevationWithFlooring=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new vH(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e.push(this.ElevationWithFlooring),e}},yH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new yH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},bH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new bH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},xH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.LongName=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new xH(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.LongName),e}},TH=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new TH(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e}},wH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new wH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},EH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new EH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},SH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new SH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new IH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.PredefinedType),e}},MH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.LongName=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new MH(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.LongName),e}},AH=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Position=n,this.Radius=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new AH(e,t,i,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},RH=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Position=n,this.Radius=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new RH(e,t,i,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},DH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new DH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},CH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new CH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},OH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new OH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},PH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.NumberOfRisers=u,this.NumberOfTreads=h,this.RiserHeight=p,this.TreadLength=d,this.PredefinedType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new PH(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.NumberOfRisers),e.push(this.NumberOfTreads),e.push(this.RiserHeight),e.push(this.TreadLength),e.push(this.PredefinedType),e}},NH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new NH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},LH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new LH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},kH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new kH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e}},FH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new FH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},UH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.OrientationOf2DPlane=l,this.LoadedBy=c,this.HasResults=u,this.SharedPlacement=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new UH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.OrientationOf2DPlane),e.push(this.LoadedBy),e.push(this.HasResults),e.push(this.SharedPlacement),e}},BH=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new BH(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e}},jH=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new jH(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},GH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new GH(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},zH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c,this.Axis=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new zH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e.push(this.Axis),e}},VH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Axis=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new VH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Axis),e}},HH=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Axis=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new HH(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Axis),e}},qH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new qH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.PredefinedType),e}},WH=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new WH(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},YH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new YH(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},XH=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new XH(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},$H=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.ActionType=l,this.ActionSource=c,this.Coefficient=u,this.Purpose=h,this.SelfWeightCoefficients=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new $H(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.ActionType),e.push(this.ActionSource),e.push(this.Coefficient),e.push(this.Purpose),e.push(this.SelfWeightCoefficients),e}},KH=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Values=r,this.Locations=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new KH(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Values),e.push(this.Locations),e}},ZH=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.ActionType=l,this.ActionSource=c,this.Coefficient=u,this.Purpose=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new ZH(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.ActionType),e.push(this.ActionSource),e.push(this.Coefficient),e.push(this.Purpose),e}},JH=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.LinearForceX=r,this.LinearForceY=i,this.LinearForceZ=s,this.LinearMomentX=a,this.LinearMomentY=o,this.LinearMomentZ=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new JH(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LinearForceX),e.push(this.LinearForceY),e.push(this.LinearForceZ),e.push(this.LinearMomentX),e.push(this.LinearMomentY),e.push(this.LinearMomentZ),e}},QH=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new QH(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},eq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.PlanarForceX=r,this.PlanarForceY=i,this.PlanarForceZ=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new eq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.PlanarForceX),e.push(this.PlanarForceY),e.push(this.PlanarForceZ),e}},tq=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.DisplacementX=r,this.DisplacementY=i,this.DisplacementZ=s,this.RotationalDisplacementRX=a,this.RotationalDisplacementRY=o,this.RotationalDisplacementRZ=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new tq(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DisplacementX),e.push(this.DisplacementY),e.push(this.DisplacementZ),e.push(this.RotationalDisplacementRX),e.push(this.RotationalDisplacementRY),e.push(this.RotationalDisplacementRZ),e}},nq=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=n,this.DisplacementX=r,this.DisplacementY=i,this.DisplacementZ=s,this.RotationalDisplacementRX=a,this.RotationalDisplacementRY=o,this.RotationalDisplacementRZ=l,this.Distortion=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new nq(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DisplacementX),e.push(this.DisplacementY),e.push(this.DisplacementZ),e.push(this.RotationalDisplacementRX),e.push(this.RotationalDisplacementRY),e.push(this.RotationalDisplacementRZ),e.push(this.Distortion),e}},rq=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.Name=n,this.ForceX=r,this.ForceY=i,this.ForceZ=s,this.MomentX=a,this.MomentY=o,this.MomentZ=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new rq(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.ForceX),e.push(this.ForceY),e.push(this.ForceZ),e.push(this.MomentX),e.push(this.MomentY),e.push(this.MomentZ),e}},iq=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=n,this.ForceX=r,this.ForceY=i,this.ForceZ=s,this.MomentX=a,this.MomentY=o,this.MomentZ=l,this.WarpingMoment=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new iq(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.ForceX),e.push(this.ForceY),e.push(this.ForceZ),e.push(this.MomentX),e.push(this.MomentY),e.push(this.MomentZ),e.push(this.WarpingMoment),e}},sq=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Name=n}static FromTape(e,t,n){let r=0,i=n[r++];return new sq(e,t,i)}ToTape(){let e=[];return e.push(this.Name),e}},aq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.DeltaTConstant=r,this.DeltaTY=i,this.DeltaTZ=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new aq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DeltaTConstant),e.push(this.DeltaTY),e.push(this.DeltaTZ),e}},oq=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new oq(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},lq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new lq(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},cq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new cq(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e}},uq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c,this.ConditionCoordinateSystem=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new uq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e.push(this.ConditionCoordinateSystem),e}},hq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new hq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},pq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new pq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},dq=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.TheoryType=o,this.ResultForLoadGroup=l,this.IsLinear=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new dq(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheoryType),e.push(this.ResultForLoadGroup),e.push(this.IsLinear),e}},mq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new mq(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},fq=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new fq(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e}},gq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Thickness=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new gq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Thickness),e}},_q=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Thickness=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new _q(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Thickness),e}},vq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new vq(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.PredefinedType),e}},yq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ContextOfItems=n,this.RepresentationIdentifier=r,this.RepresentationType=i,this.Items=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new yq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},bq=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Item=n,this.Styles=r,this.Name=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new bq(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Item),e.push(this.Styles),e.push(this.Name),e}},xq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ContextOfItems=n,this.RepresentationIdentifier=r,this.RepresentationType=i,this.Items=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new xq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},Tq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new Tq(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},wq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new wq(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},Eq=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.EdgeStart=n,this.EdgeEnd=r,this.ParentEdge=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Eq(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.ParentEdge),e}},Sq=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new Sq(e,t)}ToTape(){return[]}},Iq=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Curve3D=n,this.AssociatedGeometry=r,this.MasterRepresentation=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Iq(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},Mq=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r,this.Directrix=i,this.StartParam=s,this.EndParam=a,this.ReferenceSurface=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Mq(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Directrix),e.push(this.StartParam),e.push(this.EndParam),e.push(this.ReferenceSurface),e}},Aq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Aq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Rq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.SweptCurve=n,this.Position=r,this.ExtrudedDirection=i,this.Depth=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new Rq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e.push(this.ExtrudedDirection),e.push(this.Depth),e}},Dq=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.SweptCurve=n,this.Position=r,this.AxisPosition=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Dq(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e.push(this.AxisPosition),e}},Cq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.Name=n,this.SurfaceReinforcement1=r,this.SurfaceReinforcement2=i,this.ShearReinforcement=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new Cq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.Name),e.push(this.SurfaceReinforcement1),e.push(this.SurfaceReinforcement2),e.push(this.ShearReinforcement),e}},Oq=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Side=r,this.Styles=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new Oq(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Side),e.push(this.Styles),e}},Pq=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.DiffuseTransmissionColour=n,this.DiffuseReflectionColour=r,this.TransmissionColour=i,this.ReflectanceColour=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new Pq(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.DiffuseTransmissionColour),e.push(this.DiffuseReflectionColour),e.push(this.TransmissionColour),e.push(this.ReflectanceColour),e}},Nq=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.RefractionIndex=n,this.DispersionFactor=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Nq(e,t,i,s)}ToTape(){let e=[];return e.push(this.RefractionIndex),e.push(this.DispersionFactor),e}},Lq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.SurfaceColour=n,this.Transparency=r,this.DiffuseColour=i,this.TransmissionColour=s,this.DiffuseTransmissionColour=a,this.ReflectionColour=o,this.SpecularColour=l,this.SpecularHighlight=c,this.ReflectanceMethod=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Lq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.SurfaceColour),e.push(this.Transparency),e.push(this.DiffuseColour),e.push(this.TransmissionColour),e.push(this.DiffuseTransmissionColour),e.push(this.ReflectionColour),e.push(this.SpecularColour),e.push(this.SpecularHighlight),e.push(this.ReflectanceMethod),e}},kq=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.SurfaceColour=n,this.Transparency=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new kq(e,t,i,s)}ToTape(){let e=[];return e.push(this.SurfaceColour),e.push(this.Transparency),e}},Fq=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Textures=n}static FromTape(e,t,n){let r=0,i=n[r++];return new Fq(e,t,i)}ToTape(){let e=[];return e.push(this.Textures),e}},Uq=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.RepeatS=n,this.RepeatT=r,this.Mode=i,this.TextureTransform=s,this.Parameter=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new Uq(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e}},Bq=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.SweptArea=n,this.Position=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Bq(e,t,i,s)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e}},jq=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Directrix=n,this.Radius=r,this.InnerRadius=i,this.StartParam=s,this.EndParam=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new jq(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.Radius),e.push(this.InnerRadius),e.push(this.StartParam),e.push(this.EndParam),e}},Gq=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Directrix=n,this.Radius=r,this.InnerRadius=i,this.StartParam=s,this.EndParam=a,this.FilletRadius=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new Gq(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.Radius),e.push(this.InnerRadius),e.push(this.StartParam),e.push(this.EndParam),e.push(this.FilletRadius),e}},zq=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.SweptCurve=n,this.Position=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new zq(e,t,i,s)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e}},Vq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Vq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Hq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Hq(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},qq=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new qq(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e}},Wq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Wq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Yq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Yq(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},Xq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.FlangeEdgeRadius=u,this.WebEdgeRadius=h,this.WebSlope=p,this.FlangeSlope=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new Xq(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.FlangeEdgeRadius),e.push(this.WebEdgeRadius),e.push(this.WebSlope),e.push(this.FlangeSlope),e}},$q=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Name=n,this.Rows=r,this.Columns=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new $q(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Rows),e.push(this.Columns),e}},Kq=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Identifier=n,this.Name=r,this.Description=i,this.Unit=s,this.ReferencePath=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new Kq(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Identifier),e.push(this.Name),e.push(this.Description),e.push(this.Unit),e.push(this.ReferencePath),e}},Zq=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.RowCells=n,this.IsHeading=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new Zq(e,t,i,s)}ToTape(){let e=[];return e.push(this.RowCells),e.push(this.IsHeading),e}},Jq=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new Jq(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},Qq=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new Qq(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},eW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Status=c,this.WorkMethod=u,this.IsMilestone=h,this.Priority=p,this.TaskTime=d,this.PredefinedType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new eW(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Status),e.push(this.WorkMethod),e.push(this.IsMilestone),e.push(this.Priority),e.push(this.TaskTime),e.push(this.PredefinedType),e}},tW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i,this.DurationType=s,this.ScheduleDuration=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.EarlyStart=c,this.EarlyFinish=u,this.LateStart=h,this.LateFinish=p,this.FreeFloat=d,this.TotalFloat=m,this.IsCritical=f,this.StatusTime=g,this.ActualDuration=_,this.ActualStart=v,this.ActualFinish=y,this.RemainingTime=b,this.Completion=x}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++],x=n[r++],T=n[r++],w=n[r++];return new tW(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x,T,w)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.DurationType),e.push(this.ScheduleDuration),e.push(this.ScheduleStart),e.push(this.ScheduleFinish),e.push(this.EarlyStart),e.push(this.EarlyFinish),e.push(this.LateStart),e.push(this.LateFinish),e.push(this.FreeFloat),e.push(this.TotalFloat),e.push(this.IsCritical),e.push(this.StatusTime),e.push(this.ActualDuration),e.push(this.ActualStart),e.push(this.ActualFinish),e.push(this.RemainingTime),e.push(this.Completion),e}},nW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x,T){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i,this.DurationType=s,this.ScheduleDuration=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.EarlyStart=c,this.EarlyFinish=u,this.LateStart=h,this.LateFinish=p,this.FreeFloat=d,this.TotalFloat=m,this.IsCritical=f,this.StatusTime=g,this.ActualDuration=_,this.ActualStart=v,this.ActualFinish=y,this.RemainingTime=b,this.Completion=x,this.Recurrence=T}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++],x=n[r++],T=n[r++],w=n[r++],E=n[r++];return new nW(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b,x,T,w,E)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.DurationType),e.push(this.ScheduleDuration),e.push(this.ScheduleStart),e.push(this.ScheduleFinish),e.push(this.EarlyStart),e.push(this.EarlyFinish),e.push(this.LateStart),e.push(this.LateFinish),e.push(this.FreeFloat),e.push(this.TotalFloat),e.push(this.IsCritical),e.push(this.StatusTime),e.push(this.ActualDuration),e.push(this.ActualStart),e.push(this.ActualFinish),e.push(this.RemainingTime),e.push(this.Completion),e.push(this.Recurrence),e}},rW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u,this.PredefinedType=h,this.WorkMethod=p}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++];return new rW(e,t,i,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e.push(this.WorkMethod),e}},iW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Purpose=n,this.Description=r,this.UserDefinedPurpose=i,this.TelephoneNumbers=s,this.FacsimileNumbers=a,this.PagerNumber=o,this.ElectronicMailAddresses=l,this.WWWHomePageURL=c,this.MessagingIDs=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new iW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e.push(this.TelephoneNumbers),e.push(this.FacsimileNumbers),e.push(this.PagerNumber),e.push(this.ElectronicMailAddresses),e.push(this.WWWHomePageURL),e.push(this.MessagingIDs),e}},sW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.PredefinedType=h,this.NominalDiameter=p,this.CrossSectionArea=d,this.TensionForce=m,this.PreStress=f,this.FrictionCoefficient=g,this.AnchorageSlip=_,this.MinCurvatureRadius=v}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++],b=n[r++];return new sW(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y,b)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.TensionForce),e.push(this.PreStress),e.push(this.FrictionCoefficient),e.push(this.AnchorageSlip),e.push(this.MinCurvatureRadius),e}},aW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new aW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e}},oW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new oW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},lW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new lW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e}},cW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new cW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},uW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.NominalDiameter=p,this.CrossSectionArea=d,this.SheathDiameter=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new uW(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.SheathDiameter),e}},hW=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Coordinates=n}static FromTape(e,t,n){let r=0,i=n[r++];return new hW(e,t,i)}ToTape(){let e=[];return e.push(this.Coordinates),e}},pW=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new pW(e,t)}ToTape(){return[]}},dW=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Literal=n,this.Placement=r,this.Path=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new dW(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Literal),e.push(this.Placement),e.push(this.Path),e}},mW=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Literal=n,this.Placement=r,this.Path=i,this.Extent=s,this.BoxAlignment=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new mW(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Literal),e.push(this.Placement),e.push(this.Path),e.push(this.Extent),e.push(this.BoxAlignment),e}},fW=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Name=n,this.TextCharacterAppearance=r,this.TextStyle=i,this.TextFontStyle=s,this.ModelOrDraughting=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new fW(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TextCharacterAppearance),e.push(this.TextStyle),e.push(this.TextFontStyle),e.push(this.ModelOrDraughting),e}},gW=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Name=n,this.FontFamily=r,this.FontStyle=i,this.FontVariant=s,this.FontWeight=a,this.FontSize=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new gW(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.FontFamily),e.push(this.FontStyle),e.push(this.FontVariant),e.push(this.FontWeight),e.push(this.FontSize),e}},_W=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Colour=n,this.BackgroundColour=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new _W(e,t,i,s)}ToTape(){let e=[];return e.push(this.Colour),e.push(this.BackgroundColour),e}},vW=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.TextIndent=n,this.TextAlign=r,this.TextDecoration=i,this.LetterSpacing=s,this.WordSpacing=a,this.TextTransform=o,this.LineHeight=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new vW(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.TextIndent),e.push(this.TextAlign),e.push(this.TextDecoration),e.push(this.LetterSpacing),e.push(this.WordSpacing),e.push(this.TextTransform),e.push(this.LineHeight),e}},yW=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Maps=n}static FromTape(e,t,n){let r=0,i=n[r++];return new yW(e,t,i)}ToTape(){let e=[];return e.push(this.Maps),e}},bW=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Maps=n,this.Mode=r,this.Parameter=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new bW(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.Mode),e.push(this.Parameter),e}},xW=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Maps=n,this.Vertices=r,this.MappedTo=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new xW(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.Vertices),e.push(this.MappedTo),e}},TW=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Coordinates=n}static FromTape(e,t,n){let r=0,i=n[r++];return new TW(e,t,i)}ToTape(){let e=[];return e.push(this.Coordinates),e}},wW=class{constructor(e,t,n){this.expressID=e,this.type=t,this.TexCoordsList=n}static FromTape(e,t,n){let r=0,i=n[r++];return new wW(e,t,i)}ToTape(){let e=[];return e.push(this.TexCoordsList),e}},EW=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.StartTime=n,this.EndTime=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new EW(e,t,i,s)}ToTape(){let e=[];return e.push(this.StartTime),e.push(this.EndTime),e}},SW=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=n,this.Description=r,this.StartTime=i,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new SW(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e}},IW=class{constructor(e,t,n){this.expressID=e,this.type=t,this.ListValues=n}static FromTape(e,t,n){let r=0,i=n[r++];return new IW(e,t,i)}ToTape(){let e=[];return e.push(this.ListValues),e}},MW=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new MW(e,t)}ToTape(){return[]}},AW=class{constructor(e,t,n,r,i,s){this.expressID=e,this.type=t,this.ContextOfItems=n,this.RepresentationIdentifier=r,this.RepresentationType=i,this.Items=s}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++];return new AW(e,t,i,s,a,o)}ToTape(){let e=[];return e.push(this.ContextOfItems),e.push(this.RepresentationIdentifier),e.push(this.RepresentationType),e.push(this.Items),e}},RW=class{constructor(e,t,n,r,i){this.expressID=e,this.type=t,this.Position=n,this.MajorRadius=r,this.MinorRadius=i}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++];return new RW(e,t,i,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.MajorRadius),e.push(this.MinorRadius),e}},DW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new DW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},CW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new CW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},OW=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.StartPoint=n,this.StartDirection=r,this.SegmentLength=i,this.StartRadius=s,this.EndRadius=a,this.IsStartRadiusCCW=o,this.IsEndRadiusCCW=l,this.TransitionCurveType=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new OW(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e.push(this.StartRadius),e.push(this.EndRadius),e.push(this.IsStartRadiusCCW),e.push(this.IsEndRadiusCCW),e.push(this.TransitionCurveType),e}},PW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new PW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},NW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new NW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},LW=class{constructor(e,t,n,r,i,s,a,o,l){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.BottomXDim=s,this.TopXDim=a,this.YDim=o,this.TopXOffset=l}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++];return new LW(e,t,i,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.BottomXDim),e.push(this.TopXDim),e.push(this.YDim),e.push(this.TopXOffset),e}},kW=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.Coordinates=n,this.Normals=r,this.Closed=i,this.CoordIndex=s,this.PnIndex=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new kW(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Normals),e.push(this.Closed),e.push(this.CoordIndex),e.push(this.PnIndex),e}},FW=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Coordinates=n,this.Normals=r,this.Closed=i,this.CoordIndex=s,this.PnIndex=a,this.Flags=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new FW(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Normals),e.push(this.Closed),e.push(this.CoordIndex),e.push(this.PnIndex),e.push(this.Flags),e}},UW=class{constructor(e,t,n,r,i,s,a){this.expressID=e,this.type=t,this.BasisCurve=n,this.Trim1=r,this.Trim2=i,this.SenseAgreement=s,this.MasterRepresentation=a}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++];return new UW(e,t,i,s,a,o,l)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Trim1),e.push(this.Trim2),e.push(this.SenseAgreement),e.push(this.MasterRepresentation),e}},BW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new BW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},jW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new jW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},GW=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new GW(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e}},zW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new zW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e}},VW=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new VW(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e}},HW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new HW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e}},qW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.EdgeRadius=u,this.FlangeSlope=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new qW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e.push(this.FlangeSlope),e}},WW=class{constructor(e,t,n){this.expressID=e,this.type=t,this.Units=n}static FromTape(e,t,n){let r=0,i=n[r++];return new WW(e,t,i)}ToTape(){let e=[];return e.push(this.Units),e}},YW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new YW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},XW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new XW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},$W=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new $W(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},KW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new KW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},ZW=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new ZW(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},JW=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new JW(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},QW=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.Orientation=n,this.Magnitude=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new QW(e,t,i,s)}ToTape(){let e=[];return e.push(this.Orientation),e.push(this.Magnitude),e}},eY=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,n){return new eY(e,t)}ToTape(){return[]}},tY=class{constructor(e,t,n){this.expressID=e,this.type=t,this.LoopVertex=n}static FromTape(e,t,n){let r=0,i=n[r++];return new tY(e,t,i)}ToTape(){let e=[];return e.push(this.LoopVertex),e}},nY=class{constructor(e,t,n){this.expressID=e,this.type=t,this.VertexGeometry=n}static FromTape(e,t,n){let r=0,i=n[r++];return new nY(e,t,i)}ToTape(){let e=[];return e.push(this.VertexGeometry),e}},rY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new rY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},iY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new iY(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},sY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new sY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},aY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new aY(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},oY=class{constructor(e,t,n,r,i,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++];return new oY(e,t,i,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},lY=class{constructor(e,t,n,r){this.expressID=e,this.type=t,this.IntersectingAxes=n,this.OffsetDistances=r}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++];return new lY(e,t,i,s)}ToTape(){let e=[];return e.push(this.IntersectingAxes),e.push(this.OffsetDistances),e}},cY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new cY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},uY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new uY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},hY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new hY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},pY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new pY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},dY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new dY(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},mY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new mY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},fY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++];return new fY(e,t,i,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},gY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.PartitioningType=d,this.UserDefinedPartitioningType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new gY(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.UserDefinedPartitioningType),e}},_Y=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f,g,_){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.LiningDepth=a,this.LiningThickness=o,this.TransomThickness=l,this.MullionThickness=c,this.FirstTransomOffset=u,this.SecondTransomOffset=h,this.FirstMullionOffset=p,this.SecondMullionOffset=d,this.ShapeAspectStyle=m,this.LiningOffset=f,this.LiningToPanelOffsetX=g,this.LiningToPanelOffsetY=_}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++],v=n[r++],y=n[r++];return new _Y(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_,v,y)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.LiningDepth),e.push(this.LiningThickness),e.push(this.TransomThickness),e.push(this.MullionThickness),e.push(this.FirstTransomOffset),e.push(this.SecondTransomOffset),e.push(this.FirstMullionOffset),e.push(this.SecondMullionOffset),e.push(this.ShapeAspectStyle),e.push(this.LiningOffset),e.push(this.LiningToPanelOffsetX),e.push(this.LiningToPanelOffsetY),e}},vY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.OperationType=a,this.PanelPosition=o,this.FrameDepth=l,this.FrameThickness=c,this.ShapeAspectStyle=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new vY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.OperationType),e.push(this.PanelPosition),e.push(this.FrameDepth),e.push(this.FrameThickness),e.push(this.ShapeAspectStyle),e}},yY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.PartitioningType=d,this.UserDefinedPartitioningType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new yY(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.UserDefinedPartitioningType),e}},bY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ConstructionType=u,this.OperationType=h,this.ParameterTakesPrecedence=p,this.Sizeable=d}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++];return new bY(e,t,i,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ConstructionType),e.push(this.OperationType),e.push(this.ParameterTakesPrecedence),e.push(this.Sizeable),e}},xY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.PartitioningType=p,this.ParameterTakesPrecedence=d,this.UserDefinedPartitioningType=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new xY(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.ParameterTakesPrecedence),e.push(this.UserDefinedPartitioningType),e}},TY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.WorkingTimes=l,this.ExceptionTimes=c,this.PredefinedType=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new TY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.WorkingTimes),e.push(this.ExceptionTimes),e.push(this.PredefinedType),e}},wY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=c,this.Purpose=u,this.Duration=h,this.TotalFloat=p,this.StartTime=d,this.FinishTime=m}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++];return new wY(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e}},EY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=c,this.Purpose=u,this.Duration=h,this.TotalFloat=p,this.StartTime=d,this.FinishTime=m,this.PredefinedType=f}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++];return new EY(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e.push(this.PredefinedType),e}},SY=class{constructor(e,t,n,r,i,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=c,this.Purpose=u,this.Duration=h,this.TotalFloat=p,this.StartTime=d,this.FinishTime=m,this.PredefinedType=f}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++],d=n[r++],m=n[r++],f=n[r++],g=n[r++],_=n[r++];return new SY(e,t,i,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e.push(this.PredefinedType),e}},IY=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.Name=n,this.DataOrigin=r,this.UserDefinedDataOrigin=i,this.RecurrencePattern=s,this.Start=a,this.Finish=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new IY(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.RecurrencePattern),e.push(this.Start),e.push(this.Finish),e}},MY=class{constructor(e,t,n,r,i,s,a,o,l,c,u){this.expressID=e,this.type=t,this.ProfileType=n,this.ProfileName=r,this.Position=i,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.EdgeRadius=u}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++],u=n[r++],h=n[r++],p=n[r++];return new MY(e,t,i,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e}},AY=class{constructor(e,t,n,r,i,s,a,o){this.expressID=e,this.type=t,this.GlobalId=n,this.OwnerHistory=r,this.Name=i,this.Description=s,this.ObjectType=a,this.LongName=o}static FromTape(e,t,n){let r=0,i=n[r++],s=n[r++],a=n[r++],o=n[r++],l=n[r++],c=n[r++];return new AY(e,t,i,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e}},RY=fA();var DY=class{constructor(){this.wasmModule=void 0,this.fs=void 0}Init(){return e=this,t=null,n=function*(){RY?(this.wasmModule=yield RY({noInitialRun:!0}),this.fs=this.wasmModule.FS):console.error("Could not find wasm module at './web-ifc' from web-ifc-api.ts")},new _(((r,i)=>{var s=e=>{try{o(n.next(e))}catch(e){i(e)}},a=e=>{try{o(n.throw(e))}catch(e){i(e)}},o=e=>e.done?r(e.value):_.resolve(e.value).then(s,a);o((n=n.apply(e,t)).next())}));var e,t,n}OpenModel(e,t){this.wasmModule.FS_createDataFile("/","filename",e,!0,!0,!0);let n=hA({COORDINATE_TO_ORIGIN:!1,USE_FAST_BOOLS:!1,CIRCLE_SEGMENTS_LOW:5,CIRCLE_SEGMENTS_MEDIUM:8,CIRCLE_SEGMENTS_HIGH:12},t),r=this.wasmModule.OpenModel(n);return this.wasmModule.FS_unlink("/filename"),r}CreateModel(e){let t=hA({COORDINATE_TO_ORIGIN:!1,USE_FAST_BOOLS:!1,CIRCLE_SEGMENTS_LOW:5,CIRCLE_SEGMENTS_MEDIUM:8,CIRCLE_SEGMENTS_HIGH:12},e);return this.wasmModule.CreateModel(t)}ExportFileAsIFC(e){this.wasmModule.ExportFileAsIFC(e);let t=this.fs.readFile("/export.ifc");return this.wasmModule.FS_unlink("/export.ifc"),t}GetGeometry(e,t){return this.wasmModule.GetGeometry(e,t)}GetLine(e,t,n=!1){let r=this.GetRawLineData(e,t),i=TA[r.type](r);return n&&this.FlattenLine(e,i),i}WriteLine(e,t){var n;fe(n=J(t)).call(n,(n=>{let r=t[n];if(r&&void 0!==r.expressID)this.WriteLine(e,r),t[n]={type:5,value:r.expressID};else if(b(r)&&r.length>0)for(let i=0;i<r.length;i++)void 0!==r[i].expressID&&(this.WriteLine(e,r[i]),t[n][i]={type:5,value:r[i].expressID})}));let r={ID:t.expressID,type:t.type,arguments:t.ToTape()};this.WriteRawLineData(e,r)}FlattenLine(e,t){var n;fe(n=J(t)).call(n,(n=>{let r=t[n];if(r&&5===r.type)t[n]=this.GetLine(e,r.value,!0);else if(b(r)&&r.length>0&&5===r[0].type)for(let i=0;i<r.length;i++)t[n][i]=this.GetLine(e,r[i].value,!0)}))}GetRawLineData(e,t){return this.wasmModule.GetLine(e,t)}WriteRawLineData(e,t){return this.wasmModule.WriteLine(e,t.ID,t.type,t.arguments)}GetLineIDsWithType(e,t){return this.wasmModule.GetLineIDsWithType(e,t)}GetAllLines(e){return this.wasmModule.GetAllLines(e)}SetGeometryTransformation(e,t){16==t.length?this.wasmModule.SetGeometryTransformation(e,t):console.log(`Bad transformation matrix size: ${t.length}`)}GetVertexArray(e,t){return this.getSubArray(this.wasmModule.HEAPF32,e,t)}GetIndexArray(e,t){return this.getSubArray(this.wasmModule.HEAPU32,e,t)}getSubArray(e,t,n){var r;return I(r=e.subarray(t/4,t/4+n)).call(r,0)}CloseModel(e){this.wasmModule.CloseModel(e)}StreamAllMeshes(e,t){this.wasmModule.StreamAllMeshes(e,t)}IsModelOpen(e){return this.wasmModule.IsModelOpen(e)}LoadAllGeometry(e){return this.wasmModule.LoadAllGeometry(e)}GetFlatMesh(e,t){return this.wasmModule.GetFlatMesh(e,t)}SetWasmPath(e){CY=e}},CY="";function OY(e,t){var n=J(e);if(Xh){var r=Xh(e);t&&(r=oe(r).call(r,(function(t){return Kh(e,t).enumerable}))),n.push.apply(n,r)}return n}function PY(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?fe(n=OY(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Jh?X(e,Jh(i)):fe(r=OY(Object(i))).call(r,(function(t){U(e,t,Kh(i,t))}))}return e}const NY="expressID",LY=(e,t=!1)=>fm(e,t),kY=(e,t)=>new Br(new Float32Array(e),t),FY="default",UY={aggregates:{name:_A,relating:"RelatingObject",related:"RelatedObjects",key:"children"},spatial:{name:yA,relating:"RelatingStructure",related:"RelatedElements",key:"children"},psets:{name:bA,relating:"RelatingPropertyDefinition",related:"RelatedObjects",key:"hasPsets"},materials:{name:vA,relating:"RelatingMaterial",related:"RelatedObjects",key:"hasMaterial"},type:{name:xA,relating:"RelatingType",related:"RelatedObjects",key:"hasType"}};class BY{constructor(e,t){this.state=e,this.BVH=t,this.loadedModels=0,this.currentWebIfcID=-1,this.currentModelID=-1}parse(e){try{const t=this;function n(){return t.newIfcModel(e),t.loadedModels++,t.loadAllGeometry()}const r=function(){if(void 0===t.state.api.wasmModule)return _.resolve(t.state.api.Init()).then((function(){}))}();return _.resolve(r&&r.then?r.then(n):n())}catch(i){return _.reject(i)}}newIfcModel(e){const t=new Uint8Array(e);this.currentWebIfcID=this.state.api.OpenModel(t,this.state.webIfcSettings),this.currentModelID=this.state.useJSON?this.loadedModels:this.currentWebIfcID,this.state.models[this.currentModelID]={modelID:this.currentModelID,mesh:{},items:{},types:{},jsonData:{}}}loadAllGeometry(){return this.saveAllPlacedGeometriesByMaterial(),this.generateAllGeometriesByMaterial()}generateAllGeometriesByMaterial(){const{geometry:e,materials:t}=this.getGeometryAndMaterials();this.BVH.applyThreeMeshBVH(e);const n=new mi(e,t);return n.modelID=this.currentModelID,this.state.models[this.currentModelID].mesh=n,n}getGeometryAndMaterials(){const e=this.state.models[this.currentModelID].items,t=[],n=[];for(const r in e){n.push(e[r].material);const i=ep(e[r].geometries);t.push(LY(i))}return{geometry:LY(t,!0),materials:n}}saveAllPlacedGeometriesByMaterial(){const e=this.state.api.LoadAllGeometry(this.currentWebIfcID);for(let t=0;t<e.size();t++){const n=e.get(t),r=n.geometries;for(let e=0;e<r.size();e++)this.savePlacedGeometry(r.get(e),n.expressID)}}savePlacedGeometry(e,t){const n=this.getBufferGeometry(e);n.computeVertexNormals();const r=this.getMeshMatrix(e.flatTransformation);n.applyMatrix4(r),this.saveGeometryByMaterial(n,e,t)}getBufferGeometry(e){const t=this.state.api.GetGeometry(this.currentWebIfcID,e.geometryExpressID),n=this.getVertices(t),r=this.getIndices(t),{vertices:i,normals:s}=this.extractVertexData(n);return this.ifcGeomToBufferGeom(i,s,r)}getVertices(e){const t=e.GetVertexData(),n=e.GetVertexDataSize();return this.state.api.GetVertexArray(t,n)}getIndices(e){const t=e.GetIndexData(),n=e.GetIndexDataSize();return this.state.api.GetIndexArray(t,n)}getMeshMatrix(e){const t=new Zn;return t.fromArray(e),t}ifcGeomToBufferGeom(e,t,n){const r=new Kr;return r.setAttribute("position",kY(e,3)),r.setAttribute("normal",kY(t,3)),r.setIndex(new Br(n,1)),r}extractVertexData(e){const t=[],n=[];let r=!1;for(let i=0;i<e.length;i++)r?n.push(e[i]):t.push(e[i]),(i+1)%3==0&&(r=!r);return{vertices:t,normals:n}}saveGeometryByMaterial(e,t,n){const r=t.color,i=`${r.x}${r.y}${r.z}${r.w}`;this.storeGeometryAttribute(n,e),this.createMaterial(i,r);const s=this.state.models[this.currentModelID].items[i],a=s.geometries[n];if(!a)return s.geometries[n]=e;const o=LY([a,e]);s.geometries[n]=o}storeGeometryAttribute(e,t){var n;const r=t.attributes.position.count,i=N_(n=new Array(r)).call(n,e);t.setAttribute(NY,((e,t)=>new Br(new Uint32Array(e),t))(i,1))}createMaterial(e,t){const n=this.state.models[this.currentModelID].items;if(n[e])return;const r=new cn(t.x,t.y,t.z),i=new uc({color:r,side:2});i.transparent=1!==t.w,i.transparent&&(i.opacity=t.w),n[e]={material:i,geometries:{}}}}class jY{constructor(e,t){this.selected={},this.state=e,this.BVH=t}getSubset(e,t){const n=this.matIDNoConfig(e,t);return this.selected[n]?this.selected[n].mesh:null}removeSubset(e,t,n){const r=this.matIDNoConfig(e,n);this.selected[r]&&(t&&t.remove(this.selected[r].mesh),delete this.selected[r])}createSubset(e){if(this.isConfigValid(e)&&!this.isPreviousSelection(e))return this.isEasySelection(e)?this.addToPreviousSelection(e):(this.updatePreviousSelection(e.scene,e),this.createSelectionInScene(e))}createSelectionInScene(e){const t=oe(this).call(this,e),{geomsByMaterial:n,materials:r}=this.getGeomAndMat(t),i=this.isDefaultMat(e),s=this.getMergedGeometry(n,i),a=i?r:e.material;this.BVH.applyThreeMeshBVH(s);const o=new mi(s,a);return this.selected[this.matID(e)].mesh=o,o.modelID=e.modelID,e.scene.add(o),o}getMergedGeometry(e,t){return e.length>0?LY(e,t):new Kr}isConfigValid(e){return this.isValid(e.scene)&&this.isValid(e.modelID)&&this.isValid(e.ids)&&this.isValid(e.removePrevious)}isValid(e){return null!=e&&null!=e}getGeomAndMat(e){const t=[],n=[];for(const r in e){const i=ep(e[r].geometries);i.length&&(n.push(e[r].material),i.length>1?t.push(LY(i)):t.push(...i))}return{geomsByMaterial:t,materials:n}}updatePreviousSelection(e,t){var n;const r=this.selected[this.matID(t)];if(!r)return this.newSelectionGroup(t);e.remove(r.mesh),t.removePrevious?r.ids=new he(t.ids):fe(n=t.ids).call(n,(e=>r.ids.add(e)))}newSelectionGroup(e){this.selected[this.matID(e)]={ids:new he(e.ids),mesh:{}}}isPreviousSelection(e){if(!this.selected[this.matID(e)])return!1;if(this.containsIds(e))return!0;const t=this.selected[this.matID(e)].ids;return z(e.ids)===z(t)}containsIds(e){const t=e.ids,n=k(this.selected[this.matID(e)].ids);return P_(t).call(t,(e=>t=>e=T(n).call(n,t,e)+1)(0))}addToPreviousSelection(e){var t,n,r;const i=this.selected[this.matID(e)],s=oe(this).call(this,e),a=rx(t=K(n=ep(s)).call(n,(e=>ep(e.geometries)))).call(t),o=i.mesh.geometry;i.mesh.geometry=LY([o,...a]),fe(r=e.ids).call(r,(e=>i.ids.add(e)))}filter(e){const t=this.selected[this.matID(e)].ids,n=this.state.models[e.modelID].items,r={};for(const e in n)r[e]={material:n[e].material,geometries:this.filterGeometries(t,n[e].geometries)};return r}filterGeometries(e,t){var n,r;const i=k(e);return yp(n=oe(r=J(t)).call(r,(e=>lp(i).call(i,N(e,10))))).call(n,((e,n)=>PY(PY({},e),{},{[n]:t[n]})),{})}isEasySelection(e){const t=this.matID(e);if(!e.removePrevious&&!this.isDefaultMat(e)&&this.selected[t])return!0}isDefaultMat(e){return this.matIDNoConfig(e.modelID)===this.matID(e)}matID(e){var t;let n;return n=e.material&&e.material.uuid||FY,ye(t=ye(n).call(n," - ")).call(t,e.modelID.toString())}matIDNoConfig(e,t){var n;let r=FY;return t&&(r=t.uuid),ye(n=ye(r).call(r," - ")).call(n,e.toString())}}const GY={103090709:"IFCPROJECT",4097777520:"IFCSITE",4031249490:"IFCBUILDING",3124254112:"IFCBUILDINGSTOREY",3856911033:"IFCSPACE",1674181508:"IFCANNOTATION",25142252:"IFCCONTROLLER",32344328:"IFCBOILER",76236018:"IFCLAMP",90941305:"IFCPUMP",177149247:"IFCAIRTERMINALBOX",182646315:"IFCFLOWINSTRUMENT",263784265:"IFCFURNISHINGELEMENT",264262732:"IFCELECTRICGENERATOR",277319702:"IFCAUDIOVISUALAPPLIANCE",310824031:"IFCPIPEFITTING",331165859:"IFCSTAIR",342316401:"IFCDUCTFITTING",377706215:"IFCMECHANICALFASTENER",395920057:"IFCDOOR",402227799:"IFCELECTRICMOTOR",413509423:"IFCSYSTEMFURNITUREELEMENT",484807127:"IFCEVAPORATOR",486154966:"IFCWINDOWSTANDARDCASE",629592764:"IFCLIGHTFIXTURE",630975310:"IFCUNITARYCONTROLELEMENT",635142910:"IFCCABLECARRIERFITTING",639361253:"IFCCOIL",647756555:"IFCFASTENER",707683696:"IFCFLOWSTORAGEDEVICE",738039164:"IFCPROTECTIVEDEVICE",753842376:"IFCBEAM",812556717:"IFCTANK",819412036:"IFCFILTER",843113511:"IFCCOLUMN",862014818:"IFCELECTRICDISTRIBUTIONBOARD",900683007:"IFCFOOTING",905975707:"IFCCOLUMNSTANDARDCASE",926996030:"IFCVOIDINGFEATURE",979691226:"IFCREINFORCINGBAR",987401354:"IFCFLOWSEGMENT",1003880860:"IFCELECTRICTIMECONTROL",1051757585:"IFCCABLEFITTING",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1073191201:"IFCMEMBER",1095909175:"IFCBUILDINGELEMENTPROXY",1156407060:"IFCPLATESTANDARDCASE",1162798199:"IFCSWITCHINGDEVICE",1329646415:"IFCSHADINGDEVICE",1335981549:"IFCDISCRETEACCESSORY",1360408905:"IFCDUCTSILENCER",1404847402:"IFCSTACKTERMINAL",1426591983:"IFCFIRESUPPRESSIONTERMINAL",1437502449:"IFCMEDICALDEVICE",1509553395:"IFCFURNITURE",1529196076:"IFCSLAB",1620046519:"IFCTRANSPORTELEMENT",1634111441:"IFCAIRTERMINAL",1658829314:"IFCENERGYCONVERSIONDEVICE",1677625105:"IFCCIVILELEMENT",1687234759:"IFCPILE",1904799276:"IFCELECTRICAPPLIANCE",1911478936:"IFCMEMBERSTANDARDCASE",1945004755:"IFCDISTRIBUTIONELEMENT",1973544240:"IFCCOVERING",1999602285:"IFCSPACEHEATER",2016517767:"IFCROOF",2056796094:"IFCAIRTOAIRHEATRECOVERY",2058353004:"IFCFLOWCONTROLLER",2068733104:"IFCHUMIDIFIER",2176052936:"IFCJUNCTIONBOX",2188021234:"IFCFLOWMETER",2223149337:"IFCFLOWTERMINAL",2262370178:"IFCRAILING",2272882330:"IFCCONDENSER",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",2320036040:"IFCREINFORCINGMESH",2347447852:"IFCTENDONANCHOR",2391383451:"IFCVIBRATIONISOLATOR",2391406946:"IFCWALL",2474470126:"IFCMOTORCONNECTION",2769231204:"IFCVIRTUALELEMENT",2814081492:"IFCENGINE",2906023776:"IFCBEAMSTANDARDCASE",2938176219:"IFCBURNER",2979338954:"IFCBUILDINGELEMENTPART",3024970846:"IFCRAMP",3026737570:"IFCTUBEBUNDLE",3027962421:"IFCSLABSTANDARDCASE",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",3053780830:"IFCSANITARYTERMINAL",3079942009:"IFCOPENINGSTANDARDCASE",3087945054:"IFCALARM",3101698114:"IFCSURFACEFEATURE",3127900445:"IFCSLABELEMENTEDCASE",3132237377:"IFCFLOWMOVINGDEVICE",3171933400:"IFCPLATE",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",3242481149:"IFCDOORSTANDARDCASE",3283111854:"IFCRAMPFLIGHT",3296154744:"IFCCHIMNEY",3304561284:"IFCWINDOW",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",3319311131:"IFCHEATEXCHANGER",3415622556:"IFCFAN",3420628829:"IFCSOLARDEVICE",3493046030:"IFCGEOGRAPHICELEMENT",3495092785:"IFCCURTAINWALL",3508470533:"IFCFLOWTREATMENTDEVICE",3512223829:"IFCWALLSTANDARDCASE",3518393246:"IFCDUCTSEGMENT",3571504051:"IFCCOMPRESSOR",3588315303:"IFCOPENINGELEMENT",3612865200:"IFCPIPESEGMENT",3640358203:"IFCCOOLINGTOWER",3651124850:"IFCPROJECTIONELEMENT",3694346114:"IFCOUTLET",3747195512:"IFCEVAPORATIVECOOLER",3758799889:"IFCCABLECARRIERSEGMENT",3824725483:"IFCTENDON",3825984169:"IFCTRANSFORMER",3902619387:"IFCCHILLER",4074379575:"IFCDAMPER",4086658281:"IFCSENSOR",4123344466:"IFCELEMENTASSEMBLY",4136498852:"IFCCOOLEDBEAM",4156078855:"IFCWALLELEMENTEDCASE",4175244083:"IFCINTERCEPTOR",4207607924:"IFCVALVE",4217484030:"IFCCABLESEGMENT",4237592921:"IFCWASTETERMINAL",4252922144:"IFCSTAIRFLIGHT",4278956645:"IFCFLOWFITTING",4288193352:"IFCACTUATOR",4292641817:"IFCUNITARYEQUIPMENT",3009204131:"IFCGRID"},zY={3821786052:"IFCACTIONREQUEST",2296667514:"IFCACTOR",3630933823:"IFCACTORROLE",4288193352:"IFCACTUATOR",2874132201:"IFCACTUATORTYPE",618182010:"IFCADDRESS",1635779807:"IFCADVANCEDBREP",2603310189:"IFCADVANCEDBREPWITHVOIDS",3406155212:"IFCADVANCEDFACE",1634111441:"IFCAIRTERMINAL",177149247:"IFCAIRTERMINALBOX",1411407467:"IFCAIRTERMINALBOXTYPE",3352864051:"IFCAIRTERMINALTYPE",2056796094:"IFCAIRTOAIRHEATRECOVERY",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3087945054:"IFCALARM",3001207471:"IFCALARMTYPE",325726236:"IFCALIGNMENT",749761778:"IFCALIGNMENT2DHORIZONTAL",3199563722:"IFCALIGNMENT2DHORIZONTALSEGMENT",2483840362:"IFCALIGNMENT2DSEGMENT",3379348081:"IFCALIGNMENT2DVERSEGCIRCULARARC",3239324667:"IFCALIGNMENT2DVERSEGLINE",4263986512:"IFCALIGNMENT2DVERSEGPARABOLICARC",53199957:"IFCALIGNMENT2DVERTICAL",2029264950:"IFCALIGNMENT2DVERTICALSEGMENT",3512275521:"IFCALIGNMENTCURVE",1674181508:"IFCANNOTATION",669184980:"IFCANNOTATIONFILLAREA",639542469:"IFCAPPLICATION",411424972:"IFCAPPLIEDVALUE",130549933:"IFCAPPROVAL",3869604511:"IFCAPPROVALRELATIONSHIP",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",1310608509:"IFCARBITRARYOPENPROFILEDEF",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",3460190687:"IFCASSET",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",277319702:"IFCAUDIOVISUALAPPLIANCE",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4261334040:"IFCAXIS1PLACEMENT",3125803723:"IFCAXIS2PLACEMENT2D",2740243338:"IFCAXIS2PLACEMENT3D",1967976161:"IFCBSPLINECURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",167062518:"IFCBSPLINESURFACEWITHKNOTS",753842376:"IFCBEAM",2906023776:"IFCBEAMSTANDARDCASE",819618141:"IFCBEAMTYPE",4196446775:"IFCBEARING",3649138523:"IFCBEARINGTYPE",616511568:"IFCBLOBTEXTURE",1334484129:"IFCBLOCK",32344328:"IFCBOILER",231477066:"IFCBOILERTYPE",3649129432:"IFCBOOLEANCLIPPINGRESULT",2736907675:"IFCBOOLEANRESULT",4037036970:"IFCBOUNDARYCONDITION",1136057603:"IFCBOUNDARYCURVE",1560379544:"IFCBOUNDARYEDGECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1387855156:"IFCBOUNDARYNODECONDITION",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1260505505:"IFCBOUNDEDCURVE",4182860854:"IFCBOUNDEDSURFACE",2581212453:"IFCBOUNDINGBOX",2713105998:"IFCBOXEDHALFSPACE",644574406:"IFCBRIDGE",963979645:"IFCBRIDGEPART",4031249490:"IFCBUILDING",3299480353:"IFCBUILDINGELEMENT",2979338954:"IFCBUILDINGELEMENTPART",39481116:"IFCBUILDINGELEMENTPARTTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1950629157:"IFCBUILDINGELEMENTTYPE",3124254112:"IFCBUILDINGSTOREY",1177604601:"IFCBUILDINGSYSTEM",2938176219:"IFCBURNER",2188180465:"IFCBURNERTYPE",2898889636:"IFCCSHAPEPROFILEDEF",635142910:"IFCCABLECARRIERFITTING",395041908:"IFCCABLECARRIERFITTINGTYPE",3758799889:"IFCCABLECARRIERSEGMENT",3293546465:"IFCCABLECARRIERSEGMENTTYPE",1051757585:"IFCCABLEFITTING",2674252688:"IFCCABLEFITTINGTYPE",4217484030:"IFCCABLESEGMENT",1285652485:"IFCCABLESEGMENTTYPE",3999819293:"IFCCAISSONFOUNDATION",3203706013:"IFCCAISSONFOUNDATIONTYPE",1123145078:"IFCCARTESIANPOINT",574549367:"IFCCARTESIANPOINTLIST",1675464909:"IFCCARTESIANPOINTLIST2D",2059837836:"IFCCARTESIANPOINTLIST3D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3150382593:"IFCCENTERLINEPROFILEDEF",3902619387:"IFCCHILLER",2951183804:"IFCCHILLERTYPE",3296154744:"IFCCHIMNEY",2197970202:"IFCCHIMNEYTYPE",2611217952:"IFCCIRCLE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",1383045692:"IFCCIRCLEPROFILEDEF",1062206242:"IFCCIRCULARARCSEGMENT2D",1677625105:"IFCCIVILELEMENT",3893394355:"IFCCIVILELEMENTTYPE",747523909:"IFCCLASSIFICATION",647927063:"IFCCLASSIFICATIONREFERENCE",2205249479:"IFCCLOSEDSHELL",639361253:"IFCCOIL",2301859152:"IFCCOILTYPE",776857604:"IFCCOLOURRGB",3285139300:"IFCCOLOURRGBLIST",3264961684:"IFCCOLOURSPECIFICATION",843113511:"IFCCOLUMN",905975707:"IFCCOLUMNSTANDARDCASE",300633059:"IFCCOLUMNTYPE",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",2542286263:"IFCCOMPLEXPROPERTY",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3732776249:"IFCCOMPOSITECURVE",15328376:"IFCCOMPOSITECURVEONSURFACE",2485617015:"IFCCOMPOSITECURVESEGMENT",1485152156:"IFCCOMPOSITEPROFILEDEF",3571504051:"IFCCOMPRESSOR",3850581409:"IFCCOMPRESSORTYPE",2272882330:"IFCCONDENSER",2816379211:"IFCCONDENSERTYPE",2510884976:"IFCCONIC",370225590:"IFCCONNECTEDFACESET",1981873012:"IFCCONNECTIONCURVEGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",45288368:"IFCCONNECTIONPOINTECCENTRICITY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",1959218052:"IFCCONSTRAINT",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",2559216714:"IFCCONSTRUCTIONRESOURCE",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",3419103109:"IFCCONTEXT",3050246964:"IFCCONTEXTDEPENDENTUNIT",3293443760:"IFCCONTROL",25142252:"IFCCONTROLLER",578613899:"IFCCONTROLLERTYPE",2889183280:"IFCCONVERSIONBASEDUNIT",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",4136498852:"IFCCOOLEDBEAM",335055490:"IFCCOOLEDBEAMTYPE",3640358203:"IFCCOOLINGTOWER",2954562838:"IFCCOOLINGTOWERTYPE",1785450214:"IFCCOORDINATEOPERATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",3895139033:"IFCCOSTITEM",1419761937:"IFCCOSTSCHEDULE",602808272:"IFCCOSTVALUE",1973544240:"IFCCOVERING",1916426348:"IFCCOVERINGTYPE",3295246426:"IFCCREWRESOURCE",1815067380:"IFCCREWRESOURCETYPE",2506170314:"IFCCSGPRIMITIVE3D",2147822146:"IFCCSGSOLID",539742890:"IFCCURRENCYRELATIONSHIP",3495092785:"IFCCURTAINWALL",1457835157:"IFCCURTAINWALLTYPE",2601014836:"IFCCURVE",2827736869:"IFCCURVEBOUNDEDPLANE",2629017746:"IFCCURVEBOUNDEDSURFACE",1186437898:"IFCCURVESEGMENT2D",3800577675:"IFCCURVESTYLE",1105321065:"IFCCURVESTYLEFONT",2367409068:"IFCCURVESTYLEFONTANDSCALING",3510044353:"IFCCURVESTYLEFONTPATTERN",1213902940:"IFCCYLINDRICALSURFACE",4074379575:"IFCDAMPER",3961806047:"IFCDAMPERTYPE",3426335179:"IFCDEEPFOUNDATION",1306400036:"IFCDEEPFOUNDATIONTYPE",3632507154:"IFCDERIVEDPROFILEDEF",1765591967:"IFCDERIVEDUNIT",1045800335:"IFCDERIVEDUNITELEMENT",2949456006:"IFCDIMENSIONALEXPONENTS",32440307:"IFCDIRECTION",1335981549:"IFCDISCRETEACCESSORY",2635815018:"IFCDISCRETEACCESSORYTYPE",1945343521:"IFCDISTANCEEXPRESSION",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",562808652:"IFCDISTRIBUTIONCIRCUIT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1945004755:"IFCDISTRIBUTIONELEMENT",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3041715199:"IFCDISTRIBUTIONPORT",3205830791:"IFCDISTRIBUTIONSYSTEM",1154170062:"IFCDOCUMENTINFORMATION",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",3732053477:"IFCDOCUMENTREFERENCE",395920057:"IFCDOOR",2963535650:"IFCDOORLININGPROPERTIES",1714330368:"IFCDOORPANELPROPERTIES",3242481149:"IFCDOORSTANDARDCASE",526551008:"IFCDOORSTYLE",2323601079:"IFCDOORTYPE",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",342316401:"IFCDUCTFITTING",869906466:"IFCDUCTFITTINGTYPE",3518393246:"IFCDUCTSEGMENT",3760055223:"IFCDUCTSEGMENTTYPE",1360408905:"IFCDUCTSILENCER",2030761528:"IFCDUCTSILENCERTYPE",3900360178:"IFCEDGE",476780140:"IFCEDGECURVE",1472233963:"IFCEDGELOOP",1904799276:"IFCELECTRICAPPLIANCE",663422040:"IFCELECTRICAPPLIANCETYPE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",264262732:"IFCELECTRICGENERATOR",1534661035:"IFCELECTRICGENERATORTYPE",402227799:"IFCELECTRICMOTOR",1217240411:"IFCELECTRICMOTORTYPE",1003880860:"IFCELECTRICTIMECONTROL",712377611:"IFCELECTRICTIMECONTROLTYPE",1758889154:"IFCELEMENT",4123344466:"IFCELEMENTASSEMBLY",2397081782:"IFCELEMENTASSEMBLYTYPE",1623761950:"IFCELEMENTCOMPONENT",2590856083:"IFCELEMENTCOMPONENTTYPE",1883228015:"IFCELEMENTQUANTITY",339256511:"IFCELEMENTTYPE",2777663545:"IFCELEMENTARYSURFACE",1704287377:"IFCELLIPSE",2835456948:"IFCELLIPSEPROFILEDEF",1658829314:"IFCENERGYCONVERSIONDEVICE",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",2814081492:"IFCENGINE",132023988:"IFCENGINETYPE",3747195512:"IFCEVAPORATIVECOOLER",3174744832:"IFCEVAPORATIVECOOLERTYPE",484807127:"IFCEVAPORATOR",3390157468:"IFCEVAPORATORTYPE",4148101412:"IFCEVENT",211053100:"IFCEVENTTIME",4024345920:"IFCEVENTTYPE",297599258:"IFCEXTENDEDPROPERTIES",4294318154:"IFCEXTERNALINFORMATION",3200245327:"IFCEXTERNALREFERENCE",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",1209101575:"IFCEXTERNALSPATIALELEMENT",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",477187591:"IFCEXTRUDEDAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",2556980723:"IFCFACE",2047409740:"IFCFACEBASEDSURFACEMODEL",1809719519:"IFCFACEBOUND",803316827:"IFCFACEOUTERBOUND",3008276851:"IFCFACESURFACE",807026263:"IFCFACETEDBREP",3737207727:"IFCFACETEDBREPWITHVOIDS",24185140:"IFCFACILITY",1310830890:"IFCFACILITYPART",4219587988:"IFCFAILURECONNECTIONCONDITION",3415622556:"IFCFAN",346874300:"IFCFANTYPE",647756555:"IFCFASTENER",2489546625:"IFCFASTENERTYPE",2827207264:"IFCFEATUREELEMENT",2143335405:"IFCFEATUREELEMENTADDITION",1287392070:"IFCFEATUREELEMENTSUBTRACTION",738692330:"IFCFILLAREASTYLE",374418227:"IFCFILLAREASTYLEHATCHING",315944413:"IFCFILLAREASTYLETILES",819412036:"IFCFILTER",1810631287:"IFCFILTERTYPE",1426591983:"IFCFIRESUPPRESSIONTERMINAL",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2058353004:"IFCFLOWCONTROLLER",3907093117:"IFCFLOWCONTROLLERTYPE",4278956645:"IFCFLOWFITTING",3198132628:"IFCFLOWFITTINGTYPE",182646315:"IFCFLOWINSTRUMENT",4037862832:"IFCFLOWINSTRUMENTTYPE",2188021234:"IFCFLOWMETER",3815607619:"IFCFLOWMETERTYPE",3132237377:"IFCFLOWMOVINGDEVICE",1482959167:"IFCFLOWMOVINGDEVICETYPE",987401354:"IFCFLOWSEGMENT",1834744321:"IFCFLOWSEGMENTTYPE",707683696:"IFCFLOWSTORAGEDEVICE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",2223149337:"IFCFLOWTERMINAL",2297155007:"IFCFLOWTERMINALTYPE",3508470533:"IFCFLOWTREATMENTDEVICE",3009222698:"IFCFLOWTREATMENTDEVICETYPE",900683007:"IFCFOOTING",1893162501:"IFCFOOTINGTYPE",263784265:"IFCFURNISHINGELEMENT",4238390223:"IFCFURNISHINGELEMENTTYPE",1509553395:"IFCFURNITURE",1268542332:"IFCFURNITURETYPE",3493046030:"IFCGEOGRAPHICELEMENT",4095422895:"IFCGEOGRAPHICELEMENTTYPE",987898635:"IFCGEOMETRICCURVESET",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",3590301190:"IFCGEOMETRICSET",3009204131:"IFCGRID",852622518:"IFCGRIDAXIS",178086475:"IFCGRIDPLACEMENT",2706460486:"IFCGROUP",812098782:"IFCHALFSPACESOLID",3319311131:"IFCHEATEXCHANGER",1251058090:"IFCHEATEXCHANGERTYPE",2068733104:"IFCHUMIDIFIER",1806887404:"IFCHUMIDIFIERTYPE",1484403080:"IFCISHAPEPROFILEDEF",3905492369:"IFCIMAGETEXTURE",3570813810:"IFCINDEXEDCOLOURMAP",2571569899:"IFCINDEXEDPOLYCURVE",178912537:"IFCINDEXEDPOLYGONALFACE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",1437953363:"IFCINDEXEDTEXTUREMAP",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",4175244083:"IFCINTERCEPTOR",3946677679:"IFCINTERCEPTORTYPE",3113134337:"IFCINTERSECTIONCURVE",2391368822:"IFCINVENTORY",3741457305:"IFCIRREGULARTIMESERIES",3020489413:"IFCIRREGULARTIMESERIESVALUE",2176052936:"IFCJUNCTIONBOX",4288270099:"IFCJUNCTIONBOXTYPE",572779678:"IFCLSHAPEPROFILEDEF",3827777499:"IFCLABORRESOURCE",428585644:"IFCLABORRESOURCETYPE",1585845231:"IFCLAGTIME",76236018:"IFCLAMP",1051575348:"IFCLAMPTYPE",2655187982:"IFCLIBRARYINFORMATION",3452421091:"IFCLIBRARYREFERENCE",4162380809:"IFCLIGHTDISTRIBUTIONDATA",629592764:"IFCLIGHTFIXTURE",1161773419:"IFCLIGHTFIXTURETYPE",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",1402838566:"IFCLIGHTSOURCE",125510826:"IFCLIGHTSOURCEAMBIENT",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",1520743889:"IFCLIGHTSOURCEPOSITIONAL",3422422726:"IFCLIGHTSOURCESPOT",1281925730:"IFCLINE",3092502836:"IFCLINESEGMENT2D",388784114:"IFCLINEARPLACEMENT",1154579445:"IFCLINEARPOSITIONINGELEMENT",2624227202:"IFCLOCALPLACEMENT",1008929658:"IFCLOOP",1425443689:"IFCMANIFOLDSOLIDBREP",3057273783:"IFCMAPCONVERSION",2347385850:"IFCMAPPEDITEM",1838606355:"IFCMATERIAL",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",3708119e3:"IFCMATERIALCONSTITUENT",2852063980:"IFCMATERIALCONSTITUENTSET",760658860:"IFCMATERIALDEFINITION",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",248100487:"IFCMATERIALLAYER",3303938423:"IFCMATERIALLAYERSET",1303795690:"IFCMATERIALLAYERSETUSAGE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",2199411900:"IFCMATERIALLIST",2235152071:"IFCMATERIALPROFILE",164193824:"IFCMATERIALPROFILESET",3079605661:"IFCMATERIALPROFILESETUSAGE",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",552965576:"IFCMATERIALPROFILEWITHOFFSETS",3265635763:"IFCMATERIALPROPERTIES",853536259:"IFCMATERIALRELATIONSHIP",1507914824:"IFCMATERIALUSAGEDEFINITION",2597039031:"IFCMEASUREWITHUNIT",377706215:"IFCMECHANICALFASTENER",2108223431:"IFCMECHANICALFASTENERTYPE",1437502449:"IFCMEDICALDEVICE",1114901282:"IFCMEDICALDEVICETYPE",1073191201:"IFCMEMBER",1911478936:"IFCMEMBERSTANDARDCASE",3181161470:"IFCMEMBERTYPE",3368373690:"IFCMETRIC",2998442950:"IFCMIRROREDPROFILEDEF",2706619895:"IFCMONETARYUNIT",2474470126:"IFCMOTORCONNECTION",977012517:"IFCMOTORCONNECTIONTYPE",1918398963:"IFCNAMEDUNIT",3888040117:"IFCOBJECT",219451334:"IFCOBJECTDEFINITION",3701648758:"IFCOBJECTPLACEMENT",2251480897:"IFCOBJECTIVE",4143007308:"IFCOCCUPANT",590820931:"IFCOFFSETCURVE",3388369263:"IFCOFFSETCURVE2D",3505215534:"IFCOFFSETCURVE3D",2485787929:"IFCOFFSETCURVEBYDISTANCES",2665983363:"IFCOPENSHELL",3588315303:"IFCOPENINGELEMENT",3079942009:"IFCOPENINGSTANDARDCASE",4251960020:"IFCORGANIZATION",1411181986:"IFCORGANIZATIONRELATIONSHIP",643959842:"IFCORIENTATIONEXPRESSION",1029017970:"IFCORIENTEDEDGE",144952367:"IFCOUTERBOUNDARYCURVE",3694346114:"IFCOUTLET",2837617999:"IFCOUTLETTYPE",1207048766:"IFCOWNERHISTORY",2529465313:"IFCPARAMETERIZEDPROFILEDEF",2519244187:"IFCPATH",1682466193:"IFCPCURVE",2382730787:"IFCPERFORMANCEHISTORY",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3327091369:"IFCPERMIT",2077209135:"IFCPERSON",101040310:"IFCPERSONANDORGANIZATION",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2483315170:"IFCPHYSICALQUANTITY",2226359599:"IFCPHYSICALSIMPLEQUANTITY",1687234759:"IFCPILE",1158309216:"IFCPILETYPE",310824031:"IFCPIPEFITTING",804291784:"IFCPIPEFITTINGTYPE",3612865200:"IFCPIPESEGMENT",4231323485:"IFCPIPESEGMENTTYPE",597895409:"IFCPIXELTEXTURE",2004835150:"IFCPLACEMENT",603570806:"IFCPLANARBOX",1663979128:"IFCPLANAREXTENT",220341763:"IFCPLANE",3171933400:"IFCPLATE",1156407060:"IFCPLATESTANDARDCASE",4017108033:"IFCPLATETYPE",2067069095:"IFCPOINT",4022376103:"IFCPOINTONCURVE",1423911732:"IFCPOINTONSURFACE",2924175390:"IFCPOLYLOOP",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2839578677:"IFCPOLYGONALFACESET",3724593414:"IFCPOLYLINE",3740093272:"IFCPORT",1946335990:"IFCPOSITIONINGELEMENT",3355820592:"IFCPOSTALADDRESS",759155922:"IFCPREDEFINEDCOLOUR",2559016684:"IFCPREDEFINEDCURVEFONT",3727388367:"IFCPREDEFINEDITEM",3778827333:"IFCPREDEFINEDPROPERTIES",3967405729:"IFCPREDEFINEDPROPERTYSET",1775413392:"IFCPREDEFINEDTEXTFONT",677532197:"IFCPRESENTATIONITEM",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",3119450353:"IFCPRESENTATIONSTYLE",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",2744685151:"IFCPROCEDURE",569719735:"IFCPROCEDURETYPE",2945172077:"IFCPROCESS",4208778838:"IFCPRODUCT",673634403:"IFCPRODUCTDEFINITIONSHAPE",2095639259:"IFCPRODUCTREPRESENTATION",3958567839:"IFCPROFILEDEF",2802850158:"IFCPROFILEPROPERTIES",103090709:"IFCPROJECT",653396225:"IFCPROJECTLIBRARY",2904328755:"IFCPROJECTORDER",3843373140:"IFCPROJECTEDCRS",3651124850:"IFCPROJECTIONELEMENT",2598011224:"IFCPROPERTY",986844984:"IFCPROPERTYABSTRACTION",871118103:"IFCPROPERTYBOUNDEDVALUE",1680319473:"IFCPROPERTYDEFINITION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",4166981789:"IFCPROPERTYENUMERATEDVALUE",3710013099:"IFCPROPERTYENUMERATION",2752243245:"IFCPROPERTYLISTVALUE",941946838:"IFCPROPERTYREFERENCEVALUE",1451395588:"IFCPROPERTYSET",3357820518:"IFCPROPERTYSETDEFINITION",492091185:"IFCPROPERTYSETTEMPLATE",3650150729:"IFCPROPERTYSINGLEVALUE",110355661:"IFCPROPERTYTABLEVALUE",3521284610:"IFCPROPERTYTEMPLATE",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",738039164:"IFCPROTECTIVEDEVICE",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3219374653:"IFCPROXY",90941305:"IFCPUMP",2250791053:"IFCPUMPTYPE",2044713172:"IFCQUANTITYAREA",2093928680:"IFCQUANTITYCOUNT",931644368:"IFCQUANTITYLENGTH",2090586900:"IFCQUANTITYSET",3252649465:"IFCQUANTITYTIME",2405470396:"IFCQUANTITYVOLUME",825690147:"IFCQUANTITYWEIGHT",2262370178:"IFCRAILING",2893384427:"IFCRAILINGTYPE",3024970846:"IFCRAMP",3283111854:"IFCRAMPFLIGHT",2324767716:"IFCRAMPFLIGHTTYPE",1469900589:"IFCRAMPTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3615266464:"IFCRECTANGLEPROFILEDEF",2798486643:"IFCRECTANGULARPYRAMID",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",3915482550:"IFCRECURRENCEPATTERN",2433181523:"IFCREFERENCE",4021432810:"IFCREFERENT",3413951693:"IFCREGULARTIMESERIES",1580146022:"IFCREINFORCEMENTBARPROPERTIES",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",979691226:"IFCREINFORCINGBAR",2572171363:"IFCREINFORCINGBARTYPE",3027567501:"IFCREINFORCINGELEMENT",964333572:"IFCREINFORCINGELEMENTTYPE",2320036040:"IFCREINFORCINGMESH",2310774935:"IFCREINFORCINGMESHTYPE",160246688:"IFCRELAGGREGATES",3939117080:"IFCRELASSIGNS",1683148259:"IFCRELASSIGNSTOACTOR",2495723537:"IFCRELASSIGNSTOCONTROL",1307041759:"IFCRELASSIGNSTOGROUP",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",4278684876:"IFCRELASSIGNSTOPROCESS",2857406711:"IFCRELASSIGNSTOPRODUCT",205026976:"IFCRELASSIGNSTORESOURCE",1865459582:"IFCRELASSOCIATES",4095574036:"IFCRELASSOCIATESAPPROVAL",919958153:"IFCRELASSOCIATESCLASSIFICATION",2728634034:"IFCRELASSOCIATESCONSTRAINT",982818633:"IFCRELASSOCIATESDOCUMENT",3840914261:"IFCRELASSOCIATESLIBRARY",2655215786:"IFCRELASSOCIATESMATERIAL",826625072:"IFCRELCONNECTS",1204542856:"IFCRELCONNECTSELEMENTS",3945020480:"IFCRELCONNECTSPATHELEMENTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3190031847:"IFCRELCONNECTSPORTS",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",504942748:"IFCRELCONNECTSWITHECCENTRICITY",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",886880790:"IFCRELCOVERSBLDGELEMENTS",2802773753:"IFCRELCOVERSSPACES",2565941209:"IFCRELDECLARES",2551354335:"IFCRELDECOMPOSES",693640335:"IFCRELDEFINES",1462361463:"IFCRELDEFINESBYOBJECT",4186316022:"IFCRELDEFINESBYPROPERTIES",307848117:"IFCRELDEFINESBYTEMPLATE",781010003:"IFCRELDEFINESBYTYPE",3940055652:"IFCRELFILLSELEMENT",279856033:"IFCRELFLOWCONTROLELEMENTS",427948657:"IFCRELINTERFERESELEMENTS",3268803585:"IFCRELNESTS",1441486842:"IFCRELPOSITIONS",750771296:"IFCRELPROJECTSELEMENT",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",4122056220:"IFCRELSEQUENCE",366585022:"IFCRELSERVICESBUILDINGS",3451746338:"IFCRELSPACEBOUNDARY",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",1401173127:"IFCRELVOIDSELEMENT",478536968:"IFCRELATIONSHIP",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1076942058:"IFCREPRESENTATION",3377609919:"IFCREPRESENTATIONCONTEXT",3008791417:"IFCREPRESENTATIONITEM",1660063152:"IFCREPRESENTATIONMAP",2914609552:"IFCRESOURCE",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2439245199:"IFCRESOURCELEVELRELATIONSHIP",1042787934:"IFCRESOURCETIME",1856042241:"IFCREVOLVEDAREASOLID",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",4158566097:"IFCRIGHTCIRCULARCONE",3626867408:"IFCRIGHTCIRCULARCYLINDER",2016517767:"IFCROOF",2781568857:"IFCROOFTYPE",2341007311:"IFCROOT",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",448429030:"IFCSIUNIT",3053780830:"IFCSANITARYTERMINAL",1768891740:"IFCSANITARYTERMINALTYPE",1054537805:"IFCSCHEDULINGTIME",2157484638:"IFCSEAMCURVE",2042790032:"IFCSECTIONPROPERTIES",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",1862484736:"IFCSECTIONEDSOLID",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1509187699:"IFCSECTIONEDSPINE",4086658281:"IFCSENSOR",1783015770:"IFCSENSORTYPE",1329646415:"IFCSHADINGDEVICE",4074543187:"IFCSHADINGDEVICETYPE",867548509:"IFCSHAPEASPECT",3982875396:"IFCSHAPEMODEL",4240577450:"IFCSHAPEREPRESENTATION",4124623270:"IFCSHELLBASEDSURFACEMODEL",3692461612:"IFCSIMPLEPROPERTY",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",4097777520:"IFCSITE",1529196076:"IFCSLAB",3127900445:"IFCSLABELEMENTEDCASE",3027962421:"IFCSLABSTANDARDCASE",2533589738:"IFCSLABTYPE",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",3420628829:"IFCSOLARDEVICE",1072016465:"IFCSOLARDEVICETYPE",723233188:"IFCSOLIDMODEL",3856911033:"IFCSPACE",1999602285:"IFCSPACEHEATER",1305183839:"IFCSPACEHEATERTYPE",3812236995:"IFCSPACETYPE",1412071761:"IFCSPATIALELEMENT",710998568:"IFCSPATIALELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",463610769:"IFCSPATIALZONE",2481509218:"IFCSPATIALZONETYPE",451544542:"IFCSPHERE",4015995234:"IFCSPHERICALSURFACE",1404847402:"IFCSTACKTERMINAL",3112655638:"IFCSTACKTERMINALTYPE",331165859:"IFCSTAIR",4252922144:"IFCSTAIRFLIGHT",1039846685:"IFCSTAIRFLIGHTTYPE",338393293:"IFCSTAIRTYPE",682877961:"IFCSTRUCTURALACTION",3544373492:"IFCSTRUCTURALACTIVITY",2515109513:"IFCSTRUCTURALANALYSISMODEL",1179482911:"IFCSTRUCTURALCONNECTION",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",1004757350:"IFCSTRUCTURALCURVEACTION",4243806635:"IFCSTRUCTURALCURVECONNECTION",214636428:"IFCSTRUCTURALCURVEMEMBER",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",2757150158:"IFCSTRUCTURALCURVEREACTION",3136571912:"IFCSTRUCTURALITEM",1807405624:"IFCSTRUCTURALLINEARACTION",2162789131:"IFCSTRUCTURALLOAD",385403989:"IFCSTRUCTURALLOADCASE",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1252848954:"IFCSTRUCTURALLOADGROUP",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",609421318:"IFCSTRUCTURALLOADORRESULT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",2525727697:"IFCSTRUCTURALLOADSTATIC",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",530289379:"IFCSTRUCTURALMEMBER",1621171031:"IFCSTRUCTURALPLANARACTION",2082059205:"IFCSTRUCTURALPOINTACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",1235345126:"IFCSTRUCTURALPOINTREACTION",3689010777:"IFCSTRUCTURALREACTION",2986769608:"IFCSTRUCTURALRESULTGROUP",3657597509:"IFCSTRUCTURALSURFACEACTION",1975003073:"IFCSTRUCTURALSURFACECONNECTION",3979015343:"IFCSTRUCTURALSURFACEMEMBER",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",603775116:"IFCSTRUCTURALSURFACEREACTION",2830218821:"IFCSTYLEMODEL",3958052878:"IFCSTYLEDITEM",3049322572:"IFCSTYLEDREPRESENTATION",148013059:"IFCSUBCONTRACTRESOURCE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",2233826070:"IFCSUBEDGE",2513912981:"IFCSURFACE",699246055:"IFCSURFACECURVE",2028607225:"IFCSURFACECURVESWEPTAREASOLID",3101698114:"IFCSURFACEFEATURE",2809605785:"IFCSURFACEOFLINEAREXTRUSION",4124788165:"IFCSURFACEOFREVOLUTION",2934153892:"IFCSURFACEREINFORCEMENTAREA",1300840506:"IFCSURFACESTYLE",3303107099:"IFCSURFACESTYLELIGHTING",1607154358:"IFCSURFACESTYLEREFRACTION",1878645084:"IFCSURFACESTYLERENDERING",846575682:"IFCSURFACESTYLESHADING",1351298697:"IFCSURFACESTYLEWITHTEXTURES",626085974:"IFCSURFACETEXTURE",2247615214:"IFCSWEPTAREASOLID",1260650574:"IFCSWEPTDISKSOLID",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",230924584:"IFCSWEPTSURFACE",1162798199:"IFCSWITCHINGDEVICE",2315554128:"IFCSWITCHINGDEVICETYPE",2254336722:"IFCSYSTEM",413509423:"IFCSYSTEMFURNITUREELEMENT",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",3071757647:"IFCTSHAPEPROFILEDEF",985171141:"IFCTABLE",2043862942:"IFCTABLECOLUMN",531007025:"IFCTABLEROW",812556717:"IFCTANK",5716631:"IFCTANKTYPE",3473067441:"IFCTASK",1549132990:"IFCTASKTIME",2771591690:"IFCTASKTIMERECURRING",3206491090:"IFCTASKTYPE",912023232:"IFCTELECOMADDRESS",3824725483:"IFCTENDON",2347447852:"IFCTENDONANCHOR",3081323446:"IFCTENDONANCHORTYPE",3663046924:"IFCTENDONCONDUIT",2281632017:"IFCTENDONCONDUITTYPE",2415094496:"IFCTENDONTYPE",2387106220:"IFCTESSELLATEDFACESET",901063453:"IFCTESSELLATEDITEM",4282788508:"IFCTEXTLITERAL",3124975700:"IFCTEXTLITERALWITHEXTENT",1447204868:"IFCTEXTSTYLE",1983826977:"IFCTEXTSTYLEFONTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1640371178:"IFCTEXTSTYLETEXTMODEL",280115917:"IFCTEXTURECOORDINATE",1742049831:"IFCTEXTURECOORDINATEGENERATOR",2552916305:"IFCTEXTUREMAP",1210645708:"IFCTEXTUREVERTEX",3611470254:"IFCTEXTUREVERTEXLIST",1199560280:"IFCTIMEPERIOD",3101149627:"IFCTIMESERIES",581633288:"IFCTIMESERIESVALUE",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",1735638870:"IFCTOPOLOGYREPRESENTATION",1935646853:"IFCTOROIDALSURFACE",3825984169:"IFCTRANSFORMER",1692211062:"IFCTRANSFORMERTYPE",2595432518:"IFCTRANSITIONCURVESEGMENT2D",1620046519:"IFCTRANSPORTELEMENT",2097647324:"IFCTRANSPORTELEMENTTYPE",2715220739:"IFCTRAPEZIUMPROFILEDEF",2916149573:"IFCTRIANGULATEDFACESET",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3593883385:"IFCTRIMMEDCURVE",3026737570:"IFCTUBEBUNDLE",1600972822:"IFCTUBEBUNDLETYPE",1628702193:"IFCTYPEOBJECT",3736923433:"IFCTYPEPROCESS",2347495698:"IFCTYPEPRODUCT",3698973494:"IFCTYPERESOURCE",427810014:"IFCUSHAPEPROFILEDEF",180925521:"IFCUNITASSIGNMENT",630975310:"IFCUNITARYCONTROLELEMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",4292641817:"IFCUNITARYEQUIPMENT",1911125066:"IFCUNITARYEQUIPMENTTYPE",4207607924:"IFCVALVE",728799441:"IFCVALVETYPE",1417489154:"IFCVECTOR",2799835756:"IFCVERTEX",2759199220:"IFCVERTEXLOOP",1907098498:"IFCVERTEXPOINT",1530820697:"IFCVIBRATIONDAMPER",3956297820:"IFCVIBRATIONDAMPERTYPE",2391383451:"IFCVIBRATIONISOLATOR",3313531582:"IFCVIBRATIONISOLATORTYPE",2769231204:"IFCVIRTUALELEMENT",891718957:"IFCVIRTUALGRIDINTERSECTION",926996030:"IFCVOIDINGFEATURE",2391406946:"IFCWALL",4156078855:"IFCWALLELEMENTEDCASE",3512223829:"IFCWALLSTANDARDCASE",1898987631:"IFCWALLTYPE",4237592921:"IFCWASTETERMINAL",1133259667:"IFCWASTETERMINALTYPE",3304561284:"IFCWINDOW",336235671:"IFCWINDOWLININGPROPERTIES",512836454:"IFCWINDOWPANELPROPERTIES",486154966:"IFCWINDOWSTANDARDCASE",1299126871:"IFCWINDOWSTYLE",4009809668:"IFCWINDOWTYPE",4088093105:"IFCWORKCALENDAR",1028945134:"IFCWORKCONTROL",4218914973:"IFCWORKPLAN",3342526732:"IFCWORKSCHEDULE",1236880293:"IFCWORKTIME",2543172580:"IFCZSHAPEPROFILEDEF",1033361043:"IFCZONE"};class VY{constructor(e){this.state=e}getExpressId(e,t){if(!e.index)return;const n=e.index.array;return e.attributes.expressID.getX(n[3*t])}getItemProperties(e,t,n=!1){return this.state.useJSON?PY({},this.state.models[e].jsonData[t]):this.state.api.GetLine(e,t,n)}getAllItemsOfType(e,t,n){return this.state.useJSON?this.getAllItemsOfTypeJSON(e,t,n):this.getAllItemsOfTypeWebIfcAPI(e,t,n)}getPropertySets(e,t,n=!1){return this.state.useJSON?this.getPropertyJSON(e,t,n,UY.psets):this.getPropertyWebIfcAPI(e,t,n,UY.psets)}getTypeProperties(e,t,n=!1){return this.state.useJSON?this.getPropertyJSON(e,t,n,UY.type):this.getPropertyWebIfcAPI(e,t,n,UY.type)}getMaterialsProperties(e,t,n=!1){return this.state.useJSON?this.getPropertyJSON(e,t,n,UY.materials):this.getPropertyWebIfcAPI(e,t,n,UY.materials)}getSpatialStructure(e){return this.state.useJSON?this.getSpatialStructureJSON(e):this.getSpatialStructureWebIfcAPI(e)}getSpatialStructureJSON(e){const t=this.getSpatialTreeChunks(e),n=this.getAllItemsOfTypeJSON(e,gA,!1)[0],r=this.newIfcProject(n);return this.getSpatialNode(e,r,t),PY({},r)}getSpatialStructureWebIfcAPI(e){const t=this.getSpatialTreeChunks(e),n=this.state.api.GetLineIDsWithType(e,gA).get(0),r=this.newIfcProject(n);return this.getSpatialNode(e,r,t),r}getAllItemsOfTypeJSON(e,t,n){const r=this.state.models[e].jsonData,i=zY[t];if(!i)throw new Error(`Type not found: ${t}`);return this.filterJSONItemsByType(r,i,n)}filterJSONItemsByType(e,t,n){var r;const i=[];return fe(r=J(e)).call(r,(r=>{const s=N(r);e[s].type.toUpperCase()===t&&i.push(n?PY({},e[s]):s)})),i}getItemsByIDJSON(e,t){const n=this.state.models[e].jsonData,r=[];return fe(t).call(t,(e=>r.push(PY({},n[e])))),r}getPropertyJSON(e,t,n=!1,r){const i=this.getAllRelatedItemsOfTypeJSON(e,t,r),s=this.getItemsByIDJSON(e,i);return n&&fe(s).call(s,(t=>this.getJSONReferencesRecursively(e,t))),s}getJSONReferencesRecursively(e,t){if(null==t)return;const n=J(t);for(let r=0;r<n.length;r++){const i=n[r];this.getJSONItem(e,t,i)}}getJSONItem(e,t,n){if(b(t[n]))return this.getMultipleJSONItems(e,t,n);t[n]&&5===t[n].type&&(t[n]=this.getItemsByIDJSON(e,[t[n].value])[0],this.getJSONReferencesRecursively(e,t[n]))}getMultipleJSONItems(e,t,n){var r;t[n]=K(r=t[n]).call(r,(t=>(5===t.type&&(t=this.getItemsByIDJSON(e,[t.value])[0],this.getJSONReferencesRecursively(e,t)),t)))}getPropertyWebIfcAPI(e,t,n=!1,r){const i=this.getAllRelatedItemsOfTypeWebIfcAPI(e,t,r);return K(i).call(i,(t=>this.state.api.GetLine(e,t,n)))}getAllItemsOfTypeWebIfcAPI(e,t,n){const r=[],i=this.state.api.GetLineIDsWithType(e,t);for(let e=0;e<i.size();e++)r.push(i.get(e));return n?K(r).call(r,(t=>this.state.api.GetLine(e,t))):r}newIfcProject(e){return{expressID:e,type:"IFCPROJECT",children:[]}}getSpatialTreeChunks(e){const t={};return this.state.useJSON?(this.getChunksJSON(e,t,UY.aggregates),this.getChunksJSON(e,t,UY.spatial)):(this.getChunksWebIfcAPI(e,t,UY.aggregates),this.getChunksWebIfcAPI(e,t,UY.spatial)),t}getChunksJSON(e,t,n){const r=this.getAllItemsOfTypeJSON(e,n.name,!0);fe(r).call(r,(e=>{this.saveChunk(t,n,e)}))}getChunksWebIfcAPI(e,t,n){const r=this.state.api.GetLineIDsWithType(e,n.name);for(let i=0;i<r.size();i++){const s=this.state.api.GetLine(e,r.get(i),!1);this.saveChunk(t,n,s)}}saveChunk(e,t,n){var r;const i=n[t.relating].value,s=K(r=n[t.related]).call(r,(e=>e.value));var a;null==e[i]?e[i]=s:e[i]=ye(a=e[i]).call(a,s)}getSpatialNode(e,t,n){this.getChildren(e,t,n,UY.aggregates),this.getChildren(e,t,n,UY.spatial)}getChildren(e,t,n,r){const i=n[t.expressID];if(null==i)return;t[r.key]=K(i).call(i,(t=>{const r=this.newNode(e,t);return this.getSpatialNode(e,r,n),r}))}newNode(e,t){return{expressID:t,type:this.getNodeType(e,t),children:[]}}getNodeType(e,t){if(this.state.useJSON)return this.state.models[e].jsonData[t].type;const n=this.state.models[e].types[t];return GY[n]}getAllRelatedItemsOfTypeJSON(e,t,n){const r=this.getAllItemsOfTypeJSON(e,n.name,!0),i=[];return fe(r).call(r,(e=>{this.isRelated(t,e,n)&&this.getRelated(e,n,i)})),i}getAllRelatedItemsOfTypeWebIfcAPI(e,t,n){const r=this.state.api.GetLineIDsWithType(e,n.name),i=[];for(let s=0;s<r.size();s++){const a=this.state.api.GetLine(e,r.get(s));this.isRelated(t,a,n)&&this.getRelated(a,n,i)}return i}getRelated(e,t,n){const r=e[t.relating];b(r)?fe(r).call(r,(e=>n.push(e.value))):n.push(r.value)}isRelated(e,t,n){const r=t[n.related];if(b(r)){const t=K(r).call(r,(e=>e.value));return lp(t).call(t,e)}return r.value===e}}class HY{constructor(e){this.state=e}getAllTypes(){for(const e in this.state.models){const t=this.state.models[e].types;0==J(t).length&&this.getAllTypesOfModel(N(e))}}getAllTypesOfModel(e){var t;this.state.models[e].types;const n=K(t=J(GY)).call(t,(e=>N(e))),r=this.state.models[e].types;fe(n).call(n,(t=>{const n=this.state.api.GetLineIDsWithType(e,t);for(let e=0;e<n.size();e++)r[n.get(e)]=t}))}}let qY=0;const WY="IfcManager is null!";class YY extends mi{constructor(){super(...arguments),this.modelID=qY++,this.ifcManager=null,this.mesh=this}setIFCManager(e){this.ifcManager=e}setWasmPath(e){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.setWasmPath(e)}close(e){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.close(this.modelID,e)}getExpressId(e,t){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getExpressId(e,t)}getAllItemsOfType(e,t){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getAllItemsOfType(this.modelID,e,t)}getItemProperties(e,t=!1){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getItemProperties(this.modelID,e,t)}getPropertySets(e,t=!1){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getPropertySets(this.modelID,e,t)}getTypeProperties(e,t=!1){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getTypeProperties(this.modelID,e,t)}getIfcType(e){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getIfcType(this.modelID,e)}getSpatialStructure(){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getSpatialStructure(this.modelID)}getSubset(e){if(null===this.ifcManager)throw new Error(WY);return this.ifcManager.getSubset(this.modelID,e)}removeSubset(e,t){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.removeSubset(this.modelID,e,t)}createSubset(e){if(null===this.ifcManager)throw new Error(WY);const t=PY(PY({},e),{},{modelID:this.modelID});return this.ifcManager.createSubset(t)}hideItems(e){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.hideItems(this.modelID,e)}hideAllItems(){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.hideAllItems(this.modelID)}showItems(e){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.showItems(this.modelID,e)}showAllItems(){if(null===this.ifcManager)throw new Error(WY);this.ifcManager.showAllItems(this.modelID)}}class XY{initializeMeshBVH(e,t,n){this.computeBoundsTree=e,this.disposeBoundsTree=t,this.acceleratedRaycast=n,this.setupThreeMeshBVH()}applyThreeMeshBVH(e){this.computeBoundsTree&&e.computeBoundsTree()}setupThreeMeshBVH(){this.computeBoundsTree&&this.disposeBoundsTree&&this.acceleratedRaycast&&(Kr.prototype.computeBoundsTree=this.computeBoundsTree,Kr.prototype.disposeBoundsTree=this.disposeBoundsTree,mi.prototype.raycast=this.acceleratedRaycast)}}class $Y{constructor(e){this.modelCoordinates={},this.expressIDCoordinatesMap={},this.state=e}processCoordinates(e){const t=this.getAttributes(e),n=k(t.expressID.array);this.expressIDCoordinatesMap[e]={};for(let t=0;t<n.length;t++){this.expressIDCoordinatesMap[e][n[t]]||(this.expressIDCoordinatesMap[e][n[t]]=[]);this.expressIDCoordinatesMap[e][n[t]].push(3*t)}this.initializeCoordinates(e)}hideItems(e,t){this.editCoordinates(e,t,!0)}showItems(e,t){this.editCoordinates(e,t,!1)}editCoordinates(e,t,n){const r=this.expressIDCoordinatesMap[e],i=[];fe(t).call(t,(e=>{r[e]&&i.push(...r[e])}));const s=this.getCoordinates(e),a=this.modelCoordinates[e];n?fe(i).call(i,(e=>s.set([0,0,0],e))):fe(i).call(i,(e=>s.set([a[e],a[e+1],a[e+2]],e))),this.getAttributes(e).position.needsUpdate=!0}showAllItems(e){this.modelCoordinates[e]&&(this.resetCoordinates(e),this.getAttributes(e).position.needsUpdate=!0)}hideAllItems(e){var t;N_(t=this.getCoordinates(e)).call(t,0),this.getAttributes(e).position.needsUpdate=!0}initializeCoordinates(e){const t=this.getCoordinates(e);this.modelCoordinates[e]||(this.modelCoordinates[e]=new Float32Array(t))}resetCoordinates(e){const t=this.modelCoordinates[e];this.getCoordinates(e).set(t)}getCoordinates(e){return this.getAttributes(e).position.array}getAttributes(e){return this.state.models[e].mesh.geometry.attributes}}class KY{constructor(){this.state={models:[],api:new DY,useJSON:!1},this.BVH=new XY,this.parser=new BY(this.state,this.BVH),this.subsets=new jY(this.state,this.BVH),this.properties=new VY(this.state),this.types=new HY(this.state),this.hider=new $Y(this.state)}parse(e){try{const t=this;return _.resolve(t.parser.parse(e)).then((function(e){t.state.useJSON?t.disposeMemory():t.types.getAllTypes(),t.hider.processCoordinates(e.modelID);const n=new YY(e.geometry,e.material);return n.setIFCManager(t),n}))}catch(e){return _.reject(e)}}setWasmPath(e){this.state.api.SetWasmPath(e)}applyWebIfcConfig(e){this.state.webIfcSettings=e}useJSONData(e=!0){this.state.useJSON=e,this.disposeMemory()}addModelJSONData(e,t){const n=this.state.models[e];n&&(n.jsonData=t)}disposeMemory(){this.state.api=null,this.state.api=new DY}setupThreeMeshBVH(e,t,n){this.BVH.initializeMeshBVH(e,t,n)}close(e,t){this.state.api.CloseModel(e),t&&t.remove(this.state.models[e].mesh),delete this.state.models[e]}getExpressId(e,t){return this.properties.getExpressId(e,t)}getAllItemsOfType(e,t,n){return this.properties.getAllItemsOfType(e,t,n)}getItemProperties(e,t,n=!1){return this.properties.getItemProperties(e,t,n)}getPropertySets(e,t,n=!1){return this.properties.getPropertySets(e,t,n)}getTypeProperties(e,t,n=!1){return this.properties.getTypeProperties(e,t,n)}getMaterialsProperties(e,t,n=!1){return this.properties.getMaterialsProperties(e,t,n)}getIfcType(e,t){const n=this.state.models[e].types[t];return GY[n]}getSpatialStructure(e){return this.properties.getSpatialStructure(e)}getSubset(e,t){return this.subsets.getSubset(e,t)}removeSubset(e,t,n){this.subsets.removeSubset(e,t,n)}createSubset(e){return this.subsets.createSubset(e)}hideItems(e,t){this.hider.hideItems(e,t)}hideAllItems(e){this.hider.hideAllItems(e)}showItems(e,t){this.hider.showItems(e,t)}showAllItems(e){this.hider.showAllItems(e)}}class ZY extends Lc{constructor(e){super(e),this.ifcManager=new KY}load(e,t,n,r){const i=this,s=new Uc(i.manager);s.setPath(i.path),s.setResponseType("arraybuffer"),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{return _.resolve(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){if("string"==typeof n)throw new Error("IFC files must be given as a buffer!");return _.resolve(i.parse(n)).then((function(e){t(e)}))}),(function(t){r?r(t):console.error(t),i.manager.itemError(e)})))}catch(e){return _.reject(e)}}),n,r)}parse(e){return this.ifcManager.parse(e)}}class JY extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===this.path?su.extractUrlBase(e):this.path,a=new Uc(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(i.parse(n,s))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split("\n");let r={};const i=/\s+/,s={};for(let e=0;e<n.length;e++){let t=n[e];if(t=se(t).call(t),0===t.length||"#"===t.charAt(0))continue;const a=T(t).call(t," ");let o=a>=0?t.substring(0,a):t;o=o.toLowerCase();let l=a>=0?t.substring(a+1):"";if(l=se(l).call(l),"newmtl"===o)r={name:l},s[l]=r;else if("ka"===o||"kd"===o||"ks"===o||"ke"===o){const e=l.split(i,3);r[o]=[O(e[0]),O(e[1]),O(e[2])]}else r[o]=l}const a=new QY(this.resourcePath||t,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(s),a}}class QY{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:0,this.wrap=void 0!==this.options.wrap?this.options.wrap:Ke}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const n in e){const r=e[n],i={};t[n]=i;for(const e in r){let t=!0,n=r[e];const s=e.toLowerCase();switch(s){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(n=[n[0]/255,n[1]/255,n[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===n[0]&&0===n[1]&&0===n[2]&&(t=!1)}t&&(i[s]=n)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,n=this.materialsInfo[e],r={name:e,side:this.side};function i(e,n){if(r[e])return;const i=t.getTextureParams(n,r),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(o=i.url)||""===o?"":/^https?:\/\//i.test(o)?o:a+o));var a,o;j(s).copy(i.scale),s.offset.copy(i.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,"map"!==e&&"emissiveMap"!==e||(s.encoding=St),r[e]=s}for(const e in n){const t=n[e];let s;if(""!==t)switch(e.toLowerCase()){case"kd":r.color=(new cn).fromArray(t).convertSRGBToLinear();break;case"ks":r.specular=(new cn).fromArray(t).convertSRGBToLinear();break;case"ke":r.emissive=(new cn).fromArray(t).convertSRGBToLinear();break;case"map_kd":i("map",t);break;case"map_ks":i("specularMap",t);break;case"map_ke":i("emissiveMap",t);break;case"norm":i("normalMap",t);break;case"map_bump":case"bump":i("bumpMap",t);break;case"map_d":i("alphaMap",t),r.transparent=!0;break;case"ns":r.shininess=O(t);break;case"d":s=O(t),s<1&&(r.opacity=s,r.transparent=!0);break;case"tr":s=O(t),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(r.opacity=1-s,r.transparent=!0)}}return this.materials[e]=new lc(r),this.materials[e]}getTextureParams(e,t){var n;const r={scale:new Xt(1,1),offset:new Xt(0,0)},i=e.split(/\s+/);let s;return s=T(i).call(i,"-bm"),s>=0&&(t.bumpScale=O(i[s+1]),E(i).call(i,s,2)),s=T(i).call(i,"-s"),s>=0&&(r.scale.set(O(i[s+1]),O(i[s+2])),E(i).call(i,s,4)),s=T(i).call(i,"-o"),s>=0&&(r.offset.set(O(i[s+1]),O(i[s+2])),E(i).call(i,s,4)),r.url=se(n=i.join(" ")).call(n),r}loadTexture(e,t,n,r,i){const s=void 0!==this.manager?this.manager:Nc;let a=s.getHandler(e);null===a&&(a=new zc(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);const o=a.load(e,n,r,i);return void 0!==t&&(o.mapping=t),o}}var eX=n(75548);const tX=/^[og]\s*(.+)?/,nX=/^mtllib /,rX=/^usemtl /,iX=/^usemap /,sX=/\s+/,aX=new xn,oX=new xn,lX=new xn,cX=new xn,uX=new xn,hX=new cn;function pX(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const n=this._finalize(!1);var r;n&&(n.inherited||n.groupCount<=0)&&E(r=this.materials).call(r,n.index,1);const i={index:this.materials.length,name:e||"",mtllib:b(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t;const n={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return n.clone=_e(t=this.clone).call(t,n),n}};return this.materials.push(i),i},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--){var n;if(this.materials[e].groupCount<=0)E(n=this.materials).call(n,e,1)}return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){const e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=N(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){const n=N(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){const n=N(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){const r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){const r=this.vertices,i=this.object.geometry.normals;aX.fromArray(r,e),oX.fromArray(r,t),lX.fromArray(r,n),uX.subVectors(lX,oX),cX.subVectors(aX,oX),uX.cross(cX),uX.normalize(),i.push(uX.x,uX.y,uX.z),i.push(uX.x,uX.y,uX.z),i.push(uX.x,uX.y,uX.z)},addColor:function(e,t,n){const r=this.colors,i=this.object.geometry.colors;void 0!==r[e]&&i.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&i.push(r[t+0],r[t+1],r[t+2]),void 0!==r[n]&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){const r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,s,a,o,l){const c=this.vertices.length;let u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),p=this.parseVertexIndex(n,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),void 0!==a&&""!==a){const e=this.normals.length;u=this.parseNormalIndex(a,e),h=this.parseNormalIndex(o,e),p=this.parseNormalIndex(l,e),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(void 0!==r&&""!==r){const e=this.uvs.length;u=this.parseUVIndex(r,e),h=this.parseUVIndex(i,e),p=this.parseUVIndex(s,e),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,r=this.uvs.length;for(let t=0,r=e.length;t<r;t++)this.addVertexLine(this.parseVertexIndex(e[t],n));for(let e=0,n=t.length;e<n;e++)this.addUVLine(this.parseUVIndex(t[e],r))}};return e.startObject("",!1),e}class dX extends Lc{constructor(e){super(e),this.materials=null}load(e,t,n,r){const i=this,s=new Uc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}setMaterials(e){return this.materials=e,this}parse(e){var t;const n=new pX;-1!==T(e).call(e,"\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==T(e).call(e,"\\\n")&&(e=e.replace(/\\\n/g,""));const r=e.split("\n");let i=[];for(let e=0,t=r.length;e<t;e++){var s;const t=eX(s=r[e]).call(s);if(0===t.length)continue;const f=t.charAt(0);if("#"!==f)if("v"===f){const e=t.split(sX);switch(e[0]){case"v":n.vertices.push(O(e[1]),O(e[2]),O(e[3])),e.length>=7?(hX.setRGB(O(e[4]),O(e[5]),O(e[6])).convertSRGBToLinear(),n.colors.push(hX.r,hX.g,hX.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(O(e[1]),O(e[2]),O(e[3]));break;case"vt":n.uvs.push(O(e[1]),O(e[2]))}}else if("f"===f){var a;const e=se(a=I(t).call(t,1)).call(a).split(sX),r=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n.length>0){const e=n.split("/");r.push(e)}}const i=r[0];for(let e=1,t=r.length-1;e<t;e++){const t=r[e],s=r[e+1];n.addFace(i[0],t[0],s[0],i[1],t[1],s[1],i[2],t[2],s[2])}}else if("l"===f){var o;const e=se(o=t.substring(1)).call(o).split(" ");let r=[];const i=[];if(-1===T(t).call(t,"/"))r=e;else for(let t=0,n=e.length;t<n;t++){const n=e[t].split("/");""!==n[0]&&r.push(n[0]),""!==n[1]&&i.push(n[1])}n.addLineGeometry(r,i)}else if("p"===f){var l;const e=se(l=I(t).call(t,1)).call(l).split(" ");n.addPointGeometry(e)}else if(null!==(i=tX.exec(t))){var c,u,h;const e=I(c=" "+se(u=I(h=i[0]).call(h,1)).call(u)).call(c,1);n.startObject(e)}else if(rX.test(t)){var p;n.object.startMaterial(se(p=t.substring(7)).call(p),n.materialLibraries)}else if(nX.test(t)){var d;n.materialLibraries.push(se(d=t.substring(7)).call(d))}else if(iX.test(t))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===f){if(i=t.split(" "),i.length>1){var m;const e=se(m=i[1]).call(m).toLowerCase();n.object.smooth="0"!==e&&"off"!==e}else n.object.smooth=!0;const e=n.object.currentMaterial();e&&(e.smooth=n.object.smooth)}else{if("\0"===t)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+t+'"')}}n.finalize();const f=new io;f.materialLibraries=ye(t=[]).call(t,n.materialLibraries);if(!0===!(1===n.objects.length&&0===n.objects[0].geometry.vertices.length))for(let e=0,t=n.objects.length;e<t;e++){const t=n.objects[e],r=t.geometry,i=t.materials,s="Line"===r.type,a="Points"===r.type;let o=!1;if(0===r.vertices.length)continue;const l=new Kr;l.setAttribute("position",new zr(r.vertices,3)),r.normals.length>0&&l.setAttribute("normal",new zr(r.normals,3)),r.colors.length>0&&(o=!0,l.setAttribute("color",new zr(r.colors,3))),!0===r.hasUVIndices&&l.setAttribute("uv",new zr(r.uvs,2));const c=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],r=t.name+"_"+t.smooth+"_"+o;let l=n.materials[r];if(null!==this.materials)if(l=this.materials.create(t.name),!s||!l||l instanceof Fo){if(a&&l&&!(l instanceof Xo)){const e=new Xo({size:10,sizeAttenuation:!1});Lr.prototype.copy.call(e,l),e.color.copy(l.color),e.map=K(l),l=e}}else{const e=new Fo;Lr.prototype.copy.call(e,l),e.color.copy(l.color),l=e}void 0===l&&(l=s?new Fo:a?new Xo({size:1,sizeAttenuation:!1}):new lc,l.name=t.name,l.flatShading=!t.smooth,l.vertexColors=o,n.materials[r]=l),c.push(l)}let u;if(c.length>1){for(let e=0,t=i.length;e<t;e++){const t=i[e];l.addGroup(t.groupStart,t.groupCount,e)}u=s?new Wo(l,c):a?new Qo(l,c):new mi(l,c)}else u=s?new Wo(l,c[0]):a?new Qo(l,c[0]):new mi(l,c[0]);u.name=t.name,f.add(u)}else if(n.vertices.length>0){const e=new Xo({size:1,sizeAttenuation:!1}),t=new Kr;t.setAttribute("position",new zr(n.vertices,3)),n.colors.length>0&&void 0!==n.colors[0]&&(t.setAttribute("color",new zr(n.colors,3)),e.vertexColors=!0);const r=new Qo(t,e);f.add(r)}return f}}const mX=new cn;class fX extends Lc{constructor(e){super(e),this.propertyNameMapping={}}load(e,t,n,r){const i=this,s=new Uc(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}setPropertyNameMapping(e){this.propertyNameMapping=e}parse(e){function t(e){let t="",n=0;const r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/.exec(e);null!==r&&(t=r[1],n=new Blob([r[0]]).size);const i={comments:[],elements:[],headerLength:n,objInfo:""},s=t.split(/\r\n|\r|\n/);let a;function o(e,t){const n={type:e[0]};return"list"===n.type?(n.name=e[3],n.countType=e[1],n.itemType=e[2]):n.name=e[1],n.name in t&&(n.name=t[n.name]),n}for(let e=0;e<s.length;e++){let t=s[e];if(t=se(t).call(t),""===t)continue;const n=t.split(/\s+/),r=n.shift();switch(t=n.join(" "),r){case"format":i.format=n[0],i.version=n[1];break;case"comment":i.comments.push(t);break;case"element":void 0!==a&&i.elements.push(a),a={},a.name=n[0],a.count=N(n[1]),a.properties=[];break;case"property":a.properties.push(o(n,u.propertyNameMapping));break;case"obj_info":i.objInfo=t;break;default:console.log("unhandled",r,n)}}return void 0!==a&&i.elements.push(a),i}function n(e,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return N(e);case"float":case"double":case"float32":case"float64":return O(e)}}function r(e,t){const r=t.split(/\s+/),i={};for(let t=0;t<e.length;t++)if("list"===e[t].type){const s=[],a=n(r.shift(),e[t].countType);for(let i=0;i<a;i++)s.push(n(r.shift(),e[t].itemType));i[e[t].name]=s}else i[e[t].name]=n(r.shift(),e[t].type);return i}function i(e,t){const n={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]};let i;let o="";null!==(i=/end_header\s([\s\S]*)$/.exec(e))&&(o=i[1]);const l=o.split(/\r\n|\r|\n/);let c=0,u=0;for(let e=0;e<l.length;e++){let i=l[e];if(i=se(i).call(i),""===i)continue;u>=t.elements[c].count&&(c++,u=0);const s=r(t.elements[c].properties,i);a(n,t.elements[c].name,s),u++}return s(n)}function s(e){let t=new Kr;return e.indices.length>0&&t.setIndex(e.indices),t.setAttribute("position",new zr(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new zr(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new zr(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new zr(e.colors,3)),e.faceVertexUvs.length>0&&(t=t.toNonIndexed(),t.setAttribute("uv",new zr(e.faceVertexUvs,2))),t.computeBoundingSphere(),t}function a(e,t,n){function r(e){for(let t=0,r=e.length;t<r;t++){const r=e[t];if(r in n)return r}return null}const i=r(["x","px","posx"])||"x",s=r(["y","py","posy"])||"y",a=r(["z","pz","posz"])||"z",o=r(["nx","normalx"]),l=r(["ny","normaly"]),c=r(["nz","normalz"]),u=r(["s","u","texture_u","tx"]),h=r(["t","v","texture_v","ty"]),p=r(["red","diffuse_red","r","diffuse_r"]),d=r(["green","diffuse_green","g","diffuse_g"]),m=r(["blue","diffuse_blue","b","diffuse_b"]);if("vertex"===t)e.vertices.push(n[i],n[s],n[a]),null!==o&&null!==l&&null!==c&&e.normals.push(n[o],n[l],n[c]),null!==u&&null!==h&&e.uvs.push(n[u],n[h]),null!==p&&null!==d&&null!==m&&(mX.setRGB(n[p]/255,n[d]/255,n[m]/255).convertSRGBToLinear(),e.colors.push(mX.r,mX.g,mX.b));else if("face"===t){const t=n.vertex_indices||n.vertex_index,r=n.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),r&&6===r.length&&(e.faceVertexUvs.push(r[0],r[1]),e.faceVertexUvs.push(r[2],r[3]),e.faceVertexUvs.push(r[4],r[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3]))}}function o(e,t,n,r){switch(n){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,r),2];case"uint16":case"ushort":return[e.getUint16(t,r),2];case"int32":case"int":return[e.getInt32(t,r),4];case"uint32":case"uint":return[e.getUint32(t,r),4];case"float32":case"float":return[e.getFloat32(t,r),4];case"float64":case"double":return[e.getFloat64(t,r),8]}}function l(e,t,n,r){const i={};let s,a=0;for(let l=0;l<n.length;l++)if("list"===n[l].type){const c=[];s=o(e,t+a,n[l].countType,r);const u=s[0];a+=s[1];for(let i=0;i<u;i++)s=o(e,t+a,n[l].itemType,r),c.push(s[0]),a+=s[1];i[n[l].name]=c}else s=o(e,t+a,n[l].type,r),i[n[l].name]=s[0],a+=s[1];return[i,a]}let c;const u=this;if(e instanceof ArrayBuffer){const n=su.decodeText(new Uint8Array(e)),r=t(n);c="ascii"===r.format?i(n,r):function(e,t){const n={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},r="binary_little_endian"===t.format,i=new DataView(e,t.headerLength);let o,c=0;for(let e=0;e<t.elements.length;e++)for(let s=0;s<t.elements[e].count;s++){o=l(i,c,t.elements[e].properties,r),c+=o[1];const s=o[0];a(n,t.elements[e].name,s)}return s(n)}(e,r)}else c=i(e,t(e));return c}}let gX;!function(e){e[e.NULL=0]="NULL",e[e.POINT=1]="POINT",e[e.POLYLINE=3]="POLYLINE",e[e.POLYGON=5]="POLYGON"}(gX||(gX={}));class _X{parse(e){var t={},n=new DataView(e),r=0;if(t.fileCode=n.getInt32(r,!1),9994!=t.fileCode)throw new Error("Unknown file code: "+t.fileCode);for(r+=24,t.wordLength=n.getInt32(r,!1),t.byteLength=2*t.wordLength,r+=4,t.version=n.getInt32(r,!0),r+=4,t.shapeType=n.getInt32(r,!0),r+=4,t.minX=n.getFloat64(r,!0),t.minY=n.getFloat64(r+8,!0),t.maxX=n.getFloat64(r+16,!0),t.maxY=n.getFloat64(r+24,!0),t.minZ=n.getFloat64(r+32,!0),t.maxZ=n.getFloat64(r+40,!0),t.minM=n.getFloat64(r+48,!0),t.maxM=n.getFloat64(r+56,!0),r+=64,t.records=[];r<t.byteLength;){var i={};i.number=n.getInt32(r,!1),r+=4,i.length=n.getInt32(r,!1),r+=4;try{i.shape=this.parseShape(n,r,i.length)}catch(e){console.log(e,i)}r+=2*i.length,t.records.push(i)}return t}parseShape(e,t,n){var r=0,i=null,s={};switch(s.type=e.getInt32(t,!0),t+=4,s.type){case gX.NULL:break;case gX.POINT:s.content={x:e.getFloat64(t,!0),y:e.getFloat64(t+8,!0)};break;case gX.POLYLINE:case gX.POLYGON:for(i=s.content={minX:e.getFloat64(t,!0),minY:e.getFloat64(t+8,!0),maxX:e.getFloat64(t+16,!0),maxY:e.getFloat64(t+24,!0),parts:new Int32Array(e.getInt32(t+32,!0)),points:new Float64Array(2*e.getInt32(t+36,!0))},t+=40,r=0;r<i.parts.length;r++)i.parts[r]=e.getInt32(t,!0),t+=4;for(r=0;r<i.points.length;r++)i.points[r]=e.getFloat64(t,!0),t+=8;break;case 8:case 11:case 13:case 15:case 18:case 21:case 23:case 25:case 28:case 31:throw new Error("Shape type not supported: "+s.type+":"+ +s.type);default:throw new Error("Unknown shape type at "+(t-4)+": "+s.type)}return s}}class vX{constructor(e){gh(this,"buffer",void 0),gh(this,"u8",void 0),this.buffer=e,this.u8=new Uint8Array(e)}getBit(e){var t=7&e;return(this.u8[e>>3]&128>>t)>>7-t}setBit(e,t){var n=e>>3,r=this.u8[n],i=7&e;this.u8[n]=t?r|128>>i:r&~(128>>i)}getInt12(e){var t=e/8|0,n=this.u8[t],r=this.u8[t+1],i=this.u8[t+2],s=e%8,a=8-s,o=Math.min(12-a,8);return(((n&=~(255<<a))<<16)+((r&=255<<8-o)<<8)+(i&=255<<8-Math.max(12-a-o,0))>>12-s)-2048}setInt12(e,t){var n=e/8|0,r=e%8,i=(t+=2048)<<12-r,s=(16711680&i)>>16,a=(65280&i)>>8,o=255&i,l=8-r,c=Math.min(12-l,8),u=Math.max(12-l-c,0),h=255<<l;this.u8[n]=(this.u8[n]&h)+s;var p=~(255<<8-c);this.u8[n+1]=(this.u8[n+1]&p)+a;var d=~(255<<8-u);this.u8[n+2]=(this.u8[n+2]&d)+o}getInt6(e){var t=e/8|0,n=this.u8[t],r=this.u8[t+1],i=e%8,s=8-i;return(((n&=~((255<<s)+(255>>8-(2-i))))<<8)+(r&=255<<8-Math.max(6-s,0))>>10-i)-32}setInt6(e,t){var n=e/8|0,r=e%8,i=(t+=32)<<10-r,s=(65280&i)>>8,a=255&i,o=8-r,l=Math.max(6-o,0),c=(255<<o)+(255>>8-(2-r));this.u8[n]=(this.u8[n]&c)+s;var u=~(255<<8-l);this.u8[n+1]=(this.u8[n+1]&u)+a}test(){var e,t,n=new ArrayBuffer(3),r=new vX(n);for(t=0;t<12;t++)for(e=-2048;e<2048;e++)if(r.setInt12(t,e),r.getInt12(t)!=e){console.log("12-bit prob at",t,e),console.log("expected",e,"got",r.getInt12(t));break}for(t=0;t<18;t++)for(e=-32;e<32;e++)if(r.setInt6(t,e),r.getInt6(t)!=e){console.log("6-bit prob at",t,e),console.log("expected",e,"got",r.getInt6(t));break}return r}}class yX{constructor(){gh(this,"LINE_MATERIAL",new Fo({color:0,linewidth:2,opacity:.8,transparent:!0})),gh(this,"MESH_MATERIAL",new kr({color:1926655,opacity:.8,transparent:!0}))}createModel(e){for(var t=[],n=[],r=0;r<e.records.length;r++){var i=e.records[r].shape;if(i.type===gX.POLYLINE||i.type===gX.POLYGON)for(var s=i.content.points,a=i.content.parts,o=0;o<a.length;o++){const e=[];for(var l=a[o],c=a[o+1]||s.length/2;l<c;l++){var u=s[2*l],h=s[2*l+1];e.push(new xn(u,h,0))}if(i.type===gX.POLYGON){const r=Jl.triangulateShape(e,[]),i=[];ge()(r).call(r,(e=>i.push(...e)));const s=new Kr;s.setFromPoints(e),s.setIndex(i),t.push(s);const a=new Kr;e.length>2&&!e[0].equals(e[e.length-1])&&e.push(e[0]),a.setFromPoints(e),n.push(a)}else{const t=new Kr;t.setFromPoints(e),n.push(t)}}}var p=new Tr;for(r=0;r<n.length;r++)p.add(new Vo(n[r],this.LINE_MATERIAL));for(r=0;r<t.length;r++)p.add(new mi(t[r],this.MESH_MATERIAL));return console.log("parsed",t.length,n.length),p}loadCompressed(e){for(var t=this.deltaDecode6(e),n=[],r=[],i=0;i<t.length;i++){let e=[];if(-32768!==t[i]){var s=180*t[i]/32767,a=180*t[i+1]/32767;i++,e.push(new xn(s,a,0))}else{for(var o=[],l=1;l<e.length;l++)e[l-1].x==e[l].x&&e[l-1].y==e[l].y||o.push(e[l]);const t=new Kr;t.setFromPoints(o),n.push(t),e=[]}}var c=new Tr;for(i=0;i<r.length;i++)c.add(new Vo(r[i],this.LINE_MATERIAL));for(i=0;i<n.length;i++)c.add(new mi(n[i],this.MESH_MATERIAL));return console.log("parsed compressed",n.length,r.length),c}compress(e){for(var t=[],n=0;n<e.records.length;n++){var r=e.records[n].shape;if(r.type===gX.POLYGON)for(var i=r.content.points,s=r.content.parts,a=0;a<s.length;a++){for(var o=s[a],l=s[a+1]||i.length/2;o<l;o++){var c=i[2*o],u=i[2*o+1];t.push(c/180*32767,u/180*32767)}t.push(-32768)}}var h=new Int16Array(t);console.log("16-bit quantized byteLength",h.buffer.byteLength);var p=this.deltaEncode6(h);return console.log("delta-encoded byteLength",p.byteLength),p}deltaEncode(e){for(var t=[],n=[],r=[],i=0,s=0,a=0,o=0;o<e.length;o++)-32768!=e[o]?0==r.length?(i=e[o],s=e[o+1],r.push(i,s),a+=4,o++):Math.abs(i-e[o])>1023||Math.abs(s-e[o+1])>1023?(n.push(r),a+=1,r=[],i=e[o],s=e[o+1],r.push(i,s),a+=4,o++):(r.push((e[o]-i)/8,(e[o+1]-s)/8),i+=8*((e[o]-i)/8|0),s+=8*((e[o+1]-s)/8|0),a+=2,o++):(n.push(r),t.push(n),n=[],r=[],a+=3);return this.storeDeltas(a,t)}deltaEncode6(e){var t=[],n=[],r=[],i=0,s=0,a=0,o=0;for(a=0;a<e.length;a++)e[a]=0|e[a]/16;for(a=0;a<e.length;a++)-2048!==e[a]?0==r.length?(i=e[a],s=e[a+1],r.push(i,s),o+=4,a++):Math.abs(i-e[a])>31||Math.abs(s-e[a+1])>31?(n.push(r),o+=1,r=[],i=e[a],s=e[a+1],r.push(i,s),o+=4,a++):(r.push(e[a]-i,e[a+1]-s),i+=e[a]-i,s+=e[a+1]-s,o+=2,a++):(n.push(r),t.push(n),n=[],r=[],o+=3);return this.storeDeltas6(o,t)}storeDeltas(e,t){for(var n=new ArrayBuffer(e),r=new DataView(n),i=0,s=0;s<t.length;s++){for(var a=t[s],o=0;o<a.length;o++){var l=a[o];r.setInt16(i,l[0]),i+=2,r.setInt16(i,l[1]),i+=2;for(var c=2;c<l.length;c++)r.setInt8(i++,l[c]);r.setInt8(i,-128),i+=1}r.setInt16(i,-32768),i+=2}return n}deltaDecode(e){for(var t=new DataView(e),n=0,r=[];n<e.byteLength;){var i=t.getInt16(n);if(n+=2,-32768!==i){var s=t.getInt16(n);for(n+=2,r.push(i,s);n<e.byteLength;){var a=t.getInt8(n);if(n++,-128==a)break;var o=t.getInt8(n);n++,i+=8*a,s+=8*o,r.push(i,s)}}else r.push(-32768)}return r}storeDeltas6(e,t){for(var n=new ArrayBuffer(Math.ceil(.75*e)+4),r=new vX(n),i=32,s=0;s<t.length;s++){for(var a=t[s],o=0;o<a.length;o++){var l=a[o];r.setInt12(i,l[0]),i+=12,r.setInt12(i,l[1]),i+=12;for(var c=2;c<l.length;c++)r.setInt6(i,l[c]),i+=6;r.setInt6(i,-32),i+=6}r.setInt12(i,-2048),i+=12}return new DataView(n).setUint32(0,i),n}deltaDecode6(e){for(var t=new DataView(e).getUint32(0),n=new vX(e),r=32,i=[];r<t;){var s=n.getInt12(r);if(r+=12,-2048!==s){var a=n.getInt12(r);for(r+=12,i.push(s,a);r<t;){var o=n.getInt6(r);if(r+=6,-32===o)break;var l=n.getInt6(r);r+=6,s+=o,a+=l,i.push(s,a)}}else i.push(-2048)}for(var c=0;c<i.length;c++)i[c]*=16;return i}}class bX{load(e,t,n,r){try{const i=this;i.updateProgress(n,0);const s=new XMLHttpRequest;return s.responseType="arraybuffer",s.onload=()=>{i.updateProgress(n,50);const e=(new _X).parse(s.response),r=(new yX).createModel(e);i.updateProgress(n,99),t(r)},s.onerror=r,s.open("GET",e),s.send(null),v().resolve()}catch(e){return v().reject(e)}}updateProgress(e,t){if(e){e(new ProgressEvent("progress",{lengthComputable:!0,loaded:t,total:100}))}}}class xX extends Lc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Uc(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){function t(e,t,n){for(let r=0,i=e.length;r<i;r++)if(e[r]!==t.getUint8(n+r))return!1;return!0}const n=function(e){if("string"==typeof e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}(e);return function(e){const n=new DataView(e);if(84+50*n.getUint32(80,!0)===n.byteLength)return!0;const r=[115,111,108,105,100];for(let e=0;e<5;e++)if(t(r,n,e))return!1;return!0}(n)?function(e){const t=new DataView(e),n=t.getUint32(80,!0);let r,i,s,a,o,l,c,u,h=!1;for(let e=0;e<70;e++)1129270351==t.getUint32(e,!1)&&82==t.getUint8(e+4)&&61==t.getUint8(e+5)&&(h=!0,a=new Float32Array(3*n*3),o=t.getUint8(e+6)/255,l=t.getUint8(e+7)/255,c=t.getUint8(e+8)/255,u=t.getUint8(e+9)/255);const p=new Kr,d=new Float32Array(3*n*3),m=new Float32Array(3*n*3);for(let e=0;e<n;e++){const n=84+50*e,u=t.getFloat32(n,!0),p=t.getFloat32(n+4,!0),f=t.getFloat32(n+8,!0);if(h){const e=t.getUint16(n+48,!0);0==(32768&e)?(r=(31&e)/31,i=(e>>5&31)/31,s=(e>>10&31)/31):(r=o,i=l,s=c)}for(let o=1;o<=3;o++){const l=n+12*o,c=3*e*3+3*(o-1);d[c]=t.getFloat32(l,!0),d[c+1]=t.getFloat32(l+4,!0),d[c+2]=t.getFloat32(l+8,!0),m[c]=u,m[c+1]=p,m[c+2]=f,h&&(a[c]=r,a[c+1]=i,a[c+2]=s)}}return p.setAttribute("position",new Br(d,3)),p.setAttribute("normal",new Br(m,3)),h&&(p.setAttribute("color",new Br(a,3)),p.hasColors=!0,p.alpha=u),p}(n):function(e){const t=new Kr,n=/solid([\s\S]*?)endsolid/g,r=/facet([\s\S]*?)endfacet/g;let i=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,a=new RegExp("vertex"+s+s+s,"g"),o=new RegExp("normal"+s+s+s,"g"),l=[],c=[],u=new xn;let h,p=0,d=0,m=0;for(;null!==(h=n.exec(e));){d=m;const e=h[0];for(;null!==(h=r.exec(e));){let e=0,t=0;const n=h[0];for(;null!==(h=o.exec(n));)u.x=O(h[1]),u.y=O(h[2]),u.z=O(h[3]),t++;for(;null!==(h=a.exec(n));)l.push(O(h[1]),O(h[2]),O(h[3])),c.push(u.x,u.y,u.z),e++,m++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}const n=d,s=m-d;t.addGroup(n,s,p),p++}return t.setAttribute("position",new zr(l,3)),t.setAttribute("normal",new zr(c,3)),t}("string"!=typeof(r=e)?su.decodeText(new Uint8Array(r)):r);var r}}class TX{constructor(){gh(this,"gltfLoader",void 0),gh(this,"font",void 0)}loadLocalModel(e,t,n){try{const r=this,i=t.toLowerCase();return vp()(i).call(i,"fbx")?v().resolve(r.loadFbx(e,n)):vp()(i).call(i,"obj")?v().resolve(r.loadObj(e,n)):vp()(i).call(i,"stl")?v().resolve(r.loadStl(e,n)):vp()(i).call(i,"ifc")?v().resolve(r.loadIfc(e,n)):vp()(i).call(i,"shp")?v().resolve(r.loadShp(e,n)):vp()(i).call(i,"dae")?v().resolve(r.loadDae(e,n)):vp()(i).call(i,"dxf")?v().resolve(r.loadDxf(e,n)):vp()(i).call(i,"jpg")||vp()(i).call(i,"jpeg")||vp()(i).call(i,"png")?v().resolve(r.loadImage(e,n)):v().resolve(r.loadGltf(e,n))}catch(e){return v().reject(e)}}loadModel(e,t,n){try{const r=this,i=e;if(!i)return v().resolve();let s=(null==t?void 0:t.toLowerCase())||"";if(!s){const e=i.split("?")[0].toLowerCase();if(e){const t=Ce()(e).call(e,".");-1!==t&&(s=M()(e).call(e,t+1))}}return vp()(s).call(s,"fbx")?v().resolve(r.loadFbx(i,n)):vp()(s).call(s,"obj")?v().resolve(r.loadObj(i,n)):vp()(s).call(s,"stl")?v().resolve(r.loadStl(i,n)):vp()(s).call(s,"ifc")?v().resolve(r.loadIfc(i,n)):vp()(s).call(s,"shp")?v().resolve(r.loadShp(i,n)):vp()(s).call(s,"dae")?v().resolve(r.loadDae(i,n)):vp()(s).call(s,"dxf")?v().resolve(r.loadDxf(i,n)):vp()(s).call(s,"jpg")||vp()(s).call(s,"jpeg")||vp()(s).call(s,"png")?v().resolve(r.loadImage(i,n)):v().resolve(r.loadGltf(i,n))}catch(e){return v().reject(e)}}loadGltf(e,t){try{const n=this.getGltfLoader();return-1!==w()(e).call(e,"#")&&console.warn(`[LoadingHelper] '#' is not allowed in filename ${e}`),e=e.replace(/#/g,encodeURIComponent("#")),v().resolve(n.loadAsync(e,t)).then((function(e){return v().resolve(e.scene)}))}catch(e){return v().reject(e)}}parseGltf(e,t,n,r){return this.getGltfLoader().parse(e,t,(e=>n(e.scene)),r)}loadFbx(e,t){try{const n=new VI;return v().resolve(n.loadAsync(e,t)).then(v().resolve)}catch(e){return v().reject(e)}}loadObj(e,t){try{const n=new dX,r=new JY,i=e.replace(".obj",".mtl");return v().resolve(r.loadAsync(i,t)).then((function(r){return r.preload(),n.setMaterials(r),v().resolve(n.loadAsync(e,t)).then(v().resolve)}))}catch(e){return v().reject(e)}}loadStl(e,t){try{const n=new xX;return v().resolve(n.loadAsync(e,t)).then((function(e){return v().resolve(new mi(e))}))}catch(e){return v().reject(e)}}loadIfc(e,t){try{const n=new ZY,r=n.ifcManager;return r&&"function"==typeof r.setWasmPath&&r.setWasmPath("../three/js/libs/ifc/"),v().resolve(n.loadAsync(e,t)).then((function(e){return v().resolve(e.mesh)}))}catch(e){return v().reject(e)}}loadShp(e,t){try{const n=new bX;return v().resolve(new(v())(((r,i)=>{n.load(e,(e=>{r(e)}),t,(e=>{i(e)}))})))}catch(e){return v().reject(e)}}loadDae(e,t){try{const n=new Zb;return v().resolve(n.loadAsync(e,t)).then((function(e){return v().resolve(e.scene)}))}catch(e){return v().reject(e)}}loadDxf(e,t){try{this.font||console.warn("[LoadingHelper] Should set font first!");const n=new pE;return v().resolve(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return v().resolve(n.loadAsync(e,t)).then((function(e){return v().resolve(e.threejsObject)}))}),(function(){const e=new ErrorEvent("");return v().reject(e)})))}catch(e){return v().reject(e)}}loadPly(e,t){try{const n=new fX;return v().resolve(n.loadAsync(e,t)).then((function(e){return v().resolve(new mi(e))}))}catch(e){return v().reject(e)}}loadImage(e,t){try{const n=new zc;return v().resolve(n.loadAsync(e,t)).then((function(e){if(!e)return v().reject("Failed to load image!");const t=e.image;let n=t&&t.height||10,r=t&&t.width||10;n*=10/r,r=10;const i=new kr({map:e,side:2,transparent:!0}),s=new ki(r,n),a=new mi(s,i);return v().resolve(a)}))}catch(e){return v().reject(e)}}loadDxfDataAsync(e,t,n,r,i){try{var s;const a=this;function o(r){return l.load(e,t,n)}a.font||console.warn("[LoadingHelper] Should set font first!");const l=new pE(i);l.setFont(a.font),l.manager.onLoad=()=>{r&&r()};const c=a.font.getFontData;return v().resolve(c?v().resolve(null===(s=a.font)||void 0===s?void 0:s.getFontData()).then(o):o())}catch(u){return v().reject(u)}}setFont(e){this.font=e}getGltfLoader(){if(!this.gltfLoader){this.gltfLoader=new lM;const e=new Qb;e.setDecoderPath("three/js/libs/draco/gltf/"),this.gltfLoader.setDRACOLoader(e)}return this.gltfLoader}}function wX(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function EX(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=wX(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=wX(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}class SX extends bv{constructor(e,t){super(),gh(this,"timer",Yh()()),gh(this,"translate",this.initLocalization()),gh(this,"container",void 0),gh(this,"camera",void 0),gh(this,"scene",this.initScene()),gh(this,"renderer",void 0),gh(this,"enableSVGRenderer",!0),gh(this,"svgRenderer",void 0),gh(this,"ambientLight",void 0),gh(this,"directionalLight",void 0),gh(this,"hemisphereLight",void 0),gh(this,"controls",void 0),gh(this,"selectedObject",void 0),gh(this,"groundGrid",void 0),gh(this,"grassGround",void 0),gh(this,"sceneBackgroundColor",new cn(15463159)),gh(this,"skyOfGradientRamp",void 0),gh(this,"stats",void 0),gh(this,"loadedModels",{}),gh(this,"pmremGenerator",void 0),gh(this,"perspectiveCamera",void 0),gh(this,"orthoCamera",void 0),gh(this,"perspectiveCameraControls",void 0),gh(this,"orthoCameraConrols",void 0),gh(this,"composerRenderEnabled",!0),gh(this,"composerEnabled",!1),gh(this,"composer",void 0),gh(this,"renderPass",void 0),gh(this,"effectFxaaPass",void 0),gh(this,"ssaoPass",void 0),gh(this,"saoPass",void 0),gh(this,"outlinePass",void 0),gh(this,"ssaaRenderPass",void 0),gh(this,"bloomPass",void 0),gh(this,"unrealBloomPass",void 0),gh(this,"height",0),gh(this,"width",0),gh(this,"raycaster",void 0),gh(this,"cameraUpdateInterval",void 0),gh(this,"savedMaterialsForOpacity",[]),gh(this,"mouseMoved",!1),gh(this,"mouseDoubleClicked",!1),gh(this,"section",void 0),gh(this,"sectionMode",void 0),gh(this,"measurementManager",void 0),gh(this,"datGui",void 0),gh(this,"webcam",void 0),gh(this,"webcamPlane",void 0),gh(this,"raf",new Mb),gh(this,"renderEnabled",!0),gh(this,"svgRenderEnabled",!0),gh(this,"timeoutSymbol",void 0),gh(this,"isFrustumInsectChecking",!1),gh(this,"lastFrameExecuteTime",Yh()()),gh(this,"maxFps",60),gh(this,"events",[]),gh(this,"settings",A_),gh(this,"spinner",void 0),gh(this,"jobCount",0),gh(this,"rootHtmlElement",void 0),gh(this,"contextMenu",void 0),gh(this,"navCube",void 0),gh(this,"axes",void 0),gh(this,"axesInScene",void 0),gh(this,"twoDModelCount",0),gh(this,"vertexNormalsHelpers",void 0),gh(this,"toolbar",void 0),gh(this,"bottomBar",void 0),gh(this,"bimViewerCfg",void 0),gh(this,"bbox",new En),gh(this,"cameraCfg",void 0),gh(this,"onResize",(()=>{var e;const t=null===(e=this.renderer)||void 0===e?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)})),gh(this,"enableRender",((e=1e3)=>{this.renderEnabled=!0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.timeoutSymbol=this.raf.setTimeout((()=>{this.renderEnabled=!1,this.composerRenderEnabled=!0}),e))})),gh(this,"enableSVGRender",((e=1e3)=>{this.svgRenderEnabled=!0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.timeoutSymbol=this.raf.setTimeout((()=>{this.svgRenderEnabled=!1}),e))})),gh(this,"applyOptionsAndAddToScene",((e,t,n)=>{im.info(`[BimViewer] '${e}' is loaded in ${(Yh()()-this.timer)/1e3}s, adding to scene...`),this.timer=Yh()();const r=n.src&&n.src.toLowerCase();if(r&&vp()(r).call(r,"dxf")&&this.twoDModelCount++,n.matrix&&16===n.matrix.length){const e=new Zn;e.elements=n.matrix,t.applyMatrix4(e)}else{const e=n.position||[0,0,0],r=n.rotation||[0,0,0],i=n.scale||[1,1,1];t.position.set(e[0],e[1],e[2]),t.rotation.set(r[0]*Math.PI/180,r[1]*Math.PI/180,r[2]*Math.PI/180),t.scale.set(i[0],i[1],i[2])}const i=n.instantiate,s=n.merge;i?Re()((()=>{this.instantiate(t),Re()((()=>{s&&this.merge(t),this.addLoadedModelToScene(t,n)}),0)}),0):s?Re()((()=>{this.merge(t),Re()((()=>this.addLoadedModelToScene(t,n)),0)}),0):this.addLoadedModelToScene(t,n)})),this.bimViewerCfg=EX(EX({},mh),e),this.container=this.initContainer(),this.rootHtmlElement=this.initRootHtmlElement(),im.info("[BimViewer]","bimViewerCfg",this.bimViewerCfg),this.width=this.container.clientWidth,this.height=this.container.clientHeight,this.settings=A_,this.cameraCfg=t,this.cameraCfg&&this.cameraCfg.near&&(this.settings.camera.near=this.cameraCfg.near),this.cameraCfg&&this.cameraCfg.far&&(this.settings.camera.far=this.cameraCfg.far),this.increaseJobCount(),this.init(),this.animate(),this.renderer&&this.container.append(this.renderer.domElement),window.addEventListener("resize",this.onResize),window.addEventListener("keyup",(e=>{e.altKey&&"KeyR"===e.code&&this.flyToRandomObject()})),this.decreaseJobCount(),im.info(`[BimViewer] Initialized in ${(Yh()()-this.timer)/1e3}s`)}init(){this.initSpinner(),this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initPointerEvents(),!0===this.bimViewerCfg.enableDatGui&&this.initDatGui(),this.initOthers(),!0===this.bimViewerCfg.enableAxisGizmo&&(this.axes=this.initAxes()),!0===this.bimViewerCfg.enableStats&&(this.stats=this.initStats()),this.bimViewerCfg.enableToolbar&&(this.toolbar=this.initToolbar()),this.bimViewerCfg.enableBottomBar&&(this.bottomBar=this.initBottomBar()),this.bimViewerCfg.enableNavCube&&(this.navCube=this.initNavCube()),this.bimViewerCfg.enableContextMenu&&(this.contextMenu=this.initContextMenu())}initContainer(){const e=document.getElementById(this.bimViewerCfg.containerId);if(!e)return im.error("[BimViewer] containerId:",this.bimViewerCfg.containerId,"is not found in Dom tree! The video will rendered to body"),document.body;const t=document.createElement("div");return t.style.cssText="width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;",e.appendChild(t),t}initScene(){const e=new mo;return e.matrixAutoUpdate=Ih,e}initRenderer(){this.renderer=new ho({antialias:!0,preserveDrawingBuffer:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.renderer.outputEncoding=St,this.renderer.toneMappingExposure=1,this.renderer.physicallyCorrectLights=!0,this.renderer.setClearColor(11119017,1),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=2,this.pmremGenerator=new ts(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.enableSVGRenderer&&(this.svgRenderer=new dh,this.svgRenderer.setSize(this.width,this.height),this.svgRenderer.setClearColor(16777215,0),this.svgRenderer.clear(),this.svgRenderer.domElement.classList.add("svg-renderer"),this.container.appendChild(this.svgRenderer.domElement)),this.setEnvironmentFromDataArray()}initCamera(){this.scene&&(this.perspectiveCamera=new Ti(45,this.width/this.height,this.settings.camera.near,this.settings.camera.far),this.perspectiveCamera.layers.enable(Rh),this.perspectiveCamera.position.set(0,100,0),this.scene.add(this.perspectiveCamera),this.camera=this.perspectiveCamera)}initControls(e=!1){if(!this.renderer)return;C_.printDeviceInfo();const t=e?this.orthoCamera:this.perspectiveCamera;if(!t)return;const n=new wb(t,this.renderer.domElement);n.enableDamping=!0,n.dampingFactor=.5,n.enabled=!0,n.keyPanSpeed=10,n.keys={LEFT:"KeyA",UP:"KeyQ",RIGHT:"KeyD",BOTTOM:"KeyE"},n.listenToKeyEvents(document.body),n.update(),e?this.orthoCameraConrols=n:this.perspectiveCameraControls=n,this.controls=n,this.addEvent(n,"change",this.onControlsChange(this)),this.addEvent(window,"keydown",this.onKeyDown(this))}initRootHtmlElement(){const e=document.createElement("div");return e.id="rootHtmlElement",this.container.appendChild(e),e}onControlsChange(e){return()=>{e.enableRender()}}onKeyDown(e){return t=>{const n=e.camera,r=e.controls;if(!n||!r)return;const i=this.settings.keyboard.sensitivity||3,s=new xn;n.getWorldPosition(s);const a=r.target,o=a.clone();if("ArrowLeft"===t.code||"ArrowRight"===t.code){const e=i;let n=Math.PI*e/180;"ArrowLeft"===t.code&&(n=-n),o.x=(a.x-s.x)*Math.cos(n)-(a.z-s.z)*Math.sin(n)+s.x,o.z=(a.z-s.z)*Math.cos(n)+(a.x-s.x)*Math.sin(n)+s.z,r.target=o,r.update()}else if("ArrowUp"===t.code||"ArrowDown"===t.code){const e=i;let n=Math.PI*e/180;const l=new xn(a.x-s.x,a.y-s.y,a.z-s.z).length(),c=a.y-s.y;"ArrowDown"===t.code&&(n=-n);const u=Math.asin(c/l)+n;if(u<-Math.PI/2||u>Math.PI/2)return;const h=Math.sin(u)*l;o.y=a.y+(h-c),r.target=o,r.update()}else if("KeyW"===t.code){const e=.01*i,t=s.distanceTo(a);t<n.near&&r.target.lerp(s,-n.near/t),s.lerp(a,e),n.position.set(s.x,s.y,s.z)}else if("KeyS"===t.code){const e=.01*i;s.lerp(a,-e),n.position.set(s.x,s.y,s.z)}else if("KeyF"===t.code)this.flyToSelectedObject();else if("KeyT"===t.code){const e=this.getIntersections();if(e.length>0){const t=Se()(e).call(e,(e=>{const t=e.object;return t.visible&&t instanceof mi}));if(t&&t.point&&this.camera&&this.controls){const e=this.camera.position,n=t.point,r=this.controls.target,i=e.distanceTo(n);if(i>this.camera.near&&i<this.camera.far){const t=e.distanceTo(r),n=e.clone().lerp(r,i/t);this.controls.target.set(n.x,n.y,n.z),this.measurementManager&&cm.displayPointMarker(this.measurementManager.scene,n,1e3)}}}}else"KeyY"===t.code&&this.flyTo(s,a.clone().setY(s.y));e.enableRender()}}onPointerUp(e,t){return()=>{if(!e.mouseDoubleClicked){switch(t.button){case Pe:e.handleMouseClick(t);break;case Ne:break;case Le:e.handleRightClick(t)}e.enableRender()}}}initLights(){if(!this.scene)return;const e=16777215,t=new ru(e,.3);t.position.set(-2,2,4),this.directionalLight=t,this.ambientLight=new iu(3158064),this.hemisphereLight=new Hc(e,14540253,3),this.hemisphereLight.position.set(0,300,0),this.scene.add(t),this.scene.add(this.ambientLight),this.scene.add(this.hemisphereLight)}initPointerEvents(){if(!this.renderer||!this.camera||!this.controls)return;let e=-1,t=-1;this.renderer.domElement.addEventListener("pointerdown",(n=>{e=n.x,t=n.y,this.mouseMoved=!1,Re()((()=>{this.dynamicallyUpdateControllerTarget()}),10),this.enableRender()})),this.renderer.domElement.addEventListener("pointermove",(n=>{var r;if(null!==(r=this.measurementManager)&&void 0!==r&&r.isMeasurementActive())this.enableSVGRender();else if(this.section&&this.enableRender(),e>=0&&t>=0){const r=5;(Math.abs(n.x-e)>r||Math.abs(n.y-t)>r)&&(this.mouseMoved=!0)}})),this.renderer.domElement.addEventListener("pointerup",(n=>{var r;this.mouseMoved||this.mouseDoubleClicked||this.section||null!==(r=this.measurementManager)&&void 0!==r&&r.isMeasurementActive()||Re()(this.onPointerUp(this,n),200),this.mouseDoubleClicked&&Re()((()=>{this.mouseDoubleClicked=!1}),200),e=-1,t=-1})),this.renderer.domElement.addEventListener("dblclick",(e=>{var t;this.mouseDoubleClicked=!0,this.mouseMoved||this.section||null!==(t=this.measurementManager)&&void 0!==t&&t.isMeasurementActive()||(this.handleMouseClick(e),this.flyToSelectedObject(),this.enableRender())})),this.raycaster=new gu}initDatGui(){this.datGui=new E_(this),this.datGui.close()}initSpinner(){if(!this.bimViewerCfg.enableSpinner)return;const e=document.createElement("div");e.classList.add("bim-viewer-spinner");const t=document.createElement("div");t.classList.add(Dh,"icon-loading"),e.append(t),this.container.appendChild(e),this.spinner=e,this.setSpinnerVisibility(this.jobCount>0)}initOthers(){const e=this;if(!this.scene||!this.renderer||!this.camera)return;const t=this.datGui&&this.datGui.controls;if(t){if(t.showGroundGrid&&(this.groundGrid=r_.createGroundGrid(),this.scene.add(this.groundGrid)),t.showGrassGround)try{return v().resolve(r_.createGrassGround()).then((function(t){e.grassGround=t,e.scene&&e.scene.add(e.grassGround),e.enableRender()}))}catch(e){v().reject(e)}t.webcam&&this.enableWebCam(),this.composerEnabled=t.composerEnabled,this.composerEnabled&&(this.enableComposer(!0),this.enableRenderPass(t.renderPassEnabled),this.enableFxaaPass(t.fxaaEnabled),this.enableSaoPass(t.saoEnabled),this.enableSsaoPass(t.ssaoEnabled),this.enableOutlinePass(t.outlineEnabled),this.enableSsaaPass(t.ssaaEnabled),this.enableBloomPass(t.bloomEnabled),this.enableUnrealBloomPass(t.unrealBloomEnabled))}im.info(`[BimViewer] WebGL: ${C_.getWebGlRendererInfo(this.renderer.domElement)}`),this.renderer.domElement.style.outlineWidth="0"}initLocalization(){return Xd.init({lng:"cn",debug:!1,resources:{en:{translation:Fm},cn:{translation:Um}}}),Xd.t}initNavCube(){const e=document.createElement("div");e.id="navCube";const t=new hb;return t.renderer&&(e.appendChild(t.renderer.domElement),t.setHostRenderer(this)),this.rootHtmlElement.appendChild(e),t}initAxes(){const e=document.createElement("div");e.classList.add("axesRenderer");const t=new Wf(e,this);return this.rootHtmlElement.append(e),this.axesInScene=new qf(!1),this.scene.add(this.axesInScene),t}initStats(){const e=Kd();e.setMode(0);const t=document.createElement("div");return t.classList.add("statsOutput"),t.appendChild(e.domElement),this.rootHtmlElement.append(t),e}initContextMenu(){const e=new Bm({items:Ff,context:{bimViewer:this,toolbar:this.toolbar,section:this.section},container:this.rootHtmlElement});return window.oncontextmenu=e=>e.preventDefault(),e}initToolbar(){return new yy(this,fp().merge(Sy,this.bimViewerCfg.toolbarMenuConfig))}initBottomBar(){return new VX(this)}get has2dModel(){return this.twoDModelCount>0}showContextMenu(e){if(!this.contextMenu)return;const t=this.getAllIntersections(e);im.log("[BimViewer] showContextMenu intersections = ",t);const n=(0,mp.find)(t,(e=>{const t=e.object;return t instanceof mi&&t.visible})),r=this.contextMenu.context,i=null==n?void 0:n.instanceId,s=null==n?void 0:n.faceIndex;let a;s&&(a=df.getBatchIdByFaceIndex(null==n?void 0:n.object,s)),this.contextMenu.context=EX(EX({},r),{},{hit:null==n?void 0:n.object,instanceId:i,batchId:a}),this.contextMenu.show(e.clientX,e.clientY)}handleRightClick(e){this.showContextMenu(e)}sycnCameraPosition(e,t){const n=e.position;if(t.position.set(n.x,n.y,n.z),this.scene){const e=this.scene.position;t.lookAt(e)}}sycnControls(e,t,n){const r=n,i=e.target;t.center?t.center.set(r.x,r.y,r.z):t.center=r.clone(),t.target.set(i.x,i.y,i.z),t.update()}setToOrthographicCamera(e=!1){if(!this.scene||!this.controls)return;const t=this.perspectiveCamera,n=this.perspectiveCameraControls;let r=this.orthoCamera,i=this.orthoCameraConrols;e?(r||(r=new Wi(-this.width/2,this.width/2,this.height/2,-this.height/2,this.settings.camera.near,this.settings.camera.far),r.layers.enable(Rh),r.position.set(0,100,0),r.zoom=10,r.updateProjectionMatrix(),this.scene&&this.scene.add(r),this.orthoCamera=r),i||(this.initControls(!0),i=this.orthoCameraConrols),t&&(this.sycnCameraPosition(t,r),r.zoom=10,r.updateProjectionMatrix()),n&&i&&this.sycnControls(n,i,r.position),this.camera=r,this.controls=i):(t&&r&&this.sycnCameraPosition(r,t),n&&i&&t&&this.sycnControls(i,n,t.position),this.camera=t,this.controls=n),this.resize()}animate(){var e,t,n,r;if(requestAnimationFrame(ve()(e=this.animate).call(e,this)),this.maxFps>0){if(Yh()()-this.lastFrameExecuteTime<1e3/this.maxFps)return;this.lastFrameExecuteTime=Yh()()}if(this.webcam&&this.webcam.animate(),this.controls&&this.controls.update(),this.scene&&this.camera)if(this.renderEnabled)this.renderer&&this.renderer.render(this.scene,this.camera),this.dispatchEvent("render"),this.svgRenderer&&(null===(r=this.measurementManager)||void 0===r||r.render(this.svgRenderer,this.camera));else if(this.svgRenderEnabled){var i;if(this.svgRenderer)null===(i=this.measurementManager)||void 0===i||i.render(this.svgRenderer,this.camera)}this.composerRenderEnabled&&this.composer&&this.composerEnabled&&(this.composer.render(),this.composerRenderEnabled=!1),this.frustrumCullingByModelBBox(),null===(t=this.stats)||void 0===t||t.update(),null===(n=this.bottomBar)||void 0===n||n.update()}frustrumCullingByModelBBox(){const e=new Pi,t=new Zn;var n;(this.isFrustumInsectChecking=!0,this.camera)&&(t.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),e.setFromProjectionMatrix(t),ge()(n=tp()(this.loadedModels)).call(n,(t=>{const n=this.scene&&this.scene.getObjectById(t.id),r=t.bbox;n&&r&&this.scene&&(void 0===n.userData._visible&&(n.userData._visible=!0,$()(n,{visible:{set:e=>{n.userData._visible=e,this.isFrustumInsectChecking||(n.userData.userConfigVisibility=!0)},get:()=>n.userData._visible}})),void 0===n.userData.userConfigVisibility&&(r.geometry.computeBoundingBox(),r.geometry.boundingBox&&(n.visible=e.intersectsBox(r.geometry.boundingBox))))})));this.isFrustumInsectChecking=!1}destroy(){var e,t;ge()(e=this.events).call(e,(e=>e.node.removeEventListener(e.type,e.func))),this.events=[],this.datGui&&this.datGui.gui&&(this.datGui.beforeDestroy(),this.datGui=void 0);const n=this.webcamPlane;this.scene&&n&&(this.scene.remove(n),n.geometry.dispose(),n.material.dispose(),this.webcamPlane=void 0),this.webcam=void 0,this.camera=void 0,this.composer=void 0,this.renderPass=void 0,this.effectFxaaPass=void 0,this.saoPass=void 0,this.ssaoPass=void 0,this.outlinePass=void 0,this.scene&&this.scene.clear(),this.renderer&&(this.container.removeChild(this.renderer.domElement),this.renderer.clear(),this.renderer.dispose(),this.renderer=void 0),this.ambientLight=void 0,this.directionalLight=void 0,this.hemisphereLight=void 0,this.controls&&(this.controls.dispose(),this.controls=void 0),this.stats=void 0,this.raycaster=void 0,this.selectedObject=void 0,this.groundGrid&&(this.groundGrid.geometry.dispose(),this.groundGrid.material.dispose(),this.groundGrid.clear(),this.groundGrid=void 0),this.grassGround&&(this.grassGround.geometry.dispose(),this.grassGround.material.dispose(),this.grassGround.clear(),this.grassGround=void 0),this.skyOfGradientRamp&&(this.skyOfGradientRamp.geometry.dispose(),this.skyOfGradientRamp.material.dispose(),this.skyOfGradientRamp.clear(),this.skyOfGradientRamp=void 0),this.savedMaterialsForOpacity=void 0,this.section=void 0,this.sectionMode=void 0,ge()(t=Q()(this.loadedModels)).call(t,(e=>{delete this.loadedModels[e]})),this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.raf=void 0),this.contextMenu&&this.contextMenu.destroy(),this.navCube&&this.navCube.dispose(),this.axes&&this.axes.dispose(),this.toolbar&&this.toolbar.destroy(),this.pmremGenerator&&this.pmremGenerator.dispose(),this.container.removeChild(this.rootHtmlElement),window.removeEventListener("resize",this.onResize)}loadLocalModel(e,t,n){try{const r=this,i=new TX;return v().resolve(i.loadLocalModel(e,t.src,n)).then((function(n){return n?(r.applyOptionsAndAddToScene(e,n,t),v().resolve()):v().reject()}))}catch(e){return v().reject(e)}}loadModel(e,t){try{const n=this;n.timer=Yh()(),n.increaseJobCount();const r=new TX;return v().resolve(r.loadModel(e.src,e.fileFormat,t)).then((function(t){return t?(n.applyOptionsAndAddToScene(e.src,t,e),v().resolve()):(n.decreaseJobCount(),v().reject())}))}catch(e){return v().reject(e)}}addLoadedModelToScene(e,t){var n;if(!this.scene)return;e.matrixAutoUpdate=Ih,e.updateMatrix(),e.traverse((e=>{!Ih&&e.matrixAutoUpdate&&(e.matrixAutoUpdate=Ih,e.updateMatrix())})),this.scene.add(e);const r=new Eu(e);r.name="BIM_VIEWER_BOX_HELPER",r.visible=!1,r.matrixAutoUpdate=Ih,r.material&&(r.material=void 0,r.layers.set(Rh));let i=t.modelId||t.src;if(this.loadedModels[i]){let e=1;for(;this.loadedModels[`${i}_${e}`];)e++;i=`${i}_${e}`,im.warn(`[BimViewer] Model '${i}' is loaded more than once!`)}this.loadedModels[i]={id:e.id,bbox:r},this.computeBoundingBox();const s=Z()(n=tp()(this.loadedModels)).call(n,(e=>e.id));if(!s||s.length<=1){if(this.has2dModel)this.setToOrthographicCamera(!0),this.skyOfGradientRamp&&this.scene.remove(this.skyOfGradientRamp);else{const e=this.datGui&&this.datGui.controls;this.regenSkyOfGradientRamp(),e&&e.showGroundGrid&&this.regenGroundGrid()}this.tryAdjustCameraNearAndFar(),this.goToHomeView()}this.scene.add(r),t.edges&&uf.addOutlines(e),this.enableRender(),this.decreaseJobCount(),im.info(`[BimViewer] Added '${t.src}' to scene in ${(Yh()()-this.timer)/1e3}s`)}addOrRemoveObjectOpacity(e=!0,t=.3,n,r){var i;if(this.savedMaterialsForOpacity||(this.savedMaterialsForOpacity=[]),!this.scene)return;const s=this.scene,a=[];ge()(i=Q()(this.loadedModels)).call(i,(i=>{const o=this.loadedModels[i];if(e){this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0&&uf.revertObjectOpacityById(s,o.id,this.savedMaterialsForOpacity);const e=uf.setObjectOpacityById(s,o.id,t,n,r);a.push(...e)}else this.savedMaterialsForOpacity&&uf.revertObjectOpacityById(s,o.id,this.savedMaterialsForOpacity)})),this.savedMaterialsForOpacity=e?a:[],this.enableRender()}hasTransparentObject(){return!!(this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0)}showVertexNormals(e,t=.1){e?(this.vertexNormalsHelpers||(this.vertexNormalsHelpers=new io),this.scene.traverseVisible((e=>{const n=["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"];if(e instanceof mi&&!cp()(n).call(n,e.name)){var r;if(!e.geometry.attributes.normal)return;const n=new Yb(e,t,16711680);null===(r=this.vertexNormalsHelpers)||void 0===r||r.add(n)}})),this.scene.add(this.vertexNormalsHelpers)):this.vertexNormalsHelpers&&(this.scene.remove(this.vertexNormalsHelpers),this.vertexNormalsHelpers=void 0)}resize(e,t){const n=this.camera;n&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,n instanceof Ti?n.aspect=this.width/this.height:n instanceof Wi&&(n.left=-this.width/2,n.right=this.width/2,n.top=this.height/2,n.bottom=-this.height/2),n.updateProjectionMatrix(),this.renderer&&this.renderer.setSize(this.width,this.height),this.composer&&this.composer.setSize(this.width,this.height),this.effectFxaaPass&&this.effectFxaaPass.uniforms.resolution.value.set(1/this.width,1/this.height)),this.enableRender()}getRaycaster(){return this.raycaster}getRaycastableObjectsByMouse(e){let t=[];if(!(this.raycaster&&this.camera&&this.scene&&e))return t;const n=M_.getScreenPointByEvent(e,this.container),r=M_.screenPoint2NdcPoint(n,this.camera,this.container);return this.raycaster.setFromCamera(r,this.camera),t=this.getRaycastableObjects(),t}getRaycastableObjects(){var e;const t=[];return ge()(e=tp()(this.loadedModels)).call(e,(e=>{const n=this.scene&&this.scene.getObjectById(e.id);n&&n.visible&&t.push(n)})),t}getIntersections(e){const t=this.getRaycastableObjectsByMouse(e);if(this.measurementManager){const e=this.measurementManager.getMeasurementsMarkers();t.push(...e)}return this.raycaster&&this.raycaster.intersectObjects(t,!0)||[]}getAllIntersections(e){if(!this.raycaster||!this.camera||!this.scene)return[];let t=new Xt;e&&(t=M_.getScreenPointByEvent(e,this.container));const n=M_.screenPoint2NdcPoint(t,this.camera,this.container);this.raycaster.setFromCamera(n,this.camera);const r=this.scene.children;return this.raycaster.intersectObjects(r,!0)||[]}handleMouseClick(e){var t,n;if(null!==(t=this.measurementManager)&&void 0!==t&&t.isMeasurementActive())return;const r=this.getIntersections(e),i=Se()(r).call(r,(e=>{const t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof mi)}));let s,a,o=i&&i.object||void 0;if(o)if(o instanceof ko)s=i.instanceId,this.selectedObject&&this.selectedObject.id===o.id&&this.selectedObject.userData.instanceId===s&&(o=void 0);else if(df.isMergedMesh(o)){const e=i&&i.faceIndex||-1;e>=0?(a=df.getBatchIdByFaceIndex(o,e),this.selectedObject&&this.selectedObject.id===o.id&&this.selectedObject.userData.batchId===a&&(o=void 0)):o=void 0}else this.selectedObject&&this.selectedObject.id===o.id&&(o=void 0);const l=null===(n=o)||void 0===n?void 0:n.userData.measurementDataId;var c;l&&(null===(c=this.measurementManager)||void 0===c||c.selectMeasurement(l));o?this.selectObject(o,s,a):this.clearSelection()}selectObject(e,t,n,r){if(this.selectedObject){const t=this.selectedObject.userData;if(null!=t.instanceId&&t.originalMatrix&&t.clonedMesh){this.scene&&this.scene.remove(t.clonedMesh);const n=this.selectedObject;if(n.setMatrixAt(t.instanceId,t.originalMatrix),n.instanceMatrix.needsUpdate=!0,n.updateMatrix(),delete t.instanceId,delete t.originalMatrix,e===t.clonedMesh)return t.clonedMesh.geometry.dispose(),delete t.clonedMesh,this.selectedObject=void 0,void(this.outlinePass&&(this.outlinePass.selectedObjects=[]));t.clonedMesh.geometry.dispose(),delete t.clonedMesh}else if(null!=t.batchId&&t.clonedMesh){if(this.scene&&this.scene.remove(t.clonedMesh),delete t.batchId,e===t.clonedMesh)return t.clonedMesh.geometry.dispose(),delete t.clonedMesh,this.selectedObject=void 0,void(this.outlinePass&&(this.outlinePass.selectedObjects=[]));t.clonedMesh.geometry.dispose(),delete t.clonedMesh}else if(t.originalMaterial){if(this.selectedObject.material){const e=this.selectedObject.material;x()(e)?ge()(e).call(e,(e=>e.dispose())):e instanceof Lr&&e.dispose()}this.selectedObject.material=t.originalMaterial,delete t.originalMaterial}this.selectedObject=void 0,this.outlinePass&&(this.outlinePass.selectedObjects=[])}if(this.scene&&e){if(e instanceof ko&&null!=t){const n=e,i=new Zn,s=new Zn;s.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),n.getMatrixAt(t,i),this.selectedObject=e,this.outlinePass&&(this.outlinePass.selectedObjects=[e]);const a=tf.clonedHighlightMaterials(e,{depthTest:r});if(a){const r=new mi(n.geometry.clone(),a);r.applyMatrix4(e.matrixWorld.multiply(i)),r.matrixWorldNeedsUpdate=!0,r.name="Cloned mesh for highlighting";const o=i.clone();o.multiplyMatrices(i,s),n.setMatrixAt(t,o),n.instanceMatrix.needsUpdate=!0,n.updateMatrix(),this.selectedObject.userData.instanceId=t,this.selectedObject.userData.originalMatrix=i,this.selectedObject.userData.clonedMesh=r,this.scene.add(r)}}else if(df.isMergedMesh(e)&&null!=n){const t=df.getBatchByBatchId(e,n);let i=`[BimViewer] Clicked on merged mesh(id: ${e.id}).`;i+=` Original mesh batchId: ${n}, name: ${null==t?void 0:t.name}`,im.info(i);const s=tf.clonedHighlightMaterials(e,{depthTest:r}),a=df.cloneGeometryForBatch(e,t);if(s&&a){const t=new mi(a,s);t.applyMatrix4(e.matrixWorld),t.matrixWorldNeedsUpdate=!0,t.name="Cloned mesh for highlighting",this.selectedObject=e,this.selectedObject.userData.batchId=n,this.selectedObject.userData.clonedMesh=t,this.scene.add(t)}}else{const t=tf.clonedHighlightMaterials(e,{depthTest:r});t&&(this.selectedObject=e,this.selectedObject.userData.originalMaterial=this.selectedObject.material,this.selectedObject.material=t,this.outlinePass&&(this.outlinePass.selectedObjects=[e]))}this.enableRender()}else this.enableRender()}clearSelection(){this.selectObject()}flyToObjects(e){if(!e||0===e.length||!this.camera)return;const t=new xn,n=new xn;l_.getCameraPositionByObjects(e,this.camera,t,n),this.flyTo(t,n)}flyToObject(e){this.flyToObjects([e])}flyToSelectedObject(){if(!this.selectedObject)return;let e=this.selectedObject;(e instanceof ko&&e.userData.clonedMesh||df.isMergedMesh(e)&&e.userData.clonedMesh)&&(e=e.userData.clonedMesh),this.flyToObject(e)}flyToRandomObject(){var e;const t=Z()(e=tp()(this.loadedModels)).call(e,(e=>e.id)),n=t.length;if(n<=0)return;const r=t[Math.floor(Math.random()*n)];if(!this.scene.getObjectById(r))return;const i=[];if(this.scene.traverseVisible((e=>{const t=["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"];(e instanceof mi||e instanceof Vo)&&!cp()(t).call(t,e.name)&&i.push(e.id)})),i.length<1)return;const s=Math.floor(Math.random()*i.length),a=this.scene.getObjectById(i[s]);a&&(im.info(`[BimViewer] Flying to random object: ${a.name}, type: ${a.type}`),this.selectObject(a,void 0,void 0,!0),this.flyToObject(a))}flyTo(e,t,n){const r=this.camera,i=this.controls;if(!r||!i)return;if(e.equals(t))return void im.error("[BimViewer] camera position and lookAt cannot be the same!");if(!cm.isVectorValid(e)||!cm.isVectorValid(t))return void im.error("[BimViewer] invalid position or lookAt!");const s=e.distanceTo(t);s<r.near?(e=e.clone().sub(t).normalize().multiplyScalar(1.1*r.near),im.warn("[BimViewer] camera could be too close to see the object!")):s>r.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*r.far),im.warn("[BimViewer] camera could be too far to see the object!"));const a=(e,t)=>{r.lookAt(t),r.position.set(e.x,e.y,e.z),i.target.set(t.x,t.y,t.z),i.update(),this.enableRender()},o=r.position.clone(),l=i.target.clone(),c=500,u=Yh()();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=dp()((()=>{let r=Yh()()-u;r>c&&(r=c);const i=(e,t,n)=>{const r=e.x+(t.x-e.x)*n,i=e.y+(t.y-e.y)*n,s=e.z+(t.z-e.z)*n;return new xn(r,i,s)},s=i(o,e,r/c),h=i(l,t,r/c);a(s,h),r>=c&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0,n&&n())}),10)}viewFitAll(){const e=new xn,t=new xn;this.scene&&this.camera&&(l_.getCameraPositionByVisibleObject(this.scene,this.camera,e,t),this.flyTo(e,t))}goToHomeView(){const e=this.cameraCfg,t=e&&cm.arrayToVector3(e.eye),n=e&&cm.arrayToVector3(e.look);if(t&&n)this.flyTo(t,n);else if(this.scene){var r;const e=new xn,t=new xn,n=new xn(-1,-.5,-1);if(this.has2dModel){const e=this.bbox.max.x-this.bbox.min.x,t=this.bbox.max.y-this.bbox.min.y,r=this.bbox.max.z-this.bbox.min.z,i=Math.min(e,t,r);e-i<=0?n.set(1,0,0):t-i<=0?n.set(0,-1,0):r-i<=0&&n.set(0,0,-1)}if(l_.getCameraPositionByBboxAndDirection(this.bbox,e,t,null===(r=this.camera)||void 0===r?void 0:r.projectionMatrix,n),this.camera instanceof Wi){const e=this.camera,t=this.bbox,n=t.max.x-t.min.x,r=t.max.z-t.min.z,i=e.right-e.left,s=e.top-e.bottom;e.zoom=Math.max(i,s)/Math.max(n,r),e.zoom/=2,e.updateProjectionMatrix()}e.equals(t)||this.flyTo(e,t)}}tryAdjustCameraNearAndFar(){const e=this.camera;if(!this.scene||!e)return;const t=this.bbox,n=e.near,r=e.far,i=t.max.x-t.min.x,s=t.max.y-t.min.y,a=t.max.z-t.min.z,o=Math.max(i,s,a),l=o/5,c=5*o;if(n>l||r<c){const t=e=>cm.numberToString(e);im.info(`[BimViewer] BBox's longest side is: ${t(o)}`),n>l&&(im.warn(`[BimViewer] camera.near(${t(n)}) shouldn't bigger than ${t(l)}, will change it!`),e.near=l),r<c&&(im.warn(`[BimViewer] camera.far(${t(r)}) shouldn't smaller than ${t(c)}, will change it!`),e.far=c)}if(e instanceof Wi){const t=e.right-e.left,n=e.top-e.bottom;e.zoom=Math.max(t,n)/Math.max(i,a),e.zoom/=2}e.updateProjectionMatrix()}regenSkyOfGradientRamp(){var e;if(!this.scene)return;this.skyOfGradientRamp&&(this.skyOfGradientRamp.geometry.dispose(),this.skyOfGradientRamp.material.dispose(),this.scene.remove(this.skyOfGradientRamp),this.skyOfGradientRamp.clear(),this.skyOfGradientRamp=void 0);const t=Z()(e=tp()(this.loadedModels)).call(e,(e=>e.id));if(t){const e=this.cameraCfg,n=e&&cm.arrayToVector3(e.eye),r=e&&cm.arrayToVector3(e.look);if(n&&r){const e=n,t=r,i=new En;i.expandByPoint(new xn(e.x,e.y,e.z)),i.expandByPoint(new xn(t.x,t.y,t.z)),this.skyOfGradientRamp=i_.createSkyOfGradientRampByBoundingBox(i)}else this.skyOfGradientRamp=i_.createSkyOfGradientRampByObjectsInScene(this.scene,t);this.scene.add(this.skyOfGradientRamp)}}regenGroundGrid(){var e;if(!this.scene)return;this.groundGrid&&(this.groundGrid.geometry.dispose(),this.groundGrid.material.dispose(),this.scene.remove(this.groundGrid));if(Z()(e=tp()(this.loadedModels)).call(e,(e=>e.id))){const e=this.cameraCfg,t=e&&cm.arrayToVector3(e.look);t&&(t.y=0),this.groundGrid=r_.createGroundGrid(void 0,void 0,t),this.scene.add(this.groundGrid)}}enableComposer(e){this.scene&&this.camera&&this.renderer&&(this.composerEnabled=e,e&&!this.composer&&(this.composer=new Py(this.renderer)),this.enableRender())}enableRenderPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.renderPass){const e=new Ab(this.scene,this.camera);e.setSize(this.width,this.height),this.composer.addPass(e),this.renderPass=e}this.renderPass&&(this.renderPass.enabled=e),this.enableRender()}}enableFxaaPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.effectFxaaPass){const e=new Dy(Ly);e.uniforms.resolution.value.set(1/this.width,1/this.height),e.setSize(this.width,this.height),e.renderToScreen=!0,this.composer.addPass(e),this.effectFxaaPass=e}this.effectFxaaPass&&(this.effectFxaaPass.enabled=e),this.enableRender()}}enableSaoPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.saoPass){const e=new Nb(this.scene,this.camera,!1,!0,new Xt(1/this.width,1/this.height));e.setSize(this.width,this.height),e.params.output=0,e.params.saoBias=.5,e.params.saoIntensity=5e-5,e.params.saoScale=5,e.params.saoKernelRadius=40,e.params.saoMinResolution=0,this.composer.addPass(e),this.saoPass=e}this.saoPass&&(this.saoPass.enabled=e),this.enableRender()}}enableSsaoPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.ssaoPass){const e=new Gb(this.scene,this.camera,this.width,this.height);e.kernelRadius=16,e.minDistance=.005,e.maxDistance=.1,this.composer.addPass(e),this.ssaoPass=e}this.ssaoPass&&(this.ssaoPass.enabled=e),this.enableRender()}}enableOutlinePass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.outlinePass){const e=new Eb(new Xt(this.width,this.height),this.scene,this.camera);e.edgeStrength=3,e.edgeGlow=0,e.edgeThickness=2,e.pulsePeriod=0,e.visibleEdgeColor.set(16711680),e.hiddenEdgeColor.set(16752768),this.composer.addPass(e),this.outlinePass=e}this.outlinePass&&(this.outlinePass.enabled=e),this.enableRender()}}enableSsaaPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.ssaaRenderPass){const e=new Lb(this.scene,this.camera,16777215,0);this.composer.addPass(e),this.ssaaRenderPass=e}this.ssaaRenderPass&&(this.ssaaRenderPass.enabled=e),this.enableRender()}}enableBloomPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.bloomPass){const e=new Lm(1,25,4);e.renderToScreen=!0,this.composer.addPass(e),this.bloomPass=e}this.bloomPass&&(this.bloomPass.enabled=e),this.enableRender()}}enableUnrealBloomPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.unrealBloomPass){const e=new Vb(new Xt(this.width,this.height),1,0,0);e.threshold=0,e.strength=.5,e.radius=0,this.composer.addPass(e),this.unrealBloomPass=e}this.unrealBloomPass&&(this.unrealBloomPass.enabled=e),this.enableRender()}}enableSection(e=qh.ObjectsBoxSection){var t;if(!(this.scene&&this.camera&&this.renderer&&this.controls))return;this.section&&this.disableSection();const n=Z()(t=tp()(this.loadedModels)).call(t,(e=>e.id));!n||n.length<1?im.warn("[BimViewer] No object to section!"):(this.renderer.localClippingEnabled=!0,this.sectionMode=e,e===qh.ObjectsBoxSection?(this.section=new yb(this.scene,this.camera,this.renderer,this.controls,n),this.section.open()):e===qh.PickPlaneSection?(this.section=new Ib(this,n,this.container),this.section.open()):e===qh.AxisPlaneSection&&(this.section=new Am(this,n,this.container),this.section.open()),this.enableRender())}disableSection(){this.renderer&&this.section&&(this.section.close(),this.section=void 0,this.enableRender())}activateMeasurement(e){this.measurementManager||(this.measurementManager=new Yy(this));this.measurementManager.activateMeasurement(e),this.enableSVGRender()}deactivateMeasurement(){var e;null===(e=this.measurementManager)||void 0===e||e.deactivateMeasurement(),this.enableSVGRender()}clearMeasurements(){var e;null===(e=this.measurementManager)||void 0===e||e.clearMeasurements(),this.enableSVGRender()}enableWebCam(){this.scene&&(this.webcam||(this.webcam=new Xb),this.webcamPlane||(this.webcamPlane=this.webcam.createWebCamPlane(),this.webcamPlane.position.set(10,2,0)),this.scene.add(this.webcamPlane))}disableWebCam(){this.scene&&this.webcamPlane&&(this.webcamPlane.geometry.dispose(),this.webcamPlane.material.dispose(),this.scene.remove(this.webcamPlane))}setEnvironment(e){a_.createEnvTexture(this.pmremGenerator,e).then((e=>{this.scene.environment=e}))}setEnvironmentFromDataArray(e){a_.createEnvTextureFromDataArray(this.pmremGenerator,e).then((e=>{this.scene.environment=e}))}takeObjectsScreenshot(e){try{const t=this;return v().resolve(new(v())(((n,r)=>{t.renderer||r("renderer is undefined"),t.scene.traverse((t=>{t instanceof mi&&((0,mp.includes)(e,(0,mp.get)(t.userData,"UniqueId"))?t.visible=!0:t.visible=!1)})),t.enableRender(),Re()((()=>{var e;n(null===(e=t.renderer)||void 0===e?void 0:e.domElement.toDataURL("image/png"))}),1e3)})))}catch(e){return v().reject(e)}}instantiate(e){new ky(e).instantiate()}merge(e){this.increaseJobCount();try{const t=[];e.traverse((e=>{e.geometry&&e.material&&t.push(e)})),df.deepMerge(t,e)}finally{this.decreaseJobCount()}}setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))}increaseJobCount(){this.setSpinnerVisibility(++this.jobCount>0)}decreaseJobCount(){this.setSpinnerVisibility(--this.jobCount>0)}addEvent(e,t,n){e.addEventListener(t,n),this.events.push({node:e,type:t,func:n})}updateProjectSettings(e){this.settings=e;const t=(e,t)=>{e&&t&&(e.near=t.near,e.far=t.far,e.updateProjectionMatrix())};t(this.perspectiveCamera,this.settings.camera),t(this.orthoCamera,this.settings.camera),this.enableRender(10)}dynamicallyUpdateControllerTarget(e){const t=this.getIntersections(e);if(t.length<0)return;const n=this.camera,r=this.controls;if(!n||!r)return;const i=Se()(t).call(t,(e=>{if(e.distance<n.near||e.distance>n.far)return!1;const t=e.object;return t.visible&&t instanceof mi}));if(null!=i&&i.point&&r){const e=n.position,t=r.target,s=i.distance,a=e.distanceTo(t),o=e.clone().lerp(t,s/a);r.target.set(o.x,o.y,o.z)}}computeBoundingBox(){var e;const t=new En;return ge()(e=tp()(this.loadedModels)).call(e,(e=>{if(e.bbox){e.bbox.geometry.computeBoundingBox();const n=e.bbox.geometry.boundingBox;n&&!n.isEmpty()&&t.union(n)}})),this.bbox=t,t}}let IX;!function(e){e[e.Browser=0]="Browser",e[e.Browserless=1]="Browserless",e[e.Headless=2]="Headless"}(IX||(IX={}));class MX{constructor(e,t,n){if(gh(this,"containerOrCanvas",void 0),gh(this,"glContext",void 0),gh(this,"camera",void 0),gh(this,"scene",this.initScene()),gh(this,"renderer",void 0),gh(this,"renderTarget",void 0),gh(this,"controls",void 0),gh(this,"selectedObject",void 0),gh(this,"loadedModels",{}),gh(this,"pmremGenerator",void 0),gh(this,"viewerMode",IX.Browser),gh(this,"raycaster",new gu),gh(this,"savedMaterialsForOpacity",[]),gh(this,"jobCount",0),gh(this,"bbox",new En),gh(this,"outlineMaterial",new Fo({color:1118481})),gh(this,"outlineRoot",new io),gh(this,"transparentObjectIds",[]),gh(this,"applyOptionsAndAddToScene",((e,t,n)=>{if(im.info(`[SimplifiedBimViewer] '${e}' is loaded, adding to scene...`),n.matrix&&16===n.matrix.length){const e=new Zn;e.elements=n.matrix,t.applyMatrix4(e)}else{const e=n.position||[0,0,0],r=n.rotation||[0,0,0],i=n.scale||[1,1,1];t.position.set(e[0],e[1],e[2]),t.rotation.set(r[0]*Math.PI/180,r[1]*Math.PI/180,r[2]*Math.PI/180),t.scale.set(i[0],i[1],i[2])}this.addLoadedModelToScene(t,n)})),gh(this,"getMeshes",(e=>{const t=[];return e instanceof mi?t.push(e):e.traverseVisible((e=>{e instanceof mi&&t.push(e)})),t})),this.containerOrCanvas=e,t&&(this.viewerMode=t),this.glContext=n,this.viewerMode===IX.Browserless&&(e instanceof HTMLDivElement||!n))throw new Error("[SimplifiedBimViewer] Parameters don't match Browserless viewerMode !");this.increaseJobCount(),this.init(),this.decreaseJobCount(),im.info("[SimplifiedBimViewer] Initialized"),this.animate()}init(){this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initPointerEvents(),this.scene.add(this.outlineRoot)}initScene(){const e=new mo;return e.background=new cn(7112861),e.matrixAutoUpdate=!0,e}isBrowserlessMode(){return this.viewerMode===IX.Browserless}isBrowserMode(){return this.viewerMode===IX.Browser}initRenderer(){const e={antialias:!0,preserveDrawingBuffer:!0},t=this.isBrowserlessMode();t&&q()(e,{canvas:this.containerOrCanvas,context:this.glContext});const n=new ho(e);if(t){const e=this.containerOrCanvas.width,t=this.containerOrCanvas.height;im.info(`[SimplifiedBimViewer] Render target size: ${e} x ${t}`),this.renderTarget=new _n(e,t,{minFilter:nt,magFilter:Qe,format:ht,type:st}),n.setRenderTarget(this.renderTarget)}else{const e=this.containerOrCanvas.clientWidth,t=this.containerOrCanvas.clientHeight;this.containerOrCanvas.append(n.domElement),n.setPixelRatio(window.devicePixelRatio),n.setSize(e,t)}n.outputEncoding=St,n.toneMappingExposure=1,n.physicallyCorrectLights=!0,n.setClearColor(11119017,1),n.shadowMap.enabled=!0,n.shadowMap.type=2,this.renderer=n,t||(this.pmremGenerator=new ts(n),this.pmremGenerator.compileEquirectangularShader(),this.setEnvironmentFromDataArray())}initCamera(){if(!this.scene)return;const e=this.containerOrCanvas.clientWidth||this.containerOrCanvas.width||0,t=this.containerOrCanvas.clientHeight||this.containerOrCanvas.height||0;let n=1;e&&t&&(n=e/t),this.camera=new Ti(68,n,.05,1e4),this.camera.position.set(10,10,10),this.camera.lookAt(0,0,0),this.scene.add(this.camera)}initControls(){if(!this.renderer)return;const e=this.camera;if(!e)return;const t=new wb(e,this.renderer.domElement);t.enableDamping=!0,t.dampingFactor=.5,t.enabled=!0,t.keyPanSpeed=10,t.keys={LEFT:"KeyA",UP:"KeyQ",RIGHT:"KeyD",BOTTOM:"KeyE"},t.update(),this.controls=t,t.addEventListener("change",(()=>{!this.isBrowserMode()&&this.renderer&&this.renderer.render(this.scene,e)}))}initLights(){if(!this.scene)return;const e=16777215,t=new ru(e,.3);t.position.set(-2,2,4);const n=new iu(3158064),r=new Hc(e,14540253,3);r.position.set(0,300,0),this.scene.add(t),this.scene.add(n),this.scene.add(r)}initPointerEvents(){if(!this.renderer||!this.camera||!this.controls)return;let e=!1,t=!1,n=-1,r=-1;this.renderer.domElement.addEventListener("pointerdown",(t=>{n=t.x,r=t.y,e=!1})),this.renderer.domElement.addEventListener("pointermove",(t=>{if(n>=0&&r>=0){const i=5;(Math.abs(t.x-n)>i||Math.abs(t.y-r)>i)&&(e=!0)}})),this.renderer.domElement.addEventListener("pointerup",(()=>{t&&Re()((()=>{t=!1}),200),n=-1,r=-1})),this.renderer.domElement.addEventListener("dblclick",(n=>{t=!0,e||(this.handleMouseClick(n),this.flyToSelectedObject())}))}animate(){var e,t;this.isBrowserMode()&&requestAnimationFrame(ve()(e=this.animate).call(e,this));(this.controls&&this.controls.update(),this.scene&&this.camera)&&(null===(t=this.renderer)||void 0===t||t.render(this.scene,this.camera))}destroy(){var e;this.camera=void 0,this.scene&&this.scene.clear(),this.renderer&&(this.containerOrCanvas.removeChild(this.renderer.domElement),this.renderer.clear(),this.renderer.dispose(),this.renderer=void 0),this.controls&&(this.controls.dispose(),this.controls=void 0),this.renderTarget&&(this.renderTarget.dispose(),this.renderTarget=void 0),this.raycaster=void 0,this.selectedObject=void 0,this.savedMaterialsForOpacity=void 0,ge()(e=Q()(this.loadedModels)).call(e,(e=>{delete this.loadedModels[e]}))}loadLocalModel(e,t,n){try{const r=this,i=new TX;return v().resolve(i.loadLocalModel(e,t.src,n)).then((function(n){return n?(r.applyOptionsAndAddToScene(e,n,t),v().resolve()):v().reject()}))}catch(e){return v().reject(e)}}loadModel(e,t){try{const n=this;n.increaseJobCount();const r=new TX;return v().resolve(r.loadModel(e.src,e.fileFormat,t)).then((function(t){return t?(n.applyOptionsAndAddToScene(e.src,t,e),v().resolve()):v().reject()}))}catch(e){return v().reject(e)}}parseGltf(e,t,n,r){this.increaseJobCount(),(new TX).parseGltf(e,t.src,(e=>{this.applyOptionsAndAddToScene(t.src,e,t),n&&n(e)}),(e=>{r&&r(e)}))}addLoadedModelToScene(e,t){var n;if(!this.scene)return;e.updateMatrix(),this.scene.add(e);const r=new Eu(e);r.name="BIM_VIEWER_BOX_HELPER",r.visible=!1,r.material&&(r.material=void 0,r.layers.set(Rh));let i=t.modelId||t.src;if(this.loadedModels[i]){let e=1;for(;this.loadedModels[`${i}_${e}`];)e++;i=`${i}_${e}`,im.warn(`[BimViewer] Model '${i}' is loaded more than once!`)}this.loadedModels[i]={id:e.id,bbox:r},this.computeBoundingBox();const s=Z()(n=tp()(this.loadedModels)).call(n,(e=>e.id));(!s||s.length<=1)&&(this.tryAdjustCameraNearAndFar(),this.goToHomeView()),this.scene.add(r),t.edges&&uf.addOutlines(e),this.decreaseJobCount(),im.info(`[SimplifiedBimViewer] Added '${t.src}' to scene`)}addOrRemoveObjectOpacity(e=!0,t=.3,n,r){var i;if(this.savedMaterialsForOpacity||(this.savedMaterialsForOpacity=[]),!this.scene)return;const s=this.scene,a=[];ge()(i=Q()(this.loadedModels)).call(i,(i=>{const o=this.loadedModels[i];if(e){this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0&&uf.revertObjectOpacityById(s,o.id,this.savedMaterialsForOpacity);const e=uf.setObjectOpacityById(s,o.id,t,n,r);a.push(...e)}else this.savedMaterialsForOpacity&&uf.revertObjectOpacityById(s,o.id,this.savedMaterialsForOpacity)})),this.savedMaterialsForOpacity=e?a:[]}hasTransparentObject(){return!!(this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0)}getIntersections(e){var t;if(!this.raycaster||!this.camera||!this.scene)return[];let n=new Xt;e&&(n=M_.getScreenPointByEvent(e,this.containerOrCanvas));const r=M_.screenPoint2NdcPoint(n,this.camera,this.containerOrCanvas);this.raycaster.setFromCamera(r,this.camera);const i=[];return ge()(t=tp()(this.loadedModels)).call(t,(e=>{const t=this.scene&&this.scene.getObjectById(e.id);t&&t.visible&&i.push(t)})),this.raycaster.intersectObjects(i,!0)||[]}handleMouseClick(e){const t=this.getIntersections(e),n=Se()(t).call(t,(e=>{const t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof mi)}));let r=n&&n.object||void 0;r&&this.selectedObject&&this.selectedObject.id===r.id&&(r=void 0),r?this.selectObject(r):this.clearSelection()}selectObject(e){if(this.selectedObject){const e=this.selectedObject.userData;if(e.originalMaterial){if(this.selectedObject.material){const e=this.selectedObject.material;x()(e)?ge()(e).call(e,(e=>e.dispose())):e instanceof Lr&&e.dispose()}this.selectedObject.material=e.originalMaterial,delete e.originalMaterial}this.selectedObject=void 0}if(!this.scene||!e)return;const t=tf.clonedHighlightMaterials(e);t&&(this.selectedObject=e,this.selectedObject.userData.originalMaterial=this.selectedObject.material,this.selectedObject.material=t)}clearSelection(){this.selectObject()}flyToObjects(e){if(!e||0===e.length||!this.camera)return;const t=new xn,n=new xn;l_.getCameraPositionByObjects(e,this.camera,t,n),this.flyTo(t,n)}flyToObject(e){this.flyToObjects([e])}flyToSelectedObject(){this.selectedObject&&this.flyToObject(this.selectedObject)}flyTo(e,t,n){const r=this.camera,i=this.controls;if(!r||!i)return;const s=e=x()(e)?new xn(e[0],e[1],e[2]):e,a=t=x()(t)?new xn(t[0],t[1],t[2]):t;var o;(im.info("[SimplifiedBimViewer] flyTo: ",cm.vectorToString(s)),r.lookAt(a.x,a.y,a.z),r.position.set(s.x,s.y,s.z),i.target.set(a.x,a.y,a.z),i.update(),this.isBrowserMode())||(null===(o=this.renderer)||void 0===o||o.render(this.scene,r));n&&n()}goToHomeView(){var e;const t=new xn,n=new xn,r=new xn,i=new xn;this.bbox.getSize(i),this.bbox.getCenter(r);const s=(i.x+i.y+i.z)/3*1.5,a=new xn(r.x+s,r.y+s/1.5,r.z+s),o=r.clone().sub(a);l_.getCameraPositionByBboxAndDirection(this.bbox,t,n,null===(e=this.camera)||void 0===e?void 0:e.projectionMatrix,o),t.equals(n)||this.flyTo(t,n)}setEnvironmentFromDataArray(e){a_.createEnvTextureFromDataArray(this.pmremGenerator,e).then((e=>{this.scene.environment=e,this.isBrowserMode()||this.animate()}))}tryAdjustCameraNearAndFar(){const e=this.camera;if(!this.scene||!e)return;const t=this.bbox,n=e.near,r=e.far,i=t.max.x-t.min.x,s=t.max.y-t.min.y,a=t.max.z-t.min.z,o=Math.max(i,s,a),l=o/5,c=5*o;if(n>l||r<c){const t=e=>cm.numberToString(e);im.info(`[SimplifiedBimViewer] BBox's longest side is: ${t(o)}`),n>l&&(im.warn(`[SimplifiedBimViewer] camera.near(${t(n)}) shouldn't bigger than ${t(l)}, will change it!`),e.near=l),r<c&&(im.warn(`[SimplifiedBimViewer] camera.far(${t(r)}) shouldn't smaller than ${t(c)}, will change it!`),e.far=c)}e.updateProjectionMatrix()}isolateObjects(e){var t;const n=this.transparentObjectIds.length>0?void 0:this.transparentObjectIds,r=this.transparentObjectIds.length>0?this.transparentObjectIds:void 0,i=new kr({color:16777215,transparent:!0,opacity:.1});ge()(t=Q()(this.loadedModels)).call(t,(e=>{const t=this.loadedModels[e];uf.applyMaterialToObjectById(this.scene,t.id,i,r,n)})),this.outlineRoot.clear();let s=[];if(ge()(e).call(e,(e=>{const t=e.modelId;let n=t?this.scene.getObjectById(this.loadedModels[t].id):this.scene;n||(im.warn(`[BimViewer] The ModelId of ${t} has no corresponding model.`),n=this.scene),n.traverse((t=>{if((0,mp.includes)(e.id,(0,mp.get)(t.userData,"UniqueId"))){const e=this.getMeshes(t);s=be()(s).call(s,e)}}))})),s.length>0){var a;ge()(s).call(s,(e=>{var t;const n=uf.createOutline(e.geometry,e.matrix,this.outlineMaterial);null!==(t=e.parent)&&void 0!==t&&t.matrixWorld&&n.applyMatrix4(e.parent.matrixWorld),this.outlineRoot.add(n)}));const e=Z()(s).call(s,(e=>e.id));ge()(a=Q()(this.loadedModels)).call(a,(t=>{const n=this.loadedModels[t];uf.revertAppliedMaterialToObjectById(this.scene,n.id,e)})),this.transparentObjectIds=e,this.flyToObjects(s)}else im.warn(`[BimViewer] No object found with uniqueIds: ${Z()(e).call(e,(e=>e.id))}`);this.isBrowserMode()||this.animate()}increaseJobCount(){++this.jobCount}decreaseJobCount(){--this.jobCount}computeBoundingBox(){var e;const t=new En;return ge()(e=tp()(this.loadedModels)).call(e,(e=>{if(e.bbox){e.bbox.geometry.computeBoundingBox();const n=e.bbox.geometry.boundingBox;n&&!n.isEmpty()&&t.union(n)}})),this.bbox=t,t}getContext(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.getContext()}getCameraDirection(){var e;const t=new xn;return null===(e=this.camera)||void 0===e||e.getWorldDirection(t),{x:t.x,y:t.y,z:t.z}}}var AX=n(27525),RX=n.n(AX);class DX{constructor(e,t){gh(this,"camera",void 0),gh(this,"controls",void 0),gh(this,"flyDuration",500),gh(this,"autoRotateRemainingTime",0),gh(this,"automaticallyAdjustCameraPosition",!0),gh(this,"cameraUpdateInterval",void 0),gh(this,"rotateIntervalStartTime",0),gh(this,"rotateInterval",void 0),this.camera=e,this.controls=t}flyTo(e,t,n){const r=this.camera,i=this.controls;if(!r||!i)return;if(e.equals(t))return void console.error("[BimViewer] camera position and lookAt cannot be the same!");if(isNaN(e.x)||isNaN(e.y)||isNaN(e.z)||isNaN(t.x)||isNaN(t.y)||isNaN(t.z))return void console.error("[BimViewer] invalid position or lookAt!");if(this.automaticallyAdjustCameraPosition){const n=e.distanceTo(t);n<r.near?(e=e.clone().sub(t).normalize().multiplyScalar(1.1*r.near),console.warn("[BimViewer] camera could be too close to see the object!")):n>r.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*r.far),console.warn("[BimViewer] camera could be too far to see the object!"))}const s=r.position.clone(),a=i.target.clone(),o=this.flyDuration,l=Yh()();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=dp()((()=>{let c=Yh()()-l;c>o&&(c=o);const u=(e,t,n)=>{const r=e.x+(t.x-e.x)*n,i=e.y+(t.y-e.y)*n,s=e.z+(t.z-e.z)*n;return new xn(r,i,s)};((e,t)=>{r.lookAt(t),r.position.set(e.x,e.y,e.z),i.target.set(t.x,t.y,t.z),i.update()})(u(s,e,c/o),u(a,t,c/o)),c>=o&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0,n&&n())}),10)}lookTo(e){const t=this.camera,n=this.controls;if(!t||!n)return;const r=t.position,i=n.target.distanceTo(r),s=e.normalize().multiplyScalar(i),a=new xn(r.x+s.x,r.y+s.y,r.z+s.z);this.flyTo(r,a)}startAutoRotate(){const e=this.camera,t=this.controls;if(!e||!t)return;t.autoRotate=!0;const n=new xn;e.getWorldPosition(n);const r=t.target;if(r.y===n.y)return;const i=(r.y-n.y)/50;for(let e=0;e<50;++e)Re()((()=>{const e=t.target.y-i;t.target.setY(e),t.update()}),30*e)}delayAutoRotate(){this.autoRotateRemainingTime=5e3,this.controls&&(this.controls.autoRotate=!1)}startToRotate(e){const t=Yh()()-this.rotateIntervalStartTime;this.rotateIntervalStartTime=Yh()(),this.rotateInterval&&t<100||(this.rotateInterval&&clearInterval(this.rotateInterval),this.rotateInterval=dp()((()=>{if(Yh()()-this.rotateIntervalStartTime>=100)return clearInterval(this.rotateInterval),void(this.rotateInterval=void 0);"ArrowLeft"===e.code||"ArrowRight"===e.code?this.rotateLeftOrRight(.3,"ArrowLeft"===e.code):"ArrowUp"!==e.code&&"ArrowDown"!==e.code||this.rotateUpOrDown(.3,"ArrowUp"===e.code)}),1))}rotateLeftOrRight(e,t=!0){const n=this.controls;if(!this.camera||!n)return;const r=this.camera.position,i=n.target,s=i.clone();let a=Math.PI*e/180;t&&(a=-a),s.x=(i.x-r.x)*Math.cos(a)-(i.z-r.z)*Math.sin(a)+r.x,s.z=(i.z-r.z)*Math.cos(a)+(i.x-r.x)*Math.sin(a)+r.z,this.camera.lookAt(s),n.target=s,n.update()}rotateUpOrDown(e,t=!0){const n=this.controls;if(!this.camera||!n)return;const r=this.camera.position,i=n.target,s=i.clone();let a=Math.PI*e/180;const o=new xn(i.x-r.x,i.y-r.y,i.z-r.z).length(),l=i.y-r.y;t||(a=-a);const c=Math.asin(l/o)+a;if(c<-Math.PI/2||c>Math.PI/2)return;const u=Math.sin(c)*o;s.y=i.y+(u-l),n.target=s,n.update()}}class CX{static createCSS2DObject(e){const t=new Uf(e);return e.dataset.objectId=t.id.toString(),t}static createDefaultHotpoint(e=12){const t=document.createElement("div"),n=t.style;return n.width=`${e}px`,n.height=`${e}px`,n.opacity="0.8",n.cursor="pointer",n.top=-e/2+"px",n.left=-e/2+"px",n.backgroundColor="#ffffff",n.border="2px solid #00DAB7",n.borderRadius="50%",this.createCSS2DObject(t)}static createHotpoint(e){if(e){const t=document.createElement("div"),n=t.style;return n.top="0px",n.left="0px",t.innerHTML=e,this.createCSS2DObject(t)}return this.createDefaultHotpoint()}static createLabel(e,t=""){const n=document.createElement("div");if(n.innerHTML=e,t)n.classList.add(t);else{const e=n.style;e.padding="5px 9px",e.color="#ffffffdd",e.fontSize="12px",e.position="absolute",e.backgroundColor="rgba(0, 0, 0, 0.3)",e.borderRadius="12px",e.cursor="pointer",e.top="0px",e.left="0px"}return this.createCSS2DObject(n)}static tryFindObjectId(e){if(null!=e.dataset.objectId)return L()(e.dataset.objectId);const t=e.parentElement;return!t||t instanceof HTMLBodyElement?void 0:this.tryFindObjectId(t)}}class OX extends io{constructor(e,t,n=10){super(),gh(this,"textureLoader",void 0),gh(this,"images",void 0),gh(this,"mesh",void 0),gh(this,"thumbnailImages",void 0),gh(this,"thumbnailMesh",void 0),gh(this,"size",void 0),gh(this,"fadingInInterval",void 0),gh(this,"fadingOutInterval",void 0),this.images=e,this.thumbnailImages=t,this.size=n,this.textureLoader=new zc,this.mesh=new mi}fadeIn(e=1e3){let t=this.getMaterials();if(!(x()(t)&&t.length>0))return void(this.visible=!0);ge()(t).call(t,(e=>e.opacity=0));const n=1/(e/10);this.visible=!0,this.clearFading(),this.renderOrder+=1,this.fadingInInterval=dp()((()=>{let e=1;const r=this.getMaterials();this.materialEquals(t,r)||(t=r),t.length>0&&(e=Math.min(t[0].opacity+n,1),ge()(t).call(t,(t=>t.opacity=e))),e>=1&&this.clearFading()}),10)}materialEquals(e,t){return fp().isEqualWith(e,t,((e,t)=>{if(!x()(e)||!x()(t))return e.id===t.id}))}fadeOut(e=1e3){const t=this.getMaterials(),n=1/(e/10),r=1/(e/10);this.clearFading(),this.scale.set(2,2,2),this.fadingOutInterval=dp()((()=>{const e=this.scale.x+r;this.scale.set(e,e,e);let i=0;t.length>0&&(i=Math.max(t[0].opacity-n,0),ge()(t).call(t,(e=>e.opacity=i))),(i<=0||e>=3)&&this.clearFading()}),10)}clearFading(){const e=this.getMaterials();this.fadingInInterval&&(clearInterval(this.fadingInInterval),this.fadingInInterval=void 0,this.visible=!0,ge()(e).call(e,(e=>e.opacity=1)),this.renderOrder-=1),this.fadingOutInterval&&(clearInterval(this.fadingOutInterval),this.fadingOutInterval=void 0,this.visible=!1,ge()(e).call(e,(e=>e.opacity=1)),this.scale.set(1,1,1))}getMaterials(){let e=this.thumbnailMesh;e||(e=this.mesh);const t=[];return x()(e.material)?t.push(...e.material):e.material&&t.push(e.material),t}create(){}createThumbnailMesh(e){try{const t=this;return t.thumbnailImages&&6==t.thumbnailImages.length?(t.thumbnailMesh=new mi(new gi(e,e,e)),t.thumbnailMesh.geometry.scale(1,1,-1),v().resolve(t.loadTexturesAsync(t.thumbnailImages)).then((function(e){const n=Z()(e).call(e,(e=>new kr({map:e,side:0,transparent:!0})));t.thumbnailMesh&&(t.thumbnailMesh.material=n,t.add(t.thumbnailMesh))}))):v().resolve()}catch(e){return v().reject(e)}}loadTextures(e){return Z()(e).call(e,(e=>this.textureLoader.load(e)))}loadTexturesAsync(e){try{const t=this,n=Z()(e).call(e,(e=>t.textureLoader.loadAsync(e)));return v().resolve(v().all(n))}catch(e){return v().reject(e)}}destroyMesh(e){var t,n;(this.remove(e),e.clear(),e.geometry.dispose(),x()(e.material))?ge()(t=e.material).call(t,(e=>{var t;null===(t=Z()(e))||void 0===t||t.dispose(),e.dispose()})):(null===(n=Z()(e.material))||void 0===n||n.dispose(),e.material.dispose())}destroy(){this.clearFading(),this.images=[],this.mesh&&(this.mesh instanceof mi?this.destroyMesh(this.mesh):this.mesh.traverse((e=>{e instanceof mi&&this.destroyMesh(e)})),this.mesh=void 0)}}class PX extends OX{constructor(e,t,n=20){if(super(e,t,n),6!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 6, got ${e.length}`)}create(){try{const e=this;return v().resolve(e.createThumbnailMesh(e.size+.1)).then((function(){function t(e){}return e.thumbnailMesh?void e.createMesh():v().resolve(e.createMesh()).then(t)}))}catch(e){return v().reject(e)}}createMesh(){try{const e=this,t=e.mesh;return t.geometry=new gi(e.size,e.size,e.size),t.geometry.scale(1,1,-1),v().resolve(e.loadTexturesAsync(e.images)).then((function(n){const r=Z()(n).call(n,(e=>new kr({map:e,side:0,transparent:!0})));t.material=r,e.add(t),e.thumbnailMesh&&(e.destroyMesh(e.thumbnailMesh),e.thumbnailMesh=void 0,e.thumbnailImages=void 0)}))}catch(e){return v().reject(e)}}}class NX extends OX{constructor(e,t,n=20){if(super(e,t,n),gh(this,"ratio",void 0),gh(this,"subPlaneWidth0",void 0),gh(this,"subPlaneWidth1",void 0),24!==e.length)throw new Error(`[VRCube24Faces] Wrong number of images! Expected 24, got ${e.length}`);this.ratio=1,this.subPlaneWidth0=this.size*(this.ratio/(this.ratio+1)),this.subPlaneWidth1=this.size-this.subPlaneWidth0}create(){try{const e=this;return v().resolve(e.createThumbnailMesh(e.size+.1)).then((function(){function t(e){}return e.thumbnailMesh?void e.createMesh():v().resolve(e.createMesh()).then(t)}))}catch(e){return v().reject(e)}}createMesh(){try{const e=this;return e.mesh=new io,e.mesh.scale.set(1,1,-1),v().resolve(e.loadTexturesAsync(e.images)).then((function(t){const n=Z()(t).call(t,(e=>new kr({map:e,side:1,transparent:!0})));if(24!==n.length)throw new Error(`[VRCube24Faces] Wrong number of materials! Expected 24, got ${n.length}`);const r=e.createPlaneOfAFace(M()(n).call(n,0,4));r.rotateOnAxis(new xn(0,1,0),-Math.PI/2),r.position.set(e.size/2,0,0);const i=e.createPlaneOfAFace(M()(n).call(n,4,8));i.rotateOnAxis(new xn(0,1,0),Math.PI/2),i.position.set(-e.size/2,0,0);const s=e.createPlaneOfAFace(M()(n).call(n,8,12));s.rotateOnAxis(new xn(1,0,0),-Math.PI/2),s.rotateOnAxis(new xn(0,0,1),Math.PI),s.rotateOnAxis(new xn(1,0,0),Math.PI),s.position.set(0,e.size/2,0);const a=e.createPlaneOfAFace(M()(n).call(n,12,16));a.rotateOnAxis(new xn(1,0,0),Math.PI/2),a.rotateOnAxis(new xn(0,0,1),Math.PI),a.rotateOnAxis(new xn(1,0,0),Math.PI),a.position.set(0,-e.size/2,0);const o=e.createPlaneOfAFace(M()(n).call(n,16,20));o.rotateOnAxis(new xn(0,1,0),Math.PI),o.position.set(0,0,e.size/2);var l;(e.createPlaneOfAFace(M()(n).call(n,20,24)).position.set(0,0,-e.size/2),e.add(e.mesh),e.thumbnailMesh)&&(e.destroyMesh(e.thumbnailMesh),e.remove(e.thumbnailMesh),null===(l=e.thumbnailMesh)||void 0===l||l.clear(),e.thumbnailMesh=void 0)}))}catch(e){return v().reject(e)}}createPlaneOfAFace(e){var t;const n=new io,r=new ki(this.subPlaneWidth0,this.subPlaneWidth0),i=new ki(this.subPlaneWidth1,this.subPlaneWidth0),s=new ki(this.subPlaneWidth0,this.subPlaneWidth1),a=new ki(this.subPlaneWidth1,this.subPlaneWidth1),o=new mi(r,e[0]),l=new mi(i,e[1]),c=new mi(s,e[2]),u=new mi(a,e[3]);return o.position.set(this.subPlaneWidth1/2,this.subPlaneWidth1/2,0),l.position.set(-this.subPlaneWidth0/2,this.subPlaneWidth1/2,0),c.position.set(this.subPlaneWidth1/2,-this.subPlaneWidth0/2,0),u.position.set(-this.subPlaneWidth0/2,-this.subPlaneWidth0/2,0),o.geometry.scale(-1,1,1),l.geometry.scale(-1,1,1),c.geometry.scale(-1,1,1),u.geometry.scale(-1,1,1),n.add(o,l,c,u),null===(t=this.mesh)||void 0===t||t.add(n),n}}class LX extends OX{constructor(e,t,n=10){if(super(e,t,n),1!==e.length)throw new Error(`[VRSphere] Wrong number of images! Expected 1, got ${e.length}`)}create(){try{const e=this;return v().resolve(e.createThumbnailMesh(e.size+.1)).then((function(){function t(e){}return e.thumbnailMesh?void e.createMesh():v().resolve(e.createMesh()).then(t)}))}catch(e){return v().reject(e)}}createMesh(){try{const e=this,t=e.mesh,n=100;return t.geometry=new ic(e.size,n,n),t.geometry.scale(-1,1,1),v().resolve(e.loadTexturesAsync(e.images)).then((function(n){const r=Z()(n).call(n,(e=>new kr({map:e,side:0,transparent:!0})));var i;(t.material=r[0],e.add(t),e.thumbnailMesh)&&(e.destroyMesh(e.thumbnailMesh),e.remove(e.thumbnailMesh),null===(i=e.thumbnailMesh)||void 0===i||i.clear(),e.thumbnailMesh=void 0)}))}catch(e){return v().reject(e)}}}class kX{constructor(e){gh(this,"promise",void 0),gh(this,"isCanceled",void 0),gh(this,"cancelReject",void 0),this.isCanceled=!1;const t=new(v())(((e,t)=>{this.cancelReject=t}));this.promise=v().race([t,e])}cancel(){this.cancelReject&&this.cancelReject({type:"cancel"})}}function FX(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function UX(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=FX(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=FX(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}class BX{constructor(e,t){gh(this,"container",void 0),gh(this,"vrViewerCfg",void 0),gh(this,"camera",void 0),gh(this,"scene",this.initScene()),gh(this,"renderer",void 0),gh(this,"css2dRenderer",void 0),gh(this,"css3dRenderer",void 0),gh(this,"controls",void 0),gh(this,"minFov",50),gh(this,"maxFov",95),gh(this,"height",0),gh(this,"width",0),gh(this,"raycaster",new gu),gh(this,"datGui",void 0),gh(this,"cameraConfig",void 0),gh(this,"autoRotate",!0),gh(this,"events",[]),gh(this,"lastFrameExecuteTime",Yh()()),gh(this,"maxFps",60),gh(this,"isMousePressing",!1),gh(this,"settings",A_),gh(this,"spinner",void 0),gh(this,"jobCount",0),gh(this,"viewpoints",[]),gh(this,"previousViewpointId",""),gh(this,"previousPanoramaId",""),gh(this,"activeViewpointId",""),gh(this,"activePanoramaId",""),gh(this,"viewpointAssetsMap",new(ue())),gh(this,"controlsHelper",void 0),gh(this,"cameraUpdateInterval",void 0),gh(this,"fianlCameraPosition",void 0),gh(this,"finalCameraTarget",void 0),gh(this,"loadingPanos",[]),gh(this,"rootHtmlElement",void 0),gh(this,"axes",void 0),gh(this,"toolbar",void 0),gh(this,"bottomBar",void 0),gh(this,"onHotpointClicked",void 0),gh(this,"handleDragEnd",void 0),gh(this,"onResize",(()=>{var e;const t=null===(e=this.renderer)||void 0===e?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)})),gh(this,"onMouseWheel",(e=>{const t=e.wheelDelta>0?-5:5;this.updateFov(t)})),this.vrViewerCfg=e,this.container=this.initContainer(),this.rootHtmlElement=this.initRootHtmlElement(),this.width=this.container.clientWidth,this.height=this.container.clientHeight,this.cameraConfig=t||{eye:[0,0,0],look:[0,0,0]},this.settings=A_,this.cameraConfig.near&&(this.settings.camera.near=this.cameraConfig.near),this.cameraConfig.far&&(this.settings.camera.far=this.cameraConfig.far),this.setSpinnerVisibility(++this.jobCount>0),this.init(),this.animate(),this.setSpinnerVisibility(--this.jobCount>0)}init(){this.initSpinner(),this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initEvents(),this.initOthers(),!0===this.vrViewerCfg.enableAxisGizmo&&(this.axes=this.initAxes()),this.vrViewerCfg.enableToolbar&&(this.toolbar=this.initToolbar()),this.vrViewerCfg.enableBottomBar&&(this.bottomBar=this.initBottomBar())}initContainer(){const e=document.getElementById(this.vrViewerCfg.containerId);if(!e)return im.error("[BimViewer] containerId:",this.vrViewerCfg.containerId,"is not found in Dom tree! The video will rendered to body"),document.body;const t=document.createElement("div");return t.style.cssText="width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;",e.appendChild(t),t}initScene(){const e=new mo;return e.background=new cn(16777215),e.matrixAutoUpdate=!0,e}initRenderer(){this.renderer=new ho({antialias:!1,preserveDrawingBuffer:!1}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.css2dRenderer=new Hf,this.css2dRenderer.setSize(this.width,this.height),this.css2dRenderer.domElement.style.height="0",this.css2dRenderer.domElement.style.width="0",this.container.appendChild(this.renderer.domElement),this.container.appendChild(this.css2dRenderer.domElement)}initCamera(){this.scene&&(this.camera=new Ti(75,this.width/this.height,this.settings.camera.near,this.settings.camera.far),this.scene.add(this.camera))}initControls(){if(!this.renderer||!this.camera)return;const e=new Sh(this.camera,this.renderer.domElement,!0);e.enabled=!0,e.autoRotate=this.autoRotate,e.autoRotateSpeed=this.vrViewerCfg.autoRotateSpeed||-2,e.enablePan=!1,e.enableZoom=!1,e.enableRotate=!0,e.rotateSpeed=.3,e.minPolarAngle=.05*Math.PI,e.maxPolarAngle=.95*Math.PI,e.listenToKeyEvents(document.body),e.update(),this.controls=e,this.controlsHelper=new DX(this.camera,e),this.controls.controlsHelper=this.controlsHelper,this.autoRotate&&this.controlsHelper.delayAutoRotate(),this.controlsHelper.automaticallyAdjustCameraPosition=!1,this.controls.addEventListener("end",(()=>{this.handleDragEnd&&this.handleDragEnd()}));const t=new xn(0,0,0),n=new xn(10,0,0);this.setCameraPositionAndDirection(t,n)}onKeyDown(e){return t=>{var n;const r=e.camera,i=e.controls;if(r&&i){var s;if("ArrowLeft"===t.code||"ArrowRight"===t.code||"ArrowUp"===t.code||"ArrowDown"===t.code)null===(s=this.controlsHelper)||void 0===s||s.startToRotate(t);null===(n=this.controlsHelper)||void 0===n||n.delayAutoRotate()}}}initLights(){if(!this.scene)return;const e=new ru(16777215,.3);e.position.set(-2,2,4),this.scene.add(e)}initEvents(){const e=this.renderer,t=this.camera;if(!e||!t)return;let n=!1,r=-1,i=-1;this.addEvent(window,"keydown",this.onKeyDown(this)),this.addEvent(window,"resize",this.onResize),this.addEvent(window,"mousewheel",this.onMouseWheel),this.addEvent(window,"pointerdown",(t=>{var s;(r=t.x,i=t.y,n=!1,this.isMousePressing=!0,this.autoRotate)&&(null===(s=this.controlsHelper)||void 0===s||s.delayAutoRotate());t.button===Pe&&t.target instanceof HTMLCanvasElement&&(e.domElement.style.cursor="move")})),this.addEvent(window,"pointermove",(e=>{if(r>=0&&i>=0){const t=5;(Math.abs(e.x-r)>t||Math.abs(e.y-i)>t)&&(n=!0)}})),this.addEvent(window,"pointerup",(r=>{var i;(this.isMousePressing=!1,this.autoRotate)&&(null===(i=this.controlsHelper)||void 0===i||i.delayAutoRotate());if(e.domElement.style.cursor="auto",!n&&r.button===Pe)if(r.target&&r.target instanceof HTMLDivElement){const e=CX.tryFindObjectId(r.target);if(e){const t=this.scene.getObjectById(e);if(t){const e=t.userData.hotpoint;e&&(im.info("[VRViewer] Clicked on hotpoint: ",e.hotpointId||e),this.onHotpointClicked&&this.onHotpointClicked(e))}}}else{const e=this.getIntersection(r);if(e){const n=e=>cm.vectorToString(e),r=e.point,i=r.clone().sub(t.position).normalize();im.info(`[VRViewer] Clicked at: ${n(r)},\n Camera position: ${n(t.position)},\n Target direction: ${n(i)}`)}}}))}initSpinner(){const e=document.createElement("div");e.classList.add("spinner");const t=document.createElement("div");t.classList.add(Dh,"icon-loading"),e.append(t),this.container.appendChild(e),this.spinner=e,this.setSpinnerVisibility(this.jobCount>0)}initOthers(){this.controls&&this.renderer&&this.camera&&(this.renderer.domElement.style.outlineWidth="0")}initRootHtmlElement(){const e=document.createElement("div");return e.id="rootHtmlElement",this.container.appendChild(e),e}initAxes(){const e=document.createElement("div");e.classList.add("axesRenderer");const t=new Wf(e,this);return this.rootHtmlElement.append(e),t}initToolbar(){return new yy(this,UX(UX({},My),this.vrViewerCfg.toolbarMenuConfig),[[ff.SceneClear]])}initBottomBar(){return new VX(this)}animate(){var e,t,n,r,i;if(requestAnimationFrame(ve()(e=this.animate).call(e,this)),this.maxFps>0){const e=Yh()()-this.lastFrameExecuteTime;if(e<1e3/this.maxFps)return;if(this.lastFrameExecuteTime=Yh()(),this.autoRotate){const t=this.controlsHelper;t&&t.autoRotateRemainingTime>0&&!this.isMousePressing&&(t.autoRotateRemainingTime-=e,t.autoRotateRemainingTime<=0&&this.controls&&t.startAutoRotate())}}(null===(t=this.controls)||void 0===t||t.update(),this.scene&&this.camera)&&(null===(n=this.renderer)||void 0===n||n.render(this.scene,this.camera),null===(r=this.css2dRenderer)||void 0===r||r.render(this.scene,this.camera),null===(i=this.css3dRenderer)||void 0===i||i.render(this.scene,this.camera))}clearAllCachedPanoramas(){var e;ge()(e=this.viewpointAssetsMap).call(e,(e=>{const t=e.panoramas;for(let e=t.length-1;e>=0;--e){const n=t[e];n.box.destroy(),this.scene.remove(n.box)}})),this.viewpointAssetsMap.clear(),this.activePanoramaId="",this.activePanoramaId="",this.previousViewpointId="",this.previousPanoramaId=""}destroy(){var e,t,n,r,i,s,a;ge()(e=this.events).call(e,(e=>e.node.removeEventListener(e.type,e.func))),this.events=[],this.camera=void 0,this.clearAllCachedPanoramas(),null===(t=this.scene)||void 0===t||t.clear(),this.renderer&&(this.container.removeChild(this.renderer.domElement),this.renderer.clear(),this.renderer.dispose(),this.renderer=void 0),this.css2dRenderer&&this.container.removeChild(this.css2dRenderer.domElement),null===(n=this.rootHtmlElement)||void 0===n||n.remove(),null===(r=this.spinner)||void 0===r||r.remove(),null===(i=this.controls)||void 0===i||i.dispose(),this.controls=void 0,null===(s=this.axes)||void 0===s||s.dispose(),null===(a=this.toolbar)||void 0===a||a.destroy()}updateFov(e){const t=this.camera;if(!t)return;const n=this.minFov,r=this.maxFov,i=e=>{let i=t.fov+e;i=Math.min(i,r),i=Math.max(i,n),t.fov!==i&&(t.fov=i,t.updateProjectionMatrix())},s=e/20;for(let e=0;e<20;++e)Re()((()=>i(s)),5*e);var a;this.autoRotate&&(null===(a=this.controlsHelper)||void 0===a||a.delayAutoRotate())}setMinAndMaxFov(e,t){this.controls&&(this.minFov=e,this.maxFov=t,this.controls.minFov=e,this.controls.maxFov=t)}resize(e,t){const n=this.camera;var r,i,s;n&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,n.aspect=this.width/this.height,n.updateProjectionMatrix(),null===(r=this.renderer)||void 0===r||r.setSize(this.width,this.height),null===(i=this.css2dRenderer)||void 0===i||i.setSize(this.width,this.height),null===(s=this.css3dRenderer)||void 0===s||s.setSize(this.width,this.height))}enableAutoRotate(e){this.controls&&(this.autoRotate=e,this.controls.autoRotate=e)}setAutoRotateSpeed(e=1){this.controls&&(this.controls.autoRotateSpeed=e)}setCameraFov(e=75){this.camera&&(this.camera.fov=e,this.camera.updateProjectionMatrix())}setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))}addEvent(e,t,n){e.addEventListener(t,n),this.events.push({node:e,type:t,func:n})}setCameraPositionAndDirection(e,t,n){const r=this.camera,i=this.controls;if(!r||!i)return;t||(t=i.target.clone().sub(r.position)),(t=x()(t)?new xn(t[0],t[1],t[2]):t).normalize();const s=(e=x()(e)?new xn(e[0],e[1],e[2]):e).clone().addScaledVector(t,.01);this.fianlCameraPosition=e,this.finalCameraTarget=s;const a=(e,t)=>{r.lookAt(t),r.position.set(e.x,e.y,e.z),i.target.set(t.x,t.y,t.z),i.update()};if(!1===n)return this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),void a(e,s);const o=r.position.clone(),l=i.target.clone(),c=500,u=Yh()();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=dp()((()=>{let t=Yh()()-u;t>c&&(t=c);const n=(e,t,n)=>{const r=e.x+(t.x-e.x)*n,i=e.y+(t.y-e.y)*n,s=e.z+(t.z-e.z)*n;return new xn(r,i,s)},r=n(o,e,t/c),i=n(l,s,t/c);a(r,i),t>=c&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)}getCameraPositionAndDirection(){const e=this.camera;if(!e)return;const t=e.position,n=new xn;return e.getWorldDirection(n),{position:t,direction:n}}getCameraFov(){const e=this.camera;if(e)return e.fov}setViewpoints(e){var t,n;(this.handleCameraUpdateInterval(),this.viewpointAssetsMap.size>0)&&(ge()(n=this.viewpointAssetsMap).call(n,(e=>{const t=e.panoramas,n=e.css2dObjects;ge()(t).call(t,(e=>{e.box.destroy(),this.scene.remove(e.box)})),ge()(n).call(n,(e=>{this.scene.remove(e)}))})),this.viewpointAssetsMap.clear());ge()(t=this.loadingPanos).call(t,(e=>{e.creationPromise&&(e.creationPromise.cancel(),e.creationPromise=void 0)})),this.loadingPanos=[],this.previousViewpointId="",this.previousPanoramaId="",this.activeViewpointId="",this.activePanoramaId="",this.viewpoints=e}addPanorama(e,t){var n;const r=Se()(n=this.viewpoints).call(n,(t=>t.id===e));if(!r)throw new Error(`[VRViewer] Failed to find viewpoint by id '${e}'`);r.panoramas||(r.panoramas=[]),r.panoramas.push(t)}findPanorama(e,t){var n;const r=Se()(n=this.viewpoints).call(n,(t=>t.id===e));var i;if(r&&r.panoramas)return Se()(i=r.panoramas).call(i,(e=>e.id===t))}setHotpointsVisibility(e,t="",n=[]){if(!this.viewpoints)return;const r=t=>{var r;const i=this.viewpointAssetsMap.get(t.id),s=(null==i?void 0:i.css2dObjects)||[];null===(r=t.hotpoints)||void 0===r||ge()(r).call(r,(r=>{if(n&&n.length>0){if(-1===sp()(n).call(n,(e=>e===r.hotpointId)))return;if(r.visible=e,this.activeViewpointId===t.id){const t=Se()(s).call(s,(e=>e.userData.hotpoint.hotpointId===r.hotpointId));t&&(t.visible=e)}}else r.visible=e,this.activeViewpointId===t.id&&ge()(s).call(s,(t=>t.visible=e))}))};if(t){var i;const e=Se()(i=this.viewpoints).call(i,(e=>e.id===t));e&&r(e)}else{var s;ge()(s=this.viewpoints).call(s,(e=>r(e)))}}addHotpoints(e){var t;if(!this.activeViewpointId||!e)return;const n=Se()(t=this.viewpoints).call(t,(e=>e.id===this.activeViewpointId)),r=this.viewpointAssetsMap.get(this.activeViewpointId);n&&r&&(n.hotpoints||(n.hotpoints=[]),ge()(e).call(e,(e=>{var t;if(-1!==(null===(t=n.hotpoints)||void 0===t?void 0:sp()(t).call(t,(t=>t.hotpointId===e.hotpointId))))return void im.warn(`[VRViewer] Duplicated hotpointId: ${e.hotpointId}`);const i=n.position||[0,0,0],s=e.anchorPosition,a=CX.createHotpoint(e.html),o=new xn(s[0],s[1],s[2]),l=new xn(i[0],i[1],i[2]);this.relocateAnchorIfTooCloseToCamera(a,o,l),a.visible=!1!==e.visible,a.userData.hotpoint=e,r.css2dObjects.push(a),this.scene.add(a),n.hotpoints.push(e)})))}removeHotpoints(e){var t;if(!this.activeViewpointId||!e)return;const n=Se()(t=this.viewpoints).call(t,(e=>e.id===this.activeViewpointId)),r=this.viewpointAssetsMap.get(this.activeViewpointId);n&&r&&ge()(e).call(e,(e=>{if(n.hotpoints)for(let r=n.hotpoints.length-1;r>=0;--r){var t;if(e===n.hotpoints[r].hotpointId)S()(t=n.hotpoints).call(t,r,1)}for(let t=r.css2dObjects.length-1;t>=0;--t){var i;const n=r.css2dObjects[t];var s;if(e===(null===(i=n.userData.hotpoint)||void 0===i?void 0:i.hotpointId))S()(s=r.css2dObjects).call(s,t,1),this.scene.remove(n)}}))}activeViewpointById(e,t,n,r){this.activatePanoramaById(e,"",!0,t,n,r)}activatePanoramaById(e,t,n=!0,r,i,s){var a;if(e===this.activeViewpointId&&t===this.activePanoramaId)return;const o=Se()(a=this.viewpoints).call(a,(t=>t.id===e));o&&this.activatePanorama(o,t,n,r,i,s)}removeCachedPanoramas(){var e;ge()(e=this.viewpointAssetsMap).call(e,((e,t)=>{const n=e.panoramas;for(let e=n.length-1;e>=0;--e){const r=n[e];if(t===this.activeViewpointId&&r.id===this.activePanoramaId)return;if(t===this.previousViewpointId&&r.id===this.previousPanoramaId)return;r.box.destroy(),this.scene.remove(r.box),S()(n).call(n,e,1)}}))}unlimitControlsAndShowAssets(e=!1){var t;this.controls&&(this.controls.enablePan=!0,this.controls.enableZoom=!0),ge()(t=this.viewpointAssetsMap).call(t,(t=>{var n,r;(ge()(n=t.panoramas).call(n,(e=>{e.box.visible=!0})),e)&&ge()(r=t.css2dObjects).call(r,(e=>{e.visible=!0}))}))}relocateAnchorIfTooCloseToCamera(e,t,n){if(!this.camera)return im.error("[VRViewer] Camera is not initialized"),void e.position.set(t.x,t.y,t.z);let r;const i=Math.abs(t.distanceTo(n));if(i<this.camera.near){const e=t.clone().sub(n).normalize();r=n.clone().add(e.multiplyScalar(i+1))}else r=t;e.position.set(r.x,r.y,r.z)}activatePanorama(e,t,n=!0,r,i,s){try{var a;const l=this,c=(e,t,n)=>{var r;const i=Se()(r=e.panoramas).call(r,(e=>e.id===t)),s=null==i?void 0:i.box;s&&(n?l.fadeIn(s):l.fadeOut(s))},u=(e,t)=>{var n;ge()(n=e.css2dObjects).call(n,(e=>{t?!1!==e.userData.hotpoint.visible&&(e.visible=t):e.visible=t}))},h=()=>{var t;const i=new xn(0,0,0);let s=null===(t=l.getCameraPositionAndDirection())||void 0===t?void 0:t.direction;const a=e.position;if(a&&3===a.length&&i.set(a[0],a[1],a[2]),n){const t=e.initialDirection;t&&3===t.length&&(s=new xn(1,0,0),s.set(t[0],t[1],t[2]))}l.setCameraPositionAndDirection(i,s,r)};!t&&(null===(a=e.panoramas)||void 0===a?void 0:a.length)>0&&(t=e.panoramas[0].id||""),l.handleCameraUpdateInterval();const p=l.viewpointAssetsMap.get(l.activeViewpointId),d=l.viewpointAssetsMap.get(e.id);if(l.activeViewpointId&&p&&(l.activeViewpointId!==e.id&&u(p,!1),c(p,l.activePanoramaId,!1)),d){var o;if(Se()(o=d.panoramas).call(o,(e=>e.id===t)))return c(d,t,!0),l.activeViewpointId!==e.id&&u(d,!0),l.activeViewpointId!==e.id&&h(),l.activeViewpointId=e.id,l.activePanoramaId=t,i&&i(e),v().resolve()}return l.previousViewpointId=l.activeViewpointId,l.previousPanoramaId=l.activePanoramaId,l.activeViewpointId=e.id,l.activePanoramaId=t,v().resolve(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){var n;if(RX()(n=l.loadingPanos).call(n,(n=>n.viewpointId===e.id&&n.panoramaId===t)))return void im.warn(`[VRViewer] Panorama with viewpointId=${e.id} and panoramaId=${t} is being created`);const r=new kX(l.createBoxByImageOrImages(e,t));return l.loadingPanos.push({viewpointId:e.id,panoramaId:t,creationPromise:r}),v().resolve(r.promise).then((function(n){var r;l.loadingPanos=le()(r=l.loadingPanos).call(r,(n=>n.viewpointId!==e.id||n.panoramaId!==t));const s=e.position;s&&3===s.length&&n.position.set(s[0],s[1],s[2]),l.activeViewpointId===e.id&&l.activePanoramaId===t?(l.fadeIn(n),l.scene.add(n),h()):(n.visible=!1,l.scene.add(n));const a={id:t,box:n},o=l.viewpointAssetsMap.get(e.id);if(o)o.panoramas.push(a),u(o,!0);else{const r=[];var c;if(e.hotpoints)ge()(c=e.hotpoints).call(c,(i=>{const s=i.anchorPosition,a=CX.createHotpoint(i.html);a.visible=!1!==i.visible,a.userData.hotpoint=i;const o=new xn(s[0],s[1],s[2]);l.relocateAnchorIfTooCloseToCamera(a,o,n.position),l.activeViewpointId===e.id&&l.activePanoramaId===t||(a.visible=!1),r.push(a)}));const i={panoramas:[a],css2dObjects:r};l.viewpointAssetsMap.set(e.id,i),ge()(r).call(r,(e=>l.scene.add(e)))}i&&i(e)}))}),(function(e){"cancel"!==e.type&&s&&s(e)})))}catch(e){return v().reject(e)}}createBoxByImageOrImages(e,t){var n;let r=e.imageOrImages,i=e.thumbnailImages;if((null===(n=e.panoramas)||void 0===n?void 0:n.length)>0){let n=this.findPanorama(e.id,t);n||(n=e.panoramas[0],im.warn(`[VRViewer] Failed to find panorama by id '${t}', will use the first one`)),r=n.images,i=n.thumbnails}if(!r)throw new Error("[VRViewer] Invalid images!");if(x()(r)||(r=[r]),1===r.length)return this.createBoxByImage(r,i);if(6===r.length)return this.createBoxBy6Images(r,i);if(24===r.length)return this.createBoxBy24Images(r,i);throw new Error(`[VRViewer] Wrong number of images! Expected 1/6/24, got ${r.length}`)}createBoxByImage(e,t){try{const n=new LX(e,t);return v().resolve(n.create()).then((function(){return n}))}catch(e){return v().reject(e)}}createBoxBy6Images(e,t){try{if(6!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 6, got ${e.length}`);const n=new PX(e,t);return v().resolve(n.create()).then((function(){return n}))}catch(e){return v().reject(e)}}createBoxBy24Images(e,t){try{if(24!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 24, got ${e.length}`);const n=new NX(e,t);return v().resolve(n.create()).then((function(){return n}))}catch(e){return v().reject(e)}}getIntersection(e){var t;if(!this.camera||!this.scene)return;const n=this.viewpointAssetsMap.get(this.activeViewpointId);if(!n)return;const r=Se()(t=n.panoramas).call(t,(e=>e.id===this.activePanoramaId));if(!r)return;const i=r.box;let s=new Xt;e&&(s=M_.getScreenPointByEvent(e,this.container));const a=M_.screenPoint2NdcPoint(s,this.camera,this.container);this.raycaster.setFromCamera(a,this.camera);const o=[i],l=this.raycaster.intersectObjects(o,!0)||[];if(l.length>0){return Se()(l).call(l,(e=>{const t=e.object;return t.visible&&t instanceof mi}))}}fadeIn(e,t=500){e.fadeIn(t)}fadeOut(e,t=1e3){e.fadeOut(t)}handleCameraUpdateInterval(){if(this.cameraUpdateInterval){clearInterval(this.cameraUpdateInterval);const e=this.fianlCameraPosition,t=this.finalCameraTarget;e&&t&&this.controls&&this.camera&&(this.camera.lookAt(t),this.camera.position.set(e.x,e.y,e.z),this.controls.target.set(t.x,t.y,t.z),this.controls.update()),this.cameraUpdateInterval=void 0}this.fianlCameraPosition=void 0,this.finalCameraTarget=void 0}getHitResult(e){const t={location:null};if(!this.camera)return t;const n=this.getIntersection(e);return t.location=n?n.point:null,t}lookToPosition(e){var t;if(!this.camera)return;this.handleCameraUpdateInterval();const n=new xn(e[0],e[1],e[2]).clone().sub(this.camera.position);null===(t=this.controlsHelper)||void 0===t||t.lookTo(n)}}let jX;!function(e){e.MarkupClicked="MarkupClicked",e.LayoutChanged="LayoutChanged"}(jX||(jX={}));var GX;!function(e){e.statistics="statistics",e.cameraInfo="cameraInfo",e.stats="stats",e.tips="tips"}(GX||(GX={}));const zX={[GX.stats]:{icon:{default:"icon-showsectionplane"},mutexIds:[GX.statistics,GX.cameraInfo,GX.tips],onActive:e=>{e.viewer instanceof g$&&e.viewer.showStats()},onDeactive:e=>{e.viewer instanceof g$&&e.viewer.hideStats()}},[GX.statistics]:{icon:{default:"icon-info",active:"icon-info-filled"},mutexIds:[GX.stats,GX.cameraInfo,GX.tips],onActive:e=>{const t=document.createElement("span");if(!e.viewer.scene)return void(t.textContent="Failed!");t.textContent="Comupting...";const n={components:{},points:0,faces:0,materials:{},lights:{}},r=["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"];e.viewer.scene.traverse((e=>{(e instanceof mi||e instanceof Vo||e instanceof Qo)&&!cp()(r).call(r,e.name)?((e,t)=>{if(t.components[e.type]?t.components[e.type]++:t.components[e.type]=1,e.geometry){const n=e.geometry;if(e instanceof mi)if(n.index&&n.index.count){let r=Math.round(n.index.count/3);e instanceof ko&&(r*=e.count),t.faces+=r}else if(n.groups.length>0)for(let e=0;e<n.groups.length;++e)t.faces+=n.groups[e].count/3;if(n.attributes.position){const e=n.attributes.position;e.count&&e.itemSize&&(t.points+=e.count)}}const n=e=>{t.materials[e]?t.materials[e]++:t.materials[e]=1},r=e.material;r instanceof Lr?n(r.id):x()(r)&&ge()(r).call(r,(e=>n(e.id)))})(e,n):e instanceof Vc&&(n.lights[e.type]?n.lights[e.type]++:n.lights[e.type]=1)}));const i=(e,n)=>{t.innerHTML+=`<p><span>${e}:</span>${n}</p>`};if(t.innerHTML="",i("Version",QT),i("Components",V()(n.components)),i("Points",n.points),i("Faces",n.faces),i("Materials",Q()(n.materials).length),i("Lights",V()(n.lights)),e.viewer instanceof g$){i("Entities",e.viewer.getEntitiesCount())}e.tooltip.setContent(t),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()},onUpdate:e=>{const t=e.viewer.renderer,n=document.createElement("span"),r=(e,t)=>{n.innerHTML+=`<p><span>${e}:</span>${t}</p>`};n.innerHTML="<p>-- Renderer Info --</p>";const i=null==t?void 0:t.info;r("Drawcalls",V()(null==i?void 0:i.render.calls)),r("Points",V()(null==i?void 0:i.render.points)),r("Lines",V()(null==i?void 0:i.render.lines)),r("Triangles",V()(null==i?void 0:i.render.triangles)),r("Geometries",V()(null==i?void 0:i.memory.geometries)),r("Textures",V()(null==i?void 0:i.memory.textures)),e.tooltip.updateChildContent(n)}},[GX.cameraInfo]:{icon:{default:"icon-view",active:"icon-view-filled"},mutexIds:[GX.stats,GX.statistics,GX.tips],onActive:e=>{var t;const n=()=>{if(!e.viewer||!e.viewer.camera||!e.viewer.controls)return;const t=e.viewer.camera,r=e.viewer.controls,i=e=>cm.numberToString(e),s=e=>cm.vectorToString(e),a=t.position,o=r.target;if(a){const n=document.createElement("span");n.innerHTML=`\n <p><span>Camera position:</span>${s(a)}</p>\n <p><span>Camera target:</span>${s(o)}</p>`,t instanceof Wi&&(n.innerHTML+=`\n <p>top: ${i(t.top)}, bottom: ${i(t.bottom)}, left: ${i(t.left)}, right: ${i(t.right)}</p>\n <p>zoom: ${i(t.zoom)}</p>`),e.tooltip.setContent(n)}e.active||window.removeEventListener("mouseup",n)};n(),window.addEventListener("mouseup",n),null===(t=e.viewer.controls)||void 0===t||t.addEventListener("change",n),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()}},[GX.tips]:{icon:{default:"icon-more"},mutexIds:[GX.stats,GX.cameraInfo,GX.cameraInfo],onActive:e=>{const t=document.createElement("span");e.viewer instanceof SX?t.innerHTML="\n <p><span>W: </span>Move forward</p>\n <p><span>A: </span>Move backward</p>\n <p><span>S: </span>Move left</p>\n <p><span>D: </span>Move right</p>\n <p><span>Q: </span>Rise up</p>\n <p><span>E: </span>Lower down</p>\n <p><span>↑: </span>Rotate up</p>\n <p><span>↓: </span>Rotate down</p>\n <p><span>←: </span>Rotate to left</p>\n <p><span>→: </span>Rotate to right</p>\n ":e.viewer instanceof g$?t.innerHTML="\n <p><span>↑: </span>Move up</p>\n <p><span>↓: </span>Move down</p>\n <p><span>←: </span>Move to left</p>\n <p><span>→: </span>Move to right</p>\n ":e.viewer instanceof BX?t.innerHTML="\n <p><span>↑: </span>Rotate up</p>\n <p><span>↓: </span>Rotate down</p>\n <p><span>←: </span>Rotate to left</p>\n <p><span>→: </span>Rotate to right</p>\n ":t.innerHTML="\n <p>Nothing to show</p>\n ",e.tooltip.setContent(t),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()}}};class VX{constructor(e){this.viewer=e,gh(this,"element",void 0),gh(this,"itemList",new(ue())),this.init()}update(){var e;ge()(e=this.itemList).call(e,(e=>{e.update()}))}init(){const e=document.createElement("div");e.id="bottomBar",e.classList.add("bottom-bar"),(0,mp.forEach)(zX,((t,n)=>{const r=this.createItem(this.viewer,n,t);e.appendChild(r.element)})),this.element=e,this.viewer.rootHtmlElement.appendChild(this.element)}createItem(e,t,n){const r=new HX(e,this,t,n);return this.itemList.set(t,r),r}}class HX{constructor(e,t,n,r){this.viewer=e,this.bottomBar=t,this.menuId=n,this.cfg=r,gh(this,"eventBus",Zd()),gh(this,"itemconfig",void 0),gh(this,"tooltip",void 0),gh(this,"element",void 0),gh(this,"active",!1),this.itemconfig=r,this.element=this.createButton(this.menuId,r),this.tooltip=new fy(n+"-tooltip",null,{parentNode:e.rootHtmlElement}),this.eventBus.on("activeChange",(e=>{e?(this.element.classList.add("active"),(0,mp.forEach)(r.mutexIds,(e=>{var t;const n=null===(t=this.bottomBar)||void 0===t?void 0:t.itemList.get(e);n&&n.active&&n.setActive(!1)})),r.onActive&&r.onActive(this)):(this.element.classList.remove("active"),r.onDeactive&&r.onDeactive(this)),this.element instanceof HTMLElement&&um(this.element.classList,r.icon,this.active)}))}createButton(e,t){const n=document.createElement("i");n.id=e;const{default:r="icon-new",iconFont:i=Dh}=t.icon;return n.classList.add("icon"),n.classList.add(i),n.classList.add(r),n.onclick=()=>{this.active=!this.active,t.onClick&&t.onClick(this),this.eventBus.emit("activeChange",this.active)},n}setActive(e){this.active=e,this.eventBus.emit("activeChange",this.active)}update(){this.active&&this.itemconfig.onUpdate&&this.itemconfig.onUpdate(this)}}const qX={};class WX extends bv{static _registerDrawableClass(e){qX[e.prototype.getClassType()]=e}constructor(e){super(),gh(this,"viewer",void 0),gh(this,"drawableLists",[]),gh(this,"canvas",void 0),gh(this,"context",void 0),gh(this,"lineWidth",2),gh(this,"lineColor","#ff0000"),gh(this,"fillColor","rgba(255, 0, 0, 0.3)"),gh(this,"fontSize",20),this.viewer=e,this.init()}get container(){return this.viewer.container}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()}getPixelSize(e,t){const{clientWidth:n,clientHeight:r}=this.container;let i=0;if("OrthographicCamera"===t.type){const s=t;i=e*Math.max(s.right-s.left,s.top-s.bottom)/s.zoom/Math.max(n,r)}else if("PerspectiveCamera"===t.type){const n=t,s=this.viewer.cameraCfg,a=s&&cm.arrayToVector3(s.eye),o=s&&cm.arrayToVector3(s.look);i=2*e*(a.distanceTo(o)*Math.tan(n.fov/2*Math.PI/180))/r}return i}init(){this.initCanvas()}initCanvas(){const e=this.canvas=document.createElement("canvas");e.id="overlay-render",e.style.pointerEvents="none",e.style.position="absolute",e.style.left="0px",e.style.top="0px",e.style.userSelect="none",this.context=e.getContext("2d");const{clientWidth:t,clientHeight:n}=this.viewer.container;this.setSize(t,n),this.viewer.container.appendChild(e)}toHighDpr(e,t,n){const r=window.devicePixelRatio||1,i=this.canvas;return i.width=t*r,i.height=n*r,e.scale(r,r),i.style.width=`${t}px`,i.style.height=`${n}px`,e}clearCanvas(){var e,t,n;null===(e=this.context)||void 0===e||e.clearRect(0,0,null===(t=this.canvas)||void 0===t?void 0:t.width,null===(n=this.canvas)||void 0===n?void 0:n.height)}addDrawableList(e){this.drawableLists.push(e)}render(){this.clearCanvas();for(let e=0;e<this.drawableLists.length;e++){const t=this.drawableLists[e].getDrawables();for(const[e,n]of t)n.visible&&(n.setTolerance(this.getPixelSize(1,this.camera)),n.render(this.context,this.camera))}}static createDrawable(e){var t;const n=qX[e.type];if(!n)throw new Error(`Invalid drawable type: ${n}`);const r=Z()(t=e.points).call(t,(e=>new Xt(e[0],e[1]))),i=new n(e.id,r);return i.setData(e),i}setSize(e,t){this.canvas.width=e,this.canvas.height=t,this.canvas.style.width=`${e}px`,this.canvas.style.height=`${t}px`,this.toHighDpr(this.context,e,t)}setLineWidth(e){this.lineWidth=e}getLineWidth(){return this.lineWidth}setLineColor(e){this.lineColor=e}getLineColor(){return this.lineColor}setFillColor(e){this.fillColor=e}getFillColor(){return this.fillColor}setFontSize(e){this.fontSize=e}getFontSize(){return this.fontSize}measureTextLength(e){const t=this.context,n=e.split("\n");let r=0;for(let e=0;e<n.length;e++){const i=n[e];t.save(),t.font=`${this.fontSize}px Arial`;const s=t.measureText(i).width;t.restore(),r=Math.max(r,s)}return r}toVecArr(e){const t=[];for(const n of e){const e=cm.arrayToVector2(n);e&&t.push(e)}return t}screenshot(e={type:"image/png",quality:.8}){try{const t=this;return t.canvas?v().resolve(cm.canvasToImage(t.canvas)).then((function(n){var r;return v().resolve(cm.canvasToImage(null===(r=t.viewer.renderer)||void 0===r?void 0:r.domElement)).then((function(r){var i,s;t.clearCanvas(),null===(i=t.context)||void 0===i||i.drawImage(r,0,0,r.width/window.devicePixelRatio,r.height/window.devicePixelRatio),null===(s=t.context)||void 0===s||s.drawImage(n,0,0,n.width/window.devicePixelRatio,n.height/window.devicePixelRatio);return t.canvas.toDataURL(e.type,e.quality)}))})):v().resolve()}catch(e){return v().reject(e)}}destroy(){this.canvas&&(this.viewer.container.removeChild(this.canvas),this.canvas=void 0)}}class YX extends bv{constructor(e){super(),gh(this,"DEFAULT_LINE_WIDTH",1),gh(this,"DEFAULT_STROKE_STYLE","#000000"),gh(this,"DEFAULT_FILL_STYLE","#000000"),gh(this,"id",void 0),gh(this,"lineWidth",this.DEFAULT_LINE_WIDTH),gh(this,"lineColor",this.DEFAULT_STROKE_STYLE),gh(this,"fillColor",this.DEFAULT_FILL_STYLE),gh(this,"x",0),gh(this,"y",0),gh(this,"points",[]),gh(this,"userData",{}),gh(this,"width",0),gh(this,"height",0),gh(this,"tolerance",1),gh(this,"visible",!0),gh(this,"selected",!1),gh(this,"editPointSize",3),gh(this,"editPointColor","#ffffff"),gh(this,"ctx",void 0),this.id=e||cm.guid()}setTolerance(e){this.tolerance=e}render(e,t){this.ctx=e,this.draw(e,t),this.selected&&this.drawSelect(e,t)}getData(){var e;return{id:this.id,points:Z()(e=this.points).call(e,(e=>[e.x,e.y])),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.getClassType()}}setData(e){this.id=e.id,this.setLineWidth(e.lineWidth),this.setLineColor(e.lineColor),this.setFillColor(e.fillColor)}getVertexs(){return[new Xt(this.x,this.y),new Xt(this.x+this.width,this.y),new Xt(this.x+this.width,this.y+this.height),new Xt(this.x,this.y+this.height)]}setLineWidth(e){this.lineWidth=e||this.DEFAULT_LINE_WIDTH}setLineColor(e){this.lineColor=e||this.DEFAULT_STROKE_STYLE}setFillColor(e){this.fillColor=e||this.DEFAULT_FILL_STYLE}isSelected(){return this.selected}getCenter(){return this.getBounds().getCenter(new Xt)}transToScreenCoord(e,t){return this.ctx?M_.worldPosition2ScreenPoint(new xn(e.x,e.y,0),t,this.ctx.canvas):new Xt}drawBounds(e,t){const n=this.getVertexs();e.save(),e.strokeStyle="yellow",e.beginPath(),ge()(n).call(n,((n,r)=>{n=this.transToScreenCoord(n,t),0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore()}isPointInPath(e){const t=this.getVertexs();return ef.isPointInPolygon(e,t,!0)}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}}class XX extends YX{constructor(e){super(e),gh(this,"editPointSize",3),gh(this,"editPointColor","#ffffff"),gh(this,"ctx",void 0),this.id=e||cm.guid()}isSelected(){return this.selected}drawSelect(e,t){const n=this.getVertexs();this.drawPoints(e,t,n)}drawPoints(e,t,n){e.save(),e.fillStyle=this.editPointColor,e.beginPath(),ge()(n).call(n,(n=>{n=this.transToScreenCoord(n,t),e.moveTo(n.x,n.y),e.arc(n.x,n.y,this.editPointSize,0,2*Math.PI)})),e.closePath(),L_()(e).call(e),e.restore()}setEditPointSize(e){this.editPointSize=e}setEditPointColor(e){this.editPointColor=e}getCenter(){return this.getBounds().getCenter(new Xt)}isPointInPath(e){const t=this.getVertexs();return ef.isPointInPolygon(e,t,!0)}setData(e){var t;super.setData(e),this.update(Z()(t=e.points).call(t,(e=>new Xt(e[0],e[1]))))}}WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"type",_y.Arrow),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){var n;const r=Z()(n=this.points).call(n,(e=>this.transToScreenCoord(e,t)));this.drawArrowLine(e,r),this.drawArrowHead(e,r[0],r[1],this.lineWidth+10,this.lineWidth+20)}drawArrowLine(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor;const[n,r]=t,i=(new Xt).subVectors(r,n).normalize();e.beginPath(),e.moveTo(n.x,n.y);const s=r.clone().sub(i.multiplyScalar(this.lineWidth+5));e.lineTo(s.x,s.y),e.closePath(),e.stroke(),e.restore()}drawArrowHead(e,t,n,r,i){const s=180*Math.atan2(t.y-n.y,t.x-n.x)/Math.PI,a=(s+r)*Math.PI/180,o=(s-r)*Math.PI/180,l=i*Math.cos(a),c=i*Math.sin(a),u=i*Math.cos(o),h=i*Math.sin(o),p=new Xt(n.x+l,n.y+c),d=new Xt(n.x+u,n.y+h);e.save(),e.fillStyle=this.lineColor,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(p.x,p.y),e.lineTo(d.x,d.y),e.closePath(),L_()(e).call(e),e.restore()}isPointInPath(e){return ef.isPointOnLineSegments(e,this.points,this.tolerance)}getVertexs(){return this.points}update(e){const[t,n]=e;return this.points=e,this.x=Math.min(t.x,n.x),this.y=Math.min(t.y,n.y),this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"ArrowMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"radius",1),gh(this,"type",_y.Circle),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){var n;const[r,i]=Z()(n=this.points).call(n,(e=>this.transToScreenCoord(e,t)));this.radius=(new Xt).subVectors(i,r).length(),e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.arc(r.x,r.y,this.radius,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}update(e){const[t,n]=e,r=(new Xt).subVectors(n,t).length();return this.width=2*r,this.height=2*r,this.x=t.x-this.width/2,this.y=t.y-this.height/2,this.points=e,this}isPointInPath(e){const[t,n]=this.points,r=(new Xt).subVectors(t,n).length();return Math.abs(e.distanceTo(t)-r)<=2*this.tolerance}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"CircleMarkup"}});const $X=new xu;class KX extends XX{constructor(e,t){super(e),gh(this,"points",[]),gh(this,"type",_y.CloudLine),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){const n=this.points,r=[];e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath();for(let i=0;i<n.length-1;i++){const s=this.transToScreenCoord(n[i],t),a=this.transToScreenCoord(n[i+1],t),o=KX.getControlPointByTwoPoints(s,a);0===i&&e.moveTo(s.x,s.y),e.quadraticCurveTo(o.x,o.y,a.x,a.y),r.push(n[i],n[i+1])}e.stroke(),e.restore(),this.calculateWidthAndHeight(r)}static getControlPointByTwoPoints(e,t){const n=(new Xt).subVectors(t,e),r=n.angle(),i=n.length(),s=Yt.degToRad(45),a=i/2/Math.cos(s);return new Xt(e.x+a*Math.cos(s-r),e.y-a*Math.sin(s-r))}calculateWidthAndHeight(e){const t=new xu;for(let n=0;n<e.length-1;n++){const r=e[n],i=e[n+1],s=(new Xt).lerpVectors(r,i,.5),a=(new Xt).subVectors(i,r).length(),o=(new xu).setFromCenterAndSize(s,new Xt(a,a));t.union(o)}const{min:n,max:r}=t;this.width=Math.abs(r.x-n.x),this.height=Math.abs(r.y-n.y),this.x=n.x,this.y=n.y}update(e){const{min:t,max:n}=$X.setFromPoints(e);return this.x=t.x,this.y=t.y,this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this.points=e,this}getBounds(){const e=this.getVertexs();return $X.setFromPoints(e)}getClassType(){return"CloudLineMarkup"}}WX._registerDrawableClass(KX);WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"type",_y.CloudLineRectangle),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(e){var t;const n=Yt.degToRad(e);return ge()(t=this.points).call(t,(e=>e.rotateAround(this.getCenter(),n))),this.update(this.points),this}scale(e,t){var n;return ge()(n=this.points).call(n,(n=>n.divide(new Xt(e,t)))),this.update(this.points),this}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath();const n=this.getVertexs();let r;n.push(n[0]);const i=[];for(let e=0;e<n.length-1;e++){const s=this.transToScreenCoord(n[e],t),a=this.transToScreenCoord(n[e+1],t),o=(new Xt).subVectors(a,s);r||(r=o.length()/10);const l=o.length(),c=o.normalize(),u=Math.round(l/r);for(let e=0;e<u;e++)i.push(s.clone().add(c.clone().multiplyScalar(r*e)))}i.push(i[0]);for(let t=0;t<i.length-1;t++){const n=i[t],r=i[t+1],s=KX.getControlPointByTwoPoints(r,n);0===t&&e.moveTo(n.x,n.y),e.quadraticCurveTo(s.x,s.y,r.x,r.y)}e.closePath(),e.stroke(),e.restore()}update(e){const[t,n]=e;return this.points=e,this.x=Math.min(t.x,n.x),this.y=Math.min(t.y,n.y),this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this}isPointInPath(e){const t=this.getVertexs(),n=[];for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1]||t[0];n.push(r,i)}return ef.isPointOnLineSegments(e,n,3*this.tolerance)}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"CloudRectMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"radius",8),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){const n=this.transToScreenCoord(this.points[0],t);this.width=2*this.radius*this.tolerance,this.height=2*this.radius*this.tolerance,this.x=this.points[0].x-this.radius*this.tolerance,this.y=this.points[0].y-this.radius*this.tolerance,e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.arc(n.x,n.y,this.radius,0,2*Math.PI),e.closePath(),L_()(e).call(e),e.stroke(),e.restore()}update(e){const t=e[0];return this.width=2*this.radius*this.tolerance,this.height=2*this.radius*this.tolerance,this.x=t.x-this.radius*this.tolerance,this.y=t.y-this.radius*this.tolerance,this.points=e,this}isPointInPath(e){const t=this.points[0];return e.distanceTo(t)<=this.tolerance*this.radius}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"DotMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"radiusX",1),gh(this,"radiusY",1),gh(this,"points",[]),gh(this,"type",_y.Ellipse),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){var n;const[r,i]=Z()(n=this.points).call(n,(e=>this.transToScreenCoord(e,t))),s=(new Xt).lerpVectors(r,i,.5);this.radiusX=Math.abs(i.x-r.x)/2,this.radiusY=Math.abs(i.y-r.y)/2,e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.ellipse(s.x,s.y,this.radiusX,this.radiusY,0,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}update(e){const[t,n]=e;return this.x=Math.min(t.x,n.x),this.y=Math.min(t.y,n.y),this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this.points=e,this}isPointInPath(e){const[t,n]=this.points,r=(new Xt).lerpVectors(t,n,.5),i=Math.abs(n.x-t.x)/2,s=Math.abs(n.y-t.y)/2,a=Math.pow(e.x-r.x,2)/(i*i),o=Math.pow(e.y-r.y,2)/(s*s);return Math.abs(a+o-1)<=.1}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"EllipseMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"points",[]),gh(this,"type",_y.PolyLine),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor;const n=this.points;e.beginPath(),ge()(n).call(n,((n,r)=>{n=this.transToScreenCoord(n,t),0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.stroke(),e.restore()}isPointInPath(e){const t=this.points,n=[];for(let e=0;e<t.length-1;e++)n.push(t[e],t[e+1]);return ef.isPointOnLineSegments(e,n,1*this.tolerance)}getVertexs(){return this.points}update(e){const{min:t,max:n}=(new xu).setFromPoints(e);return this.x=t.x,this.y=t.y,this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this.points=e,this}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"PolylineMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"type",_y.Rectangle),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath();const n=this.getVertexs();ge()(n).call(n,((n,r)=>{n=this.transToScreenCoord(n,t),0===r?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore()}update(e){const[t,n]=e;return this.x=Math.min(t.x,n.x),this.y=Math.min(t.y,n.y),this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this.points=e,this}isPointInPath(e){const t=this.getVertexs(),n=[];for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1]||t[0];n.push(r,i)}return ef.isPointOnLineSegments(e,n,2*this.tolerance)}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"RectMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t,n){super(e),gh(this,"text",""),gh(this,"fontSize",12),gh(this,"textWidth",0),gh(this,"textRow",1),gh(this,"type",_y.Text),this.update(t),this.text=n}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.lineColor,e.font=this.fontSize/this.tolerance+"px Arial";const n=this.formatText(e,this.text),r=this.transToScreenCoord(new Xt(this.x,this.y),t);this.drawText(e,n,r.x,r.y),e.restore()}drawText(e,t,n,r){for(let i=0;i<t.length;i++){const s=t[i];if(s.lineWidth<this.textWidth+2){const t=s.lineText;e.fillText(t,n,r-i*this.fontSize/this.tolerance-4)}}this.width||(this.width=this.textWidth*this.tolerance),this.height||(this.height=t.length*this.fontSize),this.textRow=t.length}formatText(e,t){const n=t.split("\n"),r=[];for(let t=0;t<n.length;t++){const i=n[t],s=e.measureText(i).width;s>this.textWidth&&(this.textWidth=s),r.push({lineWidth:s,lineText:i})}return this.textRow!==r.length&&(this.y-=(r.length-1)*this.fontSize),Te()(r).call(r)}setFontSize(e){this.fontSize=e}update(e){const t=e[0];return this.x=t.x,this.y=t.y,this.points=[t],this.textRow=1,this}setData(e){super.setData(e),this.text=e.text,this.setFontSize(e.fontSize)}updateText(e){this.text=e}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getData(){var e;return{id:this.id,points:Z()(e=this.points).call(e,(e=>[e.x,e.y])),text:this.text,lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,fontSize:this.fontSize,type:this.getClassType()}}getClassType(){return"TextMarkup"}});WX._registerDrawableClass(class extends XX{constructor(e,t){super(e),gh(this,"type",_y.X),this.update(t)}translate(e,t){var n;const r=new Xt(e,t);return ge()(n=this.points).call(n,(e=>e.add(r))),this.update(this.points),this}rotate(){return this}scale(){return this}draw(e,t){var n;e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.beginPath();const[r,i,s,a]=Z()(n=this.getVertexs()).call(n,(e=>this.transToScreenCoord(e,t)));e.moveTo(r.x,r.y),e.lineTo(s.x,s.y),e.moveTo(i.x,i.y),e.lineTo(a.x,a.y),e.closePath(),e.stroke(),e.restore()}isPointInPath(e){const[t,n,r,i]=this.getVertexs();return ef.isPointOnLineSegments(e,[t,r,n,i],.1)}update(e){const[t,n]=e;return this.points=e,this.x=Math.min(t.x,n.x),this.y=Math.min(t.y,n.y),this.width=Math.abs(n.x-t.x),this.height=Math.abs(n.y-t.y),this}getBounds(){const e=this.getVertexs();return(new xu).setFromPoints(e)}getClassType(){return"XMarkup"}});class ZX{constructor(e){gh(this,"category",void 0),gh(this,"drawableMap",new(ue())),this.category=e}addDrawable(e){this.drawableMap.set(e.id,e)}updateDrawable(e,t){e.setData(t)}removeDrawable(e){this.drawableMap.delete(e.id)}getDrawableById(e){return this.drawableMap.get(e)}clear(){this.drawableMap.clear()}getDrawables(){return this.drawableMap}getDrawableDatas(){var e;return Z()(e=F()(this.drawableMap)).call(e,(([e,t])=>t.getData()))}setDrawableDatas(e){for(let t=0;t<e.length;t++){const n=e[t],r=WX.createDrawable(n);this.drawableMap.set(r.id,r)}}getDrawableByPosition(e){let t;for(const[n,r]of this.drawableMap)if(r.visible&&r.isPointInPath(e)){t=r;break}return t}}let JX;!function(e){e.Add="Add",e.Update="Update",e.Remove="Remove"}(JX||(JX={}));class QX extends zy{constructor(e,t){super(t),gh(this,"manager",void 0),this.manager=e}undo(){const e=super.undo();switch(null==e?void 0:e.type){case JX.Add:{const t=this.manager.getMarkupById(e.payload.id);t&&this.manager.removeMarkup(t,!1)}break;case JX.Remove:{const t=this.manager.createMarkup(e.payload);t&&this.manager.addMarkup(t,!1)}break;case JX.Update:{const{from:t,to:n}=e.payload,r=this.manager.getMarkupById(t.id);r&&this.manager.updateMarkup(r,t,!1)}}return e}redo(){const e=super.redo();switch(null==e?void 0:e.type){case JX.Add:{const t=this.manager.createMarkup(e.payload);t&&this.manager.addMarkup(t,!1)}break;case JX.Remove:{const t=this.manager.getMarkupById(e.payload.id);t&&this.manager.removeMarkup(t,!1)}break;case JX.Update:{const{from:t,to:n}=e.payload,r=this.manager.getMarkupById(n.id);r&&this.manager.updateMarkup(r,n,!1)}}return e}}const e$=new Xt;class t$ extends bv{constructor(e){var t,n;super(),gh(this,"viewer",void 0),gh(this,"overlayRender",void 0),gh(this,"drawableList",new ZX("markup")),gh(this,"lineWidth",2),gh(this,"lineColor","#ff0000"),gh(this,"fillColor","rgba(255, 0, 0, 0.3)"),gh(this,"fontSize",20),gh(this,"mouseDown",!1),gh(this,"mouseDownPositionX",-1),gh(this,"mouseDownPositionY",-1),gh(this,"textInitialPosition",void 0),gh(this,"tempKey",void 0),gh(this,"tempArrowKeys",void 0),gh(this,"selectedShape",void 0),gh(this,"type",void 0),gh(this,"isDrawing",!1),gh(this,"initialDataForEditing",void 0),gh(this,"creatingShape",void 0),gh(this,"tempPoints",[]),gh(this,"textInput",void 0),gh(this,"actived",!1),gh(this,"undoRedoHelper",new QX(this)),gh(this,"mousedown",(e=>{let t=this.pickThreePositionByMouse(e);if(this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y,0===e.button&&(this.mouseDown=!0),2===e.button){var n;if(this.creatingShape&&this.tempPoints.length<2)this.removeMarkup(this.creatingShape,!1),this.creatingShape=void 0;else null===(n=this.creatingShape)||void 0===n||n.update(this.tempPoints);this.isDrawing&&this.endDraw(this.creatingShape)}if(this.selectedShape&&(this.selectedShape.selected=!1,this.selectedShape=void 0,this.render()),!this.isDrawing){const e=this.drawableList.getDrawableByPosition(t.clone());e&&(this.selectedShape=e,e.selected=!0,this.render(),this.textInput&&(this.textInput.style.display="none"))}if(this.isCreateTextMode()&&this.mouseDown&&!this.selectedShape&&((!this.textInitialPosition||this.textInput&&0===this.textInput.value.length)&&(this.textInitialPosition=t.clone()),this.addInput(e.clientX,e.clientY)),this.isCreateLineMode()&&this.mouseDown&&!this.selectedShape){if(this.tempPoints.length>0){const e=this.tempPoints[0];if(e$.subVectors(e,t).length()<this.overlayRender.getPixelSize(5,this.camera))return t=this.tempPoints[0].clone(),this.tempPoints.push(t),void this.endDraw(this.creatingShape)}this.isDrawing=!0,this.tempPoints.push(t)}if(this.isCreateDotMode()&&this.mouseDown&&!this.selectedShape){if(!this.creatingShape){const e=this.creatingShape=this.drawShape(t);e&&this.addMarkup(e,!0)}this.isDrawing=!0,this.render()}})),gh(this,"mousemove",(e=>{if(e.preventDefault(),!this.type)return;let t=this.pickThreePositionByMouse(e);if(this.selectedShape){if(this.mouseDown){this.isEditing()||(this.initialDataForEditing=this.selectedShape.getData());const e=t.x-this.mouseDownPositionX,n=t.y-this.mouseDownPositionY;this.selectedShape.translate(e,n),this.render(),this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y}}else{if(this.isCreateDotMode())return;const e=new Xt(this.mouseDownPositionX,this.mouseDownPositionY);if(this.mouseDown&&this.isCreateShapeMode()){if(!this.creatingShape){const n=this.creatingShape=this.drawShape(e,t);n&&this.addMarkup(n,!1)}this.creatingShape.update([e,t]),this.isDrawing=!0,this.render()}if(this.isCreateLineMode()&&this.tempPoints.length>0&&this.isDrawing){if(!this.creatingShape){const e=this.creatingShape=this.drawLine([...this.tempPoints,t]);e&&this.addMarkup(e,!1)}const e=this.tempPoints[0];e$.subVectors(e,t).length()<this.overlayRender.getPixelSize(5,this.camera)&&(t=this.tempPoints[0].clone()),this.creatingShape.update([...this.tempPoints,t]),this.render()}}})),gh(this,"mouseup",(e=>{e.preventDefault(),this.mouseDown=!1,this.selectedShape&&this.isEditing()&&this.endEdit(this.selectedShape),this.isCreateShapeMode()&&this.isDrawing&&this.endDraw(this.creatingShape)})),gh(this,"keydown",(e=>{this.type&&("Delete"===e.code?this.selectedShape&&this.removeMarkup(this.selectedShape):e.ctrlKey&&"KeyZ"===e.code?this.undo():e.ctrlKey&&"KeyY"===e.code&&this.redo())})),this.viewer=e,this.overlayRender=this.viewer.overlayRender,null===(t=this.overlayRender)||void 0===t||t.addDrawableList(this.drawableList),this.viewer.addEventListener("render",ve()(n=this.render).call(n,this)),this.addMarkupEventToViewer()}get viewerCanvas(){var e;return null===(e=this.viewer.renderer)||void 0===e?void 0:e.domElement}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()}addMarkupEventToViewer(){this.viewerCanvas.addEventListener("pointerup",(e=>{const t=this.pickThreePositionByMouse(e),n=this.drawableList.getDrawableByPosition(t.clone());n&&this.viewer.dispatchEvent(jX.MarkupClicked,{markup:n.getData(),point:t})}))}removeMarkupEventFromViewer(){}setMarkupsVisibility(e){var t;ge()(t=this.drawableList.getDrawables()).call(t,(t=>t.visible=e))}clearAll(){this.drawableList.clear(),this.textInput&&(this.textInput.style.display="none"),this.undoRedoHelper.clear(),this.isDrawing&&this.endDraw(),this.render()}isActived(){return this.actived}activate(){var e;this.actived=!0,this.viewerCanvas.addEventListener("pointerdown",this.mousedown),this.viewerCanvas.addEventListener("pointermove",this.mousemove),this.viewerCanvas.addEventListener("pointerup",this.mouseup),window.addEventListener("keydown",this.keydown),this.tempKey=this.viewer.controls.mouseButtons.LEFT,this.viewer.controls.mouseButtons.LEFT=-1,this.tempArrowKeys=null===(e=this.viewer.controls)||void 0===e?void 0:Me()(e),this.viewer.controls.keys={},this.render()}deactivate(){this.actived=!1;const e=this.viewerCanvas;e&&(e.removeEventListener("pointerdown",this.mousedown),e.removeEventListener("pointermove",this.mousemove),e.removeEventListener("pointerup",this.mouseup)),window.removeEventListener("keydown",this.keydown),this.viewer.controls.mouseButtons.LEFT=this.tempKey,this.viewer.controls.keys=this.tempArrowKeys,this.textInput&&this.textInput.remove(),this.textInput=void 0,this.textInitialPosition=void 0,this.mouseDown=!1,this.selectedShape=void 0,this.tempPoints=[],this.isDrawing=!1,this.type=void 0,this.creatingShape=void 0}getActiveMarkupType(){return this.type}setDrawType(e){this.type=e,e?(this.viewer.controls.mouseButtons.LEFT=-1,this.viewer.controls.keys={}):(this.viewer.controls.mouseButtons.LEFT=this.tempKey,this.viewer.controls.keys=this.tempArrowKeys),this.endDraw()}setLineWidth(e){var t;null===(t=this.overlayRender)||void 0===t||t.setLineWidth(e)}getLineWidth(){var e;return null===(e=this.overlayRender)||void 0===e?void 0:e.getLineWidth()}setLineColor(e){var t;null===(t=this.overlayRender)||void 0===t||t.setLineColor(e)}getLineColor(){var e;return null===(e=this.overlayRender)||void 0===e?void 0:e.getLineColor()}setFillColor(e){var t;null===(t=this.overlayRender)||void 0===t||t.setFillColor(e)}getFillColor(){var e;return null===(e=this.overlayRender)||void 0===e?void 0:e.getFillColor()}setFontSize(e){var t;null===(t=this.overlayRender)||void 0===t||t.setFontSize(e)}getFontSize(){var e;return null===(e=this.overlayRender)||void 0===e?void 0:e.getFontSize()}pickPositionByScreenPoint(e){const t=new Xt,n=M_.screenPoint2NdcPoint(e,this.camera,this.viewerCanvas);this.raycaster.setFromCamera(n,this.camera);const r=this.raycaster.intersectObject(this.viewer.groundPlane||this.viewer.scene)||[];return r.length>0&&t.set(r[0].point.x,r[0].point.y),t}pickThreePositionByMouse(e){const t=M_.getScreenPointByEvent(e,this.viewerCanvas);return this.pickPositionByScreenPoint(t)}isEditing(){return!!this.initialDataForEditing}endEdit(e){this.undoRedoHelper.addRecord(JX.Update,{from:this.initialDataForEditing,to:e.getData()}),this.initialDataForEditing=void 0}endDraw(e){e&&this.undoRedoHelper.addRecord(JX.Add,e.getData()),this.textInput&&(this.textInput.style.display="none",this.textInput.value=""),this.textInitialPosition=void 0,this.tempPoints=[],this.isDrawing=!1,this.creatingShape=void 0,this.mouseDownPositionX=-1,this.mouseDownPositionY=-1}render(){var e;null===(e=this.overlayRender)||void 0===e||e.render()}addMarkup(e,t=!0){this.drawableList.addDrawable(e),this.render(),t&&this.undoRedoHelper.addRecord(JX.Add,e.getData())}updateMarkup(e,t,n=!0){this.drawableList.updateDrawable(e,t),this.render(),n&&this.undoRedoHelper.addRecord(JX.Update,e.getData())}removeMarkup(e,t=!0){this.drawableList.removeDrawable(e),this.render(),t&&this.undoRedoHelper.addRecord(JX.Remove,e.getData())}createMarkup(e){return WX.createDrawable(e)}getMarkupById(e){return this.drawableList.getDrawableById(e)}getMarkupData(){return this.drawableList.getDrawableDatas()}setMarkupData(e){this.drawableList.setDrawableDatas(e),this.render()}isCreateLineMode(){var e;return cp()(e=[_y.PolyLine,_y.CloudLine]).call(e,this.type)}isCreateDotMode(){var e;return cp()(e=[_y.Dot]).call(e,this.type)}isCreateTextMode(){var e;return cp()(e=[_y.Text]).call(e,this.type)}isCreateShapeMode(){var e;return cp()(e=[_y.X,_y.Rectangle,_y.CloudLineRectangle,_y.Circle,_y.Ellipse,_y.Arrow,_y.Dot]).call(e,this.type)}drawShape(e,t){const n=[[e.x,e.y]];return t&&n.push([t.x,t.y]),WX.createDrawable({id:cm.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.type,points:n})}drawLine(e){return WX.createDrawable({id:cm.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.type,points:Z()(e).call(e,(e=>[e.x,e.y]))})}drawText(e,t){return WX.createDrawable({id:cm.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,fontSize:this.fontSize*this.overlayRender.getPixelSize(1,this.camera),type:this.type,text:t,points:[[e.x,e.y]]})}addInput(e,t){if(!this.textInput){const e=document.createElement("textarea");let t;e.style.cssText=`\n position: fixed;\n border: 1px solid red;\n background: transparent;\n outline: none;\n resize: none;\n overflow: hidden;\n z-index: 1000;\n box-sizing: content-box;\n padding: 0px 2px;\n color: ${this.lineColor}`,e.setAttribute("wrap","off"),e.onkeydown=t=>{if("Enter"===t.key){const t=L()(e.style.height);e.style.height=`${t+this.fontSize}px`}this.isDrawing=!0},e.onkeyup=e=>{var n;const r=e.target.value,i=(null===(n=this.overlayRender)||void 0===n?void 0:n.measureTextLength(r))||0;i>50&&(t&&clearTimeout(t),t=Re()((()=>{e.target.style.width=`${i+4}px`}),0))},e.onfocus=()=>{},e.onblur=e=>{const t=e.target.value;if(t.length>0&&this.textInitialPosition){const e=this.creatingShape=this.drawText(this.textInitialPosition,t);e.setTolerance(this.overlayRender.getPixelSize(1,this.camera)),this.addMarkup(e,!1),this.endDraw(this.creatingShape)}},this.viewer.container.appendChild(e),this.textInput=e}Re()((()=>{this.textInput.focus()}),0),this.textInput.style.width="50px",this.textInput.style.height=`${this.fontSize}px`,this.textInput.style.lineHeight=`${this.fontSize}px`,this.textInput.style.fontSize=`${this.fontSize}px`,this.textInput.style.color=this.lineColor,this.textInput.style.display="inline-block",this.textInput.style.left=e+4+"px",this.textInput.style.top=t-this.fontSize+"px"}undo(){this.undoRedoHelper.undo()}redo(){this.undoRedoHelper.redo()}destroy(){this.deactivate(),this.clearAll()}}const n$=new Xt;class r$ extends YX{constructor(e,t){super(e),gh(this,"boxes",void 0),gh(this,"lineSegments",[]),this.boxes=t,this.lineColor="red",this.lineWidth=2,this.calculateCloudLineSegments(t)}calculateCloudLineSegments(e){for(let n=0;n<e.length;n++){var t;const r=e[n],i=[new Xt(r.min.x,r.min.y),new Xt(r.max.x,r.min.y),new Xt(r.max.x,r.max.y),new Xt(r.min.x,r.max.y),new Xt(r.min.x,r.min.y)],s=n$.subVectors(i[0],i[2]).length()/10||1e-4,a=[];for(let e=0;e<i.length-1;e++){const t=i[e],n=i[e+1],r=n$.subVectors(n,t),o=r.length(),l=r.normalize(),c=Math.ceil(o/s);for(let e=0;e<c;e++)a.push(t.clone().add(l.clone().multiplyScalar(s*e)))}a.push(a[0]),null===(t=this.lineSegments)||void 0===t||t.push(a)}}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor;for(let n=0;n<this.lineSegments.length;n++){const r=this.lineSegments[n];this.drawBox(e,t,r)}}drawBox(e,t,n){e.beginPath();for(let r=0;r<n.length-1;r++){const i=this.transToScreenCoord(n[r],t),s=this.transToScreenCoord(n[r+1],t),a=KX.getControlPointByTwoPoints(s,i);0===r&&e.moveTo(i.x,i.y),e.quadraticCurveTo(a.x,a.y,s.x,s.y)}e.stroke()}drawSelect(e,t){throw new Error("Method not implemented.")}isPointInPath(e){return!1}getClassType(){return"CompareDrawable"}}WX._registerDrawableClass(r$);class i$ extends bv{constructor(e){var t,n;super(),gh(this,"viewer",void 0),gh(this,"overlayRender",void 0),gh(this,"drawableList",new ZX("compare")),this.viewer=e,this.overlayRender=this.viewer.overlayRender,null===(t=this.overlayRender)||void 0===t||t.addDrawableList(this.drawableList),this.viewer.addEventListener("render",ve()(n=this.render).call(n,this))}render(){var e;null===(e=this.overlayRender)||void 0===e||e.render()}drawCompareDrawable(e){const t=[],n=[],r=[];for(const i of tp()(e)){const e=i.box;e&&(i.type===sw.Added?t.push(e):i.type===sw.Removed?n.push(e):r.push(e))}const i=ef.mergeBBoxes(t),s=ef.mergeBBoxes(n),a=ef.mergeBBoxes(r);this.drawableList.addDrawable(new r$(cm.guid(),i)),this.drawableList.addDrawable(new r$(cm.guid(),s)),this.drawableList.addDrawable(new r$(cm.guid(),a)),this.render()}setCompareDrawableVisible(e){var t;ge()(t=this.drawableList.getDrawables()).call(t,(t=>t.visible=e)),this.render()}}class s${constructor(e){this.viewer=e,gh(this,"element",void 0),gh(this,"content",void 0),gh(this,"itemList",{}),gh(this,"handleMouseWheel",(e=>{e.preventDefault(),this.element&&(this.element.scrollLeft+=e.deltaY)})),this.init()}init(){var e;const t=document.createElement("div");t.classList.add("model-layout-switch-bar");const n=document.createElement("div");n.classList.add("model-layout-switch-bar-content"),n.addEventListener("wheel",this.handleMouseWheel),ge()(e=this.viewer.getLayoutNames()).call(e,((e,t)=>{const r=this.createItem(e,t);this.itemList[e]=r,r.resetActivate=()=>{for(const e in this.itemList){this.itemList[e].resetActive()}},null==n||n.appendChild(r.element)})),this.element=t,this.content=n,this.element.appendChild(this.content),this.viewer.rootHtmlElement.appendChild(this.element)}createItem(e,t){const n=new a$(this.viewer,e);return 0===t&&n.setActive(!0),n}destroy(){for(const t in this.itemList){var e;const n=this.itemList[t];n.destroy(),null===(e=this.content)||void 0===e||e.removeChild(n.element)}this.itemList={},this.element&&this.content&&(this.element.removeChild(this.content),this.element.removeEventListener("wheel",this.handleMouseWheel),this.viewer.rootHtmlElement.removeChild(this.element),this.element=void 0)}show(){this.element&&(this.element.style.display="block")}hide(){this.element&&(this.element.style.display="none")}}class a${constructor(e,t){this.viewer=e,gh(this,"eventBus",Zd()),gh(this,"element",void 0),gh(this,"resetActivate",void 0),gh(this,"active",!1),this.element=this.createItem(t),this.eventBus.on("activechange",(e=>{this.resetActivate&&this.resetActivate(),e?(this.element.classList.add("activate"),this.viewer.activateLayout(t)):this.element.classList.remove("activate")}))}createItem(e){const t=document.createElement("div"),n=document.createElement("span");return t.classList.add("model-layout-switch-item"),t.onclick=()=>{this.active=!this.active,this.eventBus.emit("activechange",this.active)},n.innerText=e,t.appendChild(n),t}setActive(e){this.active=e,this.eventBus.emit("activechange",e)}resetActive(){this.active=!1,this.element.classList.remove("activate")}destroy(){this.eventBus.off("activechange")}}class o${constructor(e){gh(this,"element",void 0),gh(this,"progresseItems",[]),this.element=document.createElement("div"),this.element.classList.add("progress-bar"),e.appendChild(this.element)}setVisibility(e){this.element&&(e?this.element.classList.remove("hidden"):this.element.classList.add("hidden"))}addProgressItem(e,t){var n;let r=Se()(n=this.progresseItems).call(n,(t=>t.id===e));if(!r){const n=document.createElement("div");n.classList.add("progress-bar-item"),n.innerHTML=t||"",this.element.append(n),r={id:e,div:n},this.progresseItems.push(r)}this.setVisibility(!0)}updateProgress(e,t,n){var r;const i=Se()(r=this.progresseItems).call(r,(t=>t.id===e));if(!i)return;let s=t?`${t}`:"";t&&n&&(s+=": "),n&&(s+=`${n.toFixed(2)}%`),i.div.innerHTML=s}removeProgressItem(e){var t;const n=Se()(t=this.progresseItems).call(t,(t=>t.id===e));n&&n.div.remove(),0===this.progresseItems.length&&this.setVisibility(!1)}delayRemoveProgressItem(e,t=3e3){Re()((()=>{this.removeProgressItem(e)}),t)}}class l$ extends Rw{constructor(e){super(e)}load(e,t,n,r){x()(e)||(e=[e]);const i=[];for(let t=0;t<e.length;t++){const r=e[t];l$.isShxFile(r)?i.push(this.loadFile(r,n)):console.warn(`[ShxFontLoader] Invalid shx file: '${r}'`)}v().all(i).then((e=>{const n=this.parse(e);t&&t(n)})).catch((e=>{r&&r(e)}))}loadFile(e,t){try{const n=this,r=new(v())(((r,i)=>{const s=new Uc(n.manager);s.setResponseType("arraybuffer"),s.load(e,(t=>{r({url:e,arrayBuffer:t})}),t,(e=>{i(e)}))}));return v().resolve(r)}catch(e){return v().reject(e)}}loadAsync(e,t){try{const n=this;return x()(e)||(e=[e]),v().resolve(kw.checkFontIsLoaded(e)).then((function(r){return r?v().resolve(new kw):new(v())(((r,i)=>{n.load(e,r,t,i)}))}))}catch(e){return v().reject(e)}}parse(e){return new kw(e)}static isShxFile(e){var t;return"shx"===(null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase())}}class c${static setMaterialSection(e,t,n=!1,r=!1){const i=n&&e.clippingPlanes?e.clippingPlanes:[];i.push(...t),e.clippingPlanes=i,e.clipIntersection=r}static removeSection(e){e&&e.traverse((e=>{const t=e.material;x()(t)?ge()(t).call(t,(e=>{e.clippingPlanes=void 0})):t&&(t.clippingPlanes=void 0)}))}static addSection(e,t,n=!1,r=!1){e&&e.traverse((e=>{const i=e.material;x()(i)?ge()(i).call(i,(e=>{c$.setMaterialSection(e,t,n,r)})):i&&c$.setMaterialSection(i,t,n,r)}))}static generateSectionPlanesByBox(e){const t=e.min,n=e.max;return[new Di(new xn(0,-1,0),n.y),new Di(new xn(0,1,0),-t.y),new Di(new xn(1,0,0),-t.x),new Di(new xn(-1,0,0),n.x)]}static generateSectionPlanesByPoints(e,t=!0){const n=e.length;if(n<2)return;const r=[];for(let i=0;i<n-1;i++){const s=e[i],a=e[(i+1)%n],o=new Di;o.setFromCoplanarPoints(new xn(s.x,s.y,-1),new xn(s.x,s.y,0),new xn(a.x,a.y,0)),t||o.negate(),r.push(o)}return r}}function u$(e,t){var n=Q()(e);if($h()){var r=$h()(e);t&&(r=le()(r).call(r,(function(t){return Zh()(e,t).enumerable}))),n.push.apply(n,r)}return n}function h$(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ge()(n=u$(Object(i),!0)).call(n,(function(t){gh(e,t,i[t])})):Qh()?$()(e,Qh()(i)):ge()(r=u$(Object(i))).call(r,(function(t){B()(e,t,Zh()(i,t))}))}return e}const p$=new Zn,d$=new Zn,m$=new Pi,f$=new xn;class g$ extends bv{constructor(e){super(),gh(this,"CAMERA_Z_POSITION",100),gh(this,"CAMERA_MIN_ZOOM",1e-6),gh(this,"MODEL_LAYOUT_NAME","Model"),gh(this,"COMPARE_MARKUPS","Compare markups"),gh(this,"timer",Yh()()),gh(this,"translate",this.initLocalization()),gh(this,"container",void 0),gh(this,"camera",void 0),gh(this,"scene",this.initScene()),gh(this,"renderer",void 0),gh(this,"css2dRenderer",void 0),gh(this,"enableSVGRenderer",!0),gh(this,"svgRenderer",void 0),gh(this,"overlayRender",void 0),gh(this,"enableOverlayRenderer",!0),gh(this,"controls",void 0),gh(this,"font",void 0),gh(this,"enableSelection",void 0),gh(this,"selectedObject",void 0),gh(this,"stats",void 0),gh(this,"loadedModels",{}),gh(this,"masterModelId",""),gh(this,"dxfLayoutBar",void 0),gh(this,"height",0),gh(this,"width",0),gh(this,"raycaster",new gu),gh(this,"cameraUpdateInterval",void 0),gh(this,"mouseMoved",!1),gh(this,"mouseDoubleClicked",!1),gh(this,"selected",!0),gh(this,"measurementManager",void 0),gh(this,"markupManager",void 0),gh(this,"dxfCompareManager",void 0),gh(this,"raf",new Mb),gh(this,"renderEnabled",!1),gh(this,"svgRenderEnabled",!0),gh(this,"timeoutSymbol",void 0),gh(this,"spinner",void 0),gh(this,"loadingProgressBar",void 0),gh(this,"jobCount",0),gh(this,"rootHtmlElement",void 0),gh(this,"contextMenu",void 0),gh(this,"axes",void 0),gh(this,"toolbar",void 0),gh(this,"bottomBar",void 0),gh(this,"viewerCfg",void 0),gh(this,"groundPlane",void 0),gh(this,"enableHideVisuallySmallObjects",!0),gh(this,"sortedHidableObjects",{}),gh(this,"lastCameraZoom",1/0),gh(this,"activeLayoutName",""),gh(this,"layoutInfos",{}),gh(this,"units",void 0),gh(this,"raycastableObjects",void 0),gh(this,"changes",void 0),gh(this,"fpsUtils",new xv),gh(this,"hotpointRoot",void 0),gh(this,"onResize",(()=>{var e;const t=null===(e=this.renderer)||void 0===e?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)})),gh(this,"enableRender",((e=1e3)=>{this.renderEnabled=!0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.timeoutSymbol=this.raf.setTimeout((()=>{this.renderEnabled=!1}),e))})),gh(this,"enableSVGRender",((e=1e3)=>{this.svgRenderEnabled=!0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.timeoutSymbol=this.raf.setTimeout((()=>{this.svgRenderEnabled=!1}),e))})),gh(this,"loadingDxfCount",0),gh(this,"compareMode",!1),this.viewerCfg=e,this.container=this.initContainer(),this.rootHtmlElement=this.initRootHtmlElement(),this.width=this.container.clientWidth,this.height=this.container.clientHeight,this.increaseJobCount(),this.init(),this.animate(),this.enableRender(),this.decreaseJobCount(),im.info(`[DxfViewer] Initialized in ${(Yh()()-this.timer)/1e3}s`)}init(){this.initSpinner(),this.initRenderer(),this.initCSS2DRenderer(),this.initCamera(),this.initControls(),this.initEvents(),this.initMouseWheel(),this.initOthers(),!0===this.viewerCfg.enableAxisGizmo&&(this.axes=this.initAxes()),!0===this.viewerCfg.enableStats&&(this.stats=this.initStats()),this.viewerCfg.enableToolbar&&(this.toolbar=this.initToolbar()),this.viewerCfg.enableBottomBar&&(this.bottomBar=this.initBottomBar()),this.viewerCfg.enableProgressBar&&(this.loadingProgressBar=this.initLoadingProgressBar()),this.enableSelection=this.viewerCfg.enableSelection}initContainer(){const e=document.getElementById(this.viewerCfg.containerId);if(!e)return im.error("[DxfViewer] containerId:",this.viewerCfg.containerId,"is not found in Dom tree! The video will rendered to body"),document.body;const t=document.createElement("div");return t.style.cssText="width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;",e.appendChild(t),t}initScene(){const e=new mo;return e.background=new cn(2172976),e.matrixAutoUpdate=Ih,e.matrixWorldAutoUpdate=!1,e}initRenderer(){this.renderer=new ho({antialias:!0,preserveDrawingBuffer:!0,alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.renderer.setClearColor(11119017,1),this.renderer.localClippingEnabled=!0,this.container.appendChild(this.renderer.domElement),pE.maxFragmentUniforms=this.renderer.capabilities.maxFragmentUniforms-20,this.enableSVGRenderer&&(this.svgRenderer=new dh,this.svgRenderer.setSize(this.width,this.height),this.svgRenderer.setClearColor(16777215,0),this.svgRenderer.clear(),this.svgRenderer.domElement.classList.add("svg-renderer"),this.container.appendChild(this.svgRenderer.domElement)),this.enableOverlayRenderer&&(this.overlayRender=new WX(this))}initCSS2DRenderer(){this.css2dRenderer=new Hf,this.css2dRenderer.setSize(this.width,this.height),this.css2dRenderer.domElement.style.height="0",this.css2dRenderer.domElement.style.width="0",this.css2dRenderer.domElement.style.position="absolute",this.css2dRenderer.domElement.style.top="0",this.css2dRenderer.domElement.style.left="0",this.css2dRenderer.domElement.style.overflow="visible",this.container.appendChild(this.css2dRenderer.domElement)}setCompareMarkupVisibility(e){var t;null===(t=this.dxfCompareManager)||void 0===t||t.setCompareDrawableVisible(e)}initCamera(){if(!this.scene)return;const e=new Wi(-this.width/2,this.width/2,this.height/2,-this.height/2,.1,1e5);e.layers.enable(Ah),e.position.set(0,0,this.CAMERA_Z_POSITION),e.zoom=10,e.updateProjectionMatrix(),this.scene.add(e),this.camera=e}initControls(){const e=this.camera;if(!this.renderer||!e)return;const t=new wb(e,this.renderer.domElement);t.enableDamping=!1,t.enableRotate=!1,t.dampingFactor=.5,t.zoomSpeed=6,t.enableZoom=!1,t.enabled=!0,t.keyPanSpeed=10,t.mouseButtons={LEFT:Ue,MIDDLE:Ue,RIGHT:Ue},t.listenToKeyEvents(document.body),t.update(),this.controls=t,t.addEventListener("change",this.onControlsChange(this)),t.addEventListener("end",this.onControlsEnd(this))}initRootHtmlElement(){const e=document.createElement("div");return e.id="rootHtmlElement",this.container.appendChild(e),e}onControlsChange(e){return()=>{e.enableRender()}}onControlsEnd(e){return()=>{e.enableRender()}}initSpinner(){if(!this.viewerCfg.enableSpinner)return;const e=document.createElement("div");e.classList.add("bim-viewer-spinner");const t=document.createElement("div");t.classList.add(Dh,"icon-loading"),e.append(t),this.container.appendChild(e),this.spinner=e,this.setSpinnerVisibility(this.jobCount>0)}initEvents(){const e=this.renderer;if(!e||!this.camera||!this.controls)return;let t=-1,n=-1;e.domElement.addEventListener("pointerdown",(r=>{t=r.x,n=r.y,this.mouseMoved=!1,r.button===Ne&&(e.domElement.style.cursor="move")})),e.domElement.addEventListener("pointermove",(r=>{var i;if(null!==(i=this.measurementManager)&&void 0!==i&&i.isMeasurementActive())this.enableSVGRender();else if(t>=0&&n>=0){const i=5;(Math.abs(r.x-t)>i||Math.abs(r.y-n)>i)&&(this.mouseMoved=!0,e.domElement.style.cursor="move")}})),e.domElement.addEventListener("pointerup",(r=>{this.mouseMoved||this.mouseDoubleClicked||r.button!==Pe||Re()((()=>{this.handleMouseClick(r)}),200),this.mouseDoubleClicked&&Re()((()=>{this.mouseDoubleClicked=!1}),200),t=-1,n=-1,e.domElement.style.cursor="auto"})),e.domElement.addEventListener("dblclick",(()=>{this.mouseDoubleClicked=!0,this.mouseMoved})),window.addEventListener("keydown",(e=>{e.altKey&&"KeyR"===e.code&&this.flyToRandomObject()})),window.addEventListener("resize",this.onResize)}initMouseWheel(){const e=this.renderer;if(!e)return;let t=Yh()();e.domElement.addEventListener("wheel",(e=>{if(!this.camera||!this.controls)return;e.preventDefault(),e.stopPropagation();let n=this.controls.zoomSpeed;const r=Yh()(),i=r-t;if(i<10)return void im.debug("[DxfViewer] Ignore too frequent mouse wheel:");i<30&&(n*=i/30),t=r;const s=Math.pow(.95,n),a=this.camera.zoom;let o=e.deltaY>0?a*s:a/s;const l=M_.getScreenPointByEvent(e,this.container),c=M_.screenPoint2NdcPoint(l,this.camera,this.container),u=new xn(c.x,c.y,0),h=u.clone().unproject(this.camera);o=this.checkAndGetLimitedCameraZoom(o),this.camera.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,o)),this.camera.updateProjectionMatrix();const p=u.clone().unproject(this.camera),d=f$.set(0,0,0);d.subVectors(p,h),d.z=0,this.updateHidableObjectsVisibility(),this.camera.position.sub(d),this.controls.target.sub(d),this.controls.update()}))}initOthers(){this.scene&&this.renderer&&this.camera&&(this.renderer.domElement.style.outlineWidth="0")}initLocalization(){return Xd.init({lng:"cn",debug:!1,resources:{en:{translation:Fm},cn:{translation:Um}}}),Xd.t}initAxes(){const e=document.createElement("div");e.classList.add("axesRenderer");const t=new Wf(e,this,!0);return this.rootHtmlElement.append(e),t}initStats(){const e=Kd();e.setMode(0);const t=document.createElement("div");return t.classList.add("statsOutput"),t.appendChild(e.domElement),e.domElement.style.position="absolute",this.rootHtmlElement.append(t),e}showStats(){this.stats||(this.stats=this.initStats()),this.stats.showPanel(0)}hideStats(){this.stats&&this.stats.showPanel(-1)}initToolbar(){return new yy(this,fp().merge(Ay,this.viewerCfg.toolbarMenuConfig))}initBottomBar(){return new VX(this)}initLoadingProgressBar(){return new o$(this.container)}showLayoutBar(){var e;null===(e=this.dxfLayoutBar)||void 0===e||e.show()}hideLayoutBar(){var e;null===(e=this.dxfLayoutBar)||void 0===e||e.hide()}animate(){var e,t,n,r,i,s,a;if(requestAnimationFrame(ve()(e=this.animate).call(e,this)),this.scene&&this.camera)if(this.renderEnabled)pE.resolutionUniform.value.set(this.width,this.height),null===(i=this.renderer)||void 0===i||i.render(this.scene,this.camera),null===(s=this.css2dRenderer)||void 0===s||s.render(this.scene,this.camera),this.dispatchEvent("render"),this.svgRenderer&&(null===(a=this.measurementManager)||void 0===a||a.render(this.svgRenderer,this.camera));else if(this.svgRenderEnabled){var o;if(this.svgRenderer)null===(o=this.measurementManager)||void 0===o||o.render(this.svgRenderer,this.camera)}null===(t=this.controls)||void 0===t||t.update(),null===(n=this.stats)||void 0===n||n.update(),this.fpsUtils.update(),null===(r=this.bottomBar)||void 0===r||r.update()}getFps(){return this.fpsUtils.fps}destroy(){var e,t,n;this.dxfLayoutBar&&(this.dxfLayoutBar.destroy(),this.dxfLayoutBar=void 0),null===(e=this.measurementManager)||void 0===e||e.destroy(),this.measurementManager=void 0,null===(t=this.markupManager)||void 0===t||t.destroy(),this.markupManager=void 0,this.groundPlane=void 0,this.sortedHidableObjects={},this.layoutInfos={},this.raycastableObjects=void 0,this.changes={},ge()(n=Q()(this.loadedModels)).call(n,(e=>{delete this.loadedModels[e]})),this.loadedModels={},this.camera=void 0,this.scene&&this.scene.clear(),this.renderer&&(this.container.removeChild(this.renderer.domElement),this.renderer.clear(),this.renderer.dispose(),this.renderer=void 0),this.svgRenderer&&(this.container.removeChild(this.svgRenderer.domElement),this.svgRenderer.clear(),this.svgRenderer=void 0),this.overlayRender&&(this.overlayRender.destroy(),this.overlayRender=void 0),this.controls&&(this.controls.dispose(),this.controls=void 0),this.stats=void 0,this.raycaster=void 0,this.selectedObject=void 0,this.raf&&(this.timeoutSymbol&&this.raf.clearTimeout(this.timeoutSymbol),this.raf=void 0),this.contextMenu&&(this.contextMenu.destroy(),this.contextMenu=void 0),this.axes&&(this.axes.dispose(),this.axes=void 0),this.toolbar&&(this.toolbar.destroy(),this.toolbar=void 0),this.container.removeChild(this.rootHtmlElement),this.container.remove(),window.removeEventListener("resize",this.onResize)}loadModelAsync(e,t){try{var n;const r=this;r.loadingDxfCount++,r.timer=Yh()(),r.increaseJobCount();const i=e.modelId||e.src;r.masterModelId||(r.masterModelId=i);const s=e.ignorePaperSpace||r.masterModelId!==i;!1===e.ignorePaperSpace&&s&&im.warn(`[DxfViewer] Paper space will be ignored for '${i}' although 'ignorePaperSpace' is false!`),cm.printMemory("Before loadModelAsync");const a=new TX;a.setFont(r.font);const o=i,l=r.translate("ProgressBar.Loading"),c=r.translate("ProgressBar.Parsing");return null===(n=r.loadingProgressBar)||void 0===n||n.addProgressItem(o),v().resolve(a.loadDxfDataAsync(e.src,e.modelId,(e=>{const n=100*e.loaded/e.total;var i,s,a;"parseProgress"===e.type?null===(i=r.loadingProgressBar)||void 0===i||i.updateProgress(o,c,n):(null===(s=r.loadingProgressBar)||void 0===s||s.updateProgress(o,l,n),n>=100&&(null===(a=r.loadingProgressBar)||void 0===a||a.updateProgress(o,c+" ...")));t&&t(e)}),(()=>{var e;null===(e=r.loadingProgressBar)||void 0===e||e.updateProgress(o,c,100),r.enableRender()}),s).finally((()=>{r.loadingDxfCount--,0===r.loadingDxfCount&&r.font.releaseFontData&&r.font.releaseFontData()}))).then((function(t){var n;if(null===(n=r.loadingProgressBar)||void 0===n||n.delayRemoveProgressItem(o),im.info(`[DxfViewer] Loaded '${e.src}' in ${(Yh()()-r.timer)/1e3}s, adding to scene...`),0===t.threejsObject.children.length){const t=`[DxfViewer] Nothing was loaded from ${e.src}`;return im.warn(t),r.decreaseJobCount(),v().reject(t)}const s=t.threejsObject;s.name=i;const a=r.getDxfUnits(t);if(r.masterModelId===e.modelId&&(r.units=a),im.info(`[DxfViewer] Units of '${e.src}' is '${a}'`),a){let t=1;r.units&&a!==r.units&&(t=dw(a,r.units)),e.scale?e.scale=[e.scale[0]*t,e.scale[0]*t,e.scale[0]*t]:e.scale=[t,t,t]}if(e.matrix&&16===e.matrix.length){const t=new Zn;t.elements=e.matrix,s.applyMatrix4(t)}else{const t=e.position||[0,0,0],n=e.rotation||[0,0,0],r=e.scale||[1,1,1];s.position.set(t[0],t[1],t[2]),s.rotation.set(n[0]*Math.PI/180,n[1]*Math.PI/180,n[2]*Math.PI/180),s.scale.set(r[0],r[1],r[2])}return r.addLoadedModelToScene(s,e,t),cm.printMemory("After addLoadedModelToScene"),im.info(`[DxfViewer] Added '${e.src}' to scene in ${(Yh()()-r.timer)/1e3}s`),r.viewerCfg.enableLayoutBar&&!r.dxfLayoutBar&&r.masterModelId===i&&(r.dxfLayoutBar=new s$(r)),r.decreaseJobCount(),v().resolve()}))}catch(e){return v().reject(e)}}unloadDxf(){throw new Error("Not implemented yet!")}isCompareMode(){return this.compareMode}compare(e,t,n){try{const r=this;function i(){var i,c;const u=s+o,h=r.translate("ProgressBar.Loading"),p=r.translate("ProgressBar.Download"),d=r.translate("ProgressBar.Parsing"),m=.2;return r.masterModelId=a,r.loadingDxfCount+=2,null===(i=r.loadingProgressBar)||void 0===i||i.addProgressItem(u),null===(c=r.loadingProgressBar)||void 0===c||c.updateProgress(u,h,0),console.time("[DxfViewer] compare loadFile"),v().resolve(l.parse(s,(e=>{const t=100*e.loaded/e.total;n&&n(new ProgressEvent(p,{lengthComputable:!0,loaded:t*m,total:100}))}))).then((function(i){return v().resolve(l.parse(o,(e=>{const t=100*e.loaded/e.total;n&&n(new ProgressEvent(p,{lengthComputable:!0,loaded:20+t*m,total:100}))}))).then((function(a){var c,h;console.timeEnd("[DxfViewer] compare loadFile"),console.time("[DxfViewer] compare changes");const p=new aw(i,a).compare();im.info(`[DxfViewer] Compared in: ${(Yh()()-r.timer)/1e3}s, result: ${V()(p)}`),l.loadEntitiesForCompare(i,a,p,(e=>{var t;const i=100*e.loaded/e.total,s=40+.6*i;var a;(null===(t=r.loadingProgressBar)||void 0===t||t.updateProgress(u,d,s),i>=100)&&(null===(a=r.loadingProgressBar)||void 0===a||a.delayRemoveProgressItem(u));n&&n(new ProgressEvent(d,{lengthComputable:!0,loaded:s,total:100}))}));for(const e of tp()(p))e.box||delete p[e.handle];r.changes=p,console.timeEnd("[DxfViewer] compare changes"),p&&r.drawCompareMarkups(p);const m=i,f=a;if(r.loadingDxfCount-=2,im.info(`[DxfViewer] '${s}' and '${o}' are loaded in ${(Yh()()-r.timer)/1e3}s, comparing...`),r.timer=Yh()(),r.decreaseJobCount(),Q()(p).length||im.info("[DxfViewer] No change found"),0===(null===(c=m.threejsObject)||void 0===c?void 0:c.children.length)&&0===(null===(h=f.threejsObject)||void 0===h?void 0:h.children.length)){const e=`[DxfViewer] Nothing was loaded from ${s} and ${o}`;return im.warn(e),v().reject(e)}const g=m.threejsObject,_=f.threejsObject;return g.name=s,_.name=o,console.time("[DxfViewer] Add compared objects to scene"),r.addLoadedModelToScene(g,h$(h$({},e),{},{merge:!0}),m),r.addLoadedModelToScene(_,h$(h$({},t),{},{merge:!0}),f),console.timeEnd("[DxfViewer] Add compared objects to scene"),v().resolve()}))}))}const{src:s,modelId:a}=e,{src:o}=t;r.compareMode&&v().reject("It is already under comparing mode!"),(r.masterModelId||r.loadedModels.length>0)&&v().reject("Shouldn't load anything else before compare!"),r.compareMode=!0,r.timer=Yh()(),r.increaseJobCount(),r.font||console.warn("[DxfViewer] Should set font first!");const l=new pE(!0);l.setFont(r.font);const c=function(){if(r.font instanceof kw){function e(e){}const t=r.font.getFontData;return t?v().resolve(r.font.getFontData()).then(e):void 0}}();return v().resolve(c&&c.then?c.then(i):i())}catch(u){return v().reject(u)}}getEntitiesCount(){var e;let t=0;return ge()(e=tp()(this.loadedModels)).call(e,(e=>{var n;t+=(null===(n=e.dxfData)||void 0===n?void 0:n.loadedEntityCount)||0})),t}getLoadedDxfModelIds(){return Q()(this.loadedModels)}getLayoutNames(){const e=[],t=this.getLayouts();return ge()(t).call(t,(t=>{e.push(t.layoutName)})),e}getLayouts(){const e=[],t=this.loadedModels[this.masterModelId];if(t){const n=t.dxfData,r=null==n?void 0:n.objects.LAYOUT;null==r||ge()(r).call(r,(t=>{e.push(t)}))}return e}handleOverlayDxf(e){var t,n;const r=this.loadedModels[e];if(!r)return void im.warn(`[DxfViewer] Can't find model for modelId '${e}'!`);this.increaseJobCount(),this.switchTransformMs(this.MODEL_LAYOUT_NAME,e);const i=null===(t=r.dxfData)||void 0===t?void 0:t.threejsObject,s=null==i?void 0:Se()(n=i.children).call(n,(e=>e.name===this.MODEL_LAYOUT_NAME));s&&(s.traverse((e=>{this.addSpatialFilterSection(e,r.dxfData)})),this.calBoundingBoxOfLayoutChild(s)),this.showLayoutObjects(this.activeLayoutName),this.decreaseJobCount()}activateLayout(e){if(this.increaseJobCount(),0==e.length)return im.warn("[DxfViewer] layout name is empty !"),void this.decreaseJobCount();if(e===this.activeLayoutName)return void this.decreaseJobCount();const t=Yh()();this.switchTransformMs(e,this.masterModelId);const n=this.getLayoutByName(e);if(!n)return im.warn(`[DxfViewer] Can't find layout of ${e} !`),void this.decreaseJobCount();const r=this.loadedModels[this.masterModelId];if(!r)return im.warn(`[DxfViewer] Can't find master model for modelId '${this.masterModelId}'!`),void this.decreaseJobCount();if(this.raycastableObjects=void 0,this.activeLayoutName){var i,s;const e=this.getActiveLayoutInfo();e.lastCameraPosition||(e.lastCameraPosition=new xn),null===(i=this.camera)||void 0===i||i.getWorldPosition(e.lastCameraPosition),e.lastCameraZoom=null===(s=this.camera)||void 0===s?void 0:s.zoom}const a=(e=>{const t=this.layoutInfos[e];return!(null==t||!t.lastCameraZoom)})(e);if(!a){var o,l;const t=this.getLayoutViewports(n);console.time("[DxfViewer] generateSectionsBySpatialFilter");let i=[];t.length>0&&(i=t[0].frozenLayerHandles);const s=e!==this.MODEL_LAYOUT_NAME,a=null===(o=r.dxfData)||void 0===o?void 0:o.threejsObject,u=null==a?void 0:Se()(l=a.children).call(l,(t=>t.name===e));if(u){var c;const t=[],n=null===(c=r.dxfData)||void 0===c?void 0:c.layersAndThreejsObjects;u.traverse((a=>{this.addSpatialFilterSection(a,r.dxfData);const o=a;if(s&&o.material&&o.geometry){const s=o.userData.layerName;if(!this.isLayerFrozenForViewport(r.dxfData,s,i))return;t.push(o);let a=-1;var l,c;if(n&&n[s])if(a=w()(l=n[s]).call(l,o),a>=0)S()(c=n[s]).call(c,a,1);a<0&&im.warn(`[DxfViewer] Failed to find object for modelId '${this.masterModelId}', layer '${s}', layout '${e}'`)}})),ge()(t).call(t,(e=>{e.removeFromParent()}))}console.timeEnd("[DxfViewer] generateSectionsBySpatialFilter");const h=this.getFilteredViewports(n);im.debug("[DxfViewer] Active layout:",e,", viewports:",h),console.time("[DxfViewer] generateObjectsByViewport"),ge()(h).call(h,(t=>{this.generateObjectsByViewport(e,t,r.dxfData)})),console.timeEnd("[DxfViewer] generateObjectsByViewport"),e!==this.MODEL_LAYOUT_NAME&&u&&this.setLayoutHidableObjectArray(u),u&&this.calBoundingBoxOfLayoutChild(u)}this.showLayoutObjects(e),this.setMeasurementsVisibility(!1),this.setMarkupsVisibility(!1),this.activeLayoutName=e;const u=this.getActiveLayoutInfo(),h=u.measurementData;this.measurementManager&&h&&(null==h?void 0:h.length)>0&&(this.measurementManager.setMeasurementsData(h),this.setMeasurementsVisibility(!0));const p=u.markupData;if(this.markupManager&&p&&(null==p?void 0:p.length)>0&&(this.markupManager.setMarkupData(p),this.setMarkupsVisibility(!0)),u.lastCameraPosition)this.goTo(u.lastCameraPosition,u.lastCameraZoom,!1);else{let e=this.getLayoutExtentEx(n);if(e){const t=1e-16,n=1e16,r=e.max.x-e.min.x,i=e.max.y-e.min.y;(r<t||i<t||r>n||i>n)&&(im.warn(`[BimViewer] Got wired bbox, max: ${e.max.toArray()}, min: ${e.min.toArray()}, going to calculate one...`),e=this.computeBoundingBox()),u.bbox=e,this.activeLayoutName!==this.MODEL_LAYOUT_NAME&&this.updateGroundPlane(),this.zoomToBBox(e)}}this.dispatchEvent(jX.LayoutChanged),cm.printMemory(`After activated layout '${this.activeLayoutName}'`),this.enableRender(),this.decreaseJobCount(),im.info(`[DxfViewer] Activated layout '${e}' in ${(Yh()()-t)/1e3}s`)}calBoundingBoxOfLayoutChild(e){const t=e.children.length;for(let n=0;n<t;n++){const t=e.children[n];t.children.length>0?t.userData.boundingBox=rf.getBoundingBox(t):t.userData.boundingBox&&delete t.userData.boundingBox}}getActiveLayoutName(){return this.activeLayoutName}getLayers(){const e=[];if(this.masterModelId){var t;const n=this.loadedModels[this.masterModelId],r=null==n||null===(t=n.dxfData)||void 0===t?void 0:t.tables.layer.layers;r&&e.push({modelId:this.masterModelId,layers:r})}for(const[t,r]of rp()(this.loadedModels)){var n;if(t===this.masterModelId)continue;const i=null==r||null===(n=r.dxfData)||void 0===n?void 0:n.tables.layer.layers;i&&e.push({modelId:t,layers:i})}if(this.isCompareMode()){const t={};t[this.COMPARE_MARKUPS]={name:this.COMPARE_MARKUPS,handle:"dummy",visible:!0},e.push({modelId:"Compare markups",layers:t})}return e}setModelVisibility(e,t){const n=this.loadedModels[e];if(!n||!n.dxfData)throw new Error(`Failed to find model by modelId '${e}'!`);n.dxfData.threejsObject.visible=t,this.enableRender()}setLayerVisibility(e,t,n){n=n||this.masterModelId;const r=this.loadedModels[n];if(!r){if(e===this.COMPARE_MARKUPS){for(const e of this.scene.children)if(e.name===this.COMPARE_MARKUPS){e.visible=t;break}return void this.enableRender()}throw new Error(`Failed to find layer by modelId '${n}'!`)}const i=r.dxfData,s=null==i?void 0:i.tables.layer.layers[e];s?s.visible=t:im.warn(`[DxfViewer] Layer '${e}' not found from dxfData!`);const a=null==i?void 0:i.layersAndThreejsObjects[e];if(a){var o;const e=null===(o=this.camera)||void 0===o?void 0:o.zoom;ge()(a).call(a,(n=>{this.enableHideVisuallySmallObjects&&t&&e&&n.userData.visibleMinZoom&&e<n.userData.visibleMinZoom||(n.visible=t),!1!==t&&null==n.userData.layerVisible||(n.userData.layerVisible=t)}))}else im.warn(`[DxfViewer] No object found for layer '${e}'`);this.raycastableObjects=void 0,this.enableRender()}setLayerOpacity(){throw new Error("Not implemented yet!")}setLayerColor(e,t,n){n=n||this.masterModelId;const r=this.loadedModels[n];if(!r)throw new Error(`Failed to find layer by modelId '${n}'!`);const i=r.dxfData;if(!(null==i?void 0:i.tables.layer.layers[e]))throw new Error(`Failed to find layer by layerName '${e}'!`);const s=null==i?void 0:i.layersAndThreejsObjects[e];s?ge()(s).call(s,(e=>{let n=e;n.material&&tf.setMaterialColor(n.material,new cn(t))})):im.warn(`[DxfViewer] No object found for layer '${e}'`),this.enableRender()}setFont(e){try{const t=this;function n(){console.timeEnd("[DxfViewer] Font file(s) load time")}console.time("[DxfViewer] Font file(s) load time");const r=l$.isShxFile(e[0])?v().resolve((new l$).loadAsync(e)).then((function(e){t.font=e})):(e.length>1&&im.warn("[DxfViewer] Only support 1 typeface font file for now, others will be ignored!"),v().resolve((new Rw).loadAsync(e[0])).then((function(e){t.font=e})));return v().resolve(r&&r.then?r.then(n):n())}catch(i){return v().reject(i)}}setDisplayLengthUnits(){throw new Error("Not implemented yet!")}setDisplayAreaUnits(){throw new Error("Not implemented yet!")}setDisplayPrecision(){throw new Error("Not implemented yet!")}activateMeasurement(e){this.measurementManager||(this.measurementManager=new Yy(this));this.measurementManager.activateMeasurement(e),this.enableSVGRender()}deactivateMeasurement(){var e;null===(e=this.measurementManager)||void 0===e||e.deactivateMeasurement(),this.enableSVGRender()}getActiveMeasurementType(){var e;return null===(e=this.measurementManager)||void 0===e?void 0:e.getActiveMeasurementType()}getMeasurements(){var e;const t=(null===(e=this.measurementManager)||void 0===e?void 0:e.getMeasurementsData())||[];return null==t||ge()(t).call(t,(e=>{e.layoutName||(e.layoutName=this.activeLayoutName)})),t}setMeasurements(e){ge()(e).call(e,(e=>{var t;const n=e.layoutName||this.MODEL_LAYOUT_NAME;null===(t=this.getLayoutInfo(n).measurementData)||void 0===t||t.push(e)}));const t=this.getActiveLayoutInfo();this.measurementManager||(this.measurementManager=new Yy(this));const n=this.measurementManager;t.measurementData&&n.setMeasurementsData(t.measurementData),this.enableSVGRender()}selectMeasurement(e){this.measurementManager||(this.measurementManager=new Yy(this));this.measurementManager.selectMeasurement(e),this.enableSVGRender()}unselectMeasurement(){this.measurementManager||(this.measurementManager=new Yy(this));this.measurementManager.unselectMeasurement(),this.enableSVGRender()}removeMeasurement(e){this.measurementManager||(this.measurementManager=new Yy(this));this.measurementManager.removeMeasurementById(e),this.enableSVGRender()}setMeasurementsVisibility(e){this.measurementManager||(this.measurementManager=new Yy(this));this.measurementManager.setMeasurementsVisibility(e),this.enableSVGRender()}clearMeasurements(){var e;null===(e=this.measurementManager)||void 0===e||e.clearMeasurements(),this.enableSVGRender()}activateMarkup(e){this.markupManager||(this.markupManager=new t$(this)),this.markupManager.isActived()||this.markupManager.activate(),this.markupManager.setDrawType(e)}deactivateMarkup(){this.markupManager&&this.markupManager.deactivate()}getActiveMarkupType(){var e;return null===(e=this.markupManager)||void 0===e?void 0:e.getActiveMarkupType()}setMarkupLineColor(e){var t;null===(t=this.markupManager)||void 0===t||t.setLineColor(e)}getMarkupLineColor(){var e;return null===(e=this.markupManager)||void 0===e?void 0:e.getLineColor()}setMarkupFillColor(e){var t;null===(t=this.markupManager)||void 0===t||t.setFillColor(e)}getMarkupFillColor(){var e;return null===(e=this.markupManager)||void 0===e?void 0:e.getFillColor()}setMarkupLineWidth(e){var t;null===(t=this.markupManager)||void 0===t||t.setLineWidth(e)}getMarkupLineWidth(){var e;return null===(e=this.markupManager)||void 0===e?void 0:e.getLineWidth()}setMarkupFontSize(e){var t;null===(t=this.markupManager)||void 0===t||t.setFontSize(e)}getMarkupFontSize(){var e;return null===(e=this.markupManager)||void 0===e?void 0:e.getFontSize()}getMarkups(){var e;const t=(null===(e=this.markupManager)||void 0===e?void 0:e.getMarkupData())||[];return null==t||ge()(t).call(t,(e=>{e.layoutName||(e.layoutName=this.activeLayoutName)})),t}setMarkups(e){ge()(e).call(e,(e=>{var t;const n=e.layoutName||this.MODEL_LAYOUT_NAME;null===(t=this.getLayoutInfo(n).markupData)||void 0===t||t.push(e)}));const t=this.getActiveLayoutInfo();this.markupManager||(this.markupManager=new t$(this));const n=this.markupManager;t.markupData&&n.setMarkupData(t.markupData),this.activateMarkup()}setMarkupsVisibility(e){this.markupManager||(this.markupManager=new t$(this));this.markupManager.setMarkupsVisibility(e)}removeMarkup(){im.warn("Not implemented yet!")}clearMarkups(){var e;null===(e=this.markupManager)||void 0===e||e.clearAll()}addHotpoint(e){if(this.hasHotpoint(e.hotpointId))return void im.warn(`[DxfViewer] Hotpoint with id '${e.hotpointId}' already exist!`);const t=e.anchorPosition,n=CX.createHotpoint(e.html);n.position.set(t[0]||0,t[1]||0,t[2]||0),n.visible=!1!==e.visible,n.userData.hotpoint=e,n.updateWorldMatrix(!1,!1),this.hotpointRoot||(this.hotpointRoot=new io,this.hotpointRoot.name="HotpointRoot",this.scene.add(this.hotpointRoot)),this.hotpointRoot.add(n),this.enableRender()}removeHotpoint(e){var t;const n=(null===(t=this.hotpointRoot)||void 0===t?void 0:t.children)||[];for(let t=0;t<n.length;++t){var r;const i=n[t];(null===(r=i.userData.hotpoint)||void 0===r?void 0:r.hotpointId)===e&&i.removeFromParent()}}clearHotpoints(){var e;null===(e=this.hotpointRoot)||void 0===e||e.clear()}hasHotpoint(e){var t;const n=(null===(t=this.hotpointRoot)||void 0===t?void 0:t.children)||[];return-1!==sp()(n).call(n,(t=>{var n;return(null===(n=t.userData.hotpoint)||void 0===n?void 0:n.hotpointId)===e}))}getHitResult(e){if(!this.camera||!this.raycaster||!this.groundPlane)return;const t=M_.getScreenPointByEvent(e,this.container),n=M_.screenPoint2NdcPoint(t,this.camera,this.container);this.raycaster.setFromCamera(n,this.camera),this.raycaster.layers.enable(Ah);const r=this.raycaster.intersectObject(this.groundPlane,!0);if(r&&r.length>0){const e=r[0].point;return{location:[e.x,e.y]}}}drawCompareMarkups(e){this.dxfCompareManager||(this.dxfCompareManager=new i$(this)),this.dxfCompareManager.drawCompareDrawable(e)}getLayoutByName(e){let t;const n=this.getLayouts();for(const r of n)if(r.layoutName===e){t=r;break}return t}getActiveLayoutInfo(){return this.getLayoutInfo(this.activeLayoutName)}getMsTransformMatrix(e){var t,n,r;const i=this.loadedModels[e],s=null===(t=i.dxfData)||void 0===t?void 0:t.header;if(!s)return;const a=s.$ANGDIR,o=this.getDxfUnits(i.dxfData),l=null===(n=i.dxfData)||void 0===n?void 0:le()(r=n.tables.viewPort.viewPorts).call(r,(e=>"*ACTIVE"===e.name.toLocaleUpperCase()));if(!l)return;const c=new Zn,u=pE.getDcs2WcsMatrix(l[0],a),h=new xn(l[0].center.x,l[0].center.y,0).applyMatrix4(u);let p=1;this.units&&o!==this.units&&(p=dw(o,this.units)),h.multiplyScalar(p),c.makeTranslation(h.x,h.y,0),c.multiply((new Zn).makeRotationZ(Yt.degToRad(l[0].viewTwistAngle))),c.multiply((new Zn).makeTranslation(-h.x,-h.y,0)),this.loadedModels[e].msTransformMatrix=c}switchTransformMs(e,t){var n,r;const i=this.loadedModels[t];if(!i)return void im.warn(`[DxfViewer] Can't find model whose modelId is ${t}`);const s=i.msTransformMatrix;if(p$.identity(),!s||s.equals(p$))return;const a=null===(n=i.dxfData)||void 0===n?void 0:n.threejsObject,o=null==a?void 0:Se()(r=a.children).call(r,(e=>e.name===this.MODEL_LAYOUT_NAME));o&&(e===this.MODEL_LAYOUT_NAME?o.applyMatrix4(s):o.applyMatrix4(s.clone().invert()),o.updateMatrixWorld(!0))}getLayoutExtentEx(e){return e.layoutName===this.MODEL_LAYOUT_NAME?this.getModelSpaceExtent():this.getLayoutExtent(e)}getModelSpaceExtent(){var e,t;const n=this.loadedModels[this.masterModelId],r=null===(e=n.dxfData)||void 0===e?void 0:e.header,i=new xn,s=new xn;if(!r)throw new Error(`Header is undefined in ${this.masterModelId}!`);const a=null===(t=n.dxfData)||void 0===t?void 0:t.tables.viewPort.viewPorts;let o=r.$EXTMIN,l=r.$EXTMAX;const c=r.$ANGDIR;if(a&&a.length>0){for(let e=0;e<a.length;e++){const t=a[e];if("*ACTIVE"===t.name.toLocaleUpperCase()){const{center:e,viewHeight:n,aspectRatio:r}=t,i=n*r,s=pE.getDcs2WcsMatrix(t,c),a=new xn(e.x,e.y,0);a.applyMatrix4(s),o={x:a.x-i/2,y:a.y-n/2,z:0},l={x:a.x+i/2,y:a.y+n/2,z:0};break}}return i.set(o.x,o.y,o.z),s.set(l.x,l.y,l.z),new En(i,s)}}getLayoutExtent(e){var t;const n=null===(t=this.loadedModels[this.masterModelId].dxfData)||void 0===t?void 0:t.header,r=new xn,i=new xn;if(!n)throw new Error(`Header is undefined in ${this.masterModelId}!`);const s=this.getLayoutViewports(e);let a=n.$PEXTMIN,o=n.$PEXTMAX;const l=n.$ANGDIR;if(s&&s.length>0){const e=le()(s).call(s,(e=>1===L()(e.viewportId)));let t;t=e.length>0?e[0]:s[0];const{centerPoint:n,width_paperSpace:c,height_paperSpace:u}=t,h=pE.getDcs2WcsMatrix(t,l),p=new xn(n.x,n.y,0);return p.applyMatrix4(h),a={x:p.x-c/2,y:p.y-u/2,z:0},o={x:p.x+c/2,y:p.y+u/2,z:0},r.set(a.x,a.y,a.z),i.set(o.x,o.y,o.z),new En(r,i)}}showLayoutObjects(e){const t=tp()(this.loadedModels);ge()(t).call(t,(t=>{var n,r;let i=0,s=0;const a=null===(n=t.dxfData)||void 0===n?void 0:n.threejsObject;null==a||ge()(r=a.children).call(r,(t=>{const n=t.name===e;t.visible=n,n?i++:s++})),im.info(`[DxfViewer] showLayoutObjects('${e}') sets ${i} layout level object(s) to visible and ${s} to hidden for model '${null==a?void 0:a.name}'`)}))}getLayoutViewports(e){var t;const n=this.loadedModels[this.masterModelId],r=e.ownerHandle,i=null===(t=n.dxfData)||void 0===t?void 0:t.layoutViewportsMap[r];return i||[]}setMaterialUniforms(e,t){if(e instanceof bi&&(e.uniforms.u_cameraZoom&&(e.uniforms.u_cameraZoom=pE.cameraZoomUniform),e.uniforms.u_viewportScale)){1===(null==t?void 0:t.header.$PSLTSCALE)&&(e.uniforms.u_viewportScale=pE.viewportScaleUniform)}}isLayerFrozenForViewport(e,t,n){if(!e||!t)return!1;const r=e.tables.layer.layers[t];return!!(r&&(1&r.flag)>0)||!(!n||n.length<=0)&&(r&&w()(n).call(n,r.handle)>=0)}getFilteredViewports(e){const t=this.getLayoutViewports(e);let n=le()(t).call(t,(e=>"1"!==e.viewportId));return n.length===t.length&&(n=le()(t).call(t,((e,t)=>0!==t))),n}generateObjectsByViewport(e,t,n,r=[]){var i;const s=t;if("1"==t.viewportId)return;if(!s.psBBox||!s.msToPsMatrix)throw new Error("The bbox or matrix is invalid in the viewport!");pE.transformMatrixUniform={value:s.msToPsMatrix},pE.viewportScaleUniform={value:t.viewHeight/t.height_paperSpace};const a=s.psBBox.clone();a.applyMatrix4(s.msToPsMatrix.clone().invert()),a.min.setZ(-1),a.max.setZ(1);const o=this.getObjectsByBoundingBox(a);if(0===o.length)return;const l=s.psBBox.min,c=s.psBBox.max,u=new xu(new Xt(l.x,l.y),new Xt(c.x,c.y)),h=c$.generateSectionPlanesByBox(u),p=[],d=e=>(p[e.id]||(p[e.id]=e.clone(),this.setMaterialUniforms(p[e.id],n),c$.setMaterialSection(p[e.id],h)),p[e.id]),m=[...r,...t.frozenLayerHandles||[]];let f;if(e!==this.MODEL_LAYOUT_NAME){const e=t;e.associatedLeafObjectSet||(e.associatedLeafObjectSet=new(pe())),f=e.associatedLeafObjectSet}const g=new io;g.name=t.viewportId;const _=null==n?void 0:n.layersAndThreejsObjects,v=[];if(ge()(o).call(o,(t=>{const r=t.clone();r.traverse((t=>{if(t.material&&t.geometry){var r;const i=t.userData.layerName;if(this.isLayerFrozenForViewport(n,i,m))return void v.push(t);!1!==t.userData.layerVisible&&(t.visible=!0),t.material=(e=>{if(x()(e)){const t=[];return ge()(e).call(e,(e=>{const n=d(e);t.push(n)})),t}return d(e)})(t.material),null===(r=f)||void 0===r||r.add(t),_&&_[i]?_[i].push(t):im.warn(`[DxfViewer] Failed to find object for modelId '${this.masterModelId}', layer '${i}', layout '${e}'`)}})),r.userData.boundingBox&&(r.visible=!0,delete r.userData.boundingBox),g.add(r)})),f&&0===f.size)return;uf.removeEmptyObjectsFromRemovingObjects(v,g);const y=null==n?void 0:n.threejsObject;let b=null==y?void 0:Se()(i=y.children).call(i,(t=>t.name===e));b||(b=new io,uf.setSharedVariablesOfObject(b),b.name=e,null==y||y.add(b)),b.add(g),g.applyMatrix4(s.msToPsMatrix),g.updateMatrixWorld(!0),g.traverse((e=>{uf.setSharedVariablesOfObject(e),this.addSpatialFilterSection(e,n,!0)}))}findSpatialFilter(e,t){const n=t.objects.SPATIAL_FILTER;if(!n)return;let r;for(const t of n)if(t.handle===e){r=t;break}return r}getAnyMaterial(e){let t,n=e;if(n.material)return x()(n.material)?n.material[0]:n.material;for(let n=0;n<e.children.length&&(t=this.getAnyMaterial(e.children[n]),!t);n++);return t}addSpatialFilterSection(e,t,n=!1){if("INSERT"!==e.userData.entityType||!e.userData.spatialFilterHandle)return;const r=this.findSpatialFilter(e.userData.spatialFilterHandle,t);if(r){let t=n,i=!1;const s=this.getAnyMaterial(e);if(s&&(s.clippingPlanes&&(t=s.clippingPlanes.length>0),i=s.clipIntersection),t&&i!==r.clipPolylines[0].bReversed)return void im.warn("[DxfViewer] Material cannot set clipIntersection to different values at the same time. clipIntersection needs to be set to true here!");i=r.clipPolylines[0].bReversed;const a=this.generateSectionsBySpatialFilter(r,e.matrixWorld);if(a){const n=e=>{let t=0;return e.clippingPlanes&&(t=e.clippingPlanes.length),t+a.length>pE.maxFragmentUniforms},r=new(pe()),s=e=>{r.has(e.id)||(r.add(e.id),n(e)||c$.setMaterialSection(e,a,t,i))};e.traverse((e=>{const t=e.material;x()(t)?ge()(t).call(t,(e=>{s(e)})):t&&s(t)}))}}}getObjectsByBoundingBox(e){var t,n,r;const i=[];if(e.isEmpty())return im.warn("[DxfViewer] bbox is empty !"),i;const s=null===(t=this.loadedModels[this.masterModelId].dxfData)||void 0===t?void 0:t.threejsObject,a=null==s?void 0:Se()(n=s.children).call(n,(e=>e.name===this.MODEL_LAYOUT_NAME));return a&&ge()(r=a.children).call(r,(t=>{(t=>{const n=rf.getBoundingBox(t,!1);e.intersectsBox(n)&&i.push(t)})(t)})),i}getDxfUnits(e){var t;if(e||Q()(this.loadedModels).length>0&&(e=this.loadedModels[this.masterModelId].dxfData),!e)return hw.Unitless;const n=null===(t=e)||void 0===t?void 0:t.header;if(!n)return im.warn("DxfData or its header is undefined!"),hw.Unitless;const r=n.$INSUNITS;return pE.getDxfUnits(r)}generateSectionsBySpatialFilter(e,t){const n=e.clipPolylines[0];if(n.bConcave)return void im.warn("[DxfViewer] clipPolyline.bConcave = true is not supported yet in spatialFilter !");p$.copy(t),e.localMatrix&&p$.multiply(e.localMatrix);const r=n.polyline,i=[];ge()(r).call(r,(e=>{const t=e.clone().applyMatrix4(p$);i.push(new Xt(t.x,t.y))}));const s=Jl.isClockWise(i),a=!s&&!n.bReversed||s&&n.bReversed;return c$.generateSectionPlanesByPoints(i,a)}addLoadedModelToScene(e,t,n){var r;if(!this.scene)return;let i=t.modelId||t.src;if(this.loadedModels[i]){let e=1;for(;this.loadedModels[`${i}_${e}`];)e++;i=`${i}_${e}`,im.warn(`[DxfViewer] Model '${i}' is loaded more than once!`)}this.loadedModels[i]={dxfData:n},e.matrixAutoUpdate=Ih,e.updateMatrix(),cm.printMemory("Before merge"),t.merge&&(this.merge(n),cm.printMemory("After merged")),e.updateMatrixWorld(!0),pE.computeLineDistances(e),this.getMsTransformMatrix(i),this.masterModelId===i?this.activateLayout(this.MODEL_LAYOUT_NAME):this.handleOverlayDxf(i),im.debug(n),this.scene.add(e);const s=null==n?void 0:Se()(r=n.threejsObject.children).call(r,(e=>e.name===this.MODEL_LAYOUT_NAME));s&&this.setLayoutHidableObjectArray(s),this.updateGroundPlane(),this.masterModelId===i?this.goToHomeView():this.enableRender()}resize(e,t){const n=this.camera;n&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,n.left=-this.width/2,n.right=this.width/2,n.top=this.height/2,n.bottom=-this.height/2,n.updateProjectionMatrix(),this.renderer&&this.renderer.setSize(this.width,this.height),this.css2dRenderer&&this.css2dRenderer.setSize(this.width,this.height),this.svgRenderer&&this.svgRenderer.setSize(this.width,this.height),this.overlayRender&&this.overlayRender.setSize(this.width,this.height)),this.enableRender()}getRaycaster(){return this.raycaster}getRaycastableObjects(){if(this.raycastableObjects)return this.raycastableObjects;const e=Yh()(),t=[];for(const e of tp()(this.loadedModels)){var n,r;const i=null===(n=e.dxfData)||void 0===n?void 0:n.threejsObject,s=i&&Se()(r=i.children).call(r,(e=>e.name===this.activeLayoutName));s&&s.traverseVisible((e=>{uf.isLeafObject(e)&&t.push(e)}))}return this.groundPlane&&t.push(this.groundPlane),this.raycastableObjects=t,im.info(`[DxfViewer] getRaycastableObjects() finds ${t.length} objects`),im.info(`[DxfViewer] getRaycastableObjects() costs ${(Yh()()-e)/1e3} s`),t}getViewportByPoint(e){if(0===this.activeLayoutName.length||this.activeLayoutName===this.MODEL_LAYOUT_NAME)return;const t=this.getLayoutByName(this.activeLayoutName);if(!t)return;const n=this.getFilteredViewports(t);for(let t=0,i=n.length;t<i;t++){const i=n[t];if(r=i.psBBox,!(e.x<r.min.x||e.x>r.max.x||e.y<r.min.y||e.y>r.max.y))return i}var r}getRaycastableObjectsByMouse(e){let t=[];if(!(this.raycaster&&this.camera&&this.scene&&e))return t;const n=Yh()(),r=M_.getScreenPointByEvent(e,this.container),i=M_.screenPoint2NdcPoint(r,this.camera,this.container);if(this.raycaster.setFromCamera(i,this.camera),im.debug("[DxfViewer] Space coordinates corresponding to the mouse position:",this.raycaster.ray.origin),this.activeLayoutName===this.MODEL_LAYOUT_NAME)t=this.getRaycastableObjects(),im.debug("[DxfViewer] getRaycastableObjectsByMouse() from modelSpace");else{const e=new(op()),n=this.getLayoutByName(this.activeLayoutName);if(n){const r=n.directAssociatedLeafObjectSet;r&&ge()(r).call(r,(n=>{n.visible&&(t.push(n),e.add(n))}))}const r=this.getViewportByPoint(this.raycaster.ray.origin);if(r&&r.associatedLeafObjectSet){const n=this.getRaycastableObjects();ge()(n).call(n,(n=>{var i;null!==(i=r.associatedLeafObjectSet)&&void 0!==i&&i.has(n)&&!e.has(n)&&n.visible&&(t.push(n),e.add(n))})),im.debug("[DxfViewer] getRaycastableObjectsByMouse() from inside of viewport:",r.viewportId)}else im.debug("[DxfViewer] getRaycastableObjectsByMouse() from out of viewport");this.groundPlane&&t.push(this.groundPlane)}return im.debug(`[DxfViewer] getRaycastableObjectsByMouse() costs ${(Yh()()-n)/1e3} s`),t}getIntersections(e){this.raycaster&&this.raycaster.layers.enable(Ah);const t=this.getRaycastableObjectsByMouse(e);if(this.measurementManager){const e=this.measurementManager.getMeasurementsMarkers();t.push(...e)}return this.raycaster&&this.raycaster.intersectObjects(t,!0)||[]}handleMouseClick(e){var t;if(!this.enableSelection)return;if(this.measurementManager&&this.measurementManager.isMeasurementActive()||!this.selected)return;const n=this.getIntersections(e);if(n.length>0){const e=e=>cm.vectorToString(e);im.debug(`[DxfViewer] Clicked at: ${e(n[0].point)}`)}const r=Se()(n).call(n,(e=>{const t=e.object;return t.visible&&!1!==t.userData.selectable}));let i=r&&r.object||void 0;const s=null===(t=i)||void 0===t?void 0:t.userData.measurementDataId;var a;s&&(null===(a=this.measurementManager)||void 0===a||a.selectMeasurement(s));i&&this.selectedObject&&this.selectedObject.id===i.id&&(i=void 0),i?this.selectObject(i):this.clearSelection()}selectObject(e,t){if(!this.enableSelection)return;const n=e=>{var r;e.children.length>0&&ge()(r=e.children).call(r,(e=>n(e)));if(e instanceof mi||e instanceof Vo){const n=tf.clonedHighlightMaterials(e,{depthTest:t});n&&(e.userData.originalMaterial=e.material,e.material=n)}},r=e=>{var t;e.children.length>0&&ge()(t=e.children).call(t,(e=>r(e)));if((e instanceof mi||e instanceof Vo)&&e.userData.originalMaterial){const t=e.material;e.material=e.userData.originalMaterial,delete e.userData.originalMaterial,x()(t)?ge()(t).call(t,(e=>e.dispose())):t instanceof Lr&&t.dispose()}};this.selectedObject&&(r(this.selectedObject),this.selectedObject=void 0),e&&(n(e),this.selectedObject=e,e.userData.dxfEntity?im.info("[DxfViewer] Selected entity:",e.userData.dxfEntity):im.info("[DxfViewer] Selected object:",e)),this.enableRender()}clearSelection(){this.selectObject()}flyToObjects(e){if(!e||0===e.length||!this.camera)return;const t=new En;ge()(e).call(e,(e=>{const n=rf.getBoundingBox(e);n.isEmpty()||t.union(n)})),this.zoomToBBox(t)}flyToObject(e){this.flyToObjects([e])}flyToSelectedObject(){if(!this.selectedObject)return;let e=this.selectedObject;(e instanceof ko&&e.userData.clonedMesh||e instanceof mi&&df.isMergedMesh(e)&&e.userData.clonedMesh)&&(e=e.userData.clonedMesh),this.flyToObject(e)}flyToRandomObject(){const e=[];for(const n of tp()(this.loadedModels)){var t;const r=null===(t=n.dxfData)||void 0===t?void 0:t.threejsObject;r&&e.push(r.id)}const n=e.length;if(n<=0)return;const r=e[Math.floor(Math.random()*n)];if(!this.scene.getObjectByProperty("id",r.toString()))return;const i=[];if(this.scene.traverseVisible((e=>{const t=["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"];(e instanceof mi||e instanceof Vo)&&!cp()(t).call(t,e.name)&&i.push(e.id)})),i.length<1)return;const s=Math.floor(Math.random()*i.length),a=this.scene.getObjectById(i[s]);a&&(im.info(`[DxfViewer] Flying to random object: ${a.name}, type: ${a.type}`),this.selectObject(a,void 0),this.flyToObject(a))}flyTo(e,t,n,r){const i=this.camera,s=this.controls;if(!i||!s)return;if(n&&(n=this.checkAndGetLimitedCameraZoom(n)),e.equals(t))return void im.error("[DxfViewer] Camera position and lookAt cannot be the same!");if(!cm.isVectorValid(e)||!cm.isVectorValid(t))return void im.error("[DxfViewer] Invalid position or lookAt!",e,t);const a=e.distanceTo(t);a<i.near?(e=e.clone().sub(t).normalize().multiplyScalar(1.1*i.near),im.warn("[DxfViewer] Camera could be too close to see the object!")):a>i.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*i.far),im.warn("[DxfViewer] Camera could be too far to see the object!"));const o=(e,t,n)=>{i.lookAt(t),i.position.set(e.x,e.y,e.z),n&&hp()(n)&&(i.zoom=n,i.updateProjectionMatrix(),this.updateHidableObjectsVisibility()),s.target.set(t.x,t.y,t.z),s.update()};if(!1===r)return this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),void o(e,t,n);const l=i.position.clone(),c=s.target.clone(),u=i.zoom,h=300,p=Yh()();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=dp()((()=>{let r=Yh()()-p;r>h&&(r=h);const i=(e,t,n)=>{const r=e.x+(t.x-e.x)*n,i=e.y+(t.y-e.y)*n,s=e.z+(t.z-e.z)*n;return new xn(r,i,s)},s=i(l,e,r/h),a=i(c,t,r/h);let d;n&&(d=u+(n-u)*r/h),o(s,a,d),r>=h&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)}goTo(e,t,n){const r=this.camera,i=this.controls;if(!r||!i)return;const s=new xn(e.x,e.y,r.position.z),a=new xn(e.x,e.y,i.target.z);this.flyTo(s,a,t,n)}goToHomeView(){const e=this.getActiveLayoutInfo();e.bbox?this.zoomToBBox(e.bbox):im.error(`[DxfViewer] Failed to find extent for ${this.activeLayoutName}`)}zoomToBBox(e){const t=this.camera;if(!t)return;const n=e.max.x-e.min.x,r=e.max.y-e.min.y,i=t.right-t.left,s=t.top-t.bottom;let a=Math.min(i/n,s/r);a/=1.1;const o=new xn;e.getCenter(o),o.z=0;const l=o.clone().setZ(this.CAMERA_Z_POSITION);l.equals(o)||this.flyTo(l,o,a,!1)}zoomToCompareChange(e){if(this.changes){const t=this.changes[e];if(!t)return;const n=t.box;n&&this.zoomToBBox(n.clone().expandByScalar(1.2))}}getCompareChanges(){return this.changes}setBackgroundColor(e,t,n){this.scene.background=new cn(e,t,n),this.enableRender()}setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))}increaseJobCount(){this.setSpinnerVisibility(++this.jobCount>0)}decreaseJobCount(){this.setSpinnerVisibility(--this.jobCount>0)}getLayoutInfo(e){return this.layoutInfos[e]||(this.layoutInfos[e]={measurementData:[],markupData:[]}),this.layoutInfos[e]}updateGroundPlane(){if(!this.scene)return;const e=this.getActiveLayoutInfo();if(!e.bbox)return;const t=e.bbox.clone();cm.expandBoxByScale(t,3);const n=t.min,r=t.max,i=r.x-n.x+r.y-n.y+r.z-n.z;cm.expandBoxByMinSize(t,i);const s=[],a=(e,t,n)=>{s.push(new xn(e,t,n))},o=t.getSize(new xn),l=t.getCenter(new xn);if(a(-o.x/2,-o.y/2,0),a(o.x/2,-o.y/2,0),a(o.x/2,o.y/2,0),a(-o.x/2,o.y/2,0),this.groundPlane)this.groundPlane.geometry.setFromPoints(s),this.groundPlane.geometry.computeBoundingSphere(),this.groundPlane.geometry.computeBoundingBox(),this.groundPlane.geometry.computeVertexNormals();else{const e=new Kr;e.setFromPoints(s),e.setIndex([0,3,2,0,2,1]),e.computeVertexNormals();const t=new kr({color:"#888",transparent:!0,opacity:0,side:2});this.groundPlane=new mi(e,t),this.groundPlane.frustumCulled=!1,this.groundPlane.position.copy(l),this.groundPlane.scale.set(1e5,1e5,1),this.groundPlane.name="groundPlane",this.groundPlane.userData.selectable=!1,this.groundPlane.renderOrder=Hh,this.scene.add(this.groundPlane)}this.groundPlane.updateMatrixWorld()}merge(e){var t;const n={};ge()(t=e.objects.LAYOUT).call(t,(e=>{var t;const r=e;n[r.layoutName]=r,null===(t=r.directAssociatedLeafObjectSet)||void 0===t||t.clear()}));const r=Yh()(),i={},s={};let a=0,o=0;const l=()=>{const e=Yh()();for(const e in i){const t=i[e];g$.removeEmptyObjectsFromRemovingMarkedObjects(t.children,t.object),t.children=[]}a=0,o+=Yh()()-e};for(const t in e.layersAndThreejsObjects){const r=e.layersAndThreejsObjects[t];if(r.length<=1)continue;const c=Yh()(),u={};for(const e of r){let t,n=e;for(;n;){if(n.userData.isLayoutLevelObject){t=n;break}n=n.parent}if(!t)continue;const r=t.name;u[r]||(u[r]={object:t,children:[]}),u[r].children.push(e)}const h=[];for(const e in u){let t;if(e!==this.MODEL_LAYOUT_NAME){const r=n[e];r.directAssociatedLeafObjectSet||(r.directAssociatedLeafObjectSet=new(pe())),t=r.directAssociatedLeafObjectSet}const r=u[e],c=df.deepMerge(r.children,r.object,!1,!1,!0),p=c.added,d=c.removed;i[e]||(i[e]={object:r.object,children:[]}),s[e]||(s[e]={object:r.object,children:[]});const m=d.length>15e3;if(m){const e=Yh()();g$.removeEmptyObjectsFromRemovingMarkedObjects(d,r.object),o+=Yh()()-e}else a+=d.length;if(d.length===r.children.length)m||ge()(d).call(d,(t=>{i[e].children.push(t)}));else{let n=d;d.length>=100&&(n=new(pe())(d));const s=e=>x()(n)?w()(n).call(n,e)>=0:n.has(e);for(let n=0;n<r.children.length;n++){const a=r.children[n];s(a)?m||i[e].children.push(a):(h.push(a),t&&t.add(a))}}for(let n=0;n<p.length;n++){const r=p[n];uf.setSharedVariablesOfObject(r),h.push(r),s[e].children.push(r),t&&t.add(r)}a>15e3&&l()}e.layersAndThreejsObjects[t]=h,im.debug(`[DxfViewer] layer ${t} merge costs ${(Yh()()-c)/1e3}s`)}a>0&&l();for(const t in s){var c,u;const n=s[t];Se()(c=e.threejsObject.children).call(c,(e=>e.name===t))||e.threejsObject.add(n.object),ge()(u=n.children).call(u,(e=>{n.object.add(e),e.updateWorldMatrix(!1,!1)})),n.children=[]}im.debug(`[DxfViewer] MergeUtils.deepMerge costed ${df.mergeInfo.elapsedTime/1e3}s`),im.debug(`[DxfViewer] The remove operation of deep merge costed ${o/1e3}s`),im.info(`[DxfViewer] Deep merge totally costed ${(Yh()()-r)/1e3}s`);const h=df.mergeInfo;im.info(`[DxfLoader] Totally merged ${h.removedObjects} objects to ${h.mergedMeshes} meshes, ${h.mergedLines} lines, ${h.mergedPoints} points, ${h.mergedUnknownTypeObjects?h.mergedUnknownTypeObjects+" unknown type,":""} `)}statLayoutAndLayerObjects(e){const t=new(op());let n=0;for(const r in e.layersAndThreejsObjects){const i=e.layersAndThreejsObjects[r];ge()(i).call(i,(e=>{e.geometry&&(n++,t.has(e)?console.warn(e):t.add(e))}))}const r=new(op());let i=0;if(e.threejsObject.traverse((e=>{e.geometry&&(i++,r.has(e)?console.warn(e):r.add(e))})),n!=i)for(const t in e.layersAndThreejsObjects){const n=e.layersAndThreejsObjects[t];ge()(n).call(n,(e=>{e.geometry&&(r.has(e)||console.warn(e))}))}im.info(`[DxfViewer] The count of layer objects is ${n},The count of layout objects is ${i} `)}computeBoundingBox(){const e=new En;for(const n of tp()(this.loadedModels)){var t;const r=null===(t=n.dxfData)||void 0===t?void 0:t.threejsObject;if(r){const t=rf.getBoundingBox(r,!1);t.isEmpty()||e.union(t)}}return e.min.z=0,e.max.z=0,im.info(`[BimViewer] computeBoundingBox(), BBox's max: ${e.max.toArray()}, min: ${e.min.toArray()}`),e}checkAndGetLimitedCameraZoom(e){if(!e)return 1;let t=e;return e<this.CAMERA_MIN_ZOOM&&(im.warn(`[DxfViewer] Attampting to set camera's zoom value to ${e}, will use ${this.CAMERA_MIN_ZOOM}`),t=this.CAMERA_MIN_ZOOM),t}setVisibilityByCameraFrustum(){if(!this.camera)return;const e=Yh()();d$.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),m$.setFromProjectionMatrix(d$);for(const e of tp()(this.loadedModels)){var t,n;const r=null===(t=e.dxfData)||void 0===t?void 0:t.threejsObject;r&&r.visible&&ge()(n=r.children).call(n,(e=>{var t;e.visible&&ge()(t=e.children).call(t,(e=>{e.userData.boundingBox&&(m$.intersectsBox(e.userData.boundingBox)?e.visible=!0:e.visible=!1)}))}))}im.debug(`[DxfViewer] setVisibilityByCameraFrustum cost: ${(Yh()()-e)/1e3}s`)}getVisiblePixelSize(e){const t=6.5*Yt.smoothstep(e,1e4,3e4)+.5;return im.log("[DxfViewer] visiblePixelSize:",t),t}setLayoutHidableObjectArray(e){const t=this.camera;if(!this.enableHideVisuallySmallObjects||!t)return;const n=Yh()(),r=e.name;this.sortedHidableObjects[r]||(this.sortedHidableObjects[r]=[]);const i=this.sortedHidableObjects[r],s=t.zoom;this.lastCameraZoom=s;let a=1;e.traverse((e=>{if(!uf.isLeafObject(e))return;const t=e.geometry;t.boundingBox||t.computeBoundingBox();const n=t.boundingBox.clone();if(!n||!cm.isBoxValid(n))return;n.applyMatrix4(e.matrixWorld),n.getSize(f$);const r=Math.max(f$.x,f$.y),s=a/r;s<1/0?i.push({visibleMinZoom:s,object:e}):e instanceof Qo?i.push({visibleMinZoom:a,object:e}):im.warn("[DxfViewer] The size of bbox is 0 ! ",e)})),a=this.getVisiblePixelSize(i.length);let o=0;ge()(i).call(i,(e=>{const t=e.visibleMinZoom*a;e.visibleMinZoom=t,e.object.userData.visibleMinZoom=t,t>s&&(e.object.visible=!1,o++)})),re()(i).call(i,((e,t)=>e.visibleMinZoom-t.visibleMinZoom)),im.info(`[DxfViewer] setLayoutHidableObjectArray cost: ${(Yh()()-n)/1e3}s, ${o} objects changed to hidden`)}statObjects(e){const t=this.sortedHidableObjects[this.activeLayoutName],n=t.length,r={};let i=0;ge()(t).call(t,(t=>{const n=t.object;if(n.geometry&&n.material){i++;const n=(t=>{let n=0,r=t;for(;r&&(n++,r!==e);)r=r.parent;return n})(t.object);r[n]||(r[n]=0),r[n]++}}));let s=0;e.traverse((e=>{const t=e;t.geometry&&t.material&&s++})),im.info(`[DxfViewer] hidableObjects count:${n}, real count:${i}, layout count: ${s}, level:`,r),im.info("[DxfViewer] scene:",this.scene)}updateHidableObjectsVisibility(){const e=this.camera;if(!e)return;const t=Yh()(),n=e.zoom;if(Math.abs(n-this.lastCameraZoom)<1e-5)return;if(this.updateRaycasterThreshold(),this.updateCameraZoomUniform(n),this.raycastableObjects=void 0,!this.sortedHidableObjects[this.activeLayoutName])return;const r=this.sortedHidableObjects[this.activeLayoutName];if(0===r.length)return;const i=n>this.lastCameraZoom,s=Math.min(n,this.lastCameraZoom),a=Math.max(n,this.lastCameraZoom),o=[];let l=0;for(let e=0;e<r.length;++e){if(!1!==r[e].object.userData.layerVisible)if(r[e].visibleMinZoom<s)o.push(r[e].object);else{if(r[e].visibleMinZoom>a)break;r[e].object.visible=i,i&&o.push(r[e].object),l++}}this.lastCameraZoom=n,im.debug(`[DxfViewer] updateHidableObjectsVisibility cost: ${(Yh()()-t)/1e3}s, ${l}(out of ${r.length}) objects changed to ${i?"visible":"hidden"}`),this.groundPlane&&o.push(this.groundPlane),this.raycastableObjects=o}updateRaycasterThreshold(){const e=this.camera;if(!e||!this.raycaster)return;const t=12/e.zoom,n=this.raycaster.params;n.Line?n.Line.threshold=t:n.Line={threshold:t},n.Points?n.Points.threshold=t:n.Points={threshold:t}}updateCameraZoomUniform(e){pE.cameraZoomUniform.value=e}static removeEmptyObjectsFromRemovingMarkedObjects(e,t){if(0===e.length)return;const n=e=>{const r=[];for(const n of e){n.userData.validCount=0;const e=n.parent;e&&e!==t&&(void 0===e.userData.validCount&&(e.userData.validCount=e.children.length),0==--e.userData.validCount&&r.push(e))}r.length>0&&n(r)};n(e),this.removeEmptyObjectsFromMark(t)}static removeEmptyObjectsFromMark(e){if(0===e.userData.validCount||uf.isEmptyObject(e))return e.removeFromParent(),!0;for(let t=0;t<e.children.length;)this.removeEmptyObjectsFromMark(e.children[t])||++t;return!1}}class _$ extends g${constructor(e){super(e),gh(this,"cameraMarker",void 0),gh(this,"transformMatrix",void 0),gh(this,"cameraDirElement",void 0),gh(this,"cameraElement",void 0),gh(this,"baseImageId",void 0),gh(this,"bbox",new En),gh(this,"cameraDefaultUrl",void 0),gh(this,"cameraHoverUrl",void 0),gh(this,"dirDefaultUrl",void 0),gh(this,"dirHoverUrl",void 0),gh(this,"resizeObserver",void 0),gh(this,"animationId",void 0),gh(this,"zoom",1),gh(this,"_minZoomRadio",.3),gh(this,"_maxZoomRadio",5),gh(this,"isInitCameraZoom",!0),this.initBaseOverviewMap()}initBaseOverviewMap(){this.initResize(),this.initHoverMakerEvent(),this.initMarkerImageUrls(),this.initCameraPointMarker()}initResize(){this.resizeObserver=new ResizeObserver((e=>{for(const t of e){const e=t.contentRect;im.info(`[OverviewMap] container size: ${e.width}px x ${e.height}`),this.resize(e.width,e.height)}})),this.resizeObserver.observe(this.container)}createImage(e,t){const n=document.createElement("img");return n.src=e,n.draggable=!1,n.style.cssText="position: absolute; top: 0; left: 0;",n.style.transform=`translate(${t.x}, ${t.y})`,n}initCameraPointMarker(){if(!this.cameraDefaultUrl&&!this.dirDefaultUrl)return;const e=document.createElement("div"),t=document.createElement("div");if(e.classList.add("camera-marker"),e.style.cssText="top: 0; left: 0; display: block; dragable: false;",this.dirDefaultUrl){const e=this.createImage(this.dirDefaultUrl,{x:"-100%",y:"-50%"});t.appendChild(e),this.cameraDirElement=e}if(this.cameraDefaultUrl){const e=this.createImage(this.cameraDefaultUrl,{x:"-50%",y:"-50%"});t.appendChild(e),this.cameraElement=e}e.appendChild(t);const n=new Uf(e);n.onBeforeRender=this.updateMarker(n,t),n.scale.set(.25,1,.25),this.cameraMarker=n,this.scene.add(n)}computeObjectBoundingBox(e){const t=e.id,n=rf.getObjectsBoundingBox(this.scene,[t]);return this.bbox=n,n}initControls(){}initHoverMakerEvent(){}resize(e,t){this.renderer&&this.renderer.setSize(e,t),this.css2dRenderer&&(this.css2dRenderer.setSize(e,t),this.css2dRenderer.domElement.style.width="0px",this.css2dRenderer.domElement.style.height="0px"),this.enableRender()}initOthers(){this.camera&&this.controls&&this.renderer&&(this.selected=!1,this.renderer.domElement.style.outlineWidth="0")}initMarkerImageUrls(){}updateMarker(e,t){return()=>{}}animate(){var e,t,n,r,i;(requestAnimationFrame(ve()(e=this.animate).call(e,this)),this.renderEnabled&&this.scene&&this.camera)&&(null===(r=this.renderer)||void 0===r||r.render(this.scene,this.camera),null===(i=this.css2dRenderer)||void 0===i||i.render(this.scene,this.camera));null===(t=this.controls)||void 0===t||t.update(),null===(n=this.stats)||void 0===n||n.update()}transfromToCurrentCoordinateSystem(e){const t=new xn(e[0],e[1],e[2]);return this.transformMatrix&&t.applyMatrix4(this.transformMatrix),[t.x,t.y,t.z]}setTransformMatrix(e){this.transformMatrix=new Zn,this.transformMatrix.elements=e}loadImage(e,t,n,r,i,s=0,a=!0){this.increaseJobCount(),(new zc).load(e,(e=>{const o=n-t,l=i-r,c=new kr({map:e,side:0,transparent:!0}),u=new ki(o,l),h=new mi(u,c);h.rotation.set(-Math.PI/2,0,0),h.position.set(t+o/2,s,r+l/2),h.matrixAutoUpdate=!1,h.updateMatrix(),this.scene.add(h),this.computeObjectBoundingBox(h),this.isInitCameraZoom=!0,a&&this.goToHomeView(),this.enableRender(),this.baseImageId=h.id,this.dispatchEvent("loadedimage"),this.decreaseJobCount()}),void 0,(t=>{im.error(`[DxfViewer] Failed to load ${e}, ${t}`),this.decreaseJobCount()}))}updateBaseImage(e,t,n,r,i,s=0,a=!1){if(this.baseImageId){const e=this.scene.getObjectById(this.baseImageId);var o,l,c,u;if(e&&e instanceof mi)null===(o=e.geometry)||void 0===o||null===(l=o.material)||void 0===l||null===(c=Z()(l))||void 0===c||c.dispose(),null===(u=e.geometry)||void 0===u||u.dispose(),this.scene.remove(e)}this.loadImage(e,t,n,r,i,s,a)}updateMarkerImage(e,t){const{defaultUrl:n,hoverUrl:r,transformStyle:i}=e,{defaultUrl:s,hoverUrl:a}=t;var o;(n&&this.cameraDirElement&&(this.dirDefaultUrl=n,this.cameraDirElement.setAttribute("src",n)),r&&(this.dirHoverUrl=r),s&&this.cameraDirElement&&i)&&(this.cameraDefaultUrl=s,this.cameraDirElement.style.transform=i,null===(o=this.cameraElement)||void 0===o||o.setAttribute("src",s));a&&(this.cameraHoverUrl=a)}cancelAnimation(){this.animationId&&cancelAnimationFrame(this.animationId)}goToHomeView(){if(!this.scene||!this.camera||!this.controls)return;const e=this.camera,t=this.bbox,n=t.max.x-t.min.x,r=t.max.z-t.min.z,i=e.right-e.left,s=e.top-e.bottom;e.zoom=Math.min(i/n,s/r),e.zoom/=1,e.updateProjectionMatrix();const a=new xn;t.getCenter(a);const o=a.clone().setY(t.max.y+1);var l;o.equals(a)||(e.lookAt(a),e.position.set(o.x,o.y,o.z),null===(l=this.cameraMarker)||void 0===l||l.position.set(o.x,0,o.z),this.controls.target.set(a.x,a.y,a.z),this.controls.update());this.isInitCameraZoom&&(this.zoom=this.camera.zoom,this.controls.minZoom=this.zoom*this._minZoomRadio,this.controls.maxZoom=this.zoom*this._maxZoomRadio,this.isInitCameraZoom=!1),this.enableRender()}reset(){this.camera&&this.camera.updateProjectionMatrix(),this.goToHomeView()}destroy(){var e;super.destroy(),null===(e=this.resizeObserver)||void 0===e||e.unobserve(this.container)}}class v$ extends _${constructor(e){super(e),gh(this,"tolerance",5),gh(this,"rotateStart",new Xt),gh(this,"translateStart",new Xt),gh(this,"cameraDirDivPos",new Xt),gh(this,"parentTranslate",new Xt),gh(this,"isMarkerRotating",!1),gh(this,"isMarkerTranslating",!1),gh(this,"pointerMoveHandle",void 0),gh(this,"cameraDirPointerDownHandle",void 0),gh(this,"cameraPointerDownHandle",void 0),gh(this,"pointerUpHandle",void 0),gh(this,"dblClickHandle",void 0),gh(this,"wheelEventHandle",void 0),this.initCameraMarkerEvents(),this.initHoverMakerEvent()}get minZoomRadio(){return this._minZoomRadio}set minZoomRadio(e){this.controls&&(this._minZoomRadio=e,this.controls.minZoom=e*this.minZoomRadio)}get maxZoomRadio(){return this._maxZoomRadio}set maxZoomRadio(e){this.controls&&(this._maxZoomRadio=e,this.controls.maxZoom=this.zoom*this.maxZoomRadio)}initMarkerImageUrls(){this.cameraDefaultUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABgCAMAAACuYkXGAAAAulBMVEUAAABJSV9pdntRWmdeaHZMW21ZYnJqcH9PV2dSWmtTXmtXX3Jka3tfZ3daY3NXYHBbZHNbZHJaYXNWX3D9/f5cZnT+/v6xs7zKzdKusbr6+vvs7e/Z29/s7e/09faPlaCVmaX6+vz6+vv5+fnw8fP3+Pjh4+Xu7/Da2+Dp6uz+/v719vjz9PX09PRfYXP///+vsLlpa3vDxMv19ffr6+7r6+2lprCHiJZ9fo1zdITNzdObnKeRkp9zdYQN9RLUAAAALnRSTlMAAwQICgYSBwsPDRUMDxcZHRsjH+Mg8TwvIMZ+UpGIMizVtqael3VrZ1zTuq2q+zBSvwAABtBJREFUaN7tmXlD00AQxSW7yeYsPaktKJcgeBRbbsHv/7V8b3ZjTOiRrfylTnoIpD+eb2dmD978j789dtzrjry8HrYWIL8u91Xx+HxgOYG88FHGK2gNbOxUb+7720It2BFNiAh4BXw66bjPMwlKA4gJTWiMUsrgUoZflrL9ra4sMCo0mlilldb4lxY6hQvbU7HDUipQiFjrPLYXvlKiXdAU7a03JCCWyNM8jfFM81znuRI0fmtovW7vr1ANpIGbpmmBSHglSZEiAIcr8JyOtLbDyoUarSGO2MnB/umn4RViOD3ZP0iKIi1yjQDY2EFsiUVwtHLITSaX072rWuydfIwgnG4rzWFsQxYsEkppcPGfn7wH9WUMT99Cth3HINysmQYzceECvU2IXRXv3yYp0YZFA3Abe0PYAG5xWWKvF3fPj/PZbPZ4f7e4KVV/TAr6oQwSb0PWkWsQzIVicuao3+5ntXgo2WcT2JHHSm3Q/Ct5NdI2efvJYam0GU8WPYQdcaxlBNc1DnIN0zcGd3jFAHZ5fHPkqKAbBK8mUzGqCeNWRJZ78zBbGT9unGaIps9rzEB5SmdIU8ddQO7qmH+v3IBm2ryKC3AIg4tiItxvFWSNHZ8mURLbQoGy5U6w3nRaJNGZ47Yin8HmnPnM/r3cYQMw8iz6yPu/z1rEgndeQnKs7AAuFwwfWMdi8M28DXh+Q5snEcbPlsnOipRQcV5E7ynjcdYqHqS6owRmhMsTQ+Y2ZAQyraXBlc17E9hMMwh+KTikExi5Uxoxaxvza5Ec5bDZvHRZ5mM6nBYZHX5qDXaSUSZQDEqzGUlXU2gRTAkK9pN8ic5PyS8Vsw2rGNzohCXnARbJ0wjj5yTXGzxTQhOcsQc/+IDv3fClOeoaAhsWg6vQfLIDPycY9OIgklxmw3jR4JWmE/ueTrjy288wnWhKRtSsMHboMlp85we+w0dOsyhx4GaHDy14irvu/cDP+MgxwbnSMvnVyxn9J0mizlDK2St+sF9kyAu2ZWj8XTPqmf0nirIrxMwv5vxMlqGsCa5lBZNCoeyiqOMLZpRgKnZeVE7I1BFlW4M7NFk18o1r0RDlUYLnW4B3Ac6RyBRcnz2M1N3WgwfFUcq5Lwga2YZZH2O3e4y7nv3ArOmpWKHZ7UVx1TSNyUXx1+0K5DPBhWazB7jeKix425ImmOlmalbYiTQnmE3o2g98yybkrDC1PHbpVhB8tOdb0w9sm71OmcdBo7sBzHTLelNOpb5OnAgYrb7RN6mYiYy06F3Qi7mnE+e9TOYQExqIrE9MRkki78ILL8lPzOIu6yPR0ukbM17AZTHBvXd+kin4C8GsD9PwGF64GSTr9Pwky7pw3KNigMEluV4hkm9Rp9el5KuHtuWMeNft2R7UXLKQLOCCXnSP2C9u2y0KacRwTCeK1K0461aUK0Ka3L24alt+sqg/7zonYhO8OHeBNdKRE3ox+OCz8P4w6O52skTWyA3BCPwq2X4kIvnouP1WYXjkBNvyaFj8a8mSsEZ6g/FQFvXrNzcL4Y4H4Eo962qD01wU0guRPLLk28c1LeLWcmkEBAOslu7WA9lDx1gCZB3aDPI6O+awwXEpmHs9dqA1WwWZ+KC578i3T0ux1/LD4/HICU4xQLUkbnY4DckkdwejQ+YG0YtGsdwTK/lwSL2Sw9wpALsCHMi+n82TZoz65xDt2Hf3j1T6+Hy3IFVsuOgPrF4Wh+aybcV+LJB2n8tEAnJ31B+julfE3rvD/qhLLo3gCtZW3XIwybG1mT4P+v3xl+FK7ACJ1ukIV8HgFVzaI6cKKpdZFT7TaLDPP+81qNMLwVZcdolVYGHLLh0tg/tpS4bTiIP9z1NRPjz+sn9wiO8MaK/4m3CRaeBwE9yskoAHFgBD9C7sABrsRozgbm/X+Ztq1Jw9ytpwOKboM8k0moMosivqgNiexRZJzoQwELzxEEt2qCQDDTbRZLsYIIC1XIDlWM9uzzeRgdaaI1iADD8QhDMGeBKKQetEkdgQIx/K7fkmdKioGXawCEs2ebwE6tSmItcm8MaTQueGNrKxLiy6YwNQJhipxNo0Y2W0PzWlaHEaqsXsKoSawIVcM89U24NvJzpkd1bidUG0C1KZClCLHyoFrPcBckgy0XGaJ0mBB4US6rxltTm5vkf0CkE20FCe5kVKKAtC8TIV1/OUHuMCWWTHuQZf57o8+scglNQd/7+DSLsj2GjrKJGa2NBiPeU6uKAlDM/5AeMbs8vIgUeD62kH4S4ok0IBbVC3RANUxU5FrcDbiy5pVMu3BnQ7dJl+AnZCeeHx5yE0C9us1R8uz//xD8RPQ80FqUsWMbIAAAAASUVORK5CYII=",this.cameraHoverUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABgCAMAAACuYkXGAAAAt1BMVEUAAABRUmRVYHFcZHBRWWZia3plb39aYnFeZnVYYXNZYnJPWGdZYnJRWWtZYnJZY3JWYG9eZnVcY3RXXnH+/v7+/v78/P2xs7zKzdKusbr6+vv4+frz9PXn6evs7e/09faPlaCVmaX6+vz09PX5+fns7fDa2+Dp6uzS1Nni4+X+/v7l5+rx8vL9/f1fTf////+vpv9pWP/DvP/19P9zY//r6f/r6P+lm/+Hef99bv/Nx/+bkP+RhP+tEDdkAAAALnRSTlMAAQMGCAsIDQ8UEgsXEB0gGhojJOLx5DwvIMa4m3CRiDIs1aymfWdcV03ShXjTY8FN1QAABtZJREFUaN7tmWlb2kAUhS1knSFAXFBArFtduoAgbtX//7t67gITEsCM+rFHwNZHXs9z5t6bybDzX376hi/5Bx5fxsSTeIBD8qPPUxUndP6f0+fITo0GngUs/ZEPMl0ADVAbKgf3J+siLaxWpOY1HV8yIQvQZlOeJeNedaJWHLhZlrJ94/imKkCjZhAEUYDXSMjCVtN14c4tM/GIAA3CILRhRPyo6HunJrhoVuwCGQIZxqF8t4TH3xK0rqEPmJiwZ4UXx7GN6ZX+AtwHTTYOMkf9DlkqV1MAFO9nZKLK8Iwh0C24hG7UQmv5arphBHcgJf3b35c/9yfQ/mD4+5bxFIx6hriZ6q0arVZsbZL1rwcHkxUdDEcZ0KFkzZ5JW/2qXc6B7fa/g1rV/uUR0FhGVCEHLdo6y5gb0YLFjN2k70dZHGNlIwl6KxdSbmCBTa4X2PvZ09t8Oh6P589Ps8eFawSCqB1586hecqPQIoVjpd49j1f0smAf9xEH6iMQ8nospaBlBm4cZ0c/FQunFb0Kev8oS6Q6dHBU2cAqOEC+KIYjlBek2KrulGyEvCVm4WoORrgPL+ONmj+qZ8QRcdWtn3WLhUOvLbkz2N2s6V8lI+dA04DWcRnM68bcOwfZEsefvkls4EbSGjD3G7oiM8fKrUU+NlR1FIakUSkJDSJOzGgC/R3X0GwCXWeJDXkgrUkCaOLS2JGCeJjWAU8fKea+iS1bXkvmimDD38nGfFxLL9zdJkPNsWWozG1C4KKCawbsYj7oI2Ys4DrLmjCCMJcUxLiupvdkOUXNWYArMS97LklSSvi1Nlgto02WA3SlKggcseGRGPazfG2SxFrpkp2y4ygirhlSy3mA2fLAGFh289MVW4OXDuCUZvCLD/hZlw9kBrsW4Qsdd12SpbeeSUCUxa0xMVfct6JjvoCKYfPDMwltvx8pli8ky4C5peMoaEyYlCJ+8gM/4S2Xqcli6mvFqnSuJYh4gN969gO/4S3nBI65rXcaxdEGLkfc2ud29tKc5kXL0CjSEVdYPFk7Y1oTaOyn6QRqpdzWAJf6GVw4VrCnFAzHq+NCRzFd6tJPgBGFXlRXJ0WEokgFPP0QOEVZVBZPGxqOex9dvJRaJGByybG1Bo7P8VtvHlTt6QE5FrBm7EZQzI4vPtYgw5Z0SECtt2pYo/hoSzvHxcVjMEYFGuSG9mt+YLqg3pBjrWOXBNzTdZQdnx349vQLjc2c6xjgJsAlyzyDWl0aFne+SQxzqmOOuNR6dC8TMviKsph6JjHqEjjWXYsrYwYHvHo5svCy/Ipf77UZHHKDAOjAHEVoMSta+Qlb9jJ80c6pPyw7Lu1X5MpEWfhY1n3hYQ5wRhu4BuSi0ClkefXyNlmevNRtZ+iEkjC8swC2UdmvhGy52z7r+W0Ke4ftnKdxZcuiyxdowbWvJnXbjzf1o3YuY94Cu7qvwFWvyWMoyQjc8dt4d6QmLDtGwkWw7oSk+fL22Xn9W4XeWbvbJcOxcNWwWz2qi8Dy8nXbhz3e1G+/uZkx9xB+5boUuYSd5M6cLbcQhpIf5ltGxKNwOQgj29gq190yUcoIowPytjimiMFxOeEI4DIZKWtbWw1jSX54XYu9n5DOwVXDga3eKrgmCSJYlvVrd06PJ4KelZrlGVjW8Sn8Sm9QETdk31YFO8uoOZA7I5hW9tPznJzO355moEoMV7sdCRhgWbl1jvGQlOXSx553D08mm3RwcrrLOWhv8Cnf+jMnhCyW44TJOci7hxe9TVji5i2pCHc2VKGS9OY/pphTJnc6u3uj4UGJOriCW2DbLeLKfSn8rgW7YzE6akuSTMjIY29vd+/m13DAznvnF79uTvEj4nYxIpZcvRXbdsKCyqA+UTK7hvacQAWWY0izLNFjIT30rapwhEUdyFWHpLk8CA4gqSNYVJnYxcKBSwkTY/OpMU+5gD0jjZTIXbINuqpNWOVyAUdR4eht8znh8tgtzhLDprtd2HbKc1AhYzgGq+eQ2w/tGYwGFNOJVAeUgw7lOR6gils5dVNuCbux6Li56QiSAhE4VXZLoIJN5CxIRwT0DlhLA2i4RhtCJmUByVAJwfIJtY40UY1TaTnpDijqhBJZSKkUQhDyialy3/9wwZ1383k5H54SHDgg8SpHpUrV02OttBrkRRNGajvGQxXGQo0W3KLbWqZ1EZWNpyX7eOGT/yVWPzurx5X+dlk3iQ4envRFlaBYpZa575aHsiMMPXoqdJmtygPr6oO19gMhNcxcL8NVdqMELcwzL8/uY4ay8DPH9ZW+UcQwkeAqHwT5w6va+aLPTPW1QJXTni+QYuW7gr9SHO5/eesfYdwFkua/O6kAAAAASUVORK5CYII=",this.dirDefaultUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqCAMAAAAKqCSwAAAAh1BMVEUAAABfTP9eTP9fTP9eTP9fTP9fTP9fTf9fTf9fTP9fTP9fTP9fTf9fTP9eTf9eTP9fTP9fTP9eTP9eTP9eTP9fTf9fTf9fTf9fTf9fTf9fTf9eTP9fTf9cSP9dS/9eTP9fTf9fTf9fTP9fTf9cSv9fTf9fTf9fTf9fTf9fTf9fTf9fTf9fTf/hY9QXAAAALXRSTlMARjRhS0HMZ1M5PVgva1wrTyYbFyJwlnx0gaATeAUPH4mmjYUKm5Gvv7m0q8X/SpWnAAAGcklEQVR42tXcCXriMAwFYEFhBsqeQIEGB2jTjc79zzdmFaDEjgmyhU/wf6+yvIUCxxhE8CBj3Kw9iHXZbNYew7p81tSHsEbPe2pDvDVuH6nSrVkdqcMlCB6q2z6jtgRb1aB+pGrpsCXYOq4jdZuqXGtcR2ptl2qrI9Oadi+oO2unMwZ5Q43OqY0DVaR11L2kDvfUfl+cNRl0SQHsqU/CrNmAUlsHqiyrGg+KU316GoGcEY+M1L9yrOnojNo8dQCkirGq5ciSqhhrMkYq6at7aq8nwqrGhEoKQFsHEH5EudThOVVLe5Pw1nSJ1PbFduUy1Ulwq4o01TStkDoLbE1s1P6ROpvNuhBiYKj51GFOqrNFkFwxVHuqSF2EyzWLojK1itRpMGsckVSbeLbKo4ayZoRqTXU6D2NN4tidGsSaxXGMtWrcA5xT3+vgfaTxRQF0Tc0KqSGsKjmnDooKgKb6vvJtzZBarq8i1bc10VRDX20ZUl29ebVmSeLQASZXVK/WVEtdlgCk7qyf/qxqR7Wn2iepznepfn62wdPIMNXRsQO0Cw4sdFqtNPXFk1WlJNWucVrRVF88WbMtNTF2ALK1XpxNK2194bcilU4rWgB92qxOqb58eLCqLDVMK3oMLKKyWpGaklSte4Apob4+A/PITqlGBiqdVpTKbVUHqvPWmlKJlY8a3URdnVHXfFakJnkLK1LNBYDUdRPOh+ACWK8Zc1VFBeCwsL6dqNr6i7kyUXEPYE8Vm9X8ulY1Fa081L0Vqe7NCqlfJ6uQApjmU381Fa1M1Pg+02pL3aCVmWpP9WpnRaibGofUdQnoFXYALIANi7UClRbAWg8t1dSfnxprqsvbDtdb6yFVpGorF1Vbb6PSDnCgftfCpkoP1/nTaqOp2spCNd4EUuqisFlhqt/fDa5U3W5XpjmbQKzVzY76r8GUqlMBWPrqz56KVg8FQKeVvQAwVbT6KABaqxNDB8BmdaD+abBQ3Y+Bc9qsrqlo5acW7AGmZQrgrlZSq873q6vcJQBTRWtVae4xsGvtAJZUkYpW/iWAvgXQZkX7KlLR6nsJ6BmpNFW08lC7tpvAhW21QipaWVarrjFVWqufhlTvZdVSMq0sBUCalbkDoNX/gcWxA9zNqhhOrISK1oAdYJ5XAGRaoZX1wEKpDqlSayWq6dLS7Wz1YWhWaPW6tZ5cXa+ZlwBi5aTSFxaknlarDwsVrR7PVo4LK7VyUOm3K/bV6pfUKrXemdq+U1+l1q+IoQNYD9e0AOiBhUoZa1VL899YaQd4JVQq5TxcD7FWXU8BxLqJgJPqXqs4raiUmdqq3qzwrx+0r+LCSvcARHo36qh6ql+kVomUcwlwfws4UkmdyplWhIqZ+r8Ictta/yNS1mlF+ursQLWfWFHq89KyU+EYiNLKVHwOrlYAtAOglDXVpuGTsPKpolTc4ZrsV4k0yGo1t6a6k0qgYqpFZyuUVh7GWjVRp+WWACKtmmpa4lvrjvuVxVYq5XsAPFznp/qLUuZmVfUiCKX8BYCrFVLJC0vhErCO4TCE9tVTqlr6INR1LOrTBcMS8EqljFtrOq3+kmn1XrCwotRjquQxyH62QilvB3B/Y6UF8IFSP99ZNfN/c23fWaGUi7q8z2MQkxSwAGK6Wu1jHTo2qxci9bSzajhuAtmkANW2KzTVT5QyUqu/W11IxVCneZtAVilStdXxLYDeWrNKARy/te4ZvrN6S4B1ZOV+GmansktBOfw0zNhXVwlwD4dNoGm1eueUIlVbb0sVO4APKSjrtGrZfhuIUuZhP7BYC2DuRwrZjT8MwYXVlxSU6YWlYf/KAqX8w+k5mL6wTP1JIavw20BmKY21wv3qwqsUspuvLHxLAW7+txvepZA5XQUjdZaC76HofpW+W1FqAClAesu0moSQgnL7zGaxpXqWYqzOtdoLJAXl2qxCSDFWSj1KabP6m0K4UXoTqKWzoFJIS/+DiNBSgPIXQaGlkJ2oXfPvrZ5SCD3icqkKkIJa7qgD00WQDClAWuI1sC9CChBZP7ORIgV1ubDSJaAjRQqQmKeVICnAspgqTApqVExtZSBqpIU3gdKkAFF+qgKlAKPcL9iHAqWgclKVKQXI6C8uGzKlAPHVw6VcKcDysgBqcqUAg7MCkC0F1UWqbKm21o8F0BQuBcjae6p8KUCqqY8hBYg19fkhpFvro0gBEhbpfwjbOY5gXmpMAAAAAElFTkSuQmCC",this.dirHoverUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqCAMAAAAKqCSwAAAB0VBMVEUAAAB5d55fTP9fTf9fTP9eTf9eTP9fTP9fTf5fTf9aYnFfTP9fTP9RV2hfTP9fTf9fTP9fTP9eTP9eTf9eTf9eTP9fTv5fTf9fTP9fTf9fTf9fTP9fTf9fTf9eTP9eTP9fTP9fTf9YX3BaYnRfTf9fTf9fTP9fTP9QVmZeTf9eTf9fTf9fTf9fTP9fTf9fTf9fTf9eTP9fTf9eTf9jantgTv1fTP9fTf9fTf9fTf9fTP9fTf9eTP9eTftfTf9fTf9eTf9fTP9fTf9fTf9gTvxfTf9aY3RaYnJfTf9fTf9fTf9eTf9aYnNZYXJeTP9fTf9eTuxbYnRfTv1cTuBfTvJfTf9eTP1fUPhfUuVcVsJbT91cT9tbWKtcWLFbXpNdVM5ZX3ReTvtcUsxbVMRcU8heUOb8/P5cWLlcVMheTPxZWZ79/v7+/v63ucpcXJvw8fSvs7r29vmVmarp6e7NztNWU7j7+/vR0eH7+/zh4uTy8/Tr7O2wsbr39/z3+Pj3+Pjl5+rKytSnptWpqsqKisD5+vro6PLs7PTa2ulfTf////9zY//r6P/19P9pWP/DvP+Hef+bkP/r6f+vpv/X0v+5sf/h3v/Nx/+lm/+RhP99bv89/FqOAAAAiXRSTlMABMw/RS9kbCdWB092BUIslzo8U180Ko9Zh5syI4RbNjh9DRBxaUd5CWdRrXNhXaNLSYpvCyBNgIGxjHtMG76UkqG6nh60JhnIqKbEExWqtyciFh4jwRkTIR0mGx0iISAdDycZFRjkKCQKGeLxOSeNP6ksby4QxVnUT5yAHsnJuF9HREI213iiZ4OOOrcAAA/ESURBVHja1NhPj5pAGAbwIYrr4gLVXf9lqavJFi3RZtHFblpJe/ATcIAzR7JNeuhemjTp3U/deWccRxjsSTLjYzTG0y9P3nkBURXpxehC4lj1EF1EAsuqX4Z1W6tZdde9AOu204FWfX+LFE/U7tQw1fX9jeLWrIupNdyq+7RpKW3V9DGlukD1AqRsNPuBUmFW1y3vVl2r02VU14dWvWtVrfF9l7f6BK1eK2pNdULlx6qFqQMVrVpTL7Ta8jB14CDl0tSPqO6BOvqknDWyCbW9p9IBINQ7xaxZj1L5rMKxuiXUhVJWzQFqYQBYq4tGE6mTuNmzbeFYsVYbClnTJqbqeeoG9iqjflTFqgWcyvfqGmaVUT8oYo2cIhVuAumsDvbUKyWsmiNQ6wfqiFGvekh+wgLVosdq7eWpK/nWNAjKWl23itRH2VYt5FTeqnu8Vxd76txGUpNsxVaBKrY6n99ItWrhNnDEDYCpa3YJuGuwVm+kWhNKFVsVNgChTnUkK1mMqUFJq/4GNkCx1en0qzRrFOap7fILK6dOJpKsWZRvtctaFQeAtTr5fI9kJGFUYa9SqnCsgPoiw5pFhHriwup5+3uARb7Vl/cSrGkUc6pd2KvlG2AC1IqtGrzJi/+URFF4guoL1Eeg0laHwy6qMsCEcG2WlA6AxfaqB9RR8VhBq8Mlt1ahNIGJvxw6TkQqf7Zie3VU2uryC7NWUadpsk+T9poxaumdFW2VD8Bqlaf2H1AFASIIDfIiZOCnSVRKtWir/OFaPFbD5bJfiZW2aRrG20/DMGmzCBkpH4CSVhl1dNzq9KjV/vfx+aEmxMB5/fGGrRCMT4EqbIDTDyz5AVhi6rfxuaEadc5mv3a7v7MZfAdt+r9WXfL/qjgAvFWgvmuf30qkf153u93v5+cZsWaEGpdT3dJba5H6j1Vz+00iCsJ4vDz4Um8x3qIxYdUYjalGaqJ4ibb1UkFbwQhCiwK1TcHUFrFatfEW4w5QWrHV+tc6c85ujzA7sCDzwusv337nm5lzQNYei0qgweAs/KjDa0RVrCWGymcApipDPdxbVg0aeAVQXq7AN2RF2GAp95hQ3SGQN1bKVSEBCPWyRkXWHgVqn/r6QSQNzEHNtjeg8D4QOBU8VSo9e5x7OImoQre6iA7gjTUUcsNKoSLr4N4eiYqkWtPAR6iWbdv+CbOWhbAlUpVQhxpQ93jNAGebDXDUGGBw8MbenoiqfEqklpWHuo21AoVXiBpA1Nwk1tWrA8LC0sarlzdRkbUHRaQIiqRF+GGrWoPXlqVIc48nUVU5AQiV71amW2mvDt7o79/WA1kJVZG+ysOqRl2uwlvLylFNEqqUAHKuEqo5Vqhq/8i2HpAqp1qWNQe/bKfqkA9bM0Sape8vtAC9BQiqGgPsVqqO3N3WC6cqo1JQ2W5V4F1kZmYml82RqkOCqsIW0JQAhx3U+zt7Ean4/cMUVLr0yZqfwcpOJpNJQdWmyeqERiVSMwMYAyDqmZ3/Q6qTKoikeKaMqBRYi0SazRLqkHysnNF6n6BqI6ph7fZUBUlUdaZMlQE+Sah8smpADXkcq36Nemnn/3x/R1Rs/obTCayURo1Gh3xNVuZYyahds24hqxIqBdWGwXQCayGVUqioasxzt8K+6qdbGQNcGh7e3jWrJrXoTDXVb3g+n0JSpWpMVLVVAhzgqg4/2N5tVOlOpYKqudZhNpVNtDCAeQ6WGytHvdmdrq5V30CdkarASiSS0WR0aCAWGxXerXyijjgGQNRuWGl7Uk21CNWVMq91mEslElFUNU4G2O+FeloMK1HVm9dOdmNVJWogD1ItJJLEGv/XAMfYDCCpyr06rFC7YHXOfzGv6rlHzSWUWQdadSt+FcznVST9F/XR+c7nP2KlBhC5/fTp2NjYLafGsJ5OTKTw+6eTJOpArAF1r2sAM6+ae4CQVlVIAI1671zn3x9RkTR8+zaxGlSqCWRNKK/G0QA7PEdrX8dqsMkAhHqvM111VhFqRKvawDqhUdPRNKLGRkfbvwbyIVBW9d6dc51d/ehNhb6/a4CvL1/Ob6Km0AHpdDoajcViXl41j+z7vK/XjKoc9c6VzkTto+9vRTTq/LulAlAtLS5o1nGSVanKDaA31u5VvbP1ov9DpRuAi7qwRJTVSqVKv/kikiLreFqjxvgLix6teViFzE2gV1g92ERlrHJX1VmlrTq/iJi11bKaVFZqFYDnL4mUDBAnVOZVWq5ZAvA18LpCRVKG2gErTYBoVYus+iIP1fqybWq1AoXvWtW4QkVSn+NKqH0L0KpiXfEpq5uqkcinAqw3zSvlGsDsOKFqVY/sN6iiAeRuNeKBylhlVHSq/v44rdaMpGZthaJinUZSMoD8xCajyqoqVp8e6NNZhah5vVZz1sKX8fHp6bg3aoOqZ8U7Kz1aC6oyXcVYRVH1skKa8qrBB0RF1iejox7HSj9biAnADWCO1SNC5azyAqBQww1zNVtaNCqy8ptAfr963MwA4hBowsqti+3XakJtvADgS8sHQn2iUXfxboVDIHtiI1U5qmQAzipvgOE8iSrL6qJSAnADiI9Bh5rWwLsc1T+rE1VvYd0Waw1mpzKOqgxVJwC/s/Kbq/5YTauyFmFNRl2BD1PTGUJFWduH1XF5ub7LjxVnlXcVGlXCr2FDRl2GwlQmk9Gouzz+ECIYwNe44p+VVEXUN/DHlqsKX6ccVO7V5o31gnC9JqByVpkUUfWpkqsCnxXqE6Oq2QLwhUXIVd5YDSozAGflBqBW1R41g4WkfAZgLyzcq/xYyagya5+zq7Q2AMCUqyrPVWe3OthqsrouG4CzSq//zq76t5oz/5EhCuJ4T4hr3UcciXMY1yJYZwhCTCJGXBnERGYdw65da9Z93yTNYtz8tar6Tc3r6W/XPNpMtpX1C798Ultdd72qX9NJf9FndVm0alCXLA61LP4is3Kj7tithYB6Wv2glbOq+Y8ElYeBOGSH1QXdVrEKQFK9BGTUe/6IjvrBfw2ocsIQGVyuwNWFFiGAWJFU/6wMav6u/xEQbe/6ua5VQZ2Hg0vMrLTA6ib1uLFmUIf8L7pSq5cJVUIAtte6lK41ahWdFZKqapVqdXjA/6ErVVBBq2QAzu6KAxVI9S4wOStWq5kCo9C4/Q2RXuHfv/WreMSEy0t6IwhQkRSFbFU6a1UeBKF89ysvL4e06t4IwhDgLliQFB1rowmYH74bw/r+i195ce0ao15BAzCoEq2c4+B9WhKIpCiCmuXOCrGOROz14zsmZdTz1lanYWptDQCc1U7HZ4WkurGaKpAbltxc+VQLgX7x/VdMyvUKpNaupiW2gvdpgRVJUSQISBvwRoVgP9RoJvCr9pX6QANDB68xap31ZAN1TthWuyJ+tVvRqqBCtHKTZpjVNFdZrWViZVgRAqXWZUAalIEnw1qd0XQcyqiLkjaCkFQfBBnXKi3rZw+ePK5UXj0ZunOQhEkF9SRWrDmpWPUqwJFaI6meBYpaiVUmAVaov8qopr92VJqWjrlVNwTWPWofAEgdxir+qhxhNQ12aa9RIwgKFj2wLv3TaIWkeieQm5YyCmBWS2pRSaBnNXMqNIJcVQB+VkDqrq+tWoX1WAO11GhaKmMLrK1WulBFq0iq+4AQqrCGx1YkJaPV2FZwzlYBLT2AZqtri3+5DMQW8PDmzUGW600yGEhjbAFazTVWF+bBCQOgYmB1k2LbgqfBqlQFVfEAYqvKhEX3AEeKyXYsbvNgBWXErwzawSUagCSBCfyqQuo01uy9+IT1nT9Ec0uaXKJW7asL2F2J3bNq7lkdAlKnVqVxVY2rWWp+pSRDVmV7LXQXsBpsVdWqQuqw1bpaHw5gKfj2nX9DULcog8uuuBDgHFxuKCZcCOoxu0vfYkpAnrGePasYgKQrjpYFFiwbjidaspB5AK2D/4AScJBQeXmFd1ccu9aOEBDOV/cRaWLWeuPifaSwqhrSs7wOoG0EMaq+ZwWfFaHu10jdxioF1m3/a+SbCpRqtHpasVVtxqr3V5ORZmTPKkivnzWPhOibOlcytkqs4WuLOTBi+4uu9QIHqXt2zZXA/bDD+uxXyv1MatYXTzt2AiEHUFAdpO702gyvh0MO6+2I/7RMrGdKsr0GBjBVdq1VZ4Wp9fSkpDJnk+z6Ac0vraPKl/sJtW6rFFhlywK6K4CqBtbkpOICBLVM63bWUeXzbAAXAls9razaKkuhSma1959ITbySQuAOOSwJ/mVC7S+ZVdtAq3FPGVjU2c7UWkiTokrZakpBcVjkqIbz+UI/CbEWT8C1haQreMaof1YJSbFoMYXAYPBlvSdHVTaoFwK1FpWlUO00LG5uNTcRKXYDpMI2XWE6CmDSw4cD0kvFS81anaPvBG5W/erOU225s2RUo1Z2WD/NN1UoHM5eZFb92iLnyletVhOTYoG1TFjJYVHwzwdKzd66GJww7FbPGNmvYisYndUmIE0YsEyB1fiy/IG6UpdlgyOWs0yK91birCBdwbHFfCBNHAWkxGa93qOVpUKBdZpd1sOkJKBVJbVW+qsLT7XzLtSwsg0Unlwl0EKWSXtuMSsfXOLJbWPE5spXgTS5mHu7VYaVd66eskYZla4DDWrLk1vX9tr2tpFmjF5XkbkaVgZllZJMmnTrFN2GFdmv6q8ugFabbFUhTewEmJXbLCQBJwufh07h1wGsreKQHSYs0XRlWxtIMRcUWCbtWUUq5TtxPg62L4SoBYt2GbS03aTm3ppIA9oeEjkPntLHatUOmR0b7G0ixQwrYxRLP/TXHF1nSPg6VD8N29pSqyuBtF32ynhMazQ6ie/uGw9EKI9EbW3lV9tEipkAsxKtEaKkH/vsBh4yu/dXJwNpu58ImGJISYwr65P3AVquhc8GrXb3eh2RDP8hMbyk4UDMf4EBwLK9bQVbZ9UBUnzPQlQq0otJoHsfYDmQtlOtQsuk8g8smegDETPw4jL6QgiRdliaEK1a40NADt9eEwMYD6SdACWRD0oko9iqbAXDazYdIkVelF5Exf6qrQJWdJYUYfGZOKwCcMTW3c2koyi9ylsWsGZDqKuJdDSlqLxlgQXLuFEm9fqU54y2hi/Z2VmtI9JRluNKdyViq7NHn9TLxNlqtL2WClL6stBWoWBZnwpSz9utPLthN4IWpYSU3rUVA1BCwLy0kHreqVa11ew0kXreAfAAoWg1MU2k9K49ttdEq7P6vFRJL+wDiK2mjZTia0wnkFHXpI7U8yZEcgBjAF0pJPUy02Ie4d+aRlLKW9Cv7konKZmroMr+6sa0knrelqY1m65cekk9bxqvL0ojaGyaSclcra2mm5RY54gBTE05KbEuMS2LMaknpQjLIeC/IKVSi7T6f5CSe5068z8hpUS7I6S/ARbzgdCIDH2vAAAAAElFTkSuQmCC"}initHoverMakerEvent(){this.cameraDirElement&&this.cameraElement&&(this.cameraDirElement.onmouseover=()=>{var e;this.dirHoverUrl&&(null===(e=this.cameraDirElement)||void 0===e||e.setAttribute("src",this.dirHoverUrl))},this.cameraDirElement.onmouseleave=()=>{var e;this.dirDefaultUrl&&(null===(e=this.cameraDirElement)||void 0===e||e.setAttribute("src",this.dirDefaultUrl))},this.cameraElement.onmouseover=()=>{var e;this.cameraHoverUrl&&(null===(e=this.cameraElement)||void 0===e||e.setAttribute("src",this.cameraHoverUrl))},this.cameraElement.onmouseleave=()=>{var e;this.cameraDefaultUrl&&(null===(e=this.cameraElement)||void 0===e||e.setAttribute("src",this.cameraDefaultUrl))})}initControls(){const e=this.camera;if(!this.renderer||!e)return;const t=new wb(e,this.renderer.domElement);t.enableDamping=!0,t.enableRotate=!1,t.zoomSpeed=.4,t.enableZoom=!1,t.dampingFactor=.5,t.enabled=!0,t.mouseButtons={LEFT:Ue,MIDDLE:Ue,RIGHT:Ue},t.update(),this.controls=t,t.addEventListener("change",this.onControlsChange(this))}initMouseWheel(){var e,t;this.wheelEventHandle=(t=this,function(e){if(!t.camera||!t.controls||!t.renderer)return;e.preventDefault(),e.stopPropagation();const n=t.container.getBoundingClientRect(),r=Math.pow(.95,t.controls.zoomSpeed),i=t.camera.zoom,s=e.deltaY>0?i*r:i/r,a=new Xt;a.x=(e.clientX-n.left)/t.renderer.domElement.clientWidth*2-1,a.y=-(e.clientY-n.top)/t.renderer.domElement.clientHeight*2+1;const o=new xn(a.x,a.y,0),l=o.clone().unproject(t.camera);t.camera.zoom=Math.max(t.controls.minZoom,Math.min(t.controls.maxZoom,s)),t.camera.updateProjectionMatrix();const c=o.clone().unproject(t.camera),u=new xn;u.subVectors(c,l),t.camera.position.sub(new xn(u.x,0,u.z)),t.controls.target.sub(new xn(u.x,0,u.z)),t.controls.update(),t.enableRender(),t.dispatchEvent("zoomchange",t.camera.zoom/t.zoom)}),null===(e=this.renderer)||void 0===e||e.domElement.addEventListener("wheel",this.wheelEventHandle)}initCameraMarkerEvents(){var e,t,n;this.cameraDirElement&&this.cameraElement&&this.renderer&&(this.pointerMoveHandle=(n=this,function(e){if(e.preventDefault(),n.animationId&&cancelAnimationFrame(n.animationId),n.isMarkerRotating){const r=new Xt(e.x-n.cameraDirDivPos.x,e.y-n.cameraDirDivPos.y);if(Math.abs(r.x-n.rotateStart.x)>n.tolerance||Math.abs(r.y-n.rotateStart.y)>n.tolerance){var t;let e=r.angle()-n.rotateStart.angle();e=(e+2*Math.PI)%(2*Math.PI),null===(t=n.cameraMarker)||void 0===t||t.rotateOnWorldAxis(new xn(0,1,0),-e),n.rotateStart.copy(r),n.enableRender(),n.dispatchEvent("cameramarkerchange")}}if(n.isMarkerTranslating&&n.renderer&&n.camera){const t=new Xt(e.clientX-n.parentTranslate.x,e.clientY-n.parentTranslate.y);if(Math.abs(t.x-n.translateStart.x)>n.tolerance||Math.abs(t.y-n.translateStart.y)>n.tolerance){var r;let e=new xn(n.translateStart.x/n.renderer.domElement.clientWidth*2-1,-n.translateStart.y/n.renderer.domElement.clientHeight*2+1,0),i=new xn(t.x/n.renderer.domElement.clientWidth*2-1,-t.y/n.renderer.domElement.clientHeight*2+1,0);e=e.unproject(n.camera),i=i.unproject(n.camera);const s=i.sub(e);null===(r=n.cameraMarker)||void 0===r||r.position.add(new xn(s.x,0,s.z)),n.translateStart.set(t.x,t.y),n.enableRender(),n.dispatchEvent("cameramarkerchange")}}}),this.cameraDirPointerDownHandle=function(e){return function(t){if(!e.cameraMarker||0!==t.button)return;t.preventDefault();const n=e.cameraMarker.element.getBoundingClientRect();e.cameraDirDivPos.set(n.left,n.top),e.rotateStart.set(t.x-e.cameraDirDivPos.x,t.y-e.cameraDirDivPos.y),e.isMarkerRotating=!0}}(this),this.cameraPointerDownHandle=function(e){return function(t){if(0!==t.button)return;t.preventDefault();const n=e.container.getBoundingClientRect();e.parentTranslate.set(n.left,n.top),e.translateStart.set(t.clientX-e.parentTranslate.x,t.clientY-e.parentTranslate.y),e.isMarkerTranslating=!0}}(this),this.pointerUpHandle=function(e){return function(t){t.preventDefault(),e.isMarkerRotating=!1,e.isMarkerTranslating=!1}}(this),this.dblClickHandle=function(e){return function(t){var n;if(!e.camera||!e.renderer||e.isMarkerRotating)return;t.preventDefault(),e.animationId&&cancelAnimationFrame(e.animationId);const r=new Xt,i=e.container.getBoundingClientRect();e.parentTranslate.set(i.left,i.top),r.x=(t.clientX-e.parentTranslate.x)/e.renderer.domElement.clientWidth*2-1,r.y=-(t.clientY-e.parentTranslate.y)/e.renderer.domElement.clientHeight*2+1;let s=new xn(r.x,r.y,0);s=s.unproject(e.camera),null===(n=e.cameraMarker)||void 0===n||n.position.set(s.x,s.y,s.z),e.dispatchEvent("cameramarkerchange"),e.enableRender()}}(this),this.cameraDirElement.addEventListener("pointerdown",this.cameraDirPointerDownHandle),this.cameraElement.addEventListener("pointerdown",this.cameraPointerDownHandle),this.cameraDirElement.addEventListener("pointermove",this.pointerMoveHandle),this.cameraElement.addEventListener("pointermove",this.pointerMoveHandle),null===(e=this.renderer)||void 0===e||e.domElement.addEventListener("pointermove",this.pointerMoveHandle),document.addEventListener("pointerup",this.pointerUpHandle),null===(t=this.renderer)||void 0===t||t.domElement.addEventListener("dblclick",this.dblClickHandle))}updateMarker(e,t){const n=this,r=new xn,i=new xn;return function(){if(e&&n.camera){e.getWorldScale(r),e.getWorldDirection(i);const n=new Xt(i.x,i.z).angle()+Math.PI;t.style.transform=`scale(${r.x}, ${r.z}) rotate(${Yt.radToDeg(n)}deg)`}}}updateMarkerTransform(e,t,n,r){const i=Yh()();if(this.animationId&&cancelAnimationFrame(this.animationId),!this.cameraMarker||!this.camera||!this.renderer)return;let s=new xn,a=new xn;e&&(s=new xn(e[0],e[1],e[2]),this.transformMatrix&&(s=s.applyMatrix4(this.transformMatrix)),this.cameraMarker.userData.posY=s.y),t&&(a=new xn(t[0],t[1],t[2]),this.transformMatrix&&a.applyMatrix4(this.transformMatrix)),n&&this.cameraMarker.scale.set(n[0],n[1],n[2]);const o=()=>{const e=this.cameraMarker;r||(r=1e3);let t=Yh()()-i;if(t>r&&(t=r),s){const n=e.position.clone().lerp(s,t/r);e.position.set(n.x,0,n.z)}if(a){const n=new xn;e.getWorldDirection(n);const i=n.lerp(a,t/r),s=e.position;e.lookAt(s.x+i.x,s.y+i.y,s.z+i.z)}this.enableRender(),t!==r?this.animationId=requestAnimationFrame(o):this.animationId&&cancelAnimationFrame(this.animationId)};o()}getCameraMarkerDirection(){var e;const t=new xn;return null===(e=this.cameraMarker)||void 0===e||e.getWorldDirection(t),this.transformMatrix&&t.applyMatrix4(this.transformMatrix.clone().invert()),[t.x,t.y,t.z]}getCameraMarkerPosition(){var e,t;const n=null===(e=this.cameraMarker)||void 0===e?void 0:e.position.clone();if(n)return n.y=null===(t=this.cameraMarker)||void 0===t?void 0:t.userData.posY,this.transformMatrix&&n.applyMatrix4(this.transformMatrix.clone().invert()),[n.x,n.y,n.z]}dollyIn(e=.2){if(!this.camera||!this.controls)return;const t=this.camera.zoom;this.camera.zoom=Math.min(t+e*this.zoom,this.controls.maxZoom),this.camera.updateProjectionMatrix(),this.enableRender(),this.dispatchEvent("zoomchange",this.camera.zoom/this.zoom)}dollyOut(e=.2){if(!this.camera||!this.controls)return;const t=this.camera.zoom;this.camera.zoom=Math.max(t-e*this.zoom,this.controls.minZoom),this.camera.updateProjectionMatrix(),this.enableRender(),this.dispatchEvent("zoomchange",this.camera.zoom/this.zoom)}}class y$ extends _${constructor(e){super(e),gh(this,"radius",void 0),gh(this,"markers",new(ue())),gh(this,"isInitCameraZoom",!1),this.initOverviewMap()}initOverviewMap(){var e,t;null!==(e=this.renderer)&&void 0!==e&&e.domElement.parentElement&&(null===(t=this.cameraMarker)||void 0===t||t.scale.set(.5,1,.5),this.renderer.domElement.parentElement.style.overflow="initial",this.renderer.domElement.style.borderRadius="50%")}setZoom(e){if(this.camera&&this.controls){const t=this.camera.zoom*e;this.camera.zoom=t,this.camera.updateProjectionMatrix(),this.enableRender()}}getMarkerPosition(e){if(!this.camera||!this.radius)return;let t=new Xt(e.x,e.z);const n=new Xt(this.camera.position.x,this.camera.position.z);if(Math.abs(n.distanceTo(t))>this.radius){const e=t.clone().sub(n).normalize();t=n.clone().add(e.multiplyScalar(this.radius))}return t}initControls(){const e=this.camera;if(!this.renderer||!e)return;const t=new wb(e,this.renderer.domElement);t.enableDamping=!1,t.enableRotate=!1,t.zoomSpeed=.4,t.enableZoom=!1,t.dampingFactor=.5,t.enabled=!1,t.mouseButtons={LEFT:Ue,MIDDLE:Ue,RIGHT:Ue},t.update(),this.controls=t}initMarkerImageUrls(){this.cameraDefaultUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAkCAYAAAD7PHgWAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAS5SURBVHgBvZjfbhtFFMa/swmoXJE8Ac4bwBPUPEFyhSKE8AZFUKQodohEVEXChl5UICHTSqgXIDkRKq7gJn2D8ATwBNA3wBcIouDd0zMzZ2Zn7drx2tueaDO79nrmt9/5NzZQo/VOuN/t8AZqtAQ12f0uNyhBh26hjRqtNsDxGF0GmHN0uifcQE1WC+C9U27K0CKC+dvIcgxQk9UCuLaGgYVje8kENE+PLfTKtjKgxF4qaA3jXhlhDzd0UYOtDCiJYUCY/LVDZAFu3v2MO1jRVgL85itRD2hAdQuQ5CCR44vOimVnacD+fSkra86NpK71bhb52CopCXMrX63sLA2YAR3BaXggBbUiJjqaa3mjfXJn+bKzFKBRTyDaBkMm4IRC7KlvUSQLYZNfQx9L2nIKGtdyEXOORF0NHV3JsW4XhbePD5YrO5UB+32JPSBVyTjiZBQnrLBmJKLly05lwHW2RdkszKyLK6RD8u6msqhyU/P4U26holUC/P5bKSuM2yIbMUcepiAjwyUMuwurMGuPMa7uVS071RQ0RVllsSpCD3blxSsHzRUrK0XlUToOrqqVnYUBHz10LU0XYoUg6+ak7F59gOB20h6tKd7uVCg7CwEOBrwhC3YtmM/OYmPgr9lDhvdJ30+KcJCTTc4WT5iFAK//gempDaOBqGUzlwpXupNSzQlZPPm+j83Wwf5iZedGwMEj29IObdbCKkMhIaLSgqhG+/MihcMYOsyiZedGwJxsUd60YFQqzqQLcZQ4Mbw/0WjQUHSPYf6aBynv3LT+XECJvYZM2PJZ65ZRoETLB014l0qZC1+oI+hQvCVA+510ftmZr+D/Vj3i8qta1YpaGCSKb6KSy+HV1w0E646ncY35ZWcmoKjXlBnTqAiT7yDRRsC7l6noJVOQIRQnYlJjuj1PxZmAiWtpkxbhRQ2EykpiGtayULTlCT1adjtXPHu380LAx4OwU3brUdjv+Y6h2TFBTxEEF26FgzEhoeWxUNPWzxzp/gcvLjvJDOyuDyCClha3daEJIIRW540nak/0bc9/Rq98K7STrM0oO1OAw5+4x149H/xJacEJTKuGeYCRHOdyPFPXwSumLqf4GXyyACE8bu/vTqtYAhwObY9sBVfp03EsCYde7PH+lv+9fzNs3e3R3uk92pJfF5ry2lnoy+5znCRFCOrDUvyYcj1Id8oJU9LiyZAH0ifTLHMTmlEOynMp2ObI3JG560vK0Tv8nH7DDJMfkhrZOloyRyrQDRk5nsvMb8LGz8nu6P34hL6cAjTqSeb+KR8muYkVzExIZiIzqcCPxjm+u87x4OiIRqhgJ4e8LfOmArJtoLKxrYV2NGv4teS10fg/bJ1duPnX/QQmSLnUNotR4uAyZ1y8Psb5JxXBvH39kJ7K8FQ2rGZPaMIoFaC3XARHbYbx5vobNmGOAoCq95c5Dy7IMRLFzuT75cWHH8924yp2uM/b8qtYKlA7xr3qKdcKx3jnh1/pDwv4y8/8uzzB23bHkuOZ3HR+NcaDvb3l1Kpqd1JRVfaIAtg0qmppupRYfJeGjzkVyoG8dCmu7L33/stRa1H7aJdT+Z7dktOmQDrAq2tcvCq1FrV0V8JOSt5zt54bvboXC2QAAAAASUVORK5CYII="}updateMarker(e,t){const n=this,r=new xn,i=new xn;return()=>{if(e&&n.camera){e.getWorldScale(r),e.getWorldDirection(i);const n=new Xt(i.x,i.z).angle()+Math.PI/2;t.style.transform=`scale(${r.x}, ${r.z}) rotate(${n}rad)`}}}updateMarkerPositions(e=new xn){var t;0!==this.markers.size&&ge()(t=this.markers).call(t,(t=>{const n=t.position.clone().sub(e),r=this.getMarkerPosition(n);r&&(t.marker.position.set(r.x,0,r.y),t.marker.updateMatrixWorld())}))}updateCameraPosition(e,t,n,r){const i=Yh()();if(this.animationId&&cancelAnimationFrame(this.animationId),!(this.cameraMarker&&this.camera&&this.renderer&&this.baseImageId))return;const s=this.scene.getObjectById(this.baseImageId);let a=new xn,o=new xn;e&&(a=new xn(e[0],e[1],e[2]),this.transformMatrix&&(a=a.applyMatrix4(this.transformMatrix))),t&&(o=new xn(t[0],t[1],t[2]),this.transformMatrix&&o.applyMatrix4(this.transformMatrix)),n&&this.cameraMarker.scale.set(n[0],n[1],n[2]);const l=()=>{const e=this.cameraMarker,t=this.camera;r||(r=1e3);let n=Yh()()-i;if(n>r&&(n=r),a){const e=t.position,i=a.clone().sub(e),o=e.clone().sub(i),l=s.position.clone().lerp(o,n/r);this.updateMarkerPositions(i),s.position.set(l.x,s.position.y,l.z),s.updateMatrix(),s.updateMatrixWorld()}if(o){const t=new xn;e.getWorldDirection(t);const i=t.lerp(o,n/r),s=e.position;e.lookAt(s.x+i.x,s.y+i.y,s.z+i.z)}this.enableRender(),n!==r?this.animationId=requestAnimationFrame(l):this.animationId&&cancelAnimationFrame(this.animationId)};l()}setRadius(e){if(!this.camera||!this.controls)return;const t=this.container.getBoundingClientRect(),n=M_.screenPoint2worldPosition(new Xt(0,t.height/2),this.camera,this.container),r=M_.screenPoint2worldPosition(new Xt(t.width/2,t.height/2),this.camera,this.container),i=Math.abs(new Xt(n.x,n.z).distanceTo(new Xt(r.x,r.z)))/e;this.setZoom(i),this.radius=e}addMarker(e){const{element:t,position:n,id:r}=e,i=document.createElement("div");i.style.cssText="top: 0; left: 0; display: block; dragable: false;",i.appendChild(t);const s=new Uf(i);s.onBeforeRender=()=>{if(s){const e=new xn;s.getWorldScale(e),t.style.transform=`scale(${e.x}, ${e.z})`}};const a=new xn(n[0],n[1],n[2]);return this.transformMatrix&&a.applyMatrix4(this.transformMatrix),this.markers.set(r,{position:a,marker:s}),this.scene.add(s),this.enableRender(),s}getMarker(e){var t;return null===(t=this.markers.get(e))||void 0===t?void 0:t.marker}removeMarker(e){const t=this.markers.get(e);t&&(this.scene.remove(t.marker),this.markers.delete(e),this.enableRender())}}}();var i=r.Il,s=r.Ty,a=r.SK,o=r.DN,l=r.Vi,c=r.Om,u=r.Vx,h=r.fD,p=r.OE,d=r.c_,m=r.gc,f=r.HI,g=r.al,_=r.qL,v=r.Ud,y=r.iu,b=r.dy,x=r.sz,T=r.q7,w=r.DG,E=r.ju,S=r.Co,I=r.WG,M=r.uc,A=r.HE,R=r.$p,D=r.j0,C=r.g9,O=r.Wd,P=r.WC,N=r.x8,L=r.cS,k=r.Qc,F=r.R8,U=r._u,B=r.h,j=r.WM,G=r.HY,z=r.U$,V=r.Kl,H=r.GC,q=r.Jh,W=r.mA,Y=r.M8,X=r.RV,$=r.n1,K=r.Hu,Z=r.Zs,J=r.gb,Q=r.I,ee=r.JX,te=r.cz,ne=r.Jj,re=r.$$,ie=r.iA,se=r.jq,ae=r.ed,oe=r.y9,le=r.uM,ce=r.pG,ue=r.cd,he=r.oL,pe=r.Nk,de=r.Qg,me=r.o8,fe=r.HM,ge=r.Ew,_e=r.PG,ve=r.dl,ye=r.Ez,be=r._r,xe=r.J1,Te=r.d1,we=r.kO,Ee=r.Tg,Se=r.ry,Ie=r.Rg,Me=r.fn,Ae=r.el,Re=r.TF,De=r.g,Ce=r.Bf,Oe=r.nu,Pe=r.B3,Ne=r.k_;export{i as AXIS_SECTION_PLANE_CONTROL_ID,s as AXIS_SECTION_PLANE_ID,a as BimViewer,o as CommonUtils,l as ControlsHelper,c as CoordinateConversionUtils,u as DEFAULT_BIMVIEWER_TOOLBAR_CONFIG,h as DEFAULT_BIM_VIEWER_CONFIG,p as DEFAULT_DXFVIEWER_TOOLBAR_CONFIG,d as DEFAULT_MARKUP_TOOLBAR_CONFIG,m as DEFAULT_VRVIEWER_TOOLBAR_CONFIG,f as DXFLoader,g as DatGuiHelper,_ as DeviceUtils,v as DxfChangeType,y as DxfCompare,b as DxfViewer,x as DxfViewerDatGuiHelper,T as ENTER_KEY,w as ESC_KEY,E as Event,S as Exploder,I as ExportUtils,M as FpsUtils,A as GROUND_PLANE_RENDER_ORDER,R as GROUP_CONFIG,D as GeometryUtils,C as GroundUtils,O as ICON_FONT_CLASS,P as IUploader,N as InstantiateHelper,L as KEYDOWN_EVENT,k as KEYUP_EVENT,F as Keys,U as LocalDxfUploader,B as LocalImageUploader,j as LocalModelUploader,G as MOUSEDOWN_EVENT,z as MOUSEMOVE_EVENT,V as MOUSEUP_EVENT,H as MarkupToolbar,q as MarkupType,W as MaterialUtils,Y as MathUtils,X as MeasurementType,$ as MenuTypeEnums,K as MergeUtils,Z as MetaPakingOverviewMap,J as ObjectUtils,Q as OverviewMap,ee as RafHelper,te as SECTION_BOX_ID,ne as SECTION_PLANE_CONTROL_ID,re as SECTION_PLANE_ID,ie as SECTION_PLANE_NAME,se as SIMPLE_BIM_VIEWER_CONFIG,ae as STATE,oe as SVGObject,le as SVGRenderer,ce as SceneUtils,ue as SectionMode,he as SimplifiedBimViewer,pe as SimplifyUtils,de as SkyboxUtils,me as Toolbar,fe as ToolbarMenu,ge as ToolbarMenuId,_e as VRControls,ve as VRViewer,ye as VRViewerDatGuiHelper,be as Viewer3DUtils,xe as ViewerEvent,Te as ViewerMode,we as Views,Ee as getLengthValueByUnit,Se as getUnitStr,Ie as layerForNonSnapableObjects,Me as layerForUnselectableObjects,Ae as matrixAutoUpdate,Re as parseDxfMTextContent,De as sceneAutoUpdate,Ce as setIcon,Oe as showPrecisionValue,Pe as unitConversionByMeter,Ne as unitLabel};